:root {
  --learn-green: #7c3aed;
  --learn-green-dark: #5b21b6;
  --learn-green-soft: #f3efff;
  --learn-blue: #8b5cf6;
  --learn-blue-dark: #6d28d9;
  --learn-yellow: #fbbf24;
  --learn-orange: #f59e0b;
  --learn-red: #ef4444;
  --learn-ink: #241b35;
  --learn-muted: #665e73;
  --learn-line: #e7e0f0;
  --learn-panel: #fff;
  --learn-shadow: 0 5px 0 #ddd3ee;
  --stellar-ink: #241b35;
  --stellar-muted: #665e73;
  --stellar-line: #e7e0f0;
  --stellar-surface: #fff;
  --stellar-soft: #f8f6fc;
  --stellar-violet: #7c3aed;
  --stellar-indigo: #5b21b6;
  --stellar-cyan: #a78bfa;
  --stellar-green: #15803d;
  --stellar-shadow: 0 18px 48px rgba(76, 29, 149, .12);
  --stellar-small-shadow: 0 8px 24px rgba(76, 29, 149, .08);
}

html, body { background: #faf9ff !important; }
body { color: var(--learn-ink) !important; }
::selection { background: #ddd6fe; color: #2e1065; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline-color: rgba(124, 58, 237, .36) !important;
}

.app-shell { background: #faf9ff !important; }
.content-panel {
  background:
    radial-gradient(circle at 92% 3%, rgba(167, 139, 250, .13), transparent 22rem),
    linear-gradient(180deg, #fff 0, #faf9ff 100%) !important;
}
.hero-panel { border-color: #eee9f6 !important; background: #fff !important; }
.brand { color: #6d28d9 !important; }
.hero-panel .brand > span:last-child { color: #a855f7 !important; }
.hero-panel .brand-mark {
  width: 50px !important;
  height: 50px !important;
  border: 2px solid #e0d5fb !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, #fdfcff, #eee9ff) !important;
  color: initial !important;
  font-size: 28px !important;
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #e7def8, 0 12px 24px rgba(76, 29, 149, .08) !important;
}
.brand-wordmark { display: inline-flex; align-items: baseline; gap: 1px; font: 1000 24px/1 Nunito, sans-serif; letter-spacing: -.9px; }
.brand-wordmark b { color: #17121f; font: inherit; }
.brand-wordmark em { color: #7c3aed; font: 1000 29px/.75 Nunito, sans-serif; font-style: normal; transform: translateY(-3px); text-shadow: 0 7px 16px rgba(124,58,237,.24); }
.side-menu button { color: #756c83 !important; }
.side-menu button:hover { background: #f7f4fd !important; }
.side-menu button.active {
  border-color: #c4b5fd !important;
  background: #f3efff !important;
  color: #6d28d9 !important;
}
.side-menu button span, .side-menu button.active span { color: #7c3aed !important; }
.hero-copy {
  border-color: #ded4f6 !important;
  background: linear-gradient(145deg, #f6f2ff, #efe8ff) !important;
}
.hero-copy h1, .hero-copy h1 em { color: #4c1d95 !important; }
.hero-copy p { color: #6b5a81 !important; }
.hero-panel .mascot { isolation: isolate; }
.hero-panel .mascot::after {
  content: "🦉" !important;
  display: grid !important;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 34% 34% 44% 44%;
  background: linear-gradient(145deg, #ede9fe, #c4b5fd) !important;
  color: initial;
  font-size: 64px;
  line-height: 1;
  box-shadow: inset 0 -8px 0 rgba(91, 33, 182, .09), 0 12px 26px rgba(91, 33, 182, .15);
}
.hero-panel .spark { color: #a78bfa !important; }

/* Entrada */
body[data-screen="auth-screen"] .app-shell,
body:has(#auth-screen.active) .app-shell { grid-template-columns: minmax(360px, 42vw) minmax(0, 1fr) !important; }
body[data-screen="auth-screen"] .hero-panel,
body:has(#auth-screen.active) .hero-panel {
  background:
    radial-gradient(circle at 85% 10%, rgba(216, 180, 254, .34), transparent 17rem),
    radial-gradient(circle at 10% 92%, rgba(196, 181, 253, .22), transparent 20rem),
    linear-gradient(150deg, #4c1d95 0%, #6d28d9 48%, #8b5cf6 100%) !important;
}
body[data-screen="auth-screen"] .brand,
body:has(#auth-screen.active) .brand { color: #fff !important; }
body[data-screen="auth-screen"] .brand > span:last-child,
body:has(#auth-screen.active) .brand > span:last-child { color: #e9d5ff !important; }
body[data-screen="auth-screen"] .brand-mark,
body:has(#auth-screen.active) .brand-mark {
  background: #fff !important;
  color: #6d28d9 !important;
  box-shadow: 0 4px 0 rgba(46, 16, 101, .4) !important;
}
body[data-screen="auth-screen"] .hero-copy,
body:has(#auth-screen.active) .hero-copy { background: transparent !important; }
body[data-screen="auth-screen"] .hero-copy h1,
body[data-screen="auth-screen"] .hero-copy h1 em,
body:has(#auth-screen.active) .hero-copy h1,
body:has(#auth-screen.active) .hero-copy h1 em { color: #fff !important; }
body[data-screen="auth-screen"] .hero-copy p,
body:has(#auth-screen.active) .hero-copy p { color: rgba(255, 255, 255, .87) !important; }
body[data-screen="auth-screen"] .hero-panel .mascot::after,
body:has(#auth-screen.active) .hero-panel .mascot::after {
  border-color: rgba(255,255,255,.9);
  background: linear-gradient(145deg, #fff, #ddd6fe) !important;
  box-shadow: inset 0 -11px 0 rgba(109, 40, 217, .11), 0 22px 45px rgba(46, 16, 101, .28);
  font-size: 94px;
}
.auth-card {
  border-color: #e7e0f0 !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 24px 70px rgba(76, 29, 149, .13) !important;
}
.auth-card::before { background: radial-gradient(circle, rgba(139, 92, 246, .13), transparent 68%) !important; }
.auth-card > .eyebrow { color: #6d28d9 !important; }
.auth-switch { border-color: #e6dff0 !important; background: #f5f2fa !important; }
.auth-tab { color: #71677f !important; }
.auth-tab.selected {
  border-color: #d8ccf2 !important;
  color: #6d28d9 !important;
  box-shadow: 0 3px 0 #ded5ec !important;
}
.auth-form input { border-color: #e4ddeb !important; background: #fbfaff !important; }
.auth-form input:focus { border-color: #a78bfa !important; background: #fff !important; }
.password-toggle:hover, .password-toggle:focus-visible, .password-toggle[aria-pressed="true"] { background: #f1ebff !important; color: #6d28d9 !important; }
.auth-link { color: #6d28d9 !important; }
.auth-mode-intro { border-color: #ddd0fa !important; background: #f7f3ff !important; }

/* Botões, campos e cartões */
.start-button {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  box-shadow: 0 5px 0 #4c1d95, 0 14px 28px rgba(109, 40, 217, .16) !important;
}
.start-button:hover { background: linear-gradient(135deg, #7c3aed, #5b21b6) !important; box-shadow: 0 6px 0 #4c1d95, 0 16px 30px rgba(109, 40, 217, .2) !important; }
.start-button:active { box-shadow: 0 1px 0 #4c1d95 !important; }
.text-button, .result-home { color: #6d28d9 !important; }
input, select, textarea { border-color: #e5deee !important; color: #241b35 !important; }
input:focus, select:focus, textarea:focus { border-color: #a78bfa !important; }
.choice { border-color: #e5deee !important; color: #665e73 !important; box-shadow: 0 3px 0 #ddd5e7 !important; }
.choice.selected { border-color: #a78bfa !important; background: #f3efff !important; color: #6d28d9 !important; box-shadow: 0 3px 0 #c4b5fd !important; }

/* Matérias */
.subject-welcome {
  background:
    radial-gradient(circle at 86% 12%, rgba(233, 213, 255, .27), transparent 10rem),
    linear-gradient(135deg, #5b21b6, #7c3aed 58%, #8b5cf6) !important;
  box-shadow: 0 6px 0 #4c1d95, 0 20px 42px rgba(91, 33, 182, .16) !important;
}
.subject-year-card { border-color: #d8ccf2 !important; background: #f7f3ff !important; box-shadow: 0 4px 0 #d8ccf2 !important; }
.subject-year-card > div span { color: #6d28d9 !important; }
.subject-year-card select { border-color: #bca7e8 !important; color: #4c1d95 !important; }
.subject-card {
  --subject-accent: #7c3aed;
  border-color: #e3daef !important;
  background: linear-gradient(135deg, #fff, #faf7ff) !important;
  box-shadow: 0 5px 0 #ded5e8, 0 14px 28px rgba(76, 29, 149, .07) !important;
}
.subject-card.math { --subject-accent: #7c3aed; }
.subject-card.portuguese { --subject-accent: #9333ea; }
.subject-card.history { --subject-accent: #6d28d9; }
.subject-card.geography { --subject-accent: #8b5cf6; }
.subject-card.biology { --subject-accent: #a855f7; }
.subject-card.physics { --subject-accent: #6366f1; }
.subject-card.chemistry { --subject-accent: #c026d3; }
.subject-card:hover { border-color: var(--subject-accent) !important; box-shadow: 0 7px 0 #cfc2e2, 0 19px 34px rgba(76, 29, 149, .12) !important; }
.subject-card .subject-art { background: color-mix(in srgb, var(--subject-accent) 13%, white) !important; color: var(--subject-accent); font-size: 30px; }
.subject-card i { background: #f0eaff !important; color: #6d28d9 !important; }
.subject-card strong { color: #2f2341 !important; }
.subject-card small { color: #70677d !important; }

/* Configuração e trilha */
.back-subjects, .profile-mini, .duo-stats span { border-color: #e6deef !important; box-shadow: 0 3px 0 #ddd4e8 !important; }
.duo-stats span:last-child { color: #7c3aed !important; }
.study-brief, #quiz-form, .rail-card,
.profile-card, .review-card, .plan-card, .ranking-card, .notebook-card,
.teacher-card, .accessibility-card, .review-highlight, .review-item-card,
.dashboard-stats article {
  border-color: #e6deef !important;
  background: #fff !important;
  box-shadow: 0 5px 0 #ddd5e7, 0 14px 30px rgba(76, 29, 149, .06) !important;
}
.study-brief .eyebrow { color: #6d28d9 !important; }
.enem-shortcut { border-color: #d9ccf5 !important; background: #f7f3ff !important; color: #5b21b6 !important; box-shadow: 0 4px 0 #d2c2ef !important; }
.snapshot-card { border-color: #e6deef !important; background: linear-gradient(145deg, #fff, #faf8ff) !important; box-shadow: 0 4px 0 #ddd5e7 !important; }
.quick-tools button { border-color: #e5deee !important; color: #6b6078 !important; box-shadow: 0 3px 0 #ded6e8 !important; }
.optional-tag { background: #ede9fe !important; color: #5b21b6 !important; }
.topic-chip { border-color: #cdbdf0 !important; background: #f5f1ff !important; color: #6d28d9 !important; box-shadow: 0 2px 0 #d8ccf2 !important; }
.topic-chip:hover { border-color: #8b5cf6 !important; background: #ede9fe !important; }
.school-year-hint { border-color: #d8ccf2 !important; background: #f8f5ff !important; color: #5f4a79 !important; }
.curriculum-hint { border-left-color: #8b5cf6 !important; background: #f5f1ff !important; color: #5f4a79 !important; }
.form-grid .topic-field { grid-column: 1 / -1; }
.journey-intro {
  background:
    radial-gradient(circle at 86% 15%, rgba(233, 213, 255, .26), transparent 11rem),
    linear-gradient(135deg, #5b21b6, #7c3aed 58%, #8b5cf6) !important;
  box-shadow: 0 6px 0 #4c1d95, 0 20px 40px rgba(91, 33, 182, .16) !important;
}
.journey-intro .unit-label, .journey-intro p { color: #ede9fe !important; }
.phase-map-label { border-color: #d7c9f4 !important; background: #f7f3ff !important; color: #6d28d9 !important; }
.lesson-path .path-line { background: repeating-linear-gradient(to bottom, #ddd4e9 0 11px, #f3eff8 11px 20px) !important; }
.lesson-node { background: #e9e5ee !important; color: #8d8498 !important; box-shadow: 0 8px 0 #cbc3d3 !important; }
.lesson-node .phase-illustration { display: grid; place-items: center; font-size: 29px; line-height: 1; }
.lesson-node.completed { background: linear-gradient(145deg, #8b5cf6, #6d28d9) !important; box-shadow: 0 8px 0 #4c1d95, 0 14px 26px rgba(109, 40, 217, .2) !important; }
.lesson-node.current { outline-color: #e4dcfa !important; box-shadow: 0 8px 0 #cfc7d8, 0 0 0 3px #7c3aed, 0 15px 30px rgba(109, 40, 217, .14) !important; }
.lesson-node.current::before { background: #7c3aed !important; box-shadow: 0 3px 0 #4c1d95 !important; }
.create-line { border-color: #eee9f3 !important; }
@keyframes current-pulse { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 10px rgba(124,58,237,.28)); } }

.rail-card-title button, .rail-card-title span, .weekly-ring b { color: #6d28d9 !important; }
.rail-progress.wide i { background: #7c3aed !important; }
.rail-review-button { border-color: #d8ccf2 !important; background: #f7f3ff !important; color: #4c1d95 !important; box-shadow: 0 4px 0 #d8ccf2 !important; }
.rail-review-button > span { background: #ede9fe !important; }
.rail-review-button b, .rail-review-button i { color: #5b21b6 !important; }
.rail-review-button small { color: #71627f !important; }

/* Questões */
.quiz-header { border-color: #eee9f3 !important; background: rgba(250, 249, 255, .95) !important; }
.icon-button, .listen-button, .question-tools button { border-color: #e5deee !important; color: #6b6078 !important; box-shadow: 0 3px 0 #dcd3e6 !important; }
.question-tools button.active { border-color: #b9a5e7 !important; background: #f3efff !important; color: #6d28d9 !important; }
.progress { background: #e9e4ef !important; }
.progress i { background: linear-gradient(90deg, #8b5cf6, #6d28d9) !important; }
.quiz-tag, .quiz-skill { border-color: #d8ccf2 !important; background: #f7f3ff !important; color: #5b21b6 !important; }
.answer { border-color: #ded6e7 !important; color: #241b35 !important; box-shadow: 0 4px 0 #d8d0e1 !important; }
.answer span:last-child { color: #241b35 !important; }
.answer:hover:not(:disabled) { border-color: #a78bfa !important; background: #faf8ff !important; box-shadow: 0 6px 0 #c4b5fd !important; }
.answer .letter { border-color: #ddd4e8 !important; background: #f5f2f8 !important; color: #665e73 !important; }
.answer.selected-answer { border-color: #8b5cf6 !important; background: #f3efff !important; box-shadow: 0 4px 0 #c4b5fd !important; }
.answer.correct { border-color: #22c55e !important; background: #ecfdf3 !important; color: #166534 !important; box-shadow: 0 4px 0 #15803d !important; }
.answer.correct span:last-child { color: #166534 !important; }
.answer.wrong { border-color: #ef4444 !important; background: #fff1f2 !important; color: #991b1b !important; box-shadow: 0 4px 0 #b91c1c !important; }
.answer.wrong span:last-child { color: #991b1b !important; }
.feedback { border-color: #cfc1ef !important; background: #f7f3ff !important; color: #4c3569 !important; box-shadow: 0 4px 0 #d8ccf2 !important; }
.feedback.good { border-color: #86d49d !important; background: #ecfdf3 !important; color: #166534 !important; box-shadow: 0 4px 0 #86d49d !important; }
.question-source { color: #6d28d9 !important; }
.achievement-toast { border: 1px solid #d7c8f4; background: #f7f3ff; color: #4c1d95; }

/* Resultado, perfil e revisão */
.result-screen { border-color: #e4dced !important; background: linear-gradient(145deg, #fff, #faf7ff) !important; box-shadow: 0 6px 0 #dcd3e7, 0 22px 50px rgba(76,29,149,.11) !important; }
.result-score { border-color: #cfc0ef !important; background: #f3efff !important; color: #6d28d9 !important; }
.profile-card { border-color: #d8ccf2 !important; background: linear-gradient(135deg, #f5f1ff, #fff) !important; }
.profile-avatar, .reward-icon, .saved-icon, .review-date { background: #f0eaff !important; color: #6d28d9 !important; }
.profile-data-card { margin: 0 0 22px; padding: 19px; border: 2px solid #e2d8ec; border-radius: 22px; background: linear-gradient(145deg, #fff, #fbf9ff); box-shadow: 0 5px 0 #ded6e7; }
.profile-data-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-data-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-data-heading > span { display: grid; place-items: center; flex: 0 0 auto; width: 45px; height: 45px; border-radius: 14px; background: #ede9fe; color: #6d28d9; font-size: 20px; font-weight: 1000; }
.profile-data-heading div { display: grid; min-width: 0; gap: 1px; }
.profile-data-heading small,
.profile-security-block > div > span { color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .9px; }
.profile-data-heading strong { color: #352541; font-size: 17px; font-weight: 1000; }
.profile-data-heading p,
.profile-security-block p { margin: 1px 0 0; color: #786d82; font-size: 11px; line-height: 1.4; }
#edit-profile-data,
.profile-security-block > button { flex: 0 0 auto; min-height: 41px; padding: 8px 13px; border: 2px solid #c4b5fd; border-radius: 12px; background: #f5f3ff; color: #6d28d9; font: 1000 11px Nunito, sans-serif; box-shadow: 0 3px 0 #d8cff0; cursor: pointer; }
.profile-data-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.profile-data-summary article { min-width: 0; padding: 12px; border: 1px solid #e7dfed; border-radius: 14px; background: #fff; }
.profile-data-summary article > span { display: block; color: #897d93; font-size: 8px; font-weight: 1000; letter-spacing: .65px; }
.profile-data-summary article > strong { display: block; margin-top: 4px; overflow-wrap: anywhere; color: #43334e; font-size: 12px; font-weight: 1000; line-height: 1.3; }
.profile-data-summary article > small { display: block; margin-top: 4px; color: #83778c; font-size: 8px; font-weight: 750; line-height: 1.35; }
.profile-data-summary article.missing { border-color: #f2d078; background: #fffaf0; }
.profile-data-summary article.missing > strong { color: #9a6700; }
.profile-data-form { display: grid; gap: 13px; margin-top: 17px; padding: 16px; border: 2px solid #ded3ee; border-radius: 17px; background: #f9f7ff; }
.profile-data-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.profile-data-form label,
#profile-password-form label { display: grid; min-width: 0; gap: 6px; color: #584663; font-size: 10px; font-weight: 1000; }
.profile-data-form input,
.profile-data-form select,
#profile-password-form input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 2px solid #dfd6e8; border-radius: 12px; background: #fff; color: #382a43; font: 800 13px Nunito, sans-serif; outline: none; }
.profile-data-form input:focus,
.profile-data-form select:focus,
#profile-password-form input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .1); }
.profile-data-form input[readonly] { background: #f0edf3; color: #756b7c; cursor: not-allowed; }
.profile-contact-consent { display: flex !important; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 8px !important; padding: 10px 11px; border-radius: 12px; background: #fff; line-height: 1.4; }
.profile-contact-consent input { flex: 0 0 auto; width: 18px; min-height: 18px; margin: 1px 0 0; padding: 0; }
.profile-data-actions { display: flex; justify-content: flex-end; gap: 8px; }
.profile-data-actions button { min-height: 41px; padding: 8px 14px; border: 2px solid #ddd4e7; border-radius: 12px; background: #fff; color: #706477; font: 1000 11px Nunito, sans-serif; cursor: pointer; }
.profile-data-actions button[type="submit"] { border-color: #6d28d9; background: #7c3aed; color: #fff; box-shadow: 0 3px 0 #4c1d95; }
.profile-data-actions button:disabled { opacity: .65; cursor: wait; }
.profile-security-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 16px; padding: 14px; border: 2px solid #e5dceb; border-radius: 16px; background: #fff; }
.profile-security-block > div { display: grid; gap: 2px; }
.profile-security-block > div > strong { color: #41304d; font-size: 14px; font-weight: 1000; }
#profile-password-form { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 13px; border-top: 1px solid #ebe5ef; }
#profile-password-form[hidden] { display: none !important; }
#profile-password-form .profile-data-actions { grid-column: 1 / -1; }
.profile-data-status { min-height: 18px; margin: 10px 2px 0; color: #706477; font-size: 10px; font-weight: 850; }
.profile-data-status.success { color: #167443; }
.profile-data-status.error { color: #b42335; }
.focus-card { border: 0 !important; background: linear-gradient(135deg, #4c1d95, #6d28d9 60%, #8b5cf6) !important; box-shadow: 0 16px 35px rgba(76, 29, 149, .2) !important; }
.subject-row i b, .plan-mini i b { background: linear-gradient(90deg, #8b5cf6, #6d28d9) !important; }
.review-card { background: #fcfaff !important; }
.saved-entry { border-color: #e4dced !important; background: #fff !important; box-shadow: 0 4px 12px rgba(76,29,149,.05) !important; }
.review-steps span.active { background: #ede9fe !important; color: #5b21b6 !important; }
.review-highlight > div > strong { color: #6d28d9 !important; }
.review-item-card button, .small-action { border-color: #cfc0ef !important; background: #f3efff !important; color: #5b21b6 !important; }
.day-button.selected, .access-control:hover, .access-control.selected { border-color: #a78bfa !important; background: #f3efff !important; color: #6d28d9 !important; }

/* Modal */
.modal-backdrop { background: rgba(36, 18, 61, .62) !important; }
.modal-panel { border-color: #e4dced !important; background: linear-gradient(155deg, #fff, #faf7ff) !important; box-shadow: 0 30px 90px rgba(46, 16, 101, .32) !important; }
.modal-icon { background: #ede9fe !important; }
.modal-close, .modal-secondary { border-color: #e4dced !important; color: #665e73 !important; }

/* Criador de avatar por camadas */
.custom-avatar-svg { display: block; width: 100%; height: 100%; }
.avatar-home-card,
.avatar-profile-card {
  display: grid;
  grid-template-columns: minmax(170px, 195px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 0 0 22px;
  padding: 20px 22px;
  overflow: hidden;
  border: 2px solid #ded3f5;
  border-radius: 24px;
  background: radial-gradient(circle at 3% 7%, #eee7ff 0, transparent 14rem), linear-gradient(135deg, #fff, #faf7ff 63%, #f4efff);
  box-shadow: 0 6px 0 #ddd2ef, 0 20px 40px rgba(76, 29, 149, .1);
}
.avatar-home-card { position: relative; isolation: isolate; min-height: 235px; }
.avatar-home-card::after {
  position: absolute;
  z-index: -1;
  right: -50px;
  bottom: -75px;
  width: 210px;
  height: 210px;
  border: 34px solid rgba(124, 58, 237, .06);
  border-radius: 50%;
  content: '';
}
.avatar-home-stage-shell { display: grid; place-items: center; min-width: 0; }
.avatar-home-interact {
  position: relative;
  display: grid;
  place-items: end center;
  width: 178px;
  min-height: 194px;
  padding: 19px 7px 4px;
  border: 0;
  border-radius: 26px;
  background: radial-gradient(circle at 50% 42%, #fff 0 35%, transparent 36%), linear-gradient(155deg, #eee7ff, #faf7ff);
  color: #4c1d95;
  box-shadow: inset 0 -4px 0 #ded4ef, 0 8px 20px rgba(76, 29, 149, .1);
  cursor: pointer;
}
.avatar-home-interact:focus-visible { outline: 4px solid rgba(124, 58, 237, .24); outline-offset: 3px; }
.avatar-home-bubble,
.avatar-preview-bubble {
  position: absolute;
  z-index: 3;
  top: -10px;
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  transform: translateX(-50%);
  border: 2px solid #d8c8f4;
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  color: #5b21b6;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1.25;
  box-shadow: 0 3px 0 #ded4ed;
  text-align: center;
}
.avatar-home-preview { display: block; width: 158px; height: 174px; margin: 0 auto -7px; }
.avatar-tap-hint { position: absolute; right: 8px; bottom: 8px; padding: 4px 6px; border-radius: 7px; background: rgba(76, 29, 149, .86); color: #fff; font-size: 7px; font-weight: 1000; letter-spacing: .45px; }
.avatar-home-copy,
.avatar-profile-card > div:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.avatar-home-copy { gap: 9px; align-content: center; }
.avatar-home-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.avatar-home-meta span { padding: 5px 8px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 8px; font-weight: 1000; letter-spacing: .65px; }
.avatar-home-meta span:first-child { background: #fff3c4; color: #8a6400; }
.avatar-home-meta b { font-size: 11px; }
.avatar-home-copy > strong,
.avatar-profile-card > div:nth-child(2) > strong { color: #2f2341; font-size: 20px; font-weight: 1000; }
.avatar-home-copy p,
.avatar-profile-card > div:nth-child(2) > span { margin: 0; color: #71667f; font-size: 12px; font-weight: 700; line-height: 1.4; }
.avatar-home-evolution { display: grid; gap: 5px; max-width: 430px; }
.avatar-home-evolution > i { height: 8px; overflow: hidden; border-radius: 999px; background: #e9e1f2; box-shadow: inset 0 2px 0 rgba(67, 39, 91, .07); }
.avatar-home-evolution > i > b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b); transition: width .45s ease; }
.avatar-home-evolution small { color: #776782; font-size: 9px; font-weight: 900; }
.avatar-home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.avatar-edit-button,
.avatar-unlock-result > button,
.avatar-reaction-button {
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid #bca7e8;
  border-radius: 13px;
  background: #f5f1ff;
  color: #5b21b6;
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 3px 0 #d5c7ef;
}
.avatar-edit-button:hover,
.avatar-unlock-result > button:hover,
.avatar-reaction-button:hover { transform: translateY(-1px); background: #ede9fe; }
.avatar-reaction-button { border-color: #ead88b; background: #fff9dc; color: #8a6400; box-shadow: 0 3px 0 #eadb99; }
.avatar-profile-card { grid-template-columns: 128px minmax(0, 1fr) auto; margin-bottom: 0; }
.dashboard-avatar-preview { width: 116px; height: 128px; margin: -12px auto -17px; }
.profile-avatar { padding: 3px !important; overflow: hidden; }
.profile-mini #top-avatar { overflow: hidden; padding: 1px; }
.profile-mini #top-avatar .custom-avatar-svg { transform: scale(1.2); transform-origin: 50% 34%; }

.avatar-unlock-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 2px solid #d7c5fa;
  border-radius: 17px;
  background: linear-gradient(135deg, #f3edff, #fffaf0);
  color: #4c1d95;
  text-align: left;
  box-shadow: 0 4px 0 #d9cdf0;
}
.avatar-result-companion {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: min(100%, 620px);
  margin: 16px auto;
  padding: 11px 16px 11px 10px;
  border: 2px solid #d9cdf2;
  border-radius: 20px;
  background: linear-gradient(135deg, #f2edff, #fff);
  box-shadow: 0 4px 0 #ddd3ec;
  text-align: left;
}
.avatar-result-companion > button { width: 108px; height: 106px; padding: 0; overflow: hidden; border: 0; border-radius: 17px; background: #ece6fb; cursor: pointer; }
.avatar-result-companion > button span { display: block; width: 112px; height: 125px; margin-top: -5px; }
.avatar-result-companion > div { display: grid; gap: 3px; }
.avatar-result-companion > div > span { color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .8px; }
.avatar-result-companion strong { color: #3c2854; font-size: 15px; font-weight: 1000; line-height: 1.3; }
.avatar-result-companion small { color: #776a80; font-size: 10px; font-weight: 750; }
.avatar-unlock-result[hidden] { display: none !important; }
.avatar-unlock-icons { display: flex; align-items: center; font-size: 28px; }
.avatar-unlock-icons span + span { margin-left: -7px; }
.avatar-unlock-result strong { font-weight: 1000; }
.avatar-unlock-result p { margin: 2px 0 0; color: #71627f; font-size: 12px; line-height: 1.4; }

.avatar-studio-backdrop { padding: 18px; }
.avatar-studio-panel { width: min(100%, 1040px) !important; padding: 26px !important; }
.avatar-studio-panel .modal-close { width: 44px; height: 44px; }
.avatar-studio-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-right: 48px; }
.avatar-studio-heading > div:first-child { min-width: 0; }
.avatar-studio-heading h2 { margin: 5px 0 7px; color: #2f2341; font-size: clamp(25px, 3vw, 34px); }
.avatar-studio-heading p { margin: 0; color: #71667f; line-height: 1.45; }
.avatar-phase-pill {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 6px;
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 12px;
  border: 2px solid #ead88b;
  border-radius: 14px;
  background: #fff9dc;
  color: #9a6d00;
  text-align: center;
}
.avatar-phase-pill span { grid-row: 1 / 3; font-size: 22px; }
.avatar-phase-pill strong { font-size: 20px; line-height: 1; }
.avatar-phase-pill small { font-size: 9px; font-weight: 900; text-transform: uppercase; }
.avatar-studio-layout { display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.avatar-preview-stage {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  min-width: 0;
  padding: 32px 16px 16px;
  border: 2px solid #ded4ef;
  border-radius: 21px;
  background: radial-gradient(circle at 50% 32%, #fff 0 29%, transparent 30%), linear-gradient(155deg, #f1ebff, #faf8ff);
  box-shadow: inset 0 -4px 0 #e3d9f1;
  text-align: center;
}
.avatar-studio-preview { width: min(100%, 230px); height: 245px; }
.avatar-preview-stage > strong { color: #39274f; font-size: 18px; font-weight: 1000; }
.avatar-preview-stage > span { max-width: 230px; margin-top: 4px; color: #71667f; font-size: 11px; font-weight: 700; line-height: 1.4; }
.avatar-editor-controls { display: grid; align-content: start; min-width: 0; gap: 13px; }
.avatar-name-field { display: grid; gap: 6px; color: #4c3d5d; font-size: 11px; font-weight: 1000; }
.avatar-name-field input { min-height: 45px; padding: 10px 12px; border: 2px solid #ded4e9; border-radius: 13px; background: #fff; color: #2f2341; font: inherit; font-size: 13px; font-weight: 800; outline: none; }
.avatar-name-field input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .12); }
.avatar-gender-card { display: grid; gap: 8px; min-width: 0; margin: 0 !important; padding: 13px; border: 2px solid #d8c8f5; border-radius: 16px; background: linear-gradient(135deg, #faf7ff, #fff); }
.avatar-gender-card legend { padding: 0 6px; color: #4c1d95 !important; font-size: 12px; font-weight: 1000; }
.avatar-gender-card > p { margin: 0; color: #71647d; font-size: 9px; font-weight: 750; line-height: 1.4; }
.avatar-gender-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.avatar-gender-choice button { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 0 9px; min-width: 0; min-height: 62px; padding: 8px 10px; border: 2px solid #e1d9eb; border-radius: 14px; background: #fff; color: #4d3c5e; text-align: left; box-shadow: 0 3px 0 #e2dbe9; cursor: pointer; }
.avatar-gender-choice button > span { display: grid; grid-row: 1 / 3; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #ede9fe; color: #6d28d9; font-size: 22px; font-weight: 1000; }
.avatar-gender-choice button strong { overflow: hidden; font-size: 12px; font-weight: 1000; text-overflow: ellipsis; }
.avatar-gender-choice button small { color: #81758d; font-size: 8px; font-weight: 800; }
.avatar-gender-choice button:hover { border-color: #b9a2eb; background: #faf8ff; transform: translateY(-1px); }
.avatar-gender-choice button.selected,
.avatar-gender-choice button[aria-pressed="true"] { border-color: #8b5cf6; background: #f2edff; color: #4c1d95; box-shadow: 0 3px 0 #c8b5ef, 0 0 0 3px rgba(139, 92, 246, .1); }
.avatar-gender-choice button:focus-visible { outline: 3px solid rgba(124, 58, 237, .24); outline-offset: 2px; }
.avatar-choice-note { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 9px 11px; border: 1px solid #dfd3f4; border-radius: 12px; background: #f8f5ff; color: #6e5f7b; font-size: 9px; font-weight: 750; line-height: 1.4; }
.avatar-choice-note span { color: #ec4899; font-size: 13px; }
.avatar-category-tabs { display: flex; gap: 7px; max-width: 100%; overflow-x: auto; padding: 2px 1px 7px; scrollbar-color: #c4b5fd transparent; scrollbar-width: thin; }
.avatar-category-tabs button {
  display: grid;
  place-items: center;
  gap: 2px;
  flex: 0 0 78px;
  min-width: 78px;
  min-height: 56px;
  padding: 6px 3px;
  border: 2px solid #e3dceb;
  border-radius: 12px;
  background: #fff;
  color: #71667f;
  font-size: 10px;
  font-weight: 1000;
}
.avatar-category-tabs button span { font-size: 16px; line-height: 1; }
.avatar-category-tabs button[aria-selected="true"] { border-color: #a78bfa; background: #f3efff; color: #5b21b6; box-shadow: 0 3px 0 #d6c8f1; }
.avatar-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; min-width: 0; }
.avatar-part-option {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 61px;
  padding: 8px 10px;
  border: 2px solid #e4ddec;
  border-radius: 14px;
  background: #fff;
  color: #493b5a;
  text-align: left;
  box-shadow: 0 3px 0 #dfd7e8;
}
.avatar-part-option:hover:not([aria-disabled="true"]) { border-color: #b69deb; background: #faf8ff; transform: translateY(-1px); }
.avatar-part-option[aria-pressed="true"] { border-color: #8b5cf6; background: #f3efff; color: #4c1d95; box-shadow: 0 3px 0 #c8b5ef; }
.avatar-part-option[aria-disabled="true"] { opacity: .62; filter: grayscale(.65); }
.avatar-option-sample { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 12px; background: var(--sample, #ede9fe); font-size: 21px; box-shadow: inset 0 -2px 0 rgba(48, 31, 69, .1); }
.avatar-option-sample.is-color { border: 5px solid #fff; outline: 1px solid #d8cfe4; font-size: 0; }
.avatar-option-sample.is-scene { background: var(--sample, #ede9fe); }
.avatar-part-option > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.avatar-part-option strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 1000; }
.avatar-part-option small { color: #796f86; font-size: 9px; line-height: 1.25; }
.avatar-part-option > b { align-self: start; color: #6d28d9; font-size: 12px; }
.avatar-studio-status { min-height: 20px; margin: 0; color: #6d28d9; font-size: 11px; font-weight: 800; }
.avatar-preview-bubble { top: 10px; max-width: 220px; }
.avatar-reaction-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 11px; }
.avatar-reaction-controls button { min-height: 36px; padding: 6px 8px; border: 2px solid #ddd2ee; border-radius: 10px; background: #fff; color: #5f4d6e; font-size: 8px; font-weight: 1000; box-shadow: 0 2px 0 #ded7e7; }
.avatar-reaction-controls button:hover { border-color: #a78bfa; color: #5b21b6; transform: translateY(-1px); }
.avatar-studio-actions { width: min(100%, 550px); margin: 20px 0 0 auto; }
.avatar-studio-actions .start-button { width: 100%; }

@keyframes avatar-wave { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-5deg) translateY(-5px); } 55% { transform: rotate(5deg) translateY(-2px); } 75% { transform: rotate(-2deg) translateY(-4px); } }
@keyframes avatar-celebrate { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-13px) scale(1.04); } 55% { transform: translateY(0) scale(.97); } 75% { transform: translateY(-6px) scale(1.02); } }
@keyframes avatar-focus { 0%,100% { transform: scale(1); filter: none; } 40% { transform: scale(1.035); filter: drop-shadow(0 0 9px rgba(124, 58, 237, .3)); } }
@keyframes companion-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.is-reacting-wave .custom-avatar-svg { animation: avatar-wave .85s ease-in-out; transform-origin: 50% 80%; }
.is-reacting-celebrate .custom-avatar-svg { animation: avatar-celebrate .9s ease-out; transform-origin: 50% 90%; }
.is-reacting-focus .custom-avatar-svg { animation: avatar-focus 1.15s ease-in-out; transform-origin: 50% 60%; }
.custom-avatar-svg .avatar-companion { animation: companion-float 2.5s ease-in-out infinite; transform-origin: center; }

/* Tutorial guiado: aparece uma vez e continua disponível no Início e no Perfil. */
.tutorial-help-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 13px;
  border: 2px solid #c9b8eb;
  border-radius: 13px;
  background: #f5f1ff;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 0 3px 0 #d9cdef;
}
.tutorial-help-button:hover { transform: translateY(-1px); background: #ece5ff; }
.subject-welcome .tutorial-help-button.is-light {
  margin-top: 17px;
  border-color: rgba(255,255,255,.56);
  background: rgba(255,255,255,.16);
  color: #fff;
  box-shadow: 0 3px 0 rgba(57,22,122,.28);
  backdrop-filter: blur(8px);
}
.subject-welcome .tutorial-help-button.is-light:hover { background: rgba(255,255,255,.25); }
.dashboard-header .tutorial-help-button { margin-left: auto; }

.tutorial-backdrop { padding: 18px; }
.tutorial-panel { width: min(100%, 860px) !important; padding: 28px !important; }
.tutorial-panel .modal-close { width: 44px; height: 44px; }
.tutorial-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-right: 52px; }
.tutorial-heading > div { display: flex; align-items: center; min-width: 0; gap: 10px; }
.tutorial-step-count { color: #897c98; font-size: 10px; font-weight: 1000; letter-spacing: .7px; }
.tutorial-skip {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #f4f0fa;
  color: #6d5e7c;
  font-size: 11px;
  font-weight: 1000;
}
.tutorial-skip:hover { background: #ebe4f5; color: #5b21b6; }
.tutorial-main { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); align-items: center; gap: 30px; margin-top: 22px; }
.tutorial-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 310px;
  overflow: hidden;
  padding: 24px;
  border: 2px solid #ded3f1;
  border-radius: 24px;
  background: radial-gradient(circle at 20% 15%, #fff 0 6px, transparent 7px), radial-gradient(circle at 82% 24%, #facc15 0 5px, transparent 6px), linear-gradient(145deg, #eee7ff, #faf8ff 55%, #fff9e8);
  box-shadow: inset 0 -5px 0 #e1d7f1;
}
.tutorial-visual::before,
.tutorial-visual::after { content: "✦"; position: absolute; color: #a78bfa; font-size: 24px; opacity: .7; }
.tutorial-visual::before { left: 18px; bottom: 20px; }
.tutorial-visual::after { right: 19px; top: 17px; color: #f2b91d; font-size: 16px; }
.tutorial-copy { min-width: 0; }
.tutorial-copy h2 { margin: 0 0 10px !important; color: #2f2341; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.08; letter-spacing: -1px; }
.tutorial-copy h2:focus { outline: none; }
.tutorial-copy h2:focus-visible { outline: 3px solid #a78bfa; outline-offset: 5px; border-radius: 5px; }
.tutorial-copy > p { margin: 0; color: #71667f; font-size: 15px; line-height: 1.55; }
.tutorial-copy ul { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.tutorial-copy li { position: relative; padding-left: 27px; color: #51435f; font-size: 13px; font-weight: 800; line-height: 1.45; }
.tutorial-copy li::before { content: "✓"; position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 7px; background: #e9ddff; color: #6d28d9; font-size: 11px; font-weight: 1000; }
.tutorial-progress { height: 8px; margin-top: 25px; overflow: hidden; border-radius: 99px; background: #ece7f2; }
.tutorial-progress i { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #5b21b6); transition: width .25s ease; }
.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 0; }
.tutorial-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d9d1e3; }
.tutorial-dots i.active { width: 19px; border-radius: 99px; background: #7c3aed; }
.tutorial-actions { width: min(100%, 500px); margin: 18px 0 0 auto; }
.tutorial-actions .start-button { width: 100%; }

.tutorial-subject-demo { display: grid; grid-template-columns: repeat(3, 64px); justify-content: center; gap: 10px; width: 100%; }
.tutorial-subject-demo span { display: grid; place-items: center; aspect-ratio: 1; border: 2px solid rgba(255,255,255,.9); border-radius: 19px; color: #fff; font-size: 29px; font-weight: 1000; box-shadow: 0 6px 0 rgba(72,43,121,.15); }
.tutorial-subject-demo span:nth-child(1) { background: linear-gradient(145deg,#7c3aed,#4f46e5); }
.tutorial-subject-demo span:nth-child(2) { background: linear-gradient(145deg,#db5d9c,#9333ea); }
.tutorial-subject-demo span:nth-child(3) { background: linear-gradient(145deg,#16a36a,#5fc68e); }
.tutorial-subject-demo b { grid-column: 1 / -1; justify-self: center; padding: 8px 14px; border: 2px solid #d7c9ef; border-radius: 12px; background: #fff; color: #5b21b6; font-size: 11px; box-shadow: 0 3px 0 #ddd3ea; }
.tutorial-config-demo { display: grid; width: min(100%, 285px); gap: 10px; padding: 18px; border: 2px solid #ddd4e9; border-radius: 18px; background: #fff; box-shadow: 0 7px 0 #ded6e7; }
.tutorial-config-demo > small { display: flex; justify-content: space-between; color: #786987; font-size: 9px; font-weight: 1000; letter-spacing: .7px; }
.tutorial-config-demo > small b { padding: 3px 6px; border-radius: 99px; background: #eee8ff; color: #6d28d9; font-size: 8px; }
.tutorial-config-demo > span { padding: 10px 12px; border: 2px solid #e1d8eb; border-radius: 11px; color: #8a7d97; font-size: 10px; font-weight: 800; }
.tutorial-config-demo > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tutorial-config-demo > div i { padding: 9px 7px; border: 2px solid #e1d8eb; border-radius: 10px; color: #74677f; font-size: 9px; font-style: normal; font-weight: 1000; text-align: center; }
.tutorial-config-demo > div i.selected { border-color: #8b5cf6; background: #f1ebff; color: #5b21b6; box-shadow: 0 3px 0 #d8c8f5; }
.tutorial-config-demo > strong { color: #237542; font-size: 9px; text-align: center; }
.tutorial-path-demo { display: grid; justify-items: center; width: 100%; gap: 9px; }
.tutorial-path-line { display: flex; align-items: center; justify-content: center; width: 100%; }
.tutorial-path-line i { display: grid; place-items: center; flex: 0 0 auto; width: 60px; height: 60px; border: 4px solid #d9cdef; border-radius: 50%; background: #f7f4fa; color: #9b8daa; font-style: normal; font-weight: 1000; box-shadow: 0 6px 0 #ded5e8; }
.tutorial-path-line i.done { border-color: #6d28d9; background: #8b5cf6; color: #fff; box-shadow: 0 6px 0 #5b21b6; }
.tutorial-path-line i.current { border-color: #e1ba2d; background: #fff5bf; color: #936900; box-shadow: 0 6px 0 #d9bb4d; }
.tutorial-path-line span { width: 35px; height: 5px; background: #d8cde7; }
.tutorial-path-demo strong { color: #493759; font-size: 13px; }
.tutorial-question-demo { display: grid; width: min(100%, 285px); gap: 9px; padding: 18px; border: 2px solid #ddd4e9; border-radius: 18px; background: #fff; box-shadow: 0 7px 0 #ded6e7; }
.tutorial-question-demo > small { color: #7c3aed; font-size: 9px; font-weight: 1000; letter-spacing: .8px; }
.tutorial-question-demo > strong { color: #382b46; font-size: 14px; line-height: 1.35; }
.tutorial-question-demo > span { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 10px; border: 2px solid #e5ddec; border-radius: 11px; color: #6c6077; font-size: 10px; font-weight: 800; }
.tutorial-question-demo > span.correct { border-color: #55b579; background: #effaf2; color: #237542; box-shadow: 0 3px 0 #b8dfc5; }
.tutorial-material-demo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; }
.tutorial-material-demo > div,
.tutorial-material-demo > section { display: grid; justify-items: center; align-content: center; min-height: 145px; gap: 5px; padding: 13px 8px; border: 2px solid #ded4e9; border-radius: 17px; background: #fff; color: #4f405d; box-shadow: 0 5px 0 #ded6e7; text-align: center; }
.tutorial-material-demo > div > span { display: grid; place-items: center; width: 47px; height: 55px; border-radius: 10px; background: linear-gradient(145deg, #ede9fe, #ddd6fe); color: #6d28d9; font-size: 25px; }
.tutorial-material-demo > section > span { color: #6d28d9; font-size: 35px; font-weight: 1000; line-height: 1; }
.tutorial-material-demo b { font-size: 11px; }
.tutorial-material-demo small { color: #776a83; font-size: 8px; font-weight: 900; line-height: 1.3; }
.tutorial-material-demo > i { color: #8b5cf6; font-size: 22px; font-style: normal; font-weight: 1000; }
.tutorial-avatar-demo { display: grid; grid-template-columns: 155px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; }
.tutorial-avatar-demo .custom-avatar-svg { width: 155px; height: 175px; }
.tutorial-avatar-items { display: grid; gap: 8px; }
.tutorial-avatar-items span { display: flex; align-items: center; gap: 7px; min-height: 43px; padding: 7px 9px; border: 2px solid #ded4ea; border-radius: 12px; background: #fff; color: #554661; font-size: 10px; font-weight: 900; box-shadow: 0 3px 0 #dfd7e8; }
.tutorial-avatar-items b { font-size: 20px; }
.tutorial-friends-demo { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; width: min(100%, 290px); gap: 10px; }
.tutorial-friends-demo > div { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border: 3px solid #fff; border-radius: 20px; background: linear-gradient(145deg, #8b5cf6, #5b21b6); color: #fff; box-shadow: 0 5px 0 #cfc3dd; }
.tutorial-friends-demo > div b { font-size: 14px; }
.tutorial-friends-demo > div i { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border: 3px solid #fff; border-radius: 50%; background: #22c55e; }
.tutorial-friends-demo > section { display: grid; gap: 8px; padding: 14px; border: 2px solid #ded4e9; border-radius: 18px 18px 18px 5px; background: #fff; box-shadow: 0 6px 0 #ded6e7; }
.tutorial-friends-demo > section span { justify-self: start; padding: 8px 10px; border-radius: 11px 11px 11px 4px; background: #f1edf6; color: #554661; font-size: 9px; font-weight: 800; }
.tutorial-friends-demo > section span.reply { justify-self: end; border-radius: 11px 11px 4px; background: #e9ddff; color: #5b21b6; }
.tutorial-friends-demo > section small { color: #2f8b4e; font-size: 8px; font-weight: 1000; }
.tutorial-progress-demo { display: grid; width: min(100%, 290px); gap: 10px; }
.tutorial-progress-demo article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 11px; border: 2px solid #e0d6eb; border-radius: 14px; background: #fff; box-shadow: 0 4px 0 #ded7e7; }
.tutorial-progress-demo article > span { font-size: 22px; }
.tutorial-progress-demo article > div { display: grid; gap: 5px; color: #493a57; font-size: 11px; font-weight: 1000; }
.tutorial-progress-demo article i { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 99px; background: #eee8f3; }
.tutorial-progress-demo article i b { display: block; width: var(--demo-progress, 70%); height: 100%; border-radius: inherit; background: #8b5cf6; }
.tutorial-progress-demo article > b { color: #6d28d9; font-size: 11px; }

@media (max-width: 820px) {
  body[data-screen="auth-screen"] .app-shell,
  body:has(#auth-screen.active) .app-shell { display: block !important; }
  .auth-card { border: 1px solid #e7e0f0 !important; border-radius: 24px !important; box-shadow: 0 18px 50px rgba(76,29,149,.1) !important; }
  .auth-card::before { content: "✦ Estuda+" !important; width: auto !important; height: auto !important; position: static !important; display: block !important; margin: 0 0 24px !important; border-radius: 0 !important; background: none !important; color: #6d28d9 !important; font-size: 28px !important; font-weight: 900 !important; }
  .content-panel { background: linear-gradient(180deg, #fff, #faf9ff) !important; }
  .app-nav { border-color: #e4dced !important; background: rgba(255,255,255,.96) !important; box-shadow: 0 16px 40px rgba(46,16,101,.18) !important; }
  .app-nav button.active { border-color: #c4b5fd !important; background: #f3efff !important; color: #6d28d9 !important; }
}

@media (max-width: 820px) {
  .tutorial-backdrop { place-items: end center; padding: 0; }
  .tutorial-panel { width: 100% !important; max-height: 94dvh !important; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)) !important; border-radius: 25px 25px 0 0 !important; }
  .tutorial-heading { gap: 12px; padding-right: 48px; }
  .tutorial-heading > div { display: grid; gap: 3px; }
  .tutorial-main { grid-template-columns: minmax(230px, .85fr) minmax(0, 1.15fr); gap: 18px; margin-top: 16px; }
  .tutorial-visual { min-height: 260px; padding: 16px; border-radius: 20px; }
  .tutorial-copy h2 { font-size: 30px; letter-spacing: 0; }
  .tutorial-actions { width: 100%; }
}

@media (max-width: 600px) {
  .dashboard-header { flex-wrap: wrap; }
  .dashboard-header .tutorial-help-button { margin-left: 52px; }
  .tutorial-main { grid-template-columns: 1fr; gap: 15px; margin-top: 14px; }
  .tutorial-visual { min-height: 170px; padding: 14px; }
  .tutorial-visual::before { left: 12px; bottom: 12px; font-size: 17px; }
  .tutorial-visual::after { right: 12px; top: 12px; }
  .tutorial-copy h2 { font-size: 26px; line-height: 1.12; }
  .tutorial-copy > p { font-size: 14px; line-height: 1.5; }
  .tutorial-copy ul { gap: 7px; margin-top: 13px; }
  .tutorial-copy li { font-size: 12px; line-height: 1.35; }
  .tutorial-progress { margin-top: 17px; }
  .tutorial-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-top: 13px; }
  .tutorial-actions .modal-secondary,
  .tutorial-actions .start-button { width: 100%; min-width: 0; }
  .tutorial-subject-demo { grid-template-columns: repeat(3, 52px); gap: 8px; }
  .tutorial-subject-demo span { border-radius: 16px; font-size: 24px; }
  .tutorial-config-demo { width: min(100%, 270px); padding: 13px; }
  .tutorial-path-line i { width: 48px; height: 48px; border-width: 3px; }
  .tutorial-path-line span { width: 24px; }
  .tutorial-question-demo { width: min(100%, 270px); padding: 13px; }
  .tutorial-material-demo { width: min(100%, 280px); }
  .tutorial-material-demo > div,
  .tutorial-material-demo > section { min-height: 120px; }
  .tutorial-avatar-demo { grid-template-columns: 110px minmax(0, 1fr); }
  .tutorial-avatar-demo .custom-avatar-svg { width: 110px; height: 125px; }
  .tutorial-avatar-items span { min-height: 38px; font-size: 9px; }
  .tutorial-progress-demo { width: min(100%, 270px); gap: 8px; }
  .tutorial-progress-demo article { padding: 9px; }
}

@media (max-width: 380px) {
  .tutorial-panel { padding-inline: 14px !important; }
  .tutorial-heading { display: grid; justify-content: stretch; padding-right: 44px; }
  .tutorial-skip { justify-self: start; }
  .tutorial-actions { grid-template-columns: 1fr; }
  .tutorial-subject-demo { grid-template-columns: repeat(3, 48px); }
  .tutorial-path-line i { width: 44px; height: 44px; }
  .tutorial-path-line span { width: 18px; }
  .tutorial-avatar-demo { grid-template-columns: 1fr; justify-items: center; }
  .tutorial-avatar-items { width: 100%; }
}

/* Amigos de Estudo: presença, convites e chat privado. */
.side-menu [data-side-nav="friends"] { position: relative; }
.side-menu [data-side-nav="friends"] > i,
#nav-friends-badge {
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  position: absolute; top: 4px; right: 4px; border: 2px solid #fff; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 9px; font-style: normal; font-weight: 1000;
}
.friends-screen { width: min(100%, 1050px); margin: 0 auto; padding-bottom: 54px; }
.friends-header { align-items: center; }
.friends-notice { margin: 14px 0; padding: 12px 15px; border: 1px solid #c4b5fd; border-radius: 14px; background: #f5f3ff; color: #5b21b6; font-size: 13px; font-weight: 800; }
.friends-notice.error { border-color: #fecaca; background: #fff1f2; color: #b42335; }
.guardian-chat-card,
.friend-code-card,
.add-friend-card,
.friends-section,
.shared-question-banner,
.chat-safety-card {
  border: 2px solid #e7dff1; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 #ded5e8;
}
.guardian-chat-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 15px; margin: 20px 0; padding: 18px; background: linear-gradient(135deg, #faf7ff, #fff); }
.guardian-chat-card.enabled { border-color: #86d9a5; background: linear-gradient(135deg, #f0fdf4, #fff); box-shadow: 0 5px 0 #bce5ca; }
.guardian-shield { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: #ede9fe; color: #6d28d9; font-size: 30px; font-weight: 1000; }
.guardian-chat-card.enabled .guardian-shield { background: #dcfce7; color: #168447; }
.guardian-chat-card span,
.friend-code-card span,
.shared-question-banner span,
.friends-section header span,
.add-friend-card form > label { color: #7c3aed; font-size: 10px; font-weight: 1000; letter-spacing: 1px; }
.guardian-chat-card strong,
.friend-code-card strong,
.add-friend-card strong { display: block; margin: 3px 0; color: #30223f; font-size: 18px; font-weight: 1000; }
.guardian-chat-card p,
.friend-code-card p,
.add-friend-card p,
.shared-question-banner p,
.chat-safety-card p { margin: 2px 0 0; color: #766a81; font-size: 13px; line-height: 1.45; }
.guardian-chat-card button,
.friend-code-box button,
.add-friend-card button,
.friend-row > button,
.friend-request-actions button,
.shared-question-banner button {
  min-height: 42px; padding: 8px 15px; border: 2px solid #c4b5fd; border-radius: 13px;
  background: #fff; color: #6d28d9; font: 900 12px/1 Nunito, sans-serif; box-shadow: 0 3px 0 #d8cff0; cursor: pointer;
}
.guardian-chat-card.enabled > button { border-color: #86d9a5; color: #13743d; box-shadow: 0 3px 0 #bce5ca; }
.friend-code-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 20px; }
.friend-code-box { display: flex; align-items: center; gap: 8px; padding: 8px; border: 2px dashed #c4b5fd; border-radius: 16px; background: #f7f4ff; }
.friend-code-box b { padding: 0 8px; color: #4c1d95; font: 1000 20px/1 Space Grotesk, sans-serif; letter-spacing: 2px; }
.add-friend-card { margin-top: 18px; padding: 20px; }
.add-friend-card > div:first-child { display: flex; align-items: center; gap: 12px; }
.friend-card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #ede9fe; color: #6d28d9; font-size: 25px; }
.add-friend-card form { display: grid; gap: 7px; margin-top: 16px; }
.add-friend-card form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.add-friend-card input { min-width: 0; height: 46px; padding: 0 14px; border: 2px solid #dfd5eb; border-radius: 13px; background: #fbfaff; color: #30223f; font: 900 15px/1 Nunito, sans-serif; letter-spacing: 1px; text-transform: uppercase; outline: none; }
.add-friend-card input:focus { border-color: #8b5cf6; background: #fff; }
.add-friend-card button { border-color: #6d28d9; background: #7c3aed; color: #fff; box-shadow: 0 4px 0 #4c1d95; }
.shared-question-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 18px 20px; border-color: #f3c96b; background: linear-gradient(135deg, #fffbeb, #fff); box-shadow: 0 5px 0 #f1d99c; }
.shared-question-banner strong { display: block; max-width: 760px; margin: 4px 0; color: #5b3a09; font-size: 14px; line-height: 1.4; }
.friends-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; margin-top: 20px; }
.friends-section { min-width: 0; padding: 18px; }
.friends-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.friends-section h3 { margin: 2px 0 0; color: #30223f; font-size: 19px; }
.friends-section > header > b { padding: 6px 9px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 11px; }
.friend-list { display: grid; gap: 10px; }
.friend-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px; border: 2px solid #eee8f3; border-radius: 16px; background: #fcfbff; }
.friend-row.request { grid-template-columns: 48px minmax(0, 1fr) auto; }
.friend-avatar { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #ede9fe; font-size: 24px; }
.friend-avatar i { width: 12px; height: 12px; position: absolute; right: -2px; bottom: -1px; border: 2px solid #fff; border-radius: 50%; background: #a8a0b2; }
.friend-row.online .friend-avatar i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.friend-row > div:nth-child(2) { min-width: 0; }
.friend-row > div:nth-child(2) strong { display: block; overflow: hidden; color: #3b2a49; font-size: 14px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.friend-row > div:nth-child(2) span { display: block; margin-top: 2px; color: #81758d; font-size: 11px; font-weight: 700; }
.friend-unread { display: grid; place-items: center; min-width: 23px; height: 23px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 10px; }
.friend-request-actions { display: flex; gap: 6px; }
.friend-request-actions button:first-child { border-color: #70c990; background: #effcf3; color: #177441; box-shadow: 0 3px 0 #bfe5cc; }
.friend-request-actions button:last-child { border-color: #e2d9ea; color: #796d84; box-shadow: 0 3px 0 #e3dce9; }
.friend-empty { display: grid; place-items: center; min-height: 135px; padding: 20px; border: 2px dashed #e4dceb; border-radius: 16px; color: #8a7f94; text-align: center; }
.friend-empty span { color: #a78bfa; font-size: 30px; }
.friend-empty p { margin: 5px 0; font-size: 12px; font-weight: 800; }
.chat-safety-card { margin-top: 18px; padding: 16px 18px; border-color: #bae6fd; background: #f0f9ff; box-shadow: 0 4px 0 #cce8f4; }
.chat-safety-card strong { color: #075985; }
.chat-backdrop { z-index: 900 !important; display: block !important; position: fixed; inset: 0; padding: 0 !important; background: transparent !important; backdrop-filter: none !important; pointer-events: none; }
.chat-backdrop[hidden] { display: none !important; }
.chat-panel { display: grid; grid-template-rows: auto auto minmax(170px, 1fr) auto auto auto; position: fixed !important; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); left: auto; top: auto; width: min(440px, calc(100vw - 24px)) !important; height: min(680px, calc(100dvh - 40px)); max-height: calc(100dvh - 16px); padding: 0 !important; overflow: hidden !important; border: 2px solid #d8ccf3 !important; border-radius: 24px !important; background: #fff; box-shadow: 0 22px 70px rgba(52, 25, 91, .24), 0 6px 0 rgba(76, 29, 149, .12) !important; pointer-events: auto; transform-origin: bottom right; }
.chat-panel.is-positioned { right: auto; bottom: auto; transform-origin: center; }
.chat-panel.is-dragging { transition: none !important; cursor: grabbing; box-shadow: 0 26px 80px rgba(52, 25, 91, .3), 0 0 0 4px rgba(139, 92, 246, .16) !important; }
.chat-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 70px; padding: 10px 11px 10px 13px; border-bottom: 2px solid #eee8f3; background: linear-gradient(135deg, #fff 15%, #faf7ff); transition: background .2s ease; }
.chat-drag-handle { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; padding: 3px; border-radius: 14px; cursor: grab; touch-action: none; user-select: none; }
.chat-drag-handle:active { cursor: grabbing; }
.chat-drag-handle:focus-visible { outline: 3px solid rgba(124, 58, 237, .24); outline-offset: 1px; }
.chat-friend-avatar { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #ddd6fe; border-radius: 14px; background: linear-gradient(145deg, #f5f3ff, #e9e2ff); font-size: 22px; box-shadow: 0 3px 0 #ddd6fe; }
.chat-friend-copy { min-width: 0; pointer-events: none; }
.chat-heading span { display: block; overflow: hidden; color: #22a05a; font-size: 8px; font-weight: 1000; letter-spacing: .75px; text-overflow: ellipsis; white-space: nowrap; }
.chat-heading h2 { margin: 1px 0 0; overflow: hidden; color: #30223f; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.chat-window-actions { display: flex; align-items: center; gap: 4px; position: relative; }
.chat-window-button { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid #e2d9ea; border-radius: 11px; background: #fff; color: #6f627b; font: 1000 16px/1 Nunito, sans-serif; box-shadow: 0 2px 0 #e7e0ed; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.chat-window-button:hover { border-color: #c4b5fd; background: #f7f4ff; transform: translateY(-1px); }
.chat-window-button:focus-visible { outline: 3px solid rgba(124, 58, 237, .24); outline-offset: 1px; }
#chat-options { font-size: 13px; letter-spacing: -1px; }
.chat-close-button { border-color: #fecdd3; background: #fff7f8; color: #be123c; font-size: 20px; box-shadow: 0 2px 0 #ffe4e6; }
.chat-unread-badge { display: grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 1000; box-shadow: 0 2px 7px rgba(190, 18, 60, .3); }
.chat-unread-badge[hidden] { display: none !important; }
.chat-options-menu { z-index: 3; display: flex; justify-content: flex-end; gap: 6px; padding: 8px 14px; border-bottom: 1px solid #eee8f3; background: #faf8fd; }
.chat-options-menu button { padding: 7px 10px; border: 1px solid #dfd5e8; border-radius: 9px; background: #fff; color: #765f82; font: 800 11px Nunito, sans-serif; cursor: pointer; }
.chat-options-menu button:nth-child(-n+2) { color: #b42335; }
.chat-messages { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; background: linear-gradient(180deg, #faf8ff, #f5f2fa); }
.chat-message { width: fit-content; max-width: min(82%, 520px); margin: 8px 0; padding: 10px 12px 7px; border: 2px solid #e2d9ea; border-radius: 17px 17px 17px 5px; background: #fff; box-shadow: 0 3px 0 #e0d9e6; }
.chat-message.mine { margin-left: auto; border-color: #b9a5e7; border-radius: 17px 17px 5px 17px; background: #ede9fe; box-shadow: 0 3px 0 #cabceb; }
.chat-message.is-new { animation: chat-message-arrival .5s ease-out; }
.chat-message p { margin: 0; color: #3a2b46; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message time { display: block; margin-top: 5px; color: #897d93; font-size: 9px; font-weight: 800; text-align: right; }
.message-question { margin-bottom: 8px; padding: 10px; border: 1px solid #cabceb; border-radius: 11px; background: rgba(255,255,255,.76); }
.message-question span { display: block; color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .8px; text-transform: uppercase; }
.message-question strong { display: block; margin-top: 4px; color: #3e2c4c; font-size: 12px; line-height: 1.35; }
.chat-empty { display: grid; place-items: center; min-height: 100%; align-content: center; color: #83778f; text-align: center; }
.chat-empty span { font-size: 35px; }
.chat-empty strong { margin-top: 8px; color: #4d3b5a; }
.chat-empty p { max-width: 350px; margin: 5px 0; font-size: 12px; line-height: 1.5; }
.chat-question-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 12px 0; padding: 9px 11px; border: 2px solid #f3cf77; border-radius: 13px; background: #fffbeb; }
.chat-question-preview span { color: #a16207; font-size: 8px; font-weight: 1000; letter-spacing: .8px; }
.chat-question-preview strong { display: block; max-width: 560px; overflow: hidden; color: #5d430e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-question-preview button { border: 0; background: transparent; color: #9a6b09; font-size: 18px; cursor: pointer; }
.quick-replies { display: flex; gap: 5px; padding: 7px 12px 3px; overflow-x: auto; background: #fff; }
.quick-replies button { flex: none; min-height: 27px; padding: 4px 8px; border: 1px solid #c4b5fd; border-radius: 999px; background: #f7f4ff; color: #6d28d9; font: 800 9px Nunito, sans-serif; cursor: pointer; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 54px; align-items: end; gap: 9px; padding: 9px 12px 12px; background: #fff; }
.chat-form textarea { width: 100%; min-width: 0; min-height: 122px; max-height: 220px; resize: vertical; padding: 13px 14px; border: 2px solid #ded5e8; border-radius: 16px; background: #fbfaff; color: #342640; font: 700 15px/1.45 Nunito, sans-serif; outline: none; }
.chat-form textarea:focus { border-color: #8b5cf6; background: #fff; }
.chat-form button { width: 54px; height: 54px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; font-size: 21px; box-shadow: 0 4px 0 #4c1d95; cursor: pointer; }
.chat-status { min-height: 18px; margin: -7px 15px 8px; color: #6d28d9; font-size: 10px; font-weight: 800; }
.chat-status.error { color: #b42335; }
.chat-safety-action { z-index: 5; display: grid; place-items: center; position: absolute; inset: 0; padding: 20px; background: rgba(36,18,61,.6); }
.chat-safety-action > div { width: min(100%, 430px); padding: 22px; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(36,18,61,.3); }
.chat-safety-action span { color: #7c3aed; font-size: 9px; font-weight: 1000; letter-spacing: 1px; }
.chat-safety-action h3 { margin: 5px 0; color: #342640; font-size: 21px; }
.chat-safety-action p { color: #786c82; font-size: 13px; }
.chat-safety-action textarea { width: 100%; min-height: 110px; margin-top: 10px; padding: 11px; border: 2px solid #ded5e8; border-radius: 12px; font: 700 13px Nunito, sans-serif; resize: vertical; }
.chat-safety-action > div > div:last-child { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.chat-safety-action button { min-height: 40px; padding: 8px 14px; border: 2px solid #ded5e8; border-radius: 11px; background: #fff; color: #685c72; font: 900 12px Nunito, sans-serif; cursor: pointer; }
.chat-safety-action [data-confirm] { border-color: #dc2626; background: #ef4444; color: #fff; }

.chat-panel.is-minimized { grid-template-rows: auto; width: min(360px, calc(100vw - 16px)) !important; height: 70px !important; min-height: 70px; max-height: 70px; border-radius: 20px !important; }
.chat-panel.is-minimized > :not(.chat-heading) { display: none !important; }
.chat-panel.is-minimized .chat-heading { min-height: 68px; border-bottom: 0; }
.chat-panel.has-new-message { border-color: #f59e0b !important; animation: chat-attention .72s ease-in-out 2; }
.chat-panel.has-new-message .chat-heading { background: linear-gradient(135deg, #fff7d6, #fff 68%); }

@keyframes chat-attention { 0%, 100% { transform: scale(1); box-shadow: 0 22px 70px rgba(52, 25, 91, .24), 0 0 0 0 rgba(245, 158, 11, 0); } 45% { transform: scale(1.018); box-shadow: 0 24px 76px rgba(52, 25, 91, .28), 0 0 0 7px rgba(245, 158, 11, .2); } }
@keyframes chat-message-arrival { from { opacity: .35; transform: translateY(8px); background: #fff4c7; } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 820px) {
  .friends-columns { grid-template-columns: 1fr; }
  .chat-panel { right: max(8px, env(safe-area-inset-right)); bottom: calc(78px + env(safe-area-inset-bottom)); width: min(430px, calc(100vw - 16px)) !important; height: min(650px, calc(100dvh - 98px)); max-height: calc(100dvh - 16px); border-radius: 21px !important; }
  .app-nav:not([hidden]) { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
  .friends-screen { padding: 0 2px 92px; }
  .friends-header { grid-template-columns: 44px minmax(0, 1fr) !important; }
  .friends-header .tutorial-help-button { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .guardian-chat-card { grid-template-columns: 48px minmax(0, 1fr); padding: 14px; }
  .guardian-shield { width: 46px; height: 46px; border-radius: 14px; font-size: 25px; }
  .guardian-chat-card > button { grid-column: 1 / -1; width: 100%; }
  .friend-code-card { grid-template-columns: 1fr; padding: 16px; }
  .friend-code-box { justify-content: space-between; }
  .add-friend-card { padding: 16px; }
  .add-friend-card form > div { grid-template-columns: 1fr; }
  .add-friend-card button { width: 100%; }
  .shared-question-banner { align-items: flex-start; flex-direction: column; padding: 15px; }
  .friends-section { padding: 14px; }
  .friend-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .friend-row > button { grid-column: 2 / -1; width: 100%; }
  .friend-row.request { grid-template-columns: 44px minmax(0, 1fr); }
  .friend-request-actions { grid-column: 1 / -1; }
  .friend-request-actions button { flex: 1; }
  .chat-options-menu { flex-wrap: wrap; justify-content: stretch; }
  .chat-options-menu button { flex: 1; min-width: 120px; }
  .chat-heading { gap: 5px; min-height: 64px; padding: 8px; }
  .chat-drag-handle { grid-template-columns: 38px minmax(0, 1fr); gap: 6px; }
  .chat-friend-avatar { width: 37px; height: 37px; border-radius: 12px; font-size: 19px; }
  .chat-heading h2 { font-size: 14px; }
  .chat-window-actions { gap: 3px; }
  .chat-window-button { width: 31px; height: 31px; border-radius: 10px; font-size: 14px; }
  .chat-close-button { font-size: 18px; }
  .chat-unread-badge { position: absolute; left: -5px; top: -9px; min-width: 19px; height: 19px; }
  .chat-message { max-width: 90%; }
  .quick-replies { padding-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel,
  .chat-panel.has-new-message,
  .chat-message.is-new { animation: none !important; }
}
body.a11y-calm .chat-panel,
body.a11y-calm .chat-panel.has-new-message,
body.a11y-calm .chat-message.is-new { animation: none !important; }

/* Estabilidade responsiva: celular, tablet e desktop */
html {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
}
.app-shell,
.content-panel,
.screen,
#setup-screen.active,
#adventure-overview,
#lesson-creator,
.quiz-screen,
.quiz-header,
.quiz-header > *,
.quiz-meta,
.quiz-meta > *,
.answers,
.answer,
.answer > span:last-child,
.feedback,
.feedback > *,
.feedback-actions,
.explanation-extra {
  min-width: 0;
  max-width: 100%;
}
.answer > span:last-child,
.quiz-tag,
.quiz-skill,
.feedback,
.feedback > *,
.question-source,
.explanation-extra,
.phase-map-label,
.profile-card > div,
.saved-entry > div,
.review-item-card > div {
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}
.question-source {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
}
.feedback-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}
.feedback-actions button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.feedback:focus-visible { outline: 3px solid #a78bfa; outline-offset: 3px; }
.profile-card > div,
.saved-entry > div,
.review-item-card > div,
.quest-row > div,
.rail-review-button > div {
  min-width: 0;
}
.phase-map-label {
  width: fit-content;
  max-width: min(100%, calc(100vw - 32px));
  text-align: center;
}
.learn-rail {
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.rail-leaderboard,
.setup-mobile-leaderboard {
  display: grid;
  gap: 14px;
}
.setup-mobile-leaderboard {
  display: none;
}
.leaderboard-champion {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #e7d7fb;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(192, 132, 252, .18), transparent 42%),
    linear-gradient(135deg, #fffdf7, #f7f1ff 88%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.leaderboard-crown,
.leaderboard-avatar,
.leaderboard-position {
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 900;
}
.leaderboard-crown {
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  color: #5b3200;
  box-shadow: 0 10px 24px rgba(245, 158, 11, .24);
  font-size: 22px;
}
.leaderboard-champion b {
  display: block;
  color: #25163d;
  font-size: 16px;
  line-height: 1.2;
}
.leaderboard-champion small {
  display: block;
  margin-top: 4px;
  color: #6f6290;
  font-size: 12px;
  line-height: 1.45;
}
.leaderboard-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4d7f7;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(95, 61, 171, .06);
}
.leaderboard-row.leader {
  border-color: #f5cf7b;
  background: linear-gradient(135deg, #fffaf0, #fff2cf);
}
.leaderboard-row.current-user {
  border-color: #c7b5fb;
  background: linear-gradient(135deg, #f9f6ff, #f0ebff);
}
.leaderboard-position {
  width: 40px;
  height: 40px;
  background: #efe7ff;
  color: #6d28d9;
  font-size: 13px;
}
.leaderboard-row.leader .leaderboard-position {
  background: linear-gradient(145deg, #f9dc8d, #f59e0b);
  color: #5b3200;
}
.leaderboard-person {
  min-width: 0;
}
.leaderboard-person strong,
.leaderboard-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-person strong {
  color: #26193f;
  font-size: 14px;
}
.leaderboard-person small {
  margin-top: 3px;
  color: #72678f;
  font-size: 11px;
  font-weight: 800;
}
.leaderboard-score {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: #5a2fc1;
  font-size: 14px;
  font-weight: 900;
}
.leaderboard-avatar {
  width: 32px;
  height: 32px;
  background: #f3edff;
  font-size: 18px;
}
.leaderboard-empty {
  padding: 8px 4px 2px;
  color: #77698f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.hero-panel { min-height: 100dvh; }
.side-menu[inert] button:not(.active) { opacity: .48; }
.side-menu[inert] button { cursor: default; }

/* O resumo lateral só aparece quando existe largura real para as duas colunas. */
@media (max-width: 1439px) {
  #setup-screen.active {
    grid-template-columns: minmax(0, 760px) !important;
    justify-content: center;
  }
  .duo-topbar,
  #adventure-overview,
  #lesson-creator { grid-column: 1 !important; }
  .learn-rail { display: none !important; }
  .setup-mobile-leaderboard {
    display: grid !important;
    grid-column: 1 !important;
    margin-top: 18px;
  }
  .content-panel { padding-left: clamp(22px, 3vw, 38px) !important; padding-right: clamp(22px, 3vw, 38px) !important; }
}

/* Tablet e celular: navegação inferior com cinco destinos sempre acessíveis. */
@media (max-width: 1024px) {
  .app-shell { display: block !important; width: 100% !important; }
  .hero-panel { display: none !important; }
  .content-panel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px max(20px, env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)) !important;
  }
  .screen,
  .quiz-screen,
  .dashboard-screen,
  .review-screen,
  .friends-screen,
  .result-screen { width: 100% !important; max-width: 850px !important; margin-inline: auto !important; }
  .quiz-screen { max-width: 790px !important; }
  #setup-screen.active { width: 100% !important; grid-template-columns: minmax(0, 760px) !important; }
  .auth-screen { min-height: calc(100dvh - 40px) !important; }
  .app-nav:not([hidden]) {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .app-nav[hidden],
  body.keyboard-open .app-nav:not([hidden]) { display: none !important; }
  .app-nav {
    position: fixed;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    gap: 4px !important;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
    transform: none !important;
    border: 0 !important;
    border-top: 1px solid #e4dced !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: 0 -10px 30px rgba(46, 16, 101, .08) !important;
    backdrop-filter: blur(16px);
  }
  .app-nav button {
    width: 100%;
    min-width: 0 !important;
    min-height: 58px;
    padding: 5px 2px !important;
    border-radius: 13px;
    color: #80778b !important;
    touch-action: manipulation;
  }
  .app-nav button > span { font-size: 20px; line-height: 1; }
  .app-nav button.active {
    border: 1px solid #c4b5fd !important;
    background: #f3efff !important;
    color: #6d28d9 !important;
    box-shadow: inset 0 -2px 0 #ddd2f7;
  }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .week-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    width: 100%;
  }
  .day-button { width: 100%; }
}

@media (max-width: 640px) {
  .content-panel {
    padding: 14px max(12px, env(safe-area-inset-right)) calc(98px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
  }
  .subject-grid { grid-template-columns: 1fr !important; }
  .quiz-header {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    gap: 7px !important;
    width: 100% !important;
  }
  .quiz-header .listen-button { display: none !important; }
  .quiz-header > div:nth-child(2) { width: 100%; min-width: 0; }
  .score {
    min-width: 46px;
    padding: 6px 8px !important;
    text-align: center;
  }
  .score small { display: none !important; }
  .quiz-meta { gap: 6px !important; }
  .quiz-tag,
  .quiz-skill { width: fit-content; max-width: 100%; }
  .quiz-screen h2 { font-size: clamp(21px, 6.5vw, 27px) !important; line-height: 1.32 !important; }
  .answer {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
    font-size: 15px !important;
  }
  .answer .letter { width: 32px; height: 32px; }
  .feedback { padding: 14px !important; font-size: 15px; line-height: 1.55; }
  .question-source { line-height: 1.4; }
  .profile-card,
  .saved-entry,
  .review-item-card,
  .ranking-card > div {
    flex-wrap: wrap;
  }
  .profile-card .logout-button { margin-left: 0; }
  .week-picker { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .phase-map-label { max-width: min(100%, calc(100vw - 24px)); }
  .leaderboard-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px;
  }
  .leaderboard-position {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .leaderboard-score {
    gap: 6px;
    font-size: 13px;
  }
  .leaderboard-avatar {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

@media (max-width: 359px) {
  .content-panel { padding-left: 10px !important; padding-right: 10px !important; }
  .feedback-actions { grid-template-columns: 1fr; }
  .app-nav { gap: 1px !important; padding-left: 4px !important; padding-right: 4px !important; }
  .app-nav button { font-size: 9px !important; }
  .quiz-header { grid-template-columns: 40px minmax(0, 1fr) auto !important; }
}

@media (pointer: coarse) {
  button,
  .icon-button,
  .listen-button,
  .question-tools button,
  .feedback-actions button,
  .topic-chip,
  .day-button,
  .modal-close,
  .small-action,
  .result-home,
  .back-subjects,
  .profile-mini { min-height: 44px; touch-action: manipulation; }
}

@media (max-height: 680px) and (min-width: 1025px) {
  .hero-panel { overflow-y: auto !important; }
  .hero-copy,
  .mascot,
  .hero-footer { display: none !important; }
  .side-menu { margin-top: 24px; }
}

@media (max-width: 820px) {
  .avatar-home-card { grid-template-columns: 152px minmax(0, 1fr); gap: 16px; padding: 17px; }
  .avatar-home-interact { width: 148px; min-height: 176px; }
  .avatar-home-preview { width: 140px; height: 154px; }
  .avatar-profile-card { grid-template-columns: 108px minmax(0, 1fr) auto; }
  .dashboard-avatar-preview { width: 100px; height: 112px; }
  .avatar-studio-backdrop { place-items: end center; padding: 0; }
  .avatar-studio-panel { width: 100% !important; max-height: 94dvh !important; padding: 22px 18px max(20px, env(safe-area-inset-bottom)) !important; border-radius: 25px 25px 0 0 !important; }
  .avatar-studio-layout { grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: 15px; }
  .avatar-studio-preview { height: 220px; }
  .avatar-option-grid { grid-template-columns: 1fr; }
  .avatar-part-option { min-height: 56px; }
}

@media (max-width: 600px) {
  .avatar-home-card { grid-template-columns: 124px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .avatar-profile-card { grid-template-columns: 86px minmax(0, 1fr); gap: 11px; }
  .avatar-home-interact { width: 122px; min-height: 158px; padding-left: 3px; padding-right: 3px; border-radius: 20px; }
  .avatar-home-preview { width: 120px; height: 134px; }
  .avatar-home-bubble { max-width: 142px; font-size: 8px; }
  .avatar-tap-hint { display: none; }
  .avatar-home-copy { gap: 7px; }
  .avatar-home-meta span:nth-child(2) { display: none; }
  .avatar-home-copy > strong,
  .avatar-profile-card > div:nth-child(2) > strong { font-size: 17px; }
  .avatar-profile-card > .avatar-edit-button { grid-column: 1 / -1; width: 100%; }
  .avatar-home-actions { display: grid; grid-template-columns: 1fr; }
  .avatar-home-actions button { width: 100%; }
  .dashboard-avatar-preview { width: 82px; height: 94px; }
  .avatar-unlock-result { grid-template-columns: auto minmax(0, 1fr); }
  .avatar-result-companion { grid-template-columns: 82px minmax(0, 1fr); padding: 9px 11px 9px 7px; }
  .avatar-result-companion > button { width: 78px; height: 82px; }
  .avatar-result-companion > button span { width: 82px; height: 95px; }
  .avatar-result-companion strong { font-size: 13px; }
  .avatar-unlock-result > button { grid-column: 1 / -1; width: 100%; }
  .avatar-studio-heading { padding-right: 42px; }
  .avatar-studio-heading h2 { font-size: 25px; }
  .avatar-phase-pill { min-width: 70px; padding: 7px 9px; }
  .avatar-studio-layout { grid-template-columns: 1fr; }
  .avatar-preview-stage { grid-template-columns: 126px minmax(0, 1fr); grid-template-rows:auto auto; align-items: center; justify-items: start; padding: 28px 13px 10px; text-align: left; }
  .avatar-studio-preview { grid-row: 1 / 3; width: 120px; height: 130px; }
  .avatar-preview-stage > span { max-width: none; }
  .avatar-reaction-controls { grid-column: 1 / -1; width: 100%; }
  .avatar-category-tabs { display: flex; max-width: 100%; overflow-x: auto; padding: 2px 1px 6px; scrollbar-width: thin; }
  .avatar-category-tabs button { flex: 0 0 82px; }
  .avatar-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar-part-option { grid-template-columns: 37px minmax(0, 1fr); gap: 7px; padding: 7px; }
  .avatar-option-sample { width: 36px; height: 36px; }
  .avatar-part-option > b { position: absolute; }
  .avatar-part-option { position: relative; }
  .avatar-part-option > b { top: 4px; right: 5px; }
  .avatar-studio-actions { grid-template-columns: 1fr 1.35fr; }
}

@media (max-width: 380px) {
  .avatar-home-card { grid-template-columns: 1fr; }
  .avatar-home-interact { width: 162px; min-height: 180px; }
  .avatar-home-preview { width: 150px; height: 162px; }
  .avatar-home-actions { grid-template-columns: 1fr 1fr; }
  .avatar-home-actions button { padding: 7px; font-size: 10px; }
  .avatar-studio-heading { display: grid; gap: 10px; }
  .avatar-phase-pill { grid-template-columns: auto auto auto; justify-content: center; width: fit-content; }
  .avatar-phase-pill span { grid-row: auto; }
  .avatar-option-grid { grid-template-columns: 1fr; }
  .avatar-studio-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .is-reacting-wave .custom-avatar-svg,
  .is-reacting-celebrate .custom-avatar-svg,
  .is-reacting-focus .custom-avatar-svg,
  .custom-avatar-svg .avatar-companion { animation: none !important; }
}

/* Administração protegida */
.app-announcement { display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; align-items: center; gap: 12px; margin: 0 0 18px; padding: 13px 15px; border: 2px solid #c4b5fd; border-radius: 18px; background: linear-gradient(135deg, #f5f3ff, #fff); box-shadow: 0 4px 0 #d9d0ef; }
.app-announcement > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: #7c3aed; color: #fff; font-size: 20px; }
.app-announcement strong { color: #4c1d95; font-size: 14px; font-weight: 1000; }
.app-announcement p { margin: 2px 0 0; color: #6f627a; font-size: 12px; line-height: 1.4; }
.app-announcement button { width: 36px; height: 36px; border: 0; border-radius: 11px; background: #ede9fe; color: #6d28d9; font-size: 20px; cursor: pointer; }
.admin-access-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; padding: 18px 20px; border: 2px solid #c4b5fd; border-radius: 20px; background: linear-gradient(135deg, #2e1065, #6d28d9); box-shadow: 0 5px 0 #1f0a46; }
.admin-access-card span { color: #ddd6fe; font-size: 9px; font-weight: 1000; letter-spacing: 1px; }
.admin-access-card strong { display: block; margin-top: 3px; color: #fff; font-size: 18px; font-weight: 1000; }
.admin-access-card p { margin: 3px 0 0; color: #ede9fe; font-size: 12px; }
.admin-access-actions { display: flex; flex: none; gap: 8px; }
.admin-access-card button { flex: none; min-height: 43px; padding: 8px 15px; border: 2px solid #fff; border-radius: 13px; background: #fff; color: #5b21b6; font: 1000 12px Nunito, sans-serif; box-shadow: 0 3px 0 #c4b5fd; cursor: pointer; }
.admin-access-card #change-admin-password { background: transparent; color: #fff; box-shadow: 0 3px 0 #3d146f; }
.admin-screen { width: min(100%, 1180px); margin: 0 auto; padding-bottom: 60px; }
.admin-notice { margin: 14px 0; padding: 11px 14px; border: 1px solid #c4b5fd; border-radius: 13px; background: #f5f3ff; color: #5b21b6; font-size: 12px; font-weight: 900; }
.admin-notice.error { border-color: #fecaca; background: #fff1f2; color: #b42335; }
.admin-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.admin-stats article { padding: 17px; border: 2px solid #e6ddeb; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #ded6e6; }
.admin-stats #admin-online-stat { border-color: #86efac; background: linear-gradient(145deg,#f0fdf4,#fff); box-shadow: 0 4px 0 #bbf7d0; }
.admin-stats #admin-online-stat span,
.admin-stats #admin-online-stat strong { color: #15803d; }
.admin-stats span { display: block; color: #7c3aed; font-size: 9px; font-weight: 1000; letter-spacing: .8px; }
.admin-stats strong { display: inline-block; margin: 4px 5px 0 0; color: #31213f; font: 1000 28px Space Grotesk, sans-serif; }
.admin-stats small { color: #80748a; font-size: 10px; font-weight: 800; }
.admin-tabs { display: flex; gap: 6px; margin: 18px 0; padding: 6px; overflow-x: auto; border: 2px solid #e5ddec; border-radius: 17px; background: #f8f6fb; }
.admin-tabs button { flex: 1 0 auto; min-height: 40px; padding: 7px 13px; border: 0; border-radius: 11px; background: transparent; color: #766a80; font: 900 12px Nunito, sans-serif; cursor: pointer; }
.admin-tabs button.active { background: #fff; color: #6d28d9; box-shadow: 0 3px 0 #ddd4e7; }
.admin-tabs button b { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 9px; }
.admin-tab-panel { min-width: 0; padding: 20px; border: 2px solid #e5ddec; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 #ddd5e6; }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.admin-section-heading span,
.admin-announcement-form > span { color: #7c3aed; font-size: 9px; font-weight: 1000; letter-spacing: 1px; }
.admin-section-heading h3,
.admin-announcement-form h3 { margin: 3px 0 0; color: #31213f; font-size: 20px; }
.admin-user-filters { display: flex; gap: 7px; }
.admin-user-filters input,
.admin-user-filters select { min-height: 42px; padding: 8px 11px; border: 2px solid #e1d8e9; border-radius: 12px; background: #fbfaff; color: #42334d; font: 800 12px Nunito, sans-serif; outline: none; }
.admin-user-filters input:focus,
.admin-user-filters select:focus { border-color: #8b5cf6; background: #fff; }
.admin-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e9e2ee; border-radius: 15px; }
.admin-users-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.admin-users-table th { padding: 10px 12px; background: #f8f6fa; color: #796d83; font-size: 9px; letter-spacing: .7px; text-align: left; }
.admin-users-table td { padding: 11px 12px; border-top: 1px solid #eee8f2; color: #5d5068; font-size: 12px; }
.admin-user-name { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.admin-user-name > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #ede9fe; color: #6d28d9; font-weight: 1000; }
.admin-user-name strong { display: block; color: #3c2c48; font-size: 13px; }
.admin-user-name small { display: block; color: #918699; font-size: 9px; }
.admin-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #dcfce7; color: #177441; font-size: 9px; font-weight: 1000; text-transform: uppercase; }
.admin-status.suspended { background: #fee2e2; color: #b42335; }
.admin-users-table td > button,
.admin-load-more { min-height: 36px; padding: 7px 10px; border: 2px solid #c4b5fd; border-radius: 10px; background: #f7f4ff; color: #6d28d9; font: 900 10px Nunito, sans-serif; cursor: pointer; }
.admin-load-more { display: block; margin: 14px auto 0; }
.admin-empty { padding: 30px !important; color: #8b8093; font-size: 12px; font-weight: 800; text-align: center; }
.admin-section-heading p { max-width: 680px; margin: 5px 0 0; color: #80748a; font-size: 10px; line-height: 1.45; }
.admin-online-live-status { display: inline-flex !important; align-items: center; gap: 6px; flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #f0fdf4; color: #15803d !important; font-size: 9px !important; letter-spacing: 0 !important; }
.admin-online-live-status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.14); animation: admin-online-pulse 1.8s ease-in-out infinite; }
.admin-online-list { display: grid; gap: 9px; }
.admin-online-list article { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 15px; border: 2px solid #dcfce7; border-radius: 16px; background: linear-gradient(135deg,#f7fff9,#fff); }
.admin-online-avatar { position: relative; width: 46px; height: 46px; }
.admin-online-avatar > span { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border: 2px solid #bbf7d0; border-radius: 14px; background: #fff; color: #4c1d95; font-size: 24px; font-weight: 1000; }
.admin-online-avatar > i { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #22c55e; }
.admin-online-person strong { display: block; color: #352740; font-size: 13px; }
.admin-online-person span { display: block; margin-top: 2px; color: #82758b; font-size: 10px; }
.admin-online-activity { display: grid; justify-items: end; gap: 2px; text-align: right; }
.admin-online-activity b { color: #15803d; font-size: 10px; }
.admin-online-activity small { color: #8a7e92; font-size: 9px; }
@keyframes admin-online-pulse { 0%,100% { opacity: .68; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.08); } }
.admin-report-list,
.admin-announcements-list,
.admin-audit-list { display: grid; gap: 10px; }
.admin-report { display: grid; grid-template-columns: minmax(0, 1fr) 145px; align-items: center; gap: 16px; padding: 15px; border: 2px solid #eee7f2; border-radius: 15px; background: #fcfbfd; }
.admin-report.open { border-left: 5px solid #ef4444; }
.admin-report.reviewing { border-left: 5px solid #f59e0b; }
.admin-report.closed { border-left: 5px solid #22c55e; }
.admin-report span,
.admin-announcement-row span { color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .8px; }
.admin-report strong,
.admin-announcement-row strong { display: block; margin-top: 3px; color: #392945; font-size: 14px; }
.admin-report p,
.admin-announcement-row p { margin: 4px 0; color: #6f6278; font-size: 12px; line-height: 1.45; }
.admin-report small,
.admin-announcement-row small { color: #92879a; font-size: 9px; }
.admin-report select { min-height: 40px; padding: 7px 9px; border: 2px solid #dfd6e7; border-radius: 11px; background: #fff; color: #594963; font: 800 11px Nunito, sans-serif; }
.admin-announcement-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 22px; }
.admin-announcement-form { display: grid; align-content: start; gap: 11px; padding: 18px; border: 2px solid #ddd2ef; border-radius: 17px; background: #faf8ff; }
.admin-announcement-form label { display: grid; gap: 5px; color: #665a70; font-size: 11px; font-weight: 900; }
.admin-announcement-form input:not([type="checkbox"]),
.admin-announcement-form textarea { width: 100%; padding: 10px 11px; border: 2px solid #e0d7e8; border-radius: 11px; background: #fff; color: #392b44; font: 700 12px Nunito, sans-serif; outline: none; }
.admin-announcement-form textarea { min-height: 120px; resize: vertical; }
.admin-announcement-form input:focus,
.admin-announcement-form textarea:focus { border-color: #8b5cf6; }
.admin-publish-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.admin-announcement-form > div:last-child { display: flex; justify-content: flex-end; gap: 7px; }
.admin-announcement-form button,
.admin-announcement-row button { min-height: 38px; padding: 7px 11px; border: 2px solid #d9cee5; border-radius: 10px; background: #fff; color: #65556f; font: 900 10px Nunito, sans-serif; cursor: pointer; }
.admin-announcement-form button[type="submit"] { border-color: #7c3aed; background: #7c3aed; color: #fff; box-shadow: 0 3px 0 #4c1d95; }
.admin-announcement-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 2px solid #eee7f2; border-radius: 14px; }
.admin-announcement-row > div:last-child { display: flex; gap: 6px; }
.admin-announcement-row [data-delete] { color: #b42335; }
.admin-learning-insights { display: grid; gap: 11px; }
.admin-learning-insights article { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(220px, 1.2fr); align-items: center; gap: 18px; padding: 13px; border: 1px solid #e9e2ed; border-radius: 13px; }
.admin-learning-insights strong { display: block; color: #493653; font-size: 13px; }
.admin-learning-insights span { color: #8a7f92; font-size: 10px; }
.admin-learning-insights i { height: 9px; overflow: hidden; border-radius: 999px; background: #eee9f2; }
.admin-learning-insights b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.admin-audit-list article { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e9e2ed; border-radius: 13px; }
.admin-audit-list article > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #dcfce7; color: #168447; font-weight: 1000; }
.admin-audit-list strong { display: block; color: #493653; font-size: 12px; }
.admin-audit-list small { color: #918697; font-size: 9px; }
.admin-user-panel { width: min(100%, 540px) !important; }
.admin-user-panel > p { color: #71657b; font-size: 13px; }
.admin-user-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.admin-user-actions button { min-height: 43px; border: 2px solid #c4b5fd; border-radius: 12px; background: #f5f3ff; color: #6d28d9; font: 900 11px Nunito, sans-serif; cursor: pointer; }
.admin-user-actions button.danger { border-color: #fecaca; background: #fff1f2; color: #b42335; }
.admin-user-panel label { display: grid; gap: 6px; color: #62566c; font-size: 11px; font-weight: 900; }
.admin-user-panel textarea { min-height: 110px; padding: 11px; border: 2px solid #e0d7e8; border-radius: 12px; font: 700 12px Nunito, sans-serif; resize: vertical; }
.admin-user-panel .start-button { width: 100%; margin-top: 12px; }
.admin-user-panel > small { display: block; margin-top: 12px; color: #8b8092; font-size: 9px; line-height: 1.4; }
.admin-user-panel { max-height: min(90dvh, 860px); overflow-y: auto; }
.admin-user-access-card { display: grid; gap: 12px; margin: 15px 0; padding: 15px; border: 2px solid #ddd2ff; border-radius: 17px; background: linear-gradient(145deg, #fbfaff, #f4f0ff); }
.admin-user-access-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-align: left; }
.admin-user-access-card header span { display: block; color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .9px; }
.admin-user-access-card header strong { display: block; margin-top: 2px; color: #342344; font-size: 15px; }
.admin-user-access-card header em { padding: 6px 9px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 9px; font-style: normal; font-weight: 1000; text-align: center; }
.admin-user-access-card select,
.admin-user-access-card input[type="date"],
.admin-user-access-card input[type="text"] { width: 100%; min-height: 42px; padding: 9px 11px; border: 2px solid #d9cfeb; border-radius: 11px; background: #fff; color: #3f3150; font: 800 12px Nunito, sans-serif; }
.admin-user-access-card label > small { color: #8b8092; font-size: 9px; font-weight: 700; }
.admin-user-partial-permissions { display: grid; gap: 7px; padding: 10px; border-radius: 12px; background: #fff; }
.admin-user-partial-permissions label { display: flex; align-items: center; gap: 9px; min-height: 34px; font-size: 11px; }
.admin-user-partial-permissions input { width: 18px; height: 18px; accent-color: #7c3aed; }
.admin-user-access-card button:disabled { opacity: .55; cursor: not-allowed; }
#admin-user-access-notice { min-height: 16px; margin: 0; color: #4d7c0f; font-size: 10px; font-weight: 900; text-align: center; }
#admin-user-access-notice.error { color: #b42335; }

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-announcement-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .admin-screen { max-width: 100%; padding-bottom: 95px; overflow-x: clip; }
  .admin-screen *,
  .admin-user-panel * { min-width: 0; }
  .admin-tabs,
  .admin-tab-panel,
  .admin-table-wrap,
  .admin-user-filters,
  .admin-user-filters input,
  .admin-user-filters select { width: 100%; max-width: 100%; }
  .admin-user-panel { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
  .admin-user-access-card header { align-items: stretch; flex-direction: column; }
  .admin-user-access-card header em { align-self: flex-start; }
  .admin-header { grid-template-columns: 44px minmax(0, 1fr) !important; }
  .admin-header .tutorial-help-button { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .admin-access-card { align-items: flex-start; flex-direction: column; }
  .admin-access-card button { width: 100%; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-stats article { padding: 13px; }
  .admin-stats strong { font-size: 23px; }
  .admin-tab-panel { padding: 14px; }
  .admin-section-heading { align-items: stretch; flex-direction: column; }
  .admin-user-filters { display: grid; grid-template-columns: 1fr; }
  .admin-report { grid-template-columns: 1fr; }
  .admin-report select { width: 100%; }
  .admin-announcement-row { align-items: flex-start; flex-direction: column; }
  .admin-announcement-row > div:last-child { width: 100%; }
  .admin-announcement-row button { flex: 1; }
  .admin-learning-insights article { grid-template-columns: 1fr; gap: 8px; }
  .admin-online-list article { grid-template-columns: 44px minmax(0,1fr); }
  .admin-online-activity { grid-column: 2; justify-items: start; text-align: left; }
  .admin-user-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-online-live-status i { animation: none !important; }
}

/* Modo Apostila e contato autorizado */
.auth-consent { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px !important; padding: 11px 12px; border: 1px solid #ddd6fe; border-radius: 12px; background: #f7f5ff; color: #665873 !important; font-size: 11px !important; line-height: 1.4; }
.auth-consent input { width: 18px !important; height: 18px; margin: 0; accent-color: #7c3aed; }
.side-menu .side-material-feature,
.side-menu .side-avatar-feature { border-color: #e5deee !important; background: #fff !important; color: #6b6078 !important; box-shadow: 0 3px 0 #ded6e8 !important; }
.side-menu .side-material-feature:hover,
.side-menu .side-avatar-feature:hover { border-color: #d7ccef !important; background: #faf8ff !important; transform: none !important; }
.side-menu .side-material-feature.active,
.side-menu .side-avatar-feature.active { border-color: #cfc0ef !important; background: #f5f1ff !important; color: #5b21b6 !important; box-shadow: 0 3px 0 #ded6e8 !important; }
.side-menu .side-material-feature > span,
.side-menu .side-avatar-feature > span,
.side-menu .side-material-feature.active > span,
.side-menu .side-avatar-feature.active > span { color: inherit !important; }
.side-menu .side-material-feature b,
.side-menu .side-avatar-feature b { display: grid; gap: 1px; }
.side-menu .side-material-feature small,
.side-menu .side-avatar-feature small { color: #9b8fb2; font-size: 7px; font-weight: 1000; letter-spacing: .7px; }
.side-menu .side-admin-feature { border-color: #d9cff9 !important; background: linear-gradient(135deg, #f8f5ff, #efe9ff) !important; color: #4c1d95 !important; }
.side-menu .side-admin-feature:hover { border-color: #c4b5fd !important; background: linear-gradient(135deg, #f1ebff, #e8deff) !important; }
.side-menu .side-admin-feature > span { color: #6d28d9 !important; }
.side-menu .side-admin-feature b { display: grid; gap: 1px; }
.side-menu .side-admin-feature small { color: #8b5cf6; font-size: 7px; font-weight: 1000; letter-spacing: .7px; }
.app-nav .material-nav-button { color: #6d28d9 !important; }
.app-nav .material-nav-button > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg,#6d28d9,#8b5cf6); color: #fff !important; box-shadow: 0 2px 0 #4c1d95; }
.app-nav .material-nav-button.active > span { background: #fff; color: #6d28d9 !important; box-shadow: 0 0 0 2px #c4b5fd; }
.app-nav .avatar-nav-button > span { color: #7c3aed !important; }
.material-screen { width: min(100%, 900px) !important; }
.material-header { align-items: center; }
.material-header > div { flex: 1; min-width: 0; }
.material-header p { max-width: 660px; margin: 5px 0 0; color: #75687e; font-size: 11px; line-height: 1.45; }
.material-plan-badge { flex: 0 0 auto; padding: 8px 12px; border: 2px solid #c4b5fd; border-radius: 999px; background: #f5f3ff; color: #5b21b6; font-size: 9px; font-weight: 1000; white-space: nowrap; }
.material-privacy-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; margin: 14px 0 18px; padding: 14px; border: 2px solid #bbf7d0; border-radius: 17px; background: #f0fdf4; }
.material-privacy-card > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #16a34a; color: #fff; font-size: 21px; }
.material-privacy-card strong { color: #166534; font-size: 13px; }
.material-privacy-card p { margin: 3px 0 0; color: #47735a; font-size: 11px; line-height: 1.45; }
.material-quiz-form { padding: 22px; border: 2px solid #e4dced; border-radius: 23px; background: #fff; box-shadow: 0 5px 0 #ddd5e6; }
.material-upload-callout { display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: center; gap: 12px; margin-bottom: 15px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg,#f5f3ff,#faf8ff); }
.material-upload-callout > span { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: #7c3aed; color: #fff; font-size: 21px; box-shadow: 0 3px 0 #5b21b6; }
.material-upload-callout strong { color: #4c1d95; font-size: 13px; }
.material-upload-callout p { margin: 3px 0 0; color: #786b82; font-size: 10px; line-height: 1.4; }
.material-analysis-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-bottom: 15px; }
.material-analysis-steps article { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px; border: 1px solid #e5ddef; border-radius: 14px; background: #fcfbff; }
.material-analysis-steps article > span { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: #ede9fe; color: #6d28d9; font-size: 8px; font-weight: 1000; }
.material-analysis-steps article > div { display: grid; gap: 2px; min-width: 0; }
.material-analysis-steps strong { color: #4c3c57; font-size: 9px; line-height: 1.2; }
.material-analysis-steps small { color: #87788f; font-size: 7px; line-height: 1.3; }
.material-form-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 13px; }
.material-capture-panel { position: relative; padding: 16px; border: 2px solid #dfd6e8; border-radius: 18px; background: linear-gradient(145deg,#fff,#faf8ff); }
.material-capture-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.material-capture-panel > header div { display: grid; gap: 3px; }
.material-capture-panel > header span { color: #7c3aed; font-size: 8px; font-weight: 1000; letter-spacing: .8px; }
.material-capture-panel > header strong { color: #463451; font-size: 13px; }
.material-capture-panel > header > b { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 9px; }
.material-capture-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.material-capture-actions > button { display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: center; gap: 11px; min-height: 68px; padding: 10px 12px; border-radius: 15px; font-family: Nunito,sans-serif; text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.material-capture-actions > button > span { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; font-size: 22px; }
.material-capture-actions > button > b { display: grid; gap: 2px; font-size: 12px; line-height: 1.2; }
.material-capture-actions > button small { font-size: 7px; font-weight: 1000; letter-spacing: .75px; }
.material-scan-button { border: 2px solid #6d28d9; background: linear-gradient(135deg,#7c3aed,#6d28d9); color: #fff; box-shadow: 0 4px 0 #4c1d95, 0 10px 20px rgba(91,33,182,.17); }
.material-scan-button > span { background: rgba(255,255,255,.17); }
.material-scan-button small { color: #e9ddff; }
.material-gallery-button { border: 2px solid #d9cdef; background: #fff; color: #5b3c75; box-shadow: 0 4px 0 #e6def0; }
.material-gallery-button > span { background: #f1ebff; color: #6d28d9; }
.material-gallery-button small { color: #8f79a4; }
.material-capture-actions > button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.03); }
.material-capture-actions > button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.material-capture-actions > button:focus-visible { outline: 3px solid rgba(124,58,237,.28); outline-offset: 3px; }
.material-capture-actions > button:disabled { opacity: .48; box-shadow: none; cursor: not-allowed; }
.material-native-input { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; overflow: hidden; border: 0 !important; opacity: 0; pointer-events: none; }
.material-capture-hint { display: block; margin-top: 11px; color: #80728a; font-size: 9px; line-height: 1.45; text-align: center; }
.material-form-grid label,
.material-text-label { display: grid; align-content: start; gap: 6px; color: #5f5269; font-size: 11px; font-weight: 900; }
.material-form-grid select,
.material-form-grid input,
.material-text-label textarea { width: 100%; min-height: 46px; padding: 10px 11px; border: 2px solid #dfd6e8; border-radius: 12px; background: #fbfaff; color: #3d2d49; font: 800 12px Nunito, sans-serif; outline: none; }
.material-form-grid input[type=file] { min-height: 52px; padding: 8px; }
.material-form-grid small,
.material-text-label small { color: #8d8294; font-size: 9px; line-height: 1.4; }
.material-image-preview { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 15px 0; }
.material-image-preview:empty { display: none; }
.material-image-preview article { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e5ddec; border-radius: 12px; background: #faf8fc; }
.material-image-preview img { width: 100%; height: 92px; object-fit: cover; }
.material-image-preview .material-remove-photo { position: absolute; z-index: 2; top: 5px; right: 5px; display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 2px solid rgba(255,255,255,.92); border-radius: 50%; background: rgba(76,29,149,.88); color: #fff; font: 1000 18px/1 Nunito,sans-serif; box-shadow: 0 3px 9px rgba(49,20,80,.26); cursor: pointer; backdrop-filter: blur(5px); }
.material-image-preview .material-remove-photo:hover { background: #be123c; transform: scale(1.06); }
.material-image-preview .material-remove-photo:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.material-image-preview .material-remove-photo:disabled { opacity: .45; cursor: not-allowed; }
.material-image-preview article div { padding: 7px; }
.material-image-preview strong,
.material-image-preview span { display: block; overflow: hidden; color: #51405d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.material-image-preview span { color: #93889b; }
.material-image-preview .material-page-confidence { display: inline-flex; width: auto; margin-top: 5px; padding: 3px 6px; border-radius: 999px; background: #eee9f5; color: #73647d; font-size: 7px; font-style: normal; font-weight: 1000; }
.material-image-preview .material-page-confidence.good { background: #dcfce7; color: #166534; }
.material-image-preview .material-page-confidence.warning { background: #fef3c7; color: #92400e; }
.material-image-preview .material-page-confidence.bad { background: #fee2e2; color: #991b1b; }
.material-reading-progress { margin: 15px 0; padding: 15px; border-radius: 15px; background: #f6f2ff; }
.material-reading-progress > div { display: flex; justify-content: space-between; gap: 12px; color: #5b21b6; font-size: 11px; }
.material-reading-progress i { display: block; height: 10px; margin: 9px 0; overflow: hidden; border-radius: 999px; background: #ddd6fe; }
.material-reading-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#8b5cf6,#6d28d9); transition: width .2s ease; }
.material-reading-progress p,
.material-status { margin: 4px 0 0; color: #71637b; font-size: 10px; }
.material-status.error { color: #b42335; font-weight: 900; }
.material-text-label { margin-top: 15px; }
.material-text-label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.material-text-label > span em { padding: 4px 7px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 7px; font-style: normal; letter-spacing: .5px; text-transform: uppercase; }
.material-text-label textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.material-confirm-wrap { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 12px; border: 2px solid #ddd6fe; border-radius: 14px; background: #f8f7ff; color: #4c3c57; cursor: pointer; }
.material-confirm-wrap[hidden] { display: none; }
.material-confirm-wrap input { width: 19px; height: 19px; accent-color: #7c3aed; }
.material-confirm-wrap span { display: grid; gap: 2px; }
.material-confirm-wrap strong { font-size: 11px; }
.material-confirm-wrap small { color: #81738a; font-size: 9px; }
.material-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.material-actions button { min-width: 160px; }
.material-summary-button { min-height: 46px; padding: 10px 15px; border: 2px solid #c4b5fd; border-radius: 13px; background: #f5f3ff; color: #6d28d9; font: 1000 11px Nunito, sans-serif; box-shadow: 0 3px 0 #ddd6fe; cursor: pointer; }
.material-summary-button:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.material-summary-panel { margin-top: 18px; overflow: hidden; border: 2px solid #d8b4fe; border-radius: 23px; background: #fff; box-shadow: 0 5px 0 #e9d5ff; }
.material-summary-panel[hidden] { display: none; }
.material-summary-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 19px 21px; background: linear-gradient(135deg,#4c1d95,#7c3aed); color: #fff; }
.material-summary-panel > header span { color: #ddd6fe; font-size: 8px; font-weight: 1000; letter-spacing: 1px; }
.material-summary-panel > header h3 { margin: 3px 0; color: #fff; font-size: 20px; }
.material-summary-panel > header p { margin: 0; color: #ede9fe; font-size: 9px; }
.material-summary-panel > header button { flex: 0 0 auto; min-height: 39px; padding: 8px 12px; border: 2px solid rgba(255,255,255,.65); border-radius: 11px; background: rgba(255,255,255,.14); color: #fff; font: 1000 10px Nunito,sans-serif; cursor: pointer; }
.material-summary-tools { display: flex; gap: 7px; }
.material-summary-content { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; padding: 20px; }
.material-summary-content section { padding: 15px; border: 1px solid #e7dff0; border-radius: 15px; background: #fbfaff; }
.material-summary-content h4 { margin: 0 0 9px; color: #5b21b6; font-size: 12px; }
.material-summary-content ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; color: #4c3c57; font-size: 10px; line-height: 1.55; }
.material-summary-content .material-summary-numbers { border-color: #fde68a; background: #fffbeb; }
.material-summary-content .material-summary-numbers h4 { color: #92400e; }
.material-summary-content .material-summary-overview { grid-column: 1 / -1; border-color: #c4b5fd; background: linear-gradient(135deg,#f5f3ff,#fff); }
.material-summary-content .material-summary-overview h4 { color: #4c1d95; font-size: 14px; }
.material-summary-content .material-summary-definitions { border-color: #bae6fd; background: #f0f9ff; }
.material-summary-content .material-summary-definitions h4 { color: #075985; }
.material-summary-content .material-summary-relations { border-color: #bbf7d0; background: #f0fdf4; }
.material-summary-content .material-summary-relations h4 { color: #166534; }
.material-summary-content .material-summary-keywords ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.material-summary-content .material-summary-keywords li { padding: 5px 8px; border-radius: 999px; background: #ede9fe; color: #5b21b6; font-weight: 900; }
.material-summary-content .material-summary-checklist { grid-column: 1 / -1; border-color: #fed7aa; background: #fff7ed; }
.material-summary-content .material-summary-checklist h4 { color: #9a3412; }
.material-summary-content .material-summary-checklist ul { list-style: none; padding: 0; }
.material-summary-content .material-summary-checklist li::before { content: '□'; margin-right: 8px; color: #ea580c; font-weight: 1000; }
.material-mind-map { margin: 0 20px 20px; overflow: hidden; border: 2px solid #ddd6fe; border-radius: 19px; background: linear-gradient(145deg,#fbfaff,#f6f2ff); }
.material-mind-map > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid #e7dff0; background: rgba(255,255,255,.72); }
.material-mind-map > header span { color: #7c3aed; font-size: 7px; font-weight: 1000; letter-spacing: .9px; }
.material-mind-map > header h3 { margin: 2px 0; color: #3b1768; font-size: 18px; }
.material-mind-map > header p { margin: 0; color: #75687e; font-size: 9px; }
.material-mind-map .material-mind-map-hint { padding: 6px 9px; border-radius: 999px; background: #ede9fe; white-space: nowrap; }
.material-mind-map-content { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 28px; align-items: center; padding: 22px; }
.material-mind-map-center { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; min-height: 120px; padding: 16px; border: 3px solid #a78bfa; border-radius: 50%; background: linear-gradient(145deg,#6d28d9,#8b5cf6); color: #fff; text-align: center; box-shadow: 0 7px 0 #4c1d95, 0 15px 30px rgba(76,29,149,.18); }
.material-mind-map-center::after { content: ''; position: absolute; left: 100%; top: 50%; width: 29px; height: 3px; background: #c4b5fd; }
.material-mind-map-center span { color: #ddd6fe; font-size: 7px; font-weight: 1000; letter-spacing: .8px; }
.material-mind-map-center strong { max-width: 110px; margin-top: 4px; font-size: 15px; line-height: 1.15; }
.material-mind-map-branches { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.material-mind-map-branches article { position: relative; min-width: 0; border: 2px solid var(--map-color,#c4b5fd); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 color-mix(in srgb,var(--map-color,#c4b5fd) 45%,#fff); }
.material-mind-map-branches article::before { content: ''; position: absolute; right: 100%; top: 24px; width: 16px; height: 2px; background: var(--map-color,#c4b5fd); }
.material-mind-map-branches article[data-tone="1"] { --map-color:#a78bfa; }.material-mind-map-branches article[data-tone="2"] { --map-color:#60a5fa; }.material-mind-map-branches article[data-tone="3"] { --map-color:#34d399; }.material-mind-map-branches article[data-tone="4"] { --map-color:#fbbf24; }.material-mind-map-branches article[data-tone="5"] { --map-color:#fb7185; }.material-mind-map-branches article[data-tone="6"] { --map-color:#22d3ee; }
.material-mind-map-branches button { display: grid; grid-template-columns: 25px minmax(0,1fr) 20px; align-items: center; gap: 7px; width: 100%; min-height: 47px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: #42324e; text-align: left; cursor: pointer; }
.material-mind-map-branches button span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: color-mix(in srgb,var(--map-color) 22%,#fff); color: #453152; font-size: 8px; font-weight: 1000; }
.material-mind-map-branches button strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
.material-mind-map-branches button i { color: #7b6c85; font-size: 15px; font-style: normal; font-weight: 900; text-align: center; }
.material-mind-map-details { padding: 0 11px 11px 42px; }
.material-mind-map-details[hidden] { display: none; }
.material-mind-map-details ul { display: grid; gap: 6px; margin: 0; padding-left: 13px; color: #6f6278; font-size: 8px; line-height: 1.45; }
.material-summary-panel > footer { padding: 12px 20px; border-top: 1px solid #eee7f4; background: #faf8fc; color: #74667d; font-size: 9px; }
.material-photo-tips { margin-top: 16px; padding: 17px 19px; border: 2px dashed #d8cee4; border-radius: 17px; background: #fbfafd; }
.material-photo-tips strong { color: #4c3c57; font-size: 13px; }
.material-photo-tips ul { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 19px; color: #75687e; font-size: 11px; }
.admin-whatsapp-card { display: grid; gap: 10px; margin: 14px 0; padding: 14px; border: 2px solid #bbf7d0; border-radius: 15px; background: #f0fdf4; }
.admin-whatsapp-card span { color: #15803d; font-size: 8px; font-weight: 1000; letter-spacing: .8px; }
.admin-whatsapp-card strong { display: block; margin-top: 2px; color: #14532d; font-size: 15px; }
.admin-whatsapp-card small { display: block; color: #4f765c; font-size: 9px; }
.admin-whatsapp-card label { color: #315d40; }
.admin-whatsapp-card textarea { width: 100%; min-height: 90px; background: #fff; }
.admin-whatsapp-card button { min-height: 42px; border: 0; border-radius: 12px; background: #16a34a; color: #fff; font: 1000 11px Nunito, sans-serif; box-shadow: 0 3px 0 #116b32; cursor: pointer; }
.admin-whatsapp-card button:disabled { background: #b6c9bc; box-shadow: none; cursor: not-allowed; }

@media (max-width: 700px) {
  .material-header { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: flex-start; }
  .material-header > .icon-button { grid-column: 1; grid-row: 1; }
  .material-header > div { grid-column: 2; grid-row: 1; }
  .material-plan-badge { grid-column: 2; grid-row: 2; justify-self: center; margin-top: 9px; }
  .material-analysis-steps { grid-template-columns: 1fr; }
  .material-form-grid { grid-template-columns: 1fr; }
  .material-capture-panel { padding: 14px; }
  .material-capture-actions > button { min-height: 72px; padding: 10px; }
  .material-image-preview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-actions { flex-direction: column; }
  .material-actions button { width: 100%; min-width: 0; }
  .material-summary-panel > header { align-items: flex-start; flex-direction: column; }
  .material-summary-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .material-summary-panel > header button { width: 100%; }
  .material-summary-content { grid-template-columns: 1fr; padding: 13px; }
  .material-mind-map { margin: 0 13px 13px; }
  .material-mind-map > header { align-items: flex-start; flex-direction: column; }
  .material-mind-map-content { grid-template-columns: 1fr; gap: 24px; padding: 16px; }
  .material-mind-map-center { width: 132px; min-height: 132px; justify-self: center; }
  .material-mind-map-center::after { left: 50%; top: 100%; width: 3px; height: 25px; }
  .material-mind-map-branches { grid-template-columns: 1fr; }
  .material-mind-map-branches article::before { right: auto; left: 20px; top: -11px; width: 2px; height: 10px; }
}

@media (max-width: 520px) {
  .material-capture-panel > header { align-items: flex-start; }
  .material-capture-panel > header > b { margin-top: 1px; }
  .material-capture-actions { grid-template-columns: 1fr; }
  .material-capture-actions > button { min-height: 67px; }
}

.disconnect-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 13px !important; border: 2px solid #fecaca !important; border-radius: 12px !important; background: #fff1f2 !important; color: #b42335 !important; font-weight: 1000 !important; box-shadow: 0 3px 0 #fecaca !important; cursor: pointer; }
.disconnect-button:hover { background: #ffe4e6 !important; transform: translateY(-1px); }
.disconnect-button:focus-visible { outline: 3px solid rgba(239,68,68,.28); outline-offset: 2px; }

/* Tipografia unificada: mensagens em destaque, com leitura confortável em qualquer tela. */
:root {
  --type-kicker: clamp(.72rem, 1.55vw, .84rem);
  --type-meta: clamp(.78rem, 1.75vw, .9rem);
  --type-body: clamp(.95rem, 2vw, 1.06rem);
  --type-title: clamp(1.28rem, 2.8vw, 1.58rem);
  --type-display: clamp(1.9rem, 4.7vw, 2.45rem);
}

body { font-size: var(--type-body); line-height: 1.5; }

/* Chamadas, títulos e instruções principais. */
.auth-card,
.subject-welcome,
.journey-intro,
.result-screen,
.subject-year-card > div:first-child,
.study-brief > div,
.dashboard-header > div,
.tutorial-copy,
.avatar-studio-heading > div:first-child,
.avatar-preview-stage,
.app-announcement > div,
.admin-access-card > div:first-child,
.guardian-chat-card > div:nth-child(2),
.friend-code-card > div:first-child,
.material-privacy-card > div,
.material-upload-callout > div,
.material-summary-panel > header > div:first-child,
.material-mind-map > header > div:first-child,
.chat-safety-action > div { text-align: center; }

.auth-card > .eyebrow,
.subject-welcome .eyebrow,
.study-brief .eyebrow,
.journey-intro .unit-label,
.dashboard-header .eyebrow,
.tutorial-heading .eyebrow,
.avatar-studio-heading .eyebrow,
.subject-year-card > div:first-child > span,
.material-summary-panel > header span,
.material-mind-map > header span,
.admin-section-heading span,
.admin-announcement-form > span {
  display: block;
  font-size: var(--type-kicker) !important;
  line-height: 1.25;
  letter-spacing: .08em;
}

.auth-card h2,
.subject-welcome h2,
.journey-intro h2,
.study-brief .creator-title,
.dashboard-header h2 {
  font-size: var(--type-display) !important;
  line-height: 1.08 !important;
}

.tutorial-copy h2,
.avatar-studio-heading h2,
.material-summary-panel > header h3,
.material-mind-map > header h3,
.admin-section-heading h3,
.admin-announcement-form h3 {
  font-size: var(--type-title) !important;
  line-height: 1.18 !important;
}

.auth-card .subtitle,
.subject-welcome .subtitle,
.journey-intro p,
.study-brief .subtitle,
.school-year-hint,
.curriculum-hint,
.question-bank-promise,
.app-announcement p,
.guardian-chat-card p,
.friend-code-card p,
.add-friend-card p,
.shared-question-banner p,
.chat-safety-card p,
.material-privacy-card p,
.material-upload-callout p,
.material-summary-panel > header p,
.material-mind-map > header p,
.material-summary-panel > footer,
.tutorial-copy > p,
.avatar-studio-heading p,
.avatar-choice-note,
.admin-access-card p,
.friends-screen > .subtitle,
.review-screen > .subtitle,
.admin-screen > .subtitle {
  font-size: var(--type-body) !important;
  line-height: 1.55 !important;
}

/* Orientações e retornos do sistema ficam centralizados e fáceis de localizar. */
.topic-examples,
.question-bank-promise,
.feedback,
.achievement-toast,
.friends-notice,
.admin-notice,
.chat-status,
.material-status,
.profile-data-status,
.avatar-studio-status,
.modal-error,
.empty-review,
.review-item-card.empty { text-align: center; }

.topic-examples,
.question-bank-promise,
.feedback,
.achievement-toast { justify-content: center; justify-items: center; }

.topic-examples > span { font-size: var(--type-meta) !important; text-align: center; }
.school-year-hint::before { display: inline-block; float: none; margin: 0 7px 0 0; }
.school-year-hint,
.curriculum-hint { text-align: center; }
.question-bank-promise { font-size: var(--type-meta) !important; line-height: 1.5; }

.feedback > strong { font-size: var(--type-title) !important; line-height: 1.18; }
.option-correction,
.explanation-extra { text-align: center; font-size: var(--type-body) !important; line-height: 1.55; }
.feedback-actions { justify-content: center; }
.question-source { display: block; margin-inline: auto; text-align: center; font-size: var(--type-meta) !important; }
.achievement-toast { font-size: var(--type-body) !important; line-height: 1.5; }
.friends-notice,
.admin-notice,
.chat-status,
.material-status,
.profile-data-status,
.avatar-studio-status { font-size: var(--type-meta) !important; line-height: 1.45; }

/* Blocos de evolução e avisos: conteúdo central, ações ainda fáceis de alcançar. */
.profile-card > div:nth-child(2),
.focus-card > div,
.review-highlight > div,
.dashboard-stats article,
.admin-stats article,
.admin-section-heading > div:first-child,
.material-photo-tips > strong,
.material-photo-tips > p,
.material-reading-progress > p { text-align: center; }

.dashboard-stats article,
.admin-stats article { justify-items: center; }
.profile-card > div:nth-child(2) span,
.dashboard-stats article small,
.admin-stats article small { font-size: var(--type-meta) !important; line-height: 1.35; }
.focus-card p,
.review-highlight > div > small { font-size: var(--type-meta) !important; line-height: 1.45; }
.material-photo-tips > strong { display: block; font-size: var(--type-body) !important; }
.material-reading-progress > p,
.material-summary-panel > footer { text-align: center; }

/* Tutorial e avatar: a mensagem ocupa o centro visual, sem perder os controles. */
.tutorial-heading > div,
.tutorial-actions,
.avatar-choice-note,
.avatar-gender-card p { text-align: center; }
.tutorial-copy ul { justify-items: center; }
.tutorial-copy li { display: grid; justify-items: center; padding-left: 0 !important; text-align: center; font-size: var(--type-meta) !important; }
.tutorial-copy li::before { position: static; margin-bottom: 3px; }
.avatar-choice-note,
.avatar-gender-card p { font-size: var(--type-meta) !important; line-height: 1.5; }

/* Campos, alternativas e dados ficam alinhados para leitura e preenchimento precisos. */
.form-grid label,
.material-form-grid label,
.material-text-label,
.profile-data-form label,
.modal-form label,
.admin-announcement-form label,
.admin-whatsapp-card label,
.answer,
.material-summary-content,
.material-mind-map-branches button,
.chat-messages,
.chat-form textarea,
.admin-table-wrap,
.admin-user-filters { text-align: left; }

@media (max-width: 600px) {
  .auth-card h2,
  .subject-welcome h2,
  .journey-intro h2,
  .study-brief .creator-title,
  .dashboard-header h2 { font-size: clamp(1.72rem, 8.3vw, 2.08rem) !important; }

  .tutorial-copy h2,
  .avatar-studio-heading h2 { font-size: clamp(1.4rem, 6.8vw, 1.72rem) !important; }
}

@media (max-width: 900px) {
  .profile-data-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-data-summary article:last-child { grid-column: 1 / -1; }
  .admin-access-card { align-items: flex-start; flex-direction: column; }
  .admin-access-actions { width: 100%; }
  .admin-access-actions button { flex: 1; }
}

@media (max-width: 600px) {
  .profile-data-card { padding: 14px; border-radius: 18px; }
  .profile-data-card > header { align-items: flex-start; flex-direction: column; }
  #edit-profile-data { width: 100%; }
  .profile-data-summary { grid-template-columns: 1fr; }
  .profile-data-summary article:last-child { grid-column: auto; }
  .profile-data-form { padding: 12px; }
  .profile-data-form-grid,
  #profile-password-form { grid-template-columns: 1fr; }
  .profile-security-block { grid-template-columns: 1fr; }
  .profile-security-block > button { width: 100%; }
  .profile-data-actions { display: grid; grid-template-columns: 1fr 1.35fr; }
  .profile-data-actions button { width: 100%; padding-inline: 8px; }
  .chat-form { grid-template-columns: minmax(0, 1fr) 48px; padding: 7px 9px max(10px, env(safe-area-inset-bottom)); }
  .chat-form textarea { min-height: 104px; max-height: 180px; padding: 11px 12px; font-size: 14px; resize: none; }
  .chat-form button { width: 48px; height: 48px; border-radius: 14px; }
  .quick-replies { gap: 4px; padding: 5px 9px 2px; }
  .quick-replies button { min-height: 25px; padding: 3px 7px; font-size: 8px; }
}

/* Compositor do chat: campo amplo e atalhos discretos em qualquer tela. */
.chat-panel { grid-template-rows: auto auto minmax(180px, 1fr) auto auto auto !important; }
.quick-replies {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  min-height: 34px !important;
  max-height: 38px !important;
  padding: 4px 11px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border-top: 1px solid #eee8f3;
  background: #fff !important;
  scrollbar-width: none;
}
.quick-replies::-webkit-scrollbar { display: none; }
.quick-replies::before { content: 'Atalhos'; flex: none; color: #a39aa9; font-size: 8px; font-weight: 900; letter-spacing: .45px; text-transform: uppercase; }
.quick-replies button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  padding: 3px 8px !important;
  border: 1px solid #e4ddec !important;
  border-radius: 999px !important;
  background: #fbfafd !important;
  color: #81758c !important;
  font: 800 8px/1 Nunito, sans-serif !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  opacity: .82;
}
.quick-replies button:hover,
.quick-replies button:focus-visible { border-color: #c4b5fd !important; background: #f5f1ff !important; color: #6d28d9 !important; opacity: 1; }
.chat-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 52px !important;
  grid-template-rows: auto !important;
  align-items: end !important;
  gap: 9px !important;
  min-width: 0 !important;
  min-height: 146px !important;
  padding: 9px 11px 12px !important;
  border-top: 1px solid #f1ecf5;
  background: #fff !important;
}
.chat-form > .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.chat-form > textarea {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 124px !important;
  max-height: 210px !important;
  margin: 0 !important;
  resize: vertical !important;
}
.chat-form > button[type="submit"] { grid-column: 2 !important; grid-row: 1 !important; align-self: end !important; width: 52px !important; height: 52px !important; min-height: 52px !important; margin: 0 !important; }

@media (max-width: 600px) {
  .chat-panel { grid-template-rows: auto auto minmax(150px, 1fr) auto auto auto !important; }
  .quick-replies { min-height: 32px !important; max-height: 35px !important; padding-inline: 8px !important; }
  .quick-replies::before { content: 'Sugestões'; }
  .chat-form { grid-template-columns: minmax(0, 1fr) 48px !important; min-height: 132px !important; padding: 8px 9px max(10px, env(safe-area-inset-bottom)) !important; }
  .chat-form > textarea { min-height: 110px !important; max-height: 160px !important; resize: none !important; }
  .chat-form > button[type="submit"] { width: 48px !important; height: 48px !important; min-height: 48px !important; }
}

/* Nova entrada Estuda+: inspirada no layout de apresentação enviado pelo usuário. */
body[data-screen="auth-screen"],
body:has(#auth-screen.active) { background: #f8f5ff !important; }
body[data-screen="auth-screen"] .app-shell,
body:has(#auth-screen.active) .app-shell {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
  overflow: visible !important;
  background: #f8f5ff !important;
  box-shadow: none !important;
}
body[data-screen="auth-screen"] .hero-panel,
body:has(#auth-screen.active) .hero-panel { display: none !important; }
body[data-screen="auth-screen"] .content-panel,
body:has(#auth-screen.active) .content-panel {
  width: 100% !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  background:
    radial-gradient(circle at 85% 12%, rgba(196, 181, 253, .28), transparent 25rem),
    radial-gradient(circle at 12% 88%, rgba(233, 213, 255, .42), transparent 27rem),
    #fbfaff !important;
}
.auth-screen.active {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
  margin: 0 !important;
}
.auth-screen:not(.active) { display: none !important; }

.landing-home {
  position: relative;
  isolation: isolate;
  width: min(100%, 1420px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 25px clamp(24px, 5vw, 76px) 34px;
  overflow: hidden;
}
.landing-home::before,
.landing-home::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.landing-home::before { width: 520px; height: 520px; right: -250px; top: 75px; border: 1px solid rgba(124, 58, 237, .11); }
.landing-home::after { width: 360px; height: 360px; left: -250px; bottom: -155px; background: rgba(237, 233, 254, .62); }

.landing-header {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 66px;
  padding: 8px 0 15px;
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: #2d203b;
  text-decoration: none;
}
.landing-brand > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #e0d5fb;
  border-radius: 18px;
  background: linear-gradient(145deg, #fdfcff, #eee9ff);
  font-size: 28px;
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #e7def8, 0 12px 24px rgba(76, 29, 149, .08);
}
.landing-brand strong { display: inline-flex; align-items: baseline; gap: 1px; color: #17121f; font: 1000 23px/1 Nunito, sans-serif; letter-spacing: -.8px; }
.landing-brand strong b { color: #17121f; font: inherit; }
.landing-brand em { color: #7c3aed; font: 1000 28px/.75 Nunito, sans-serif; font-style: normal; transform: translateY(-3px); text-shadow: 0 7px 16px rgba(124,58,237,.24); }
.landing-navigation { display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid rgba(229, 222, 238, .85); border-radius: 999px; background: rgba(255,255,255,.76); box-shadow: 0 8px 24px rgba(76,29,149,.05); backdrop-filter: blur(12px); }
.landing-navigation button,
.landing-login-button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #62566f;
  font-size: 12px;
  font-weight: 900;
}
.landing-navigation button:hover,
.landing-navigation button:focus-visible,
.landing-login-button:hover,
.landing-login-button:focus-visible { background: #f2edff; color: #6d28d9; }
.landing-account-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.landing-register-button,
.landing-primary-action {
  min-height: 45px;
  padding: 10px 19px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-weight: 1000;
  box-shadow: 0 4px 0 #4c1d95, 0 12px 24px rgba(109,40,217,.18);
}
.landing-register-button:hover,
.landing-primary-action:hover { transform: translateY(-1px); background: linear-gradient(135deg, #7c3aed, #5b21b6); box-shadow: 0 5px 0 #4c1d95, 0 15px 27px rgba(109,40,217,.22); }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  min-height: clamp(480px, 64dvh, 660px);
  padding: clamp(45px, 7vh, 85px) 0 clamp(32px, 5vh, 55px);
}
.landing-copy { position: relative; z-index: 3; max-width: 690px; text-align: left; }
.landing-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 11px;
  border: 1px solid #d8caf4;
  border-radius: 999px;
  background: #f4efff;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1px;
}
.landing-copy h1 {
  max-width: 690px;
  margin: 19px 0 20px;
  color: #241b35;
  font-family: "Space Grotesk", Nunito, sans-serif;
  font-size: clamp(44px, 5.15vw, 73px);
  font-weight: 700;
  line-height: .99;
  letter-spacing: clamp(-3.2px, -.25vw, -1.5px);
}
.landing-copy h1 em { display: block; color: #7c3aed; font-style: normal; }
.landing-copy h1:focus { outline: none; }
.landing-copy h1:focus-visible { outline: 3px solid rgba(124,58,237,.32); outline-offset: 7px; border-radius: 8px; }
.landing-copy > p { max-width: 590px; margin: 0; color: #6d6278; font-size: clamp(15px, 1.55vw, 19px); line-height: 1.6; }
.landing-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-top: 30px; }
.landing-primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 54px; padding-inline: 23px; font-size: 14px; }
.landing-primary-action span { font-size: 21px; }
.landing-secondary-action { min-height: 52px; padding: 10px 18px; border: 2px solid #dfd6ea; border-radius: 14px; background: rgba(255,255,255,.76); color: #5b4d68; font-size: 13px; font-weight: 1000; box-shadow: 0 3px 0 #e4ddeb; }
.landing-secondary-action:hover { border-color: #c4b5fd; background: #fff; color: #6d28d9; }
.landing-trust-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 27px; color: #73667e; font-size: 11px; font-weight: 900; }
.landing-trust-row span::first-letter { color: #7c3aed; }

.landing-mascot-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 450px;
  padding-bottom: 55px;
}
.landing-glow {
  position: absolute;
  width: min(91%, 470px);
  aspect-ratio: 1;
  border-radius: 48% 52% 43% 57%;
  background:
    radial-gradient(circle at 48% 42%, rgba(255,255,255,.96) 0 18%, transparent 19%),
    linear-gradient(145deg, rgba(237,233,254,.95), rgba(216,180,254,.64));
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.24), 0 32px 70px rgba(91,33,182,.13);
  transform: rotate(-8deg);
}
.landing-glow::before,
.landing-glow::after { content: "✦"; position: absolute; color: #9f7aea; font-size: 27px; animation: twinkle 2.6s ease-in-out infinite; }
.landing-glow::before { left: 6%; top: 28%; }
.landing-glow::after { right: 12%; bottom: 18%; animation-delay: .8s; }
.landing-owl {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(215px, 22vw, 310px);
  height: clamp(225px, 23vw, 325px);
  border: 6px solid rgba(255,255,255,.84);
  border-radius: 42% 42% 47% 47%;
  background: linear-gradient(145deg, #fff, #f0eaff 62%, #ddd6fe);
  font-size: clamp(132px, 15vw, 205px);
  line-height: 1;
  filter: drop-shadow(0 21px 18px rgba(61, 31, 105, .18));
  animation: landing-owl-float 4.5s ease-in-out infinite;
}
.landing-decoration { position: absolute; z-index: 4; display: grid; place-items: center; filter: drop-shadow(0 9px 10px rgba(76,29,149,.16)); }
.landing-trophy { left: 4%; top: 14%; font-size: 57px; transform: rotate(-10deg); }
.landing-medal { right: 4%; top: 9%; font-size: 68px; transform: rotate(12deg); }
.landing-book { left: 8%; bottom: 22%; font-size: 57px; transform: rotate(-15deg); }
.landing-star { right: 8%; bottom: 25%; color: #f4c430; font-size: 54px; transform: rotate(12deg); }
.landing-level-card {
  position: absolute;
  z-index: 5;
  right: 3%;
  bottom: 5px;
  display: grid;
  gap: 3px;
  width: min(78%, 255px);
  padding: 13px 15px;
  border: 1px solid #e5ddec;
  border-radius: 16px;
  background: rgba(255,255,255,.93);
  text-align: left;
  box-shadow: 0 10px 28px rgba(76,29,149,.12);
  backdrop-filter: blur(12px);
}
.landing-level-card span { color: #8b5cf6; font-size: 8px; font-weight: 1000; letter-spacing: .9px; }
.landing-level-card strong { color: #3b2c48; font-size: 12px; }
.landing-level-card i { height: 7px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #eee9f4; }
.landing-level-card i b { display: block; width: 72%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a78bfa,#6d28d9); }

.landing-benefits {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e5ddec;
  border-radius: 22px;
  background: #e9e2f0;
  box-shadow: 0 14px 38px rgba(76,29,149,.09);
}
.landing-benefits article { display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: center; gap: 12px; min-height: 96px; padding: 18px; background: rgba(255,255,255,.97); }
.landing-benefits article > span { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; background: #f1ebff; color: #7c3aed; font-size: 22px; font-weight: 1000; }
.landing-benefits article div { display: grid; gap: 3px; text-align: left; }
.landing-benefits strong { color: #382a45; font-size: 13px; line-height: 1.2; }
.landing-benefits small { color: #81758b; font-size: 10px; line-height: 1.35; }

.landing-auth-shell {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  width: 100%;
  min-height: 100dvh;
  padding: 30px 20px;
  background:
    radial-gradient(circle at 18% 18%, rgba(216,180,254,.38), transparent 22rem),
    radial-gradient(circle at 82% 82%, rgba(196,181,253,.3), transparent 25rem),
    #faf8ff;
}
.landing-auth-back { width: min(100%, 560px); min-height: 42px; padding: 8px 3px; border: 0; background: transparent; color: #6d28d9; text-align: left; font-size: 12px; font-weight: 1000; }
.landing-auth-back:hover { color: #4c1d95; transform: translateX(-2px); }
.landing-auth-shell .auth-card { width: min(100%, 560px) !important; padding: clamp(24px, 4vw, 38px) !important; border: 1px solid #e4dced !important; border-radius: 28px !important; background: rgba(255,255,255,.97) !important; box-shadow: 0 26px 70px rgba(76,29,149,.14) !important; }
body[data-screen="auth-screen"] .landing-auth-shell .auth-card::before,
body:has(#auth-screen.active) .landing-auth-shell .auth-card::before { display: none !important; content: none !important; }

@keyframes landing-owl-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }

@media (max-width: 1050px) {
  .landing-header { grid-template-columns: minmax(155px,1fr) auto; }
  .landing-navigation { display: none; }
  .landing-hero { grid-template-columns: minmax(0,1fr) minmax(340px,.82fr); gap: 24px; }
  .landing-copy h1 { font-size: clamp(43px, 6.3vw, 63px); }
  .landing-benefits { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; }
}

@media (max-width: 760px) {
  .landing-home { padding: 15px 17px 25px; }
  .landing-header { grid-template-columns: minmax(0,1fr) auto; gap: 10px; min-height: 62px; }
  .landing-brand { gap: 7px; }
  .landing-brand > span { width: 41px; height: 41px; border-radius: 14px; font-size: 23px; }
  .landing-brand strong { font-size: 20px; }
  .landing-brand em { font-size: 25px; }
  .landing-account-actions { gap: 3px; }
  .landing-login-button { min-height: 38px; padding-inline: 10px; font-size: 11px; }
  .landing-register-button { min-height: 40px; padding: 8px 13px; border-radius: 12px; font-size: 11px; }
  .landing-hero { grid-template-columns: 1fr; gap: 18px; min-height: auto; padding: 43px 0 27px; }
  .landing-copy { max-width: 620px; margin-inline: auto; text-align: center; }
  .landing-copy h1 { max-width: 620px; margin: 15px auto 16px; font-size: clamp(38px, 11.8vw, 54px); line-height: 1.02; letter-spacing: -2px; }
  .landing-copy > p { margin-inline: auto; font-size: 15px; line-height: 1.55; }
  .landing-hero-actions,
  .landing-trust-row { justify-content: center; }
  .landing-hero-actions { margin-top: 23px; }
  .landing-primary-action { min-height: 51px; }
  .landing-mascot-stage { min-height: 355px; padding-bottom: 46px; }
  .landing-glow { width: min(88%, 360px); }
  .landing-owl { width: 210px; height: 220px; font-size: 128px; }
  .landing-trophy { left: 9%; top: 14%; font-size: 43px; }
  .landing-medal { right: 8%; top: 9%; font-size: 50px; }
  .landing-book { left: 11%; bottom: 21%; font-size: 43px; }
  .landing-star { right: 10%; bottom: 24%; font-size: 42px; }
  .landing-level-card { right: 6%; width: min(68%, 230px); }
  .landing-benefits article { min-height: 88px; padding: 14px; }
  .landing-auth-shell { align-content: start; padding: 18px 14px 30px; }
  .landing-auth-back { margin-top: 3px; }
  .landing-auth-shell .auth-card { padding: 25px 20px !important; border-radius: 23px !important; }
}

@media (max-width: 430px) {
  .landing-login-button { display: none; }
  .landing-copy h1 { font-size: clamp(35px, 10.5vw, 45px); }
  .landing-copy h1 em { display: inline; }
  .landing-secondary-action { width: 100%; }
  .landing-primary-action { width: 100%; }
  .landing-trust-row { display: grid; grid-template-columns: 1fr 1fr; font-size: 10px; }
  .landing-trust-row span:last-child { grid-column: 1 / -1; }
  .landing-mascot-stage { min-height: 325px; }
  .landing-owl { width: 184px; height: 194px; font-size: 112px; }
  .landing-trophy { left: 6%; }
  .landing-medal { right: 4%; }
  .landing-book { left: 7%; }
  .landing-star { right: 7%; }
  .landing-benefits { grid-template-columns: 1fr; border-radius: 18px; }
  .landing-benefits article { min-height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-owl,
  .landing-glow::before,
  .landing-glow::after { animation: none !important; }
}

/* Mascote lateral interativo */
.hero-panel .side-mascot-interactive {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: visible;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  isolation: isolate;
}
.hero-panel .side-mascot-interactive::before {
  content: "TOQUE EM MIM";
  position: absolute;
  z-index: 7;
  top: 0;
  left: 50%;
  padding: 5px 9px;
  border: 1px solid #ddd2f6;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #6d28d9;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .75px;
  line-height: 1;
  box-shadow: 0 5px 13px rgba(76, 29, 149, .12);
  transform: translateX(-50%);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.hero-panel .side-mascot-interactive::after {
  z-index: 3;
  transition: filter .2s ease, box-shadow .2s ease;
}
.hero-panel .side-mascot-interactive:hover::after {
  filter: drop-shadow(0 10px 8px rgba(91, 33, 182, .24)) brightness(1.04) !important;
}
.hero-panel .side-mascot-interactive:focus { outline: none; }
.hero-panel .side-mascot-interactive:focus-visible::after {
  box-shadow: inset 0 -8px 0 rgba(91, 33, 182, .09), 0 0 0 5px #fff, 0 0 0 9px #8b5cf6, 0 14px 30px rgba(91, 33, 182, .24);
}
.hero-panel .side-mascot-interactive.is-reacting::before {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}
.side-mascot-wing {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  width: 49px;
  height: 61px;
  border: 3px solid rgba(255, 255, 255, .9);
  background: linear-gradient(145deg, #8b5e4a, #c99170);
  opacity: 0;
  pointer-events: none;
}
.side-mascot-wing::after {
  content: "";
  position: absolute;
  inset: 12px 8px;
  border: 3px solid rgba(255, 232, 214, .5);
  border-top-color: transparent;
  border-radius: 50%;
}
.side-mascot-wing.wing-left {
  left: calc(50% - 76px);
  border-radius: 85% 30% 70% 42%;
  transform: rotate(18deg) scale(.6);
  transform-origin: 90% 75%;
}
.side-mascot-wing.wing-right {
  right: calc(50% - 76px);
  border-radius: 30% 85% 42% 70%;
  transform: rotate(-18deg) scale(.6);
  transform-origin: 10% 75%;
}
.side-mascot-speech {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 111px;
  width: max-content;
  max-width: 225px;
  padding: 10px 13px;
  border: 2px solid #d8ccf4;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  color: #3f2a56;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 10px 26px rgba(76, 29, 149, .18);
  transform: translateX(-50%);
  pointer-events: none;
}
.side-mascot-speech::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 13px;
  height: 13px;
  border-right: 2px solid #d8ccf4;
  border-bottom: 2px solid #d8ccf4;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}
.side-mascot-speech[hidden] { display: none !important; }
.side-mascot-interactive.is-reacting .side-mascot-speech { animation: side-mascot-speech-in .28s cubic-bezier(.2, .9, .3, 1.25) both; }
.side-mascot-effects {
  position: absolute;
  z-index: 8;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.side-mascot-effects i {
  --effect-x: 0px;
  position: absolute;
  left: 50%;
  bottom: 47px;
  display: block;
  font-size: 23px;
  font-style: normal;
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 3px 3px rgba(76, 29, 149, .15));
  animation: side-mascot-particle 1.45s calc(var(--effect-index) * .12s) ease-out both;
}
.side-mascot-effects i:nth-child(1) { --effect-x: -72px; }
.side-mascot-effects i:nth-child(2) { --effect-x: 0px; }
.side-mascot-effects i:nth-child(3) { --effect-x: 72px; }
.hero-panel .side-mascot-interactive.is-reacting::after { animation: side-mascot-hop .72s ease-in-out 2 !important; }
.hero-panel .side-mascot-interactive.reaction-kiss::after { animation-name: side-mascot-kiss !important; }
.hero-panel .side-mascot-interactive.reaction-dance::after { animation: side-mascot-dance .42s ease-in-out 4 !important; }
.hero-panel .side-mascot-interactive.reaction-high-five::after { animation-name: side-mascot-high-five !important; }
.side-mascot-interactive.reaction-wings .side-mascot-wing { opacity: 1; }
.side-mascot-interactive.reaction-wings .wing-left { animation: side-mascot-left-wing .42s ease-in-out 4; }
.side-mascot-interactive.reaction-wings .wing-right { animation: side-mascot-right-wing .42s ease-in-out 4; }

@keyframes side-mascot-speech-in {
  from { opacity: 0; transform: translateX(-50%) translateY(9px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes side-mascot-particle {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(.45) rotate(-8deg); }
  18% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--effect-x)), -92px) scale(1.15) rotate(10deg); }
}
@keyframes side-mascot-hop {
  0%, 100% { transform: translateX(50%) translateY(0) rotate(-1deg); }
  45% { transform: translateX(50%) translateY(-14px) rotate(2deg) scale(1.04); }
}
@keyframes side-mascot-kiss {
  0%, 100% { transform: translateX(50%) rotate(0); }
  45% { transform: translateX(50%) rotate(-9deg) scale(1.06); }
}
@keyframes side-mascot-dance {
  0%, 100% { transform: translateX(50%) rotate(-7deg) translateY(0); }
  50% { transform: translateX(50%) rotate(7deg) translateY(-7px); }
}
@keyframes side-mascot-high-five {
  0%, 100% { transform: translateX(50%) translateY(0) scale(1); }
  48% { transform: translateX(50%) translateY(-18px) scale(1.08); }
}
@keyframes side-mascot-left-wing {
  0%, 100% { transform: rotate(18deg) scale(.7); }
  50% { transform: rotate(-43deg) translate(-8px, -9px) scale(1); }
}
@keyframes side-mascot-right-wing {
  0%, 100% { transform: rotate(-18deg) scale(.7); }
  50% { transform: rotate(43deg) translate(8px, -9px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel .side-mascot-interactive::after,
  .side-mascot-interactive .side-mascot-wing,
  .side-mascot-interactive .side-mascot-effects i,
  .side-mascot-interactive .side-mascot-speech { animation: none !important; }
  .side-mascot-interactive .side-mascot-effects i { opacity: 1; }
}
