/* v2 */
:root {
    --green-900: #14532d;
    --green-700: #15803d;
    --green-600: #16a34a;
    --green-500: #22c55e;
    --green-100: #dcfce7;
    --green-50:  #f0fdf4;
    --white:     #ffffff;
    --ink:       #1f2937;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --danger:    #dc2626;
    --danger-bg: #fef2f2;
    --shadow-sm: 0 1px 3px rgba(20, 83, 45, 0.08);
    --shadow-md: 0 8px 24px rgba(20, 83, 45, 0.12);
    --radius:    16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--green-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

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

/* ---------- Navbar ---------- */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--green-900);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    overflow: hidden;
    /* Az égőt SVG rajzolja, a sötét háttér is abban van – ezért nincs
       itt külön háttérszín. */
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.nav-links a { color: var(--ink); font-weight: 600; }
.nav-cta {
    background: var(--green-600);
    color: var(--white) !important;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
}
.nav-cta:hover { background: var(--green-700); text-decoration: none; }

.lang-switch {
    display: flex;
    gap: 0.25rem;
    background: var(--green-50);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem;
}
.lang-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted) !important;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    line-height: 1;
}
.lang-btn:hover { text-decoration: none; }
.lang-btn.active {
    background: var(--green-600);
    color: var(--white) !important;
}

/* ---------- Layout ---------- */
.content {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* ---------- Flash ---------- */
.flash-container { margin-bottom: 1.25rem; display: grid; gap: 0.6rem; }
.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: 1px solid transparent;
}
.flash-success { background: var(--green-100); color: var(--green-900); border-color: var(--green-500); }
.flash-error   { background: var(--danger-bg); color: var(--danger);   border-color: var(--danger); }
.flash-info    { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 0 1.5rem;
}
.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
    color: var(--green-900);
    margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
    max-width: 32rem;
}
.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.hero-login { color: var(--muted); font-weight: 600; }
.hero-art {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 280px;
}
.blob {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 260px;
    height: 260px;
    background: linear-gradient(135deg, var(--green-100), var(--green-500));
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    animation: blob 12s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}
.hero-emoji { position: relative; font-size: 6rem; }
@keyframes blob {
    0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
    50%      { border-radius: 58% 42% 37% 63% / 56% 59% 41% 44%; }
}

/* ---------- Features ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}
.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2.25rem; margin-bottom: 0.6rem; }
.feature-card h3 { color: var(--green-800, #166534); margin-bottom: 0.35rem; }
.feature-card p { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--green-600);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--green-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline {
    background: transparent;
    color: var(--green-700);
    border: 2px solid var(--green-600);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--green-50); border-color: var(--green-700); color: var(--green-800); }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.1rem; }
.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-ghost {
    background: transparent;
    color: var(--green-700);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--green-50); }
.btn-generate {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #000000;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    border-radius: 999px;
    text-decoration: none;
    margin-top: 1rem;
    box-sizing: border-box;
}
.btn-generate:hover {
    background: linear-gradient(135deg, #d97706, #ea6c00);
    color: #000000;
    text-decoration: none;
    transform: translateY(-2px);
}
.btn-generate:visited {
    color: #000000;
}
* .btn-generate,
a.btn-generate {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}
.child-card-actions { margin-top: auto; padding-top: 1rem; }

/* ---------- Subject selection ---------- */
.select-tasks-page { max-width: 720px; margin: 0 auto; }
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--muted);
}
.back-link:hover { color: var(--green-700); }
.select-tasks-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.select-tasks-header h1 { color: var(--green-900); font-size: 1.75rem; }
.select-tasks-subtitle { color: var(--muted); margin-top: 0.25rem; }
.select-tasks-meta { color: var(--green-700); font-weight: 700; font-size: 0.92rem; margin-top: 0.35rem; }
.select-tasks-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    flex-shrink: 0;
}
.select-tasks-card { margin-top: 0.5rem; }
.learning-time-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.learning-time-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--green-50);
    border: none;
    border-radius: 14px;
    padding: 0.7rem 1rem;
    margin: 0 0 0.75rem;
    cursor: pointer;
    font-family: inherit;
}
.learning-time-toggle-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-700);
}
.learning-time-toggle-arrow {
    font-size: 0.85rem;
    color: var(--green-600);
    transition: transform 0.2s ease;
    display: inline-block;
}
.learning-time-arrow-open {
    transform: rotate(180deg);
}
.learning-time-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.learning-time-grid[hidden] {
    display: none !important;
}
.learning-time-grid-playful {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.learning-time-grid-playful.learning-time-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.lt-card {
    border-radius: 16px;
    padding: 10px 14px;
    border: 2px solid var(--white);
}
.learning-time-grid-compact .lt-card {
    border-radius: 12px;
    padding: 8px 10px;
}
.lt-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.learning-time-grid-compact .lt-card-header {
    gap: 4px;
    margin-bottom: 6px;
}
.lt-card-icon { font-size: 20px; line-height: 1; }
.learning-time-grid-compact .lt-card-icon { font-size: 15px; }
.lt-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.learning-time-grid-compact .lt-card-name { font-size: 12px; }
.lt-card-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.learning-time-grid-compact .lt-card-times {
    grid-template-columns: 1fr;
    gap: 2px;
}
.lt-time-box {
    background: var(--white);
    border-radius: 10px;
    padding: 6px;
    text-align: center;
}
.learning-time-grid-compact .lt-time-box {
    background: transparent;
    padding: 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
}
.lt-time-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.learning-time-grid-compact .lt-time-value { font-size: 10px; }
.lt-time-label {
    display: block;
    font-size: 9px;
    color: var(--muted);
}
.learning-time-grid-compact .lt-time-label { font-size: 9px; }
.lt-time-today .lt-time-value { color: #16a34a; }

.lt-card:nth-child(7n+1) { background: linear-gradient(135deg, #fef9c3, #fef08a); }
.lt-card:nth-child(7n+2) { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.lt-card:nth-child(7n+3) { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.lt-card:nth-child(7n+4) { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.lt-card:nth-child(7n+5) { background: linear-gradient(135deg, #fed7aa, #fdba74); }
.lt-card:nth-child(7n+6) { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.lt-card:nth-child(7n+0) { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.learning-time-subject {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: baseline;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    background: var(--green-50);
    border-radius: 8px;
}
.lt-subject { font-weight: 700; min-width: 100px; }
.lt-today { color: var(--green-700); font-weight: 600; }
.lt-week { color: var(--muted); }
.lt-total { color: var(--muted); }
.select-tasks-empty { color: var(--muted); margin-bottom: 1rem; }
.language-selector { margin-top: 1rem; }
.language-selector[hidden] { display: none !important; }

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.task-actions[hidden] { display: none !important; }
.btn-task-practice,
.btn-ai-voice,
.btn-ai-chat,
.btn-ai-placement {
    flex: 1;
    min-width: 160px;
    max-width: 100%;
    text-align: center;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    white-space: normal;
    line-height: 1.3;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}
.btn-task-practice {
    background: #ffffff;
    color: #16a34a;
    border: 2px solid #bbf7d0;
}
.btn-ai-voice {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #ffffff;
}
.btn-ai-chat {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
}
.btn-ai-placement {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000000;
}
.btn-task-practice:hover,
.btn-ai-voice:hover,
.btn-ai-chat:hover,
.btn-ai-placement:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.22);
}
.task-chat-alt {
    margin-top: 0.35rem;
    text-align: left;
}
.task-chat-alt[hidden] { display: none !important; }
.task-alt-link {
    background: none;
    border: none;
    color: #15803d;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
    font-family: inherit;
}
.task-alt-link:hover { color: #16a34a; }
.task-chat-alt-reveal {
    margin-top: 0.5rem;
}
.task-chat-alt-reveal[hidden] { display: none !important; }
.select-tasks-cancel.form-actions {
    margin-top: 1rem;
    justify-content: flex-start;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 253, 244, 0.92);
    display: grid;
    place-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}
.loading-overlay[hidden] { display: none !important; }
.loading-box {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--green-100);
}
.loading-box p { font-weight: 700; color: var(--green-900); margin-top: 1rem; font-size: 1.1rem; }
.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 5px solid var(--green-100);
    border-top-color: var(--green-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tasks page (kid-friendly) ---------- */
.tasks-page {
    max-width: 720px;
    margin: 0 auto;
}
.tasks-hero {
    text-align: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 35%, #dbeafe 70%, #dcfce7 100%);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    margin-bottom: 1.75rem;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.tasks-hero-stars {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    margin-bottom: 0.5rem;
}
.tasks-hero-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 800;
    color: #7c3aed;
    margin-bottom: 0.35rem;
}
.tasks-hero-sub { font-size: 1.15rem; color: var(--ink); }
.tasks-hero-subject {
    margin-top: 0.5rem;
    font-weight: 700;
    color: var(--green-800, #166534);
}
.tasks-hero-subject span {
    background: var(--white);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    display: inline-block;
}
.tasks-encouragement {
    margin-top: 0.85rem;
    font-weight: 700;
    color: #db2777;
    font-size: 1.05rem;
}
.tasks-encouragement[hidden] {
    display: none !important;
}

.tasks-list {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.task-card {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 3px solid transparent;
    transition: transform 0.2s ease;
}
.task-card:hover { transform: scale(1.01); }
.task-accent-0 { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb 0%, #fff 40%); }
.task-accent-1 { border-color: #c4b5fd; background: linear-gradient(180deg, #f5f3ff 0%, #fff 40%); }
.task-accent-2 { border-color: #7dd3fc; background: linear-gradient(180deg, #f0f9ff 0%, #fff 40%); }

.task-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.task-badge-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--white);
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}
.task-accent-0 .task-badge-num { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.task-accent-1 .task-badge-num { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.task-accent-2 .task-badge-num { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.task-badge-label {
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.task-title {
    font-size: 1.2rem;
    color: var(--green-900);
    margin-bottom: 0.75rem;
}
.task-question {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--white);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 2px dashed var(--border);
    margin-bottom: 1rem;
}
.task-question p {
    flex: 1 1 100%;
}
.btn-read-aloud {
    background: linear-gradient(135deg, #a7f3d0, #34d399);
    color: #065f46;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.btn-read-aloud:hover:not(:disabled) {
    transform: translateY(-1px);
}
.btn-read-aloud:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.task-emoji { font-size: 1.75rem; flex-shrink: 0; line-height: 1; }
.task-question p {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--ink);
}

.task-answer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.85rem;
}
.task-answer-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    font-family: inherit;
}
.task-answer-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
.task-answer-row-voice {
    flex-direction: column;
    align-items: stretch;
}
.btn-speak-answer {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    touch-action: none;
    user-select: none;
}
.btn-speak-answer.recording {
    background: linear-gradient(135deg, #f87171, #dc2626);
    animation: voice-mic-pulse 1s ease-in-out infinite;
}
.btn-speak-answer:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.btn-mic-optional {
    background: #f0fdf4;
    color: #16a34a;
    border: 2px solid #bbf7d0;
    font-size: 1.25rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    flex-shrink: 0;
    line-height: 1;
    touch-action: none;
}
.btn-mic-optional.recording {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}
.task-voice-status {
    margin: 0.35rem 0 0;
    font-weight: 700;
    color: #166534;
    text-align: center;
    font-size: 0.95rem;
}
.task-voice-status[hidden] {
    display: none !important;
}
.tasks-page-voice .task-question .task-emoji {
    font-size: 2rem;
}
.btn-check {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    flex-shrink: 0;
}
.btn-check:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.btn-check:disabled {
    opacity: 0.6;
    cursor: wait;
}
.task-feedback-correct {
    background: #ecfdf5;
    border: 2px solid #86efac;
}
.task-feedback-wrong {
    background: #fff7ed;
    border: 2px solid #fed7aa;
}
.task-reveal[hidden] {
    display: none !important;
}
.btn-answer[hidden] {
    display: none !important;
}
.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}
.btn-hint {
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #92400e;
    border: none;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
}
.btn-hint:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-2px);
}
.btn-answer {
    background: linear-gradient(135deg, #86efac, #22c55e);
    color: #14532d;
    border: none;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
}
.btn-answer:hover:not(:disabled) {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    transform: translateY(-2px);
}
.task-reveal {
    margin-top: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    animation: revealPop 0.35s ease;
}
@keyframes revealPop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.task-hint {
    background: #fff7ed;
    border: 2px solid #fed7aa;
}
.task-answer {
    background: #ecfdf5;
    border: 2px solid #86efac;
}
.task-reveal-label {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: var(--green-900);
}
.task-reveal p {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
}

.tasks-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding-bottom: 1rem;
    align-items: center;
}
.tasks-regenerate-form {
    margin: 0;
    display: inline-block;
}
.tasks-footer-actions .btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* ---------- Cards / Forms ---------- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 1.5rem;
}
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    width: 100%;
}
.auth-card { max-width: 420px; }
.form-card { max-width: 540px; }
.card-title { color: var(--green-900); font-size: 1.6rem; margin-bottom: 0.25rem; }
.card-subtitle { color: var(--muted); margin-bottom: 1.5rem; }

.field { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.field input,
.field select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px var(--green-100);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.password-field { position: relative; }
.password-field input {
    width: 100%;
    padding-right: 2.75rem;
}
.password-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle:hover { color: var(--green-700); background: var(--green-50); }
.password-toggle:focus-visible {
    outline: 2px solid var(--green-500);
    outline-offset: 2px;
}
.password-toggle.visible .icon-eye { display: none; }
.password-toggle.visible .icon-eye-off { display: block; }
.password-toggle .icon-eye-off { display: none; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}
.auth-alt { text-align: center; margin-top: 1.25rem; color: var(--muted); }
.auth-forgot { text-align: right; margin: -0.35rem 0 0.75rem; }
.auth-forgot a { font-size: 0.92rem; font-weight: 600; }

/* ---------- Dashboard ---------- */
.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}
.dashboard-header h1 { color: var(--green-900); font-size: 1.9rem; }
.welcome { color: var(--muted); }

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.child-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.child-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.child-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    margin-bottom: 0.85rem;
}
.child-name { color: var(--green-900); margin-bottom: 0.75rem; }
.child-meta { list-style: none; display: grid; gap: 0.45rem; }
.child-meta li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed var(--border);
    font-size: 0.92rem;
}
.child-meta li:last-child { border-bottom: none; }
.meta-label { color: var(--muted); font-weight: 600; }
.meta-value { color: var(--ink); font-weight: 700; text-align: right; }

.empty-state {
    text-align: center;
    background: var(--white);
    border: 2px dashed var(--green-500);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    display: grid;
    gap: 1rem;
    place-items: center;
}
.empty-emoji { font-size: 3rem; }
.empty-state p { color: var(--muted); max-width: 28rem; }

/* ---------- Footer ---------- */
.footer {
    background: var(--green-900);
    color: var(--green-100);
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-art { order: -1; min-height: 200px; }
    .blob { width: 190px; height: 190px; }
    .hero-emoji { font-size: 4.5rem; }
    .features { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .navbar-inner { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .nav-links { justify-content: center; }
    .content { padding: 1.25rem 1rem 2.5rem; }
    .card { padding: 1.5rem; }
    .field-row { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; align-items: stretch; }
    .dashboard-header .btn { width: 100%; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .task-actions { flex-direction: column; }
    .task-actions .btn { width: 100%; }
    .tasks-footer-actions { flex-direction: column; }
    .tasks-footer-actions .btn { width: 100%; }
    .select-tasks-header { flex-direction: column; text-align: center; }
}

/* ---------- AI chat ---------- */
.chat-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    max-width: 1560px;
    margin: 0 auto;
    min-height: calc(100vh - 160px);
    align-items: stretch;
    position: relative;
}
.chat-layout:has(.chat-sidebar-vocab) {
    grid-template-columns: 260px 1fr minmax(160px, 200px);
}
.chat-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1rem;
    z-index: 40;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}
.topic-sidebar {
    width: 260px;
    flex-shrink: 0;
}
.topic-sidebar-card {
    background: #f0fdf4;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.08);
    border: 1px solid #bbf7d0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.topic-sidebar-title {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: #166534;
    font-weight: 800;
}
.topic-sidebar-summary {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
    color: #15803d;
    font-weight: 600;
}
.topic-sidebar-progress {
    height: 8px;
    background: #dcfce7;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.topic-sidebar-progress-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 99px;
    transition: width 0.35s ease;
}
.topic-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.topic-sidebar-list li { margin-bottom: 0.5rem; }
.topic-item {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.35;
    font-family: inherit;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.topic-item-open,
.topic-item-done {
    cursor: pointer;
    border: none;
}
.topic-item-open:hover,
.topic-item-done:hover {
    background: #f0fdf4;
}
.topic-item-active {
    border-color: #16a34a;
    background: #fff;
    font-weight: 700;
}
.topic-item-locked {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}
.topic-num {
    font-weight: 800;
    color: #16a34a;
    flex-shrink: 0;
    min-width: 1.5rem;
}
.topic-item-locked .topic-num { color: #9ca3af; }
.topic-lock { flex-shrink: 0; }
.topic-badge {
    background: #dcfce7;
    color: #16a34a;
    border-radius: 99px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}
.topic-sidebar-avg {
    margin: 1rem 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #166534;
    text-align: center;
}
.chat-current-topic {
    font-size: 1.15rem;
    margin: 0.35rem 0 0;
    color: #166534;
    font-weight: 700;
}
.chat-mode-voice { background: #d1fae5; color: #047857; }
.chat-mode-chat { background: #dcfce7; color: #16a34a; }

.voice-switch-chat {
    display: inline-block;
    font-weight: 700;
    color: #15803d;
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.voice-switch-chat:hover { color: #16a34a; text-decoration: underline; }

.chat-layout-voice .chat-main {
    background: #f0fdf4;
    border-radius: var(--radius);
    border: 1px solid #bbf7d0;
}
.chat-layout-voice .chat-messages {
    flex: 1;
    min-height: 120px;
    max-height: calc(100vh - 340px);
}
.chat-bubble.voice-assistant-card .chat-bubble-inner {
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.1);
    padding: 1rem 1.15rem;
    color: #1a1a1a;
}

.voice-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem 2rem;
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
    border-radius: 0 0 var(--radius) var(--radius);
    text-align: center;
}
.voice-status {
    margin: 0;
    font-weight: 700;
    color: #166534;
    font-size: 1.05rem;
}
.voice-mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #16a34a;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
    touch-action: none;
    user-select: none;
}
.voice-mic-btn:hover:not(.disabled):not(.recording) {
    transform: scale(1.05);
}
.voice-mic-icon {
    font-size: 2rem;
    line-height: 1;
}
.voice-mic-btn.recording {
    background: #dc2626;
    animation: voice-mic-pulse 1s ease-in-out infinite;
}
.voice-mic-btn.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
}
@keyframes voice-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    50% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}
.voice-unsupported {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 320px;
}
.voice-unsupported a { color: #16a34a; font-weight: 700; }
.btn-test-start {
    margin-top: 0.75rem;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.btn-test-start:hover { background: #15803d; }
.test-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.test-overlay[hidden] {
    display: none !important;
}
.test-modal {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.test-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--muted);
}
.test-title { margin: 0 0 1rem; color: #166534; }
.quiz-q { margin-bottom: 1.25rem; }
.quiz-q-text { font-weight: 700; margin: 0 0 0.5rem; }
.quiz-question { margin-bottom: 1.25rem; }
.quiz-question .question-text { font-weight: 700; margin: 0 0 0.5rem; }
.fill-answer-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
}
.check-fill-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}
.fill-feedback {
    margin-top: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.fill-feedback.correct { background: #dcfce7; color: #166534; }
.fill-feedback.incorrect { background: #fee2e2; color: #991b1b; }
.quiz-opt {
    display: block;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 1rem;
}
.btn-quiz-submit { width: 100%; margin-top: 0.5rem; }
.result-box {
    display: block;
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}
.result-pass {
    background: #dcfce7;
    color: #16a34a;
}
.result-fail {
    background: #ffedd5;
    color: #c2410c;
    cursor: default;
}
.result-hint {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 0.75rem;
}
.quiz-review {
    margin: 0.75rem 0;
    text-align: left;
}
.quiz-review-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}
.quiz-review-item {
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}
.quiz-review-item.correct {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.quiz-review-item.incorrect {
    background: #fef2f2;
    border-color: #fecaca;
}
.quiz-review-q {
    font-weight: 700;
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}
.quiz-review-answer {
    margin: 0.15rem 0;
    font-size: 0.9rem;
}
.quiz-review-user-correct {
    color: #16a34a;
    font-weight: 700;
}
.quiz-review-user-wrong {
    color: #dc2626;
    font-weight: 700;
}
.quiz-review-correct {
    color: #16a34a;
    font-weight: 700;
}
.quiz-review-explanation {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}
.chat-sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}
.chat-sidebar-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--green-800);
}
.chat-vocab-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.chat-vocab-lang {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}
.chat-vocab-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.4;
}
.vocab-native { font-weight: 700; display: block; }
.vocab-arrow { color: var(--muted); font-size: 0.8rem; }
.vocab-foreign { color: var(--green-700); }
.chat-vocab-empty {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}
.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}
.chat-page {
    display: flex;
    flex-direction: column;
    max-width: 720px;
    margin: 0 auto;
    min-height: calc(100vh - 180px);
    padding-bottom: 1rem;
}
.chat-header {
    margin-bottom: 0.7rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.chat-header-topbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
/* A rugalmas hézag választja el a bal oldalt (ki tanul) a jobbtól
   (érme, nagyítás, módváltó). Enélkül a space-between a névkártya
   beolvadása után szétdobná a sor közepét. */
.chat-header-ter { flex: 1 1 0; min-width: 0; }
.chat-header-topbar .chat-back,
.chat-header-topbar .voice-switch-chat {
    margin-bottom: 0;
    padding-left: 0;
}
.chat-header-topbar .chat-mode-badge {
    margin: 0;
    flex-shrink: 0;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
}
.chat-topic-card {
    background: var(--white);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    text-align: left;
}
.chat-topic-card-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.15rem;
}
.chat-topic-card .chat-current-topic {
    margin: 0;
    text-align: left;
}
.chat-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.chat-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    background: var(--green-50);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.3rem;
}
.chat-stat-icon { font-size: 1rem; line-height: 1; }
.chat-stat-value { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.chat-stat-xp { background: linear-gradient(135deg, #fff3cd, #ffe69c); }
.chat-stat-xp .chat-stat-value { color: #856404; }
.chat-stat-level { background: linear-gradient(135deg, #cce5ff, #b8daff); }
.chat-stat-level .chat-stat-value { color: #004085; }
.chat-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.chat-header-actions .btn-test-start { margin-top: 0; }
.chat-header-playful {
    background: linear-gradient(180deg, #fef3c7 0%, #dbeafe 55%, #dcfce7 100%);
    border-radius: 20px;
    padding: 10px 12px;
    border: 3px solid var(--white);
    box-shadow: 0 4px 14px rgba(20, 83, 45, 0.1);
}
.chat-header-playful .chat-header-topbar .chat-back,
.chat-header-playful .chat-header-topbar .voice-switch-chat {
    color: #166534;
    font-weight: 700;
}
.chat-mode-toggle {
    background: #16a34a;
    color: #fff !important;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}
a.chat-mode-toggle { cursor: pointer; }
a.chat-mode-toggle:hover { background: #15803d; text-decoration: none; }
/* A .chat-header-identity dobozt a fejléc már nem használja – a név és a
   tantárgy a felső sávba került. A szabály itt marad, mert más oldal is
   hivatkozhat rá. */
.chat-header-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border-radius: 16px;
    padding: 10px 14px;
    margin: 10px 0;
}

/* ── A fejléc ALSÓ sávja: mit tanul éppen, mennyit, és a Szintfelmérő ──
   Egyetlen sor, fehér lapon. A „Most ezt tanulod” szaggatott dobozát a
   célkereszt-jel helyettesíti: rövidebb, és ugyanazt mondja. */
.chat-header-also {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: 14px;
    padding: 8px 12px;
}
.chat-also-jel { font-size: 0.95rem; line-height: 1; flex-shrink: 0; }
.chat-header-also .chat-current-topic {
    margin: 0;
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
    color: #166534;
    min-width: 0;
}
.chat-header-also .chat-mini-stat {
    font-size: 0.85rem;
    font-weight: 700;
    color: #166534;
    white-space: nowrap;
}
.chat-mini-stat-sorozat { color: #c2410c; }
.chat-header-also .btn-test-start {
    margin-top: 0;
    padding: 7px 16px;
    font-size: 0.88rem;
}
.chat-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #ec4899);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.chat-header-identity-text { min-width: 0; }
.chat-header-identity-text .chat-child-name {
    font-size: 1rem;
    margin: 0;
    text-align: left;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header-identity-text .chat-subject {
    font-size: 0.78rem;
    margin: 0;
    text-align: left;
    color: #7c3aed;
    font-weight: 700;
    line-height: 1.2;
}
.chat-xp-pill {
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    color: #92400e;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
}
.chat-coins-pill {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
}
.chat-topic-card-playful {
    background: var(--white);
    border: 2px dashed #c4b5fd;
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 10px;
    text-align: left;
}
.chat-topic-card-playful .chat-topic-card-label {
    color: #7c3aed;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
}
.chat-topic-card-playful .chat-current-topic {
    font-size: 1rem;
    margin: 0;
}
.chat-mini-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #166534;
}
.chat-streak-bar {
    background: #fff;
    border: 2px solid #fed7aa;
    border-radius: 12px;
    padding: 7px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #c2410c;
    margin-bottom: 10px;
}
.btn-test-start-playful {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.3);
}
.btn-test-start-playful:hover {
    background: linear-gradient(135deg, #22c55e, #15803d);
}
.chat-header-info {
    text-align: center;
}
.chat-back {
    display: inline-block;
    margin-bottom: 0.75rem;
    margin-left: 0;
    padding-left: 16px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}
.chat-back:hover { color: var(--green-700); }
.chat-child-name {
    font-size: 1.5rem;
    margin: 0 0 0.15rem;
    text-align: center;
}
.chat-subject {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
}
.chat-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.chat-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--green-50);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.chat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-500), var(--green-600));
    border-radius: 999px;
    transition: width 0.4s ease;
}
.chat-progress-label {
    font-weight: 800;
    font-size: 1rem;
    min-width: 3rem;
}
.chat-mode-badge,
.chat-topic-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--green-700);
    margin: 0.25rem auto 0;
    text-align: center;
}
.chat-time-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0.25rem 0 0;
    text-align: center;
}
.chat-gamification {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 6px 0 0;
}
.xp-badge, .level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}
.xp-badge {
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    color: #856404;
    border: 1px solid #ffc107;
}
.level-badge {
    background: linear-gradient(135deg, #cce5ff, #b8daff);
    color: #004085;
    border: 1px solid #6ea8fe;
}
.chat-placement-link {
    display: inline-block;
    font-size: 13px;
    color: #16a34a;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 8px;
    background: #dcfce7;
    margin-top: 4px;
}
.chat-placement-disabled {
    color: #9ca3af;
    background: #f3f4f6;
    cursor: not-allowed;
    pointer-events: none;
}
.chat-early-test-btn {
    display: block;
    margin: 0.5rem auto;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    border: none;
    border-radius: 14px;
    padding: 8px 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.chat-early-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.chat-early-test-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 280px;
    max-height: 55vh;
}
.chat-bubble {
    display: flex;
    max-width: 96%;
    align-items: center;
}
.chat-bubble-assistant {
    align-self: flex-start;
}
.chat-bubble-user {
    align-self: flex-end;
}
.chat-bubble-inner {
    padding: 1rem 1.15rem;
    border-radius: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble-assistant .chat-bubble-inner {
    background: var(--green-600);
    border-bottom-left-radius: 0.35rem;
    color: #1a1a1a;
}
.chat-bubble-user .chat-bubble-inner {
    background: #3b82f6;
    color: var(--white);
    border-bottom-right-radius: 0.35rem;
}
.chat-typing .chat-bubble-inner {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    min-width: 4rem;
}
.chat-figure {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 8px auto;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.chat-figure svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.typing-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: chat-typing 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing {
    0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}
.bubble-replay-wrap {
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.bubble-replay-btn {
    font-size: 20px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #166534;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    outline: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    border-radius: 50%;
    transition: opacity 0.15s;
}
.bubble-replay-btn:hover {
    opacity: 1;
}
.chat-input-bar {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.chat-input-bar textarea {
    flex: 1;
    font-size: 1.1rem;
    padding: 1rem 1.1rem;
    border-radius: 1.25rem;
    border: 2px solid var(--border);
    font-family: inherit;
    resize: none;
    min-height: 3.25rem;
}
.chat-send-btn {
    font-size: 1.1rem;
    padding: 1rem 1.35rem;
    border-radius: 1.25rem;
    white-space: nowrap;
}

/* ---------- Birthday confetti modal ---------- */
.birthday-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    pointer-events: none;
}
.birthday-card {
    background: #fff;
    border-radius: 24px;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    position: relative;
    z-index: 2;
    max-width: 420px;
}
/* Bezáró gomb. A .birthday-modal-on `pointer-events: none` van (hogy a
   konfetti alatt is lehessen az oldalt használni), ezért a gombon ezt
   VISSZA kell kapcsolni – enélkül látszik, de nem kattintható. */
.birthday-zaro {
    position: absolute;
    top: 10px; right: 14px;
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: #8a938e;
    font-size: 26px; line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s, color 0.15s;
}
.birthday-zaro:hover,
.birthday-zaro:focus-visible { background: #f0f2f1; color: #3a423e; }
.birthday-zaro:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.35);
}

.birthday-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.birthday-card h2 { font-size: 1.5rem; margin: 0.5rem 0; color: #222; }
.birthday-card p { font-size: 1rem; color: #666; margin: 0; }

.confetti-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.confetti {
    position: absolute;
    width: 10px; height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}
.confetti:nth-child(5n+1) { left: 10%; background: #f59e0b; animation-duration: 3s; animation-delay: 0s; }
.confetti:nth-child(5n+2) { left: 30%; background: #3b82f6; animation-duration: 3.5s; animation-delay: 0.3s; }
.confetti:nth-child(5n+3) { left: 50%; background: #10b981; animation-duration: 4s; animation-delay: 0.6s; }
.confetti:nth-child(5n+4) { left: 70%; background: #ef4444; animation-duration: 2.8s; animation-delay: 0.1s; }
.confetti:nth-child(5n+5) { left: 90%; background: #8b5cf6; animation-duration: 3.2s; animation-delay: 0.4s; }
.confetti:nth-child(n+11) { animation-delay: 0.8s; }
.confetti:nth-child(n+21) { animation-delay: 1.6s; }
.confetti:nth-child(n+31) { animation-delay: 2.4s; }
.confetti:nth-child(n+41) { animation-delay: 3.2s; }
@keyframes confetti-fall {
    0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
@media (max-width: 900px) {
    .chat-sidebar-toggle { display: block; }
    .chat-layout,
    .chat-layout:has(.chat-sidebar-vocab) {
        grid-template-columns: 1fr;
    }
    .topic-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        width: 260px;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        padding: 1rem;
        background: rgba(240, 253, 244, 0.98);
    }
    .topic-sidebar.open { transform: translateX(0); }
    .topic-sidebar-card { max-height: 100%; }
    .chat-sidebar-vocab {
        max-height: 180px;
        order: 3;
    }
    .chat-main { order: 1; min-width: 0; }
}
@media (max-width: 560px) {
    .chat-messages { max-height: 50vh; }
    .chat-bubble { max-width: 96%; }
    .chat-bubble-inner { font-size: 1.12rem; padding: 1.1rem 1.2rem; }
    .chat-input-bar { flex-direction: column; align-items: stretch; }
    .chat-send-btn { width: 100%; padding: 1.15rem; }
}
.chat-thinking-text {
    font-style: italic;
    color: var(--green-700, #15803d);
    font-weight: 600;
}
.chat-thinking-text .thinking-label {
    display: inline-block;
    animation: thinking-pulse 2s ease-in-out infinite;
}
@keyframes thinking-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* A .content 1100 px-nél elvágta a chatet, ezért a rács 1280-as korlátja
   sosem érvényesült. A chat oldalon engedjük szélesebbre – a többi oldal
   marad a régi szélességen. */
body:has(.chat-layout) .content { max-width: 1560px; }

/* A teljes képernyő gombja a felső sávban, a jobb szélen – a „Hangos mód"
   mellett. Kicsi és félreeső, de mindig kéznél. */
.chat-teljes-gomb {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: #166534;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0.4rem;
}
.chat-teljes-gomb:hover { background: #fff; }

/* Teljes képernyőn a chat az egész ablakot kitölti. Osztállyal, hogy akkor
   is működjön, ha a böngésző nem engedi a valódi teljes képernyőt. */
.chat-layout.teljes-mod {
    position: fixed;
    inset: 0;
    z-index: 200;
    grid-template-columns: 1fr;
    max-width: none;
    width: 100vw;
    height: 100dvh;
    padding: 10px 16px;
    background: var(--green-50);
    box-sizing: border-box;
    overflow: hidden;
}
/* Teljes képernyőn a témalista eltűnik, a SZÓJEGYZÉK viszont marad:
   nyelvóránál az a tanulás része. */
.chat-layout.teljes-mod .topic-sidebar,
.chat-layout.teljes-mod .chat-sidebar-toggle { display: none; }
.chat-layout.teljes-mod:has(.chat-sidebar-vocab) {
    grid-template-columns: 1fr minmax(180px, 240px);
}

/* A fejlécből csak a felső sáv és a Szintfelmérő gomb marad – egy sorban.
   A névkártya, az érme, a „Most ezt tanulod" doboz és a percek a rendes
   nézetben ott vannak; nagyításban csak elvennék a helyet a beszélgetéstől. */
.chat-layout.teljes-mod .chat-header-identity,
.chat-layout.teljes-mod .chat-topic-card,
.chat-layout.teljes-mod .chat-mini-stats,
.chat-layout.teljes-mod .chat-streak-bar { display: none; }
/* A fejléc két sávra fogyott: nagyításban az alsó (téma, percek,
   Szintfelmérő) marad el, a felső sor pedig egy sorban fut tovább. */
.chat-layout.teljes-mod .chat-header-also { display: none; }
.chat-layout.teljes-mod .chat-header-topbar { flex-wrap: nowrap; }
.chat-layout.teljes-mod .chat-header {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.chat-layout.teljes-mod .chat-header-topbar { flex: 1 1 auto; }
.chat-layout.teljes-mod .chat-header-actions { flex: 0 0 auto; margin: 0; }
.chat-layout.teljes-mod .btn-test-start { margin-top: 0; }
.chat-layout.teljes-mod .chat-header-playful { padding: 8px 12px; }

/* ---------- Nagyításban minden LEÉR a képernyő aljáig ----------
   A rácsnak egyetlen, teljes magasságú sora van: enélkül a tartalomhoz
   igazodik, és alul üresen marad a képernyő fele. A beszélgetésen ülő
   magassági korlátokat itt feloldjuk – nagyításban a hely a chaté. */
.chat-layout.teljes-mod {
    grid-template-rows: 1fr;
    align-items: stretch;
}
.chat-layout.teljes-mod .chat-main {
    min-height: 0;
    height: 100%;
}
.chat-layout.teljes-mod .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;      /* a 55vh és a 100vh-340px korlát helyett */
}
/* A szójegyzék külön oszlop: a rács nyújtja ki, magában görög. Százalékos
   magasságot NEM adunk neki – attól kinőne a képernyőből. */
.chat-layout.teljes-mod .chat-sidebar-vocab {
    /* A .chat-sidebar alap szabálya "calc(100vh - 140px)"-nél megállítja –
       nagyításban ezt feloldjuk, hogy a szójegyzék is leérjen az aljáig. */
    max-height: none;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    align-self: stretch;
}

/* ── A FEJLÉC TELEFONON ──────────────────────────────────────────────────
   A két sáv telefonon is két sáv marad, csak minden elem kisebb. A név
   levágódik három ponttal, ha nem fér ki – ez jobb, mint ha a módváltó
   gombot nyomná le a következő sorba. */
@media (max-width: 560px) {
    .chat-header-playful { padding: 9px 10px; }
    .chat-avatar-circle { width: 28px; height: 28px; font-size: 0.9rem; }
    /* Egyetlen sor, nem törik: ami nem fér ki, az a NÉV, és az három
       ponttal végződik. Enélkül a módváltó gomb külön sorba csúszott. */
    .chat-header-topbar { gap: 0.4rem; flex-wrap: nowrap; }
    .chat-header-identity-text { flex: 1 1 auto; min-width: 0; }
    /* Telefonon a nyíl önmagában is érthető – a felirat vitte a helyet. */
    .chat-header-topbar .chat-back { font-size: 0; padding: 0; }
    .chat-header-topbar .chat-back::before { content: '←'; font-size: 1.35rem; }
    .chat-header-identity-text .chat-child-name { font-size: 0.9rem; }
    .chat-header-identity-text .chat-subject { font-size: 0.7rem; }
    .chat-mode-toggle { padding: 5px 10px; font-size: 0.74rem; }
    .chat-coins-pill { padding: 5px 9px; font-size: 0.85rem; }
    .chat-teljes-gomb { width: 30px; height: 30px; margin-right: 0.2rem; }
    .chat-header-also { gap: 7px 10px; padding: 7px 10px; flex-wrap: nowrap; }
    .chat-header-also .chat-current-topic {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* Telefonon a percek és a szint lemaradnak: elférnek a profilon, és
       tanulás közben nem ezekre kell néznie a gyereknek. A téma neve és a
       Szintfelmérő gomb marad – ezekre kattint. */
    .chat-header-also .chat-mini-stat { display: none; }
    .chat-header-also .btn-test-start {
        padding: 6px 13px;
        font-size: 0.82rem;
        flex-shrink: 0;
    }
    /* A módváltó gomb telefonon csak a mikrofont mutatja: a felirat vitte a
       helyet, amitől a gomb külön sorba csúszott. */
    .chat-mode-toggle { font-size: 0; padding: 6px 10px; }
    .chat-mode-toggle::before { content: '🎙'; font-size: 1rem; }
    .chat-mode-toggle.chat-mode-chat::before { content: '⌨️'; }
}

/* ── KIEJTÉS-GYAKORLÁS a chatben ─────────────────────────────────────────
   A gyerek SEMMILYEN számot nem lát: két szín van, és piros nincs köztük.
   A "gyakoroljuk még" halvány sárga – jelzés, nem ítélet. */
.kiejtes-kartya {
    background: #f7fdf9;
    border: 2px solid #cfe6d8;
    border-radius: 16px;
    padding: 15px 16px;
    margin: 4px 0 12px;
}
.kiejtes-kartya .ki-fejlec {
    font-size: 0.78rem;
    font-weight: 800;
    color: #16803c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 9px;
}
.kiejtes-kartya .ki-mondat {
    font-size: 1.24rem;
    font-weight: 700;
    line-height: 1.9;
    color: #1a1f2b;
}
.kiejtes-kartya .ki-szo {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9px;
    margin: 0 5px 6px 0;
}
.kiejtes-kartya .ki-szo.jo { background: #dcfce7; color: #14532d; }
.kiejtes-kartya .ki-szo.gyak { background: #fef3c7; color: #7a4a06; }
.kiejtes-kartya .ki-vissza {
    background: #fff;
    border: 1px solid #cfe6d8;
    border-radius: 14px;
    padding: 11px 14px;
    margin-top: 12px;
    font-size: 0.95rem;
}
.kiejtes-kartya .ki-also {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.kiejtes-kartya .ki-mikro {
    width: 56px;
    height: 56px;
    flex: none;
    border: none;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(22, 163, 74, 0.32);
}
.kiejtes-kartya .ki-mikro.vesz { background: #c0392b; }
.kiejtes-kartya .ki-mikro:disabled { opacity: 0.55; cursor: default; }
.kiejtes-kartya .ki-sugo { color: #5b6474; font-size: 0.9rem; }
.kiejtes-kartya .ki-gombsor { display: flex; gap: 9px; margin-top: 12px; }
.kiejtes-kartya .ki-g {
    flex: 1;
    border-radius: 999px;
    padding: 10px;
    font: inherit;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
}
.kiejtes-kartya .ki-zold { background: #16a34a; color: #fff; border: none; }
.kiejtes-kartya .ki-feher { background: #fff; border: 1px solid #cfe6d8; color: #16803c; }
@media (max-width: 560px) {
    .kiejtes-kartya .ki-mondat { font-size: 1.08rem; }
    .kiejtes-kartya { padding: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════
   BEMUTATÓ OLDAL (templates/index.html)
   Minden osztály `bem-` előtaggal, hogy a program többi részének
   kinézetéhez EGYÁLTALÁN ne nyúljon hozzá. Ha ezt a blokkot törlöd,
   minden más pontosan úgy marad, ahogy volt.
   ═══════════════════════════════════════════════════════════════════ */
.bem-hero,
.bem-szakasz { max-width: 1040px; margin: 0 auto; }

.bem-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 52px;
    align-items: center;
    padding: 56px 0 60px;
}
.bem-hero h1 {
    font-size: 46px;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0;
    color: #16241d;
}
.bem-hero h1 em { font-style: normal; color: #1e7a4d; }
.bem-alcim {
    font-size: 19px;
    color: #5d6b64;
    margin: 20px 0 28px;
    max-width: 22em;
}
.bem-apro { font-size: 13.5px; color: #5d6b64; margin-top: 14px; }

.bem-gomb {
    display: inline-block;
    background: #1e7a4d;
    color: #fff;
    text-decoration: none;
    padding: 13px 26px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 15.5px;
}
.bem-gomb:hover { background: #155c3a; }
.bem-gomb-vilagos { background: #fff; color: #155c3a; }
.bem-gomb-vilagos:hover { background: #eef4f0; }

/* A korválasztó: az első dolog egy kérdés, nem szöveg. */
.bem-valaszto {
    background: #fff;
    border: 1px solid #dbe5df;
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 12px 34px rgba(20, 60, 40, 0.08);
}
.bem-valaszto h3 { font-size: 17px; margin: 0 0 16px; }
.bem-evek { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bem-ev {
    border: 1.5px solid #dbe5df;
    border-radius: 14px;
    padding: 14px 0;
    text-align: center;
    font-weight: 800;
    font-size: 19px;
    background: #fff;
    color: #16241d;
    text-decoration: none;
    transition: 0.15s;
}
.bem-ev:hover { border-color: #1e7a4d; color: #1e7a4d; transform: translateY(-2px); }
.bem-ev small { display: block; font-size: 11px; font-weight: 600; opacity: 0.7; }

.bem-szakasz { padding: 68px 0; }
.bem-fejlec { text-align: center; max-width: 30em; margin: 0 auto 40px; }
.bem-fejlec h2 { font-size: 33px; letter-spacing: -0.02em; margin: 0; }
.bem-fejlec p { color: #5d6b64; font-size: 17.5px; margin-top: 14px; }

.bem-racs3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bem-kartya {
    background: #fff;
    border: 1px solid #dbe5df;
    border-radius: 18px;
    padding: 28px;
}
.bem-kartya h3 { font-size: 18px; margin: 0 0 9px; }
.bem-kartya p { color: #5d6b64; font-size: 15px; margin: 0; }
.bem-ikon {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: grid; place-items: center;
    margin-bottom: 16px;
    background: #e8f2ec;
}
.bem-ikon svg {
    width: 24px; height: 24px;
    stroke: #155c3a; fill: none; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round;
}

/* A biztonsági rész a legerősebb érv, ezért ez a legfeltűnőbb blokk. */
.bem-biztonsag {
    /* Mélység + finom minta + arany kiemelés – ugyanaz a hangulat,
       mint a gyűjtőalbumé, hogy a két felület egy márkának látsszon. */
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(61, 220, 151, 0.16), transparent 60%),
        linear-gradient(168deg, #1b6f47 0%, #125133 46%, #0c3a25 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
}
.bem-biztonsag > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.bem-biztonsag .bem-fejlec p { color: #c9ddd2; }
.bem-biztonsag .bem-kartya {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
}
.bem-biztonsag .bem-kartya p { color: #c9ddd2; }
.bem-biztonsag .bem-ikon { background: rgba(255, 255, 255, 0.12); }
.bem-biztonsag .bem-ikon svg { stroke: #fff; }

.bem-beszelgetes {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    max-width: 560px;
    margin: 40px auto 0;
}
.bem-bub {
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 10px;
    font-size: 15px;
    max-width: 84%;
    color: #16241d;
}
.bem-bub-t { background: #f2f4f3; border-bottom-left-radius: 4px; }
.bem-bub-gy { background: #e8f2ec; margin-left: auto; border-bottom-right-radius: 4px; }
.bem-ki {
    display: block;
    font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: #5d6b64; margin-bottom: 3px;
}

.bem-lepesek {
    counter-reset: bemlep;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.bem-lepes { position: relative; padding-top: 52px; }
.bem-lepes::before {
    counter-increment: bemlep;
    content: counter(bemlep);
    position: absolute; top: 0; left: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #1e7a4d; color: #fff;
    display: grid; place-items: center;
    font-weight: 800;
}
.bem-lepes h3 { font-size: 16.5px; margin: 0 0 7px; }
.bem-lepes p { color: #5d6b64; font-size: 14.5px; margin: 0; }

.bem-album-sav {
    background: #fff;
    border-top: 1px solid #dbe5df;
    border-bottom: 1px solid #dbe5df;
    max-width: none;
    padding-left: 24px; padding-right: 24px;
}
.bem-album-sav > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
/* Az album saját borítója képként – a tervezéséhez nem nyúlunk. */
.bem-borito {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 22px 54px rgba(10, 30, 20, 0.28);
}

.bem-lapok-cim {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #5d6b64;
    margin: 42px 0 18px;
}
.bem-album {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}
.bem-lap {
    box-shadow: 0 6px 18px rgba(20, 60, 40, 0.16);
    /* A kártyaképek 1020 x 1644 képpontosak – ez az arányuk. */
    aspect-ratio: 1020 / 1644;
    width: 100%;
    object-fit: cover;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(150deg, #dfeae4, #c6dbcf);
    border: 1px solid #dbe5df;
    display: grid; place-items: center;
    font-size: 12.5px; font-weight: 700;
    color: #155c3a; text-align: center; padding: 6px;
}
.bem-lap-zar {
    background: repeating-linear-gradient(45deg, #eef1ef, #eef1ef 6px, #e6eae8 6px, #e6eae8 12px);
    color: #a8b3ad;
}

.bem-zaro {
    background: #1e7a4d;
    color: #fff;
    text-align: center;
    padding: 68px 24px;
}
.bem-zaro h2 { font-size: 33px; letter-spacing: -0.02em; margin: 0; }
.bem-zaro p { color: #cfe6da; font-size: 17.5px; margin: 14px auto 28px; max-width: 24em; }

@media (max-width: 900px) {
    .bem-hero, .bem-racs3, .bem-lepesek { grid-template-columns: 1fr; }
    .bem-hero h1 { font-size: 34px; }
    .bem-album { grid-template-columns: repeat(3, 1fr); }
}

/* ── A biztonsági szakasz díszítése ──────────────────────────────────── */
.bem-biztonsag::before {
    /* halvány, ismétlődő rajzos minta, mint az album borítóján */
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.5;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'>\
<g fill='none' stroke='%23ffffff' stroke-opacity='0.055' stroke-width='2'>\
<circle cx='34' cy='36' r='15'/>\
<path d='M120 24h34v26h-34z'/>\
<path d='M150 96l14 24h-28z'/>\
<circle cx='58' cy='140' r='11'/>\
<path d='M14 96h30M14 106h22'/>\
<path d='M96 150c10-14 26-14 36 0'/>\
<path d='M172 152v22M162 162h20'/>\
<circle cx='104' cy='74' r='7'/>\
</g></svg>");
}
.bem-biztonsag > * { position: relative; z-index: 1; }

/* arany vonal a cím alatt */
.bem-biztonsag .bem-fejlec h2 { position: relative; padding-bottom: 18px; }
.bem-biztonsag .bem-fejlec h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 74px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, #f2dd8a, transparent);
}

.bem-biztonsag .bem-kartya {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.04));
    border-color: rgba(242, 221, 138, 0.24);
    box-shadow: 0 16px 34px rgba(4, 26, 16, 0.3);
}
.bem-biztonsag .bem-kartya h3 { color: #ffeeb8; }
.bem-biztonsag .bem-ikon {
    background: linear-gradient(150deg, rgba(242, 221, 138, 0.24), rgba(242, 221, 138, 0.08));
    box-shadow: inset 0 0 0 1px rgba(242, 221, 138, 0.35);
}
.bem-biztonsag .bem-ikon svg { stroke: #f7e6ae; }

/* a párbeszéd kapjon keretet és mélységet, ne csak fehér folt legyen */
.bem-biztonsag .bem-beszelgetes {
    box-shadow: 0 22px 50px rgba(4, 26, 16, 0.4);
    border: 1px solid rgba(242, 221, 138, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   BEMUTATÓ – SZÍNES VÁLTOZAT (vázlat)
   A keret nyugodt marad a szülőnek, a HANGSÚLYOK lesznek színesek
   a gyereknek. Fénykép nincs benne, csak rajzolt formák.
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --b-sarga: #f5a623;
    --b-korall: #ef5f5f;
    --b-kek: #2f8fd8;
    --b-lila: #7b5bd6;
    --b-turkiz: #17b8a6;
    --b-rozsa: #e0609b;
}

.bem-hero {
    position: relative;
    isolation: isolate;
    padding: 62px 24px 68px;
}
.bem-hero::before {
    content: "";
    position: absolute;
    inset: -40px -50vw -10px;
    z-index: -2;
    background:
        radial-gradient(52% 60% at 12% 18%, rgba(245, 166, 35, 0.24), transparent 70%),
        radial-gradient(46% 55% at 88% 12%, rgba(47, 143, 216, 0.22), transparent 70%),
        radial-gradient(50% 60% at 72% 95%, rgba(23, 184, 166, 0.22), transparent 70%),
        linear-gradient(180deg, #f2f9f5, #f6f9f7);
}
/* A HERO HÁTTERE.
   Korábban egy ISMÉTLŐDŐ mértani csempe volt itt (kör, négyzet, plusz jel),
   ezért a szakasz szélén minden alakzat félbevágódott. Most EGYETLEN,
   kézzel elrendezett kép van (static/img/hatter_jelek.svg), ami nem
   ismétlődik: a jelek a lap szélein ülnek, egyik sincs elvágva, és
   mindegyik jelent valamit — szám, művelet, betű, hangjegy, lombik,
   földgömb, könyv, ecset, vonalzó. */
.bem-hero::after {
    content: "";
    position: absolute;
    /* Pontosan a KÉPERNYŐ szélességét fedi le – nem többet, nem kevesebbet.
       Így a kép két szélén ülő jelek tényleg a képernyő szélére kerülnek
       (nem a szöveg mögé), és egyik sincs elvágva. */
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    background-image: url("/static/img/hatter_jelek.svg");
    background-repeat: no-repeat;
    background-position: center;
    /* Teljes szélességben, arányosan: a jelek így maradnak a KÉT SZÉLEN,
       ahol nem takarnak szöveget. */
    background-size: 100% auto;
}
/* Alul szabad sáv a két figurának – így nem lógnak rá a szövegre.
   A hero összesen ne legyen magasabb, mint a képernyő: a figurák lába
   se lógjon ki görgetés nélkül. */
.bem-hero {
    padding-top: 40px;
    padding-bottom: 178px;
    max-height: calc(100vh - 74px);
    box-sizing: border-box;
}
.bem-figura {
    position: absolute;
    bottom: 0;
    height: 190px;
    width: auto;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 10px 22px rgba(20, 60, 40, .16));
}
/* A KÉT SZÉLEN állnak, egymástól távol: a lány bal oldalon a szöveg
   alatt, a fiú jobb oldalon az évfolyam-kártya alatt. Egyik sem takar
   el betűt, mert fölöttük ott a szabad sáv. */
.bem-figura-1 { left: 8px; height: 168px; }
.bem-figura-2 { right: 24px; height: 176px; }
/* Alacsony ablakban még kisebbek, hogy soha ne kelljen értük görgetni. */
@media (max-height: 820px) {
    .bem-hero { padding-top: 24px; padding-bottom: 148px; }
    .bem-figura-1 { height: 140px; }
    .bem-figura-2 { height: 147px; }
}
@media (max-height: 700px) {
    .bem-hero { padding-top: 16px; padding-bottom: 124px; }
    .bem-figura-1 { height: 116px; }
    .bem-figura-2 { height: 122px; }
}
@media (max-width: 900px) {
    .bem-hero { padding-bottom: 68px; }
    .bem-figura { display: none; }
}

.bem-hero h1 { font-size: 48px; }

.bem-valaszto { border: 0; box-shadow: 0 18px 46px rgba(20, 60, 40, 0.14); }
.bem-ev { border-width: 2px; }
.bem-ev:nth-child(1) { border-color: rgba(239, 95, 95, 0.42); color: var(--b-korall); }
.bem-ev:nth-child(2) { border-color: rgba(245, 166, 35, 0.45); color: #c77f10; }
.bem-ev:nth-child(3) { border-color: rgba(23, 184, 166, 0.45); color: #0e8a7c; }
.bem-ev:nth-child(4) { border-color: rgba(47, 143, 216, 0.42); color: var(--b-kek); }
.bem-ev:nth-child(5) { border-color: rgba(123, 91, 214, 0.42); color: var(--b-lila); }
.bem-ev:nth-child(6) { border-color: rgba(224, 96, 155, 0.42); color: var(--b-rozsa); }
.bem-ev:nth-child(7) { border-color: rgba(23, 184, 166, 0.45); color: #0e8a7c; }
.bem-ev:nth-child(8) { border-color: rgba(245, 166, 35, 0.45); color: #c77f10; }
.bem-ev:hover { transform: translateY(-3px) scale(1.03); }

.bem-racs3 .bem-kartya { border-top: 5px solid var(--b-kek); }
.bem-racs3 .bem-kartya:nth-child(1) { border-top-color: var(--b-kek); }
.bem-racs3 .bem-kartya:nth-child(2) { border-top-color: var(--b-sarga); }
.bem-racs3 .bem-kartya:nth-child(3) { border-top-color: var(--b-turkiz); }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(1) .bem-ikon { background: rgba(47, 143, 216, 0.15); }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(1) .bem-ikon svg { stroke: var(--b-kek); }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(2) .bem-ikon { background: rgba(245, 166, 35, 0.2); }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(2) .bem-ikon svg { stroke: #c77f10; }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(3) .bem-ikon { background: rgba(23, 184, 166, 0.17); }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:nth-child(3) .bem-ikon svg { stroke: #0e8a7c; }
.bem-szakasz:not(.bem-biztonsag) .bem-kartya {
    box-shadow: 0 10px 26px rgba(20, 60, 40, 0.07);
    transition: transform 0.15s, box-shadow 0.15s;
}
.bem-szakasz:not(.bem-biztonsag) .bem-kartya:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(20, 60, 40, 0.12);
}

.bem-lepes:nth-child(1)::before { background: var(--b-korall); }
.bem-lepes:nth-child(2)::before { background: var(--b-sarga); }
.bem-lepes:nth-child(3)::before { background: var(--b-kek); }
.bem-lepes:nth-child(4)::before { background: var(--b-lila); }
.bem-lepes::before { box-shadow: 0 6px 14px rgba(20, 60, 40, 0.18); }

.bem-album-sav {
    background:
        radial-gradient(60% 70% at 20% 0%, rgba(245, 166, 35, 0.14), transparent 70%),
        radial-gradient(60% 70% at 85% 100%, rgba(123, 91, 214, 0.13), transparent 70%),
        #fffdf8;
}
.bem-lap { transition: transform 0.15s; }
.bem-lap:hover { transform: translateY(-5px) rotate(-1.5deg); }

.bem-zaro {
    background:
        radial-gradient(70% 120% at 15% 0%, rgba(245, 166, 35, 0.3), transparent 60%),
        radial-gradient(70% 120% at 85% 100%, rgba(23, 184, 166, 0.32), transparent 60%),
        linear-gradient(160deg, #1e7a4d, #14603b);
}

/* ═══════════════════════════════════════════════════════════════════
   SZÜLŐI PIN
   Szűk, nyugodt, játék nélkül – a gyereknek is látszania kell, hogy
   ez a rész nem az övé.
   ═══════════════════════════════════════════════════════════════════ */
.pin-lap {
    display: grid;
    place-items: center;
    padding: 56px 20px 80px;
}
.pin-doboz {
    background: #fff;
    border: 1px solid #dbe5df;
    border-radius: 20px;
    padding: 34px 30px 28px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(20, 60, 40, 0.12);
}
.pin-doboz-szeles { max-width: 420px; text-align: left; }
.pin-lakat {
    width: 54px; height: 54px;
    border-radius: 16px;
    background: #fdf1e0;
    display: grid; place-items: center;
    margin: 0 auto 16px;
}
.pin-lakat svg {
    width: 27px; height: 27px;
    stroke: #c77f10; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.pin-doboz h1 { font-size: 21px; margin: 0 0 5px; }
.pin-alcim { font-size: 14px; color: #5d6b64; margin: 0 0 20px; }
.pin-mezo {
    width: 100%;
    font-size: 30px;
    letter-spacing: 0.5em;
    text-align: center;
    padding: 12px 0 12px 0.5em;
    border: 2px solid #dbe5df;
    border-radius: 14px;
    margin-bottom: 16px;
}
.pin-mezo:focus { outline: none; border-color: #1e7a4d; }
.pin-cimke {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #5d6b64;
    margin: 14px 0 6px;
}
.pin-szoveg {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #dbe5df;
    border-radius: 12px;
    font-size: 15px;
}
.pin-szoveg:focus { outline: none; border-color: #1e7a4d; }
.pin-gomb { width: 100%; margin-top: 18px; }
.pin-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13.5px;
    color: #5d6b64;
}
.mezo-sugo { font-size: 13px; color: #5d6b64; margin: 6px 0 0; line-height: 1.5; }
.szuloknek {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #5d6b64 !important;
    border: 1px solid #dbe5df;
    border-radius: 99px;
    padding: 7px 15px;
}
.szuloknek svg {
    width: 15px; height: 15px;
    stroke: #c77f10; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.szuloknek:hover { background: #f3f6f4; text-decoration: none; }

/* A szülői rész nyitva van – látható, egy kattintással zárható. */
.pin-nyitva {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #9a5e0c !important;
    background: #fff6e6;
    border: 1px solid #f3d9ad;
    border-radius: 99px;
    padding: 6px 13px;
}
.pin-nyitva svg {
    width: 15px; height: 15px;
    fill: none; stroke: #c77f10; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.pin-nyitva:hover { background: #fdefd8; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════
   TANTÁRGYVÁLASZTÓ CSEMPÉK (a gyerek első képernyője)
   A legördülő lista megmarad rejtve – minden régi JavaScript rá épül.
   ═══════════════════════════════════════════════════════════════════ */
.targy-rejtett {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.targyracs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.targy {
    --tszin: #1e7a4d;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border: 2px solid #e3e9e5;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: transform .14s, box-shadow .14s, border-color .14s;
}
.targy:hover {
    transform: translateY(-3px);
    border-color: var(--tszin);
    box-shadow: 0 12px 26px rgba(20, 60, 40, .12);
}
.targy.kivalasztva {
    border-color: var(--tszin);
    background: color-mix(in srgb, var(--tszin) 9%, #fff);
    box-shadow: 0 10px 24px rgba(20, 60, 40, .14);
}
.targy-jel {
    width: 42px; height: 42px;
    flex: none;
    border-radius: 13px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--tszin) 15%, #fff);
}
.targy-jel svg {
    width: 22px; height: 22px;
    fill: none; stroke: var(--tszin);
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.targy-nev {
    font-weight: 700;
    font-size: 15px;
    color: #16241d;
    line-height: 1.25;
}

/* A hosszú tantárgynevek (pl. „Környezetismeret”) NE lógjanak ki. */
.targy { min-width: 0; }
.targy-nev {
    min-width: 0;
    /* A hosszú tantárgynevek (Környezetismeret, Conocimiento del Medio…)
       eddig szó KÖZEPÉN törtek el, kötőjel nélkül: „Környezetismer et".
       Az elválasztás bekapcsolásával rendes kötőjelet kapnak, és ha még
       így sem fér ki, egy hajszálnyival kisebb betűvel írjuk. */
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
    font-size: .97em;
    line-height: 1.28;
}
/* Nyelvválasztó: zászló az ikon helyén. */
.targy-zaszlo {
    font-size: 24px;
    line-height: 1;
    background: #f3f6f4;
}

/* A zászlók SVG-ként rajzolódnak: a Windows Chrome nem jeleníti meg az
   emoji-zászlókat, csak a betűpárt („GB", „DE"). */
.targy-zaszlo { background: #f3f6f4; padding: 0; overflow: hidden; }
.targy-zaszlo svg {
    width: 30px; height: 20px;
    border-radius: 3px;
    display: block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

/* ═══════════════════════════════════════════════════════════════════
   A GYEREK OLDALAINAK HÁTTERE
   Halvány, rajzos minta a tantárgyakból: számok és műveleti jelek,
   köszönés több nyelven, kémiai jel, lombik, labda, súlyzó, falevél,
   hangjegy, könyv. CSAK a gyerek felületén jelenik meg – a szülőin nem.
   Szándékosan nagyon halvány: a szöveg olvashatósága fontosabb.
   ═══════════════════════════════════════════════════════════════════ */
body.gyerek-hatter {
    /* A GYEREK OLDALAINAK HÁTTERE.
       Nyugodt színátmenet, és fölötte UGYANAZ az iskolai jelkészlet, mint
       a bemutató oldalon (static/img/hatter_jelek.svg). Nem ismétlődik,
       ezért egyetlen jel sem vágódik ketté, és a jelek a lap szélein
       ülnek – középen szabad marad a hely a tartalomnak. */
    background-color: #f2f7fb;
    background-image:
        url("/static/img/hatter_jelek.svg"),
        radial-gradient(760px 520px at 8% 0%, rgba(47, 143, 216, .16), transparent 62%),
        radial-gradient(700px 520px at 100% 22%, rgba(23, 184, 166, .15), transparent 60%),
        radial-gradient(620px 460px at 50% 100%, rgba(245, 166, 35, .12), transparent 62%);
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
    background-position: center, 0 0, 0 0, 0 0;
    background-size: 100% auto, auto, auto, auto;
    background-attachment: fixed;
}

body.gyerek-hatter .select-tasks-header,
body.gyerek-hatter .back-link {
    background: rgba(255, 255, 255, .82);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 4px 16px rgba(20, 60, 40, .06);
}
body.gyerek-hatter .back-link {
    display: inline-block;
    padding: 8px 14px;
    margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════════
   GYEREKKÁRTYA A GYEREKVÁLASZTÓN
   Minden gyerek saját színt kap – több testvérnél egy pillantásra
   megkülönböztethetők. Kevés adat, nagy betű, egyértelmű főgomb.
   ═══════════════════════════════════════════════════════════════════ */
.gy-kartya {
    --gyszin: #1e7a4d;
    position: relative;
    background: #fff;
    border: 1px solid #e3e9e5;
    border-radius: 22px;
    padding: 0 22px 20px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(20, 60, 40, .08);
    transition: transform .16s, box-shadow .16s;
}
.gy-kartya:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(20, 60, 40, .14);
}
.gy-kartya::before {          /* színes szalag a kártya tetején */
    content: "";
    display: block;
    height: 78px;
    margin: 0 -22px 0;
    background:
        radial-gradient(120% 140% at 20% -30%, rgba(255, 255, 255, .45), transparent 60%),
        var(--gyszin);
}
.gy-fejlec { display: flex; align-items: center; gap: 14px; margin-top: -34px; }
.gy-arc {
    width: 68px; height: 68px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(20, 60, 40, .18);
    display: grid; place-items: center;
    font-size: 27px; font-weight: 800;
    color: var(--gyszin);
}
.gy-cim { padding-top: 30px; min-width: 0; }
.gy-cim h3 {
    margin: 0;
    font-size: 19px;
    color: #16241d;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gy-cim p { margin: 2px 0 0; font-size: 13.5px; color: #5d6b64; }

.gy-tenyek { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 16px; }
.gy-teny {
    background: #f5f8f6;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: center;
}
.gy-teny-jel { display: block; margin: 0 auto 4px; }
.gy-teny-jel svg {
    width: 20px; height: 20px;
    fill: none; stroke: var(--gyszin); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.gy-teny b {
    display: block;
    font-size: 17px; font-weight: 800; color: #16241d;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gy-teny span { font-size: 11.5px; color: #5d6b64; }

.gy-inditas {
    display: block;
    text-align: center;
    padding: 15px;
    border-radius: 999px;
    background: var(--gyszin);
    color: #fff !important;
    font-weight: 800;
    font-size: 16.5px;
    text-decoration: none;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--gyszin) 35%, transparent);
}
.gy-inditas:hover { filter: brightness(1.07); text-decoration: none; }

.gy-also {
    display: flex; justify-content: center; gap: 16px;
    margin-top: 14px;
    font-size: 13.5px;
}
.gy-also a { color: #5d6b64 !important; font-weight: 600; }
.gy-also a:hover { color: var(--gyszin) !important; }

/* ═══════════════════════════════════════════════════════════════════
   FIÚ / LÁNY VÁLASZTÓ a gyerek profiljában
   Három nagy, kattintható gomb rádiógomb helyett – telefonon is
   könnyen eltalálható. A választott gomb zöld keretet kap.
   ═══════════════════════════════════════════════════════════════════ */
.nemvalaszto {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}
.nemgomb {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #dfe6e2;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e37;
    transition: border-color .15s, background .15s;
}
.nemgomb:hover { border-color: #9fc9b4; }
.nemgomb input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #c4d2cb;
    border-radius: 50%;
    background: #fff;
}
.nemgomb input:checked {
    border-color: #1e7a4d;
    background: radial-gradient(circle, #1e7a4d 0 45%, #fff 47%);
}
.nemgomb:has(input:checked) {
    border-color: #1e7a4d;
    background: #f0f8f3;
}
.field-hint {
    margin: 8px 0 0;
    font-size: .86rem;
    color: #6b7a73;
    line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════
   KABALA FIGURA A BESZÉLGETÉS MELLETT
   SAJÁT OSZLOPOT kap a rácsban, hogy soha ne takarjon el szöveget vagy
   gombot. Szándékosan MOZDULATLAN: a gyerek a feladatra figyeljen.

   FONTOS: minden oszlopszabály MIN-WIDTH lekérdezésben van. Korábban
   max-width nélkül álltak, ezért felülírták a 900 képpontos mobilszabályt,
   és TELEFONON a beszélgetés egy 34 képpontos sávba szorult. Így most
   keskeny képernyőn a kabala szabályaiból SEMMI nem érvényes.
   ═══════════════════════════════════════════════════════════════════ */
.chat-kabala-oszlop {
    display: none;               /* alapból nincs – csak széles képernyőn */
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
    pointer-events: none;
}
.chat-kabala {
    /* „ragadós": ha a lap hosszabb a képernyőnél, a figura akkor is
       látszik az alsó sarokban, nem csúszik le a lap aljára. */
    position: sticky;
    bottom: 14px;
    width: 100%;
    max-width: 112px;
    height: auto;
    user-select: none;
    filter: drop-shadow(0 6px 16px rgba(20, 60, 40, .14));
}

/* Szójegyzék NÉLKÜL: 1121 képponttól fér el a figura. */
@media (min-width: 1121px) {
    .chat-layout:has(.chat-kabala-oszlop) {
        grid-template-columns: 260px 1fr 130px;
    }
    .chat-layout.teljes-mod:has(.chat-kabala-oszlop) {
        grid-template-columns: 1fr 130px;
    }
    .chat-kabala-oszlop { display: flex; }
}

/* Szójegyzékkel (nyelvóra) négy oszlop kell – ehhez több hely. */
@media (min-width: 1421px) {
    .chat-layout:has(.chat-sidebar-vocab):has(.chat-kabala-oszlop) {
        grid-template-columns: 260px 1fr minmax(160px, 200px) 120px;
    }
    .chat-layout.teljes-mod:has(.chat-sidebar-vocab):has(.chat-kabala-oszlop) {
        grid-template-columns: 1fr minmax(180px, 240px) 120px;
    }
}
/* 1421 alatt nyelvórán nincs figura – ott a szójegyzék a fontosabb. */
@media (max-width: 1420px) {
    .chat-layout:has(.chat-sidebar-vocab) .chat-kabala-oszlop { display: none; }
}

/* ── MARADÉKSOR (átvitel) az oszlopos számoláshoz ──
   A gyerek jegyzete: ide írja a fölvitt egyest összeadásnál, vagy a
   kölcsönkérést kivonásnál. Nem küldjük el és nem ellenőrizzük — ugyanaz
   a szerepe, mint a füzet szélén a ceruzajelnek. */
.fsz-maradek { margin-bottom: 2px; }
.fsz-maradek-mezo {
    width: 42px;
    height: 26px;
    padding: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #c9782a;
    border: 1px dashed #dfd0bd;
    border-radius: 6px;
    background: #fffdf9;
}
.fsz-maradek-mezo:focus {
    outline: none;
    border-color: #c9782a;
    border-style: solid;
    background: #fff;
}

/* ── EGY SZÁM BEÍRÁSA (fejben számolás) ── */
.feladat-szam { display: block; width: fit-content; min-width: 190px; }
.fszam-muvelet {
    font-size: 24px;
    font-weight: 800;
    color: #16241d;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}
.fszam-mezo {
    width: 100%;
    min-width: 170px;
    height: 52px;
    padding: 0 14px;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: #1e7a4d;
    border: 2px solid #cfe0d6;
    border-radius: 12px;
    background: #f6fbf8;
}
.fszam-mezo:focus {
    outline: none;
    border-color: #1e7a4d;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 122, 77, .16);
}

/* ── PÁROSÍTÁS ── */
.feladat-parosit { display: block; }
.fpar-racs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin-bottom: 10px;
}
.fpar-oszlop { display: flex; flex-direction: column; gap: 8px; }
.fpar-elem {
    padding: 10px 14px;
    border: 2px solid #cfe0d6;
    border-radius: 12px;
    background: #f6fbf8;
    color: #16241d;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color .14s, background .14s;
}
.fpar-elem:hover { background: #fff; }
.fpar-aktiv {
    border-color: #1e7a4d;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 122, 77, .16);
}
.fpar-kesz { background: #fff; }

/* ── SORBARENDEZÉS ── */
.feladat-sorrend { display: block; }
.fsor-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fsor-elem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 2px solid #cfe0d6;
    border-radius: 12px;
    background: #f6fbf8;
    color: #16241d;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.fsor-elem:hover { background: #fff; }
.fsor-szam {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    border: 2px solid #cfe0d6;
    border-radius: 50%;
    font-size: 14px;
    color: #1e7a4d;
}
.fsor-valasztott { border-color: #1e7a4d; background: #fff; }
.fsor-valasztott .fsor-szam { border-color: #1e7a4d; background: #eaf6ef; }

/* ── HIÁNYZÓ SZÓ ── */
.feladat-hianyzo { display: block; }
.fhi-mondat {
    font-size: 18px;
    font-weight: 600;
    color: #16241d;
    line-height: 1.7;
    margin-bottom: 12px;
}
.fhi-lyuk {
    display: inline-block;
    min-width: 84px;
    padding: 0 8px;
    margin: 0 2px;
    border-bottom: 3px solid #1e7a4d;
    color: #1e7a4d;
    font-weight: 800;
    text-align: center;
}
.fhi-szavak { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fhi-valasztott { border-color: #1e7a4d; background: #fff; color: #1e7a4d; }
.fhi-mezo {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e7a4d;
    border: 2px solid #cfe0d6;
    border-radius: 12px;
    background: #f6fbf8;
}
.fhi-mezo:focus { outline: none; border-color: #1e7a4d; background: #fff; }

@media (max-width: 560px) {
    .fpar-racs { gap: 8px 10px; }
    .fpar-elem, .fsor-elem { padding: 9px 11px; font-size: 14px; }
}

/* ÜRES HELYIÉRTÉK az oszlopos számolásban (pl. 5600 − 800: az 5 alatt).
   Halvány kocka, hogy a gyerek lássa, ez az oszlop is a feladat része. */
.fsz-ures {
    border: 2px solid #e6eeea;
    border-radius: 10px;
    background: #fbfdfc;
    box-sizing: border-box;
    height: 42px;
}

/* ═══════════════════════════════════════════════════════════════════
   „BE VAN LÉPVE" JELZÉS A FEJLÉCBEN
   Egy KIS, szegélyes doboz az e-mail-címmel — nem nagyobb, mint a
   menüpontok.
   ═══════════════════════════════════════════════════════════════════ */
.belepve {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 230px;
    padding: 5px 12px 5px 8px;
    border: 1px solid #dfe6e2;
    border-radius: 999px;
    background: #fff;
    color: #46564e;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}
.belepve svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #1e7a4d;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.belepve b {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 900px) {
    .belepve { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBIL: NE LEHESSEN OLDALRA HÚZNI AZ OLDALT
   A bemutató oldal háttérsávjai szándékosan szélesebbek a tartalomnál.
   Az „overflow-x: clip" levágja a kilógó részt, de – az „overflow:
   hidden"-nel ellentétben – NEM csinál görgetődobozt, így a ragadós
   kabala figura továbbra is működik.
   ═══════════════════════════════════════════════════════════════════ */
html, body {
    overflow-x: clip;
    max-width: 100%;
}

/* A KÉT FIGURA TELEFONON IS OTT VAN a bemutató oldal alján. */
@media (max-width: 900px) {
    .bem-hero {
        padding-bottom: 150px;
        max-height: none;
    }
    .bem-figura {
        display: block;
        filter: drop-shadow(0 6px 14px rgba(20, 60, 40, .14));
    }
    .bem-figura-1 { left: 2px; height: 126px; }
    .bem-figura-2 { right: 2px; height: 132px; }
}
@media (max-width: 460px) {
    .bem-hero { padding-bottom: 122px; }
    .bem-figura-1 { height: 104px; }
    .bem-figura-2 { height: 109px; }
}

/* A témalista nyitógombja telefonon rálógott a Küldés gombra. Feljebb
   tesszük, a beszélgetés bal szélére – ott semmit nem takar. */
@media (max-width: 900px) {
    .chat-sidebar-toggle {
        bottom: auto;
        top: 50%;
        left: 0;
        border-radius: 0 12px 12px 0;
        padding: 10px 8px;
        opacity: .92;
    }
}

/* A profilkörben AVATAR van a névbetű helyett. */
.gy-arc { overflow: hidden; padding: 0; }
.gy-arc img { width: 100%; height: 100%; display: block; border-radius: 50%; }

/* ═══════════════════════════════════════════════════════════════════
   AVATAR-VÁLASZTÓ ÉS -KÉSZÍTŐ a Kinézet oldalon
   ═══════════════════════════════════════════════════════════════════ */
.av-szakasz { margin: 0 0 34px; }
.av-cim { font-size: 20px; font-weight: 800; color: #16241d; margin: 0 0 4px; }
.av-alcim { color: #5d6b64; font-size: 14px; margin: 0 0 16px; }
.av-racs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px;
}
.av-elem {
    position: relative;
    padding: 10px 8px 12px;
    border: 2px solid #e3e9e5;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: border-color .14s, transform .14s, box-shadow .14s;
}
.av-elem:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,60,40,.1); }
.av-elem img { width: 74px; height: 74px; display: block; margin: 0 auto 6px; }
.av-nev { font-size: 13px; font-weight: 700; color: #16241d; }
.av-ar { font-size: 12px; font-weight: 700; color: #c9782a; margin-top: 2px; }
.av-ingyen { color: #1e7a4d; }
.av-elem.av-aktiv { border-color: #1e7a4d; background: #f2faf5; }
.av-elem.av-zarva img { filter: grayscale(.75); opacity: .55; }
.av-pipa {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #1e7a4d; color: #fff;
    font-size: 13px; line-height: 22px;
}

/* ── keverő ── */
.av-kevero {
    margin-top: 22px;
    padding: 16px;
    border: 2px dashed #cfe0d6;
    border-radius: 18px;
    background: #f8fcfa;
}
.av-kevero-fej { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.av-elonezet { width: 104px; height: 104px; flex: none; }
.av-valasztok { display: flex; flex-direction: column; gap: 10px; flex: 1 1 240px; min-width: 0; }
.av-sor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-sor > span { font-size: 13px; font-weight: 700; color: #46564e; min-width: 76px; }
.av-korok { display: flex; gap: 7px; flex-wrap: wrap; }
.av-kor {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 0 0 2px #d9e4dd;
    cursor: pointer; padding: 0;
}
.av-kor.av-valasztva { box-shadow: 0 0 0 3px #1e7a4d; }
.av-frizurak { display: flex; gap: 6px; flex-wrap: wrap; }
.av-friz {
    padding: 6px 12px; border-radius: 999px; border: 2px solid #d9e4dd;
    background: #fff; font: inherit; font-size: 13px; font-weight: 700;
    color: #46564e; cursor: pointer;
}
.av-friz.av-valasztva { border-color: #1e7a4d; color: #1e7a4d; background: #f2faf5; }
.av-kevero-gomb {
    margin-top: 14px; padding: 11px 22px; border: 0; border-radius: 999px;
    background: #1e7a4d; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.av-kevero-gomb:hover { background: #176a42; }
.av-kevero-gomb:disabled { background: #9fc0ac; cursor: default; }

/* Az avatar a chat fejlécében és a tantárgyválasztón is. */
.chat-avatar-circle, .select-tasks-avatar { overflow: hidden; padding: 0; }
.chat-avatar-circle img, .select-tasks-avatar img {
    width: 100%; height: 100%; display: block; border-radius: 50%;
}
