:root {
  --bg1: #f1eadc;
  --bg2: #fbfaf6;
  --bg3: #edf3f1;
  --panel: #ffffff;
  --text: #14283a;
  --muted: #526472;
  --primary: #173d52;
  --primary-dark: #0d2c3d;
  --secondary: #fff0e9;
  --secondary-text: #a8321b;
  --green: #166534;
  --red: #b91c1c;
  --amber: #92400e;
  --card: #ffffff;
  --line: rgba(56, 66, 124, 0.16);
  --shadow: 0 18px 50px rgba(32, 41, 85, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); }
body { background: radial-gradient(circle at 80% -20%, #f4eadb 0%, #fbfaf6 45%, #eef3f1 100%); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
.hidden { display: none !important; }

.landing, .student-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.home-card, .join-card, .wait-card { width: min(680px, 100%); background: var(--panel); border-radius: 28px; padding: 36px; box-shadow: var(--shadow); text-align: center; }
.home-card h1, .join-card h1, .wait-card h1 { font-size: clamp(2rem, 6vw, 4rem); line-height: 1.03; margin: 18px 0 14px; letter-spacing: -0.04em; }
.home-card p, .wait-card p { color: var(--muted); font-size: 1.1rem; }
.brand-pill { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border-radius: 999px; background: var(--secondary); color: var(--secondary-text); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.home-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; padding: 14px 20px; font-weight: 850; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.primary-btn { background: var(--primary); color: white; box-shadow: 0 10px 22px rgba(15, 118, 110, .25); }
.primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled), .ghost-btn:hover:not(:disabled), .danger-btn:hover:not(:disabled) { transform: translateY(-1px); }
.secondary-btn { background: var(--secondary); color: var(--secondary-text); }
.ghost-btn { background: rgba(255,255,255,.16); color: white; border: 1px solid rgba(255,255,255,.35); }
.danger-btn { background: #fee2e2; color: #991b1b; }
.full { width: 100%; }
.small-note { font-size: .92rem !important; }

.topbar { height: 72px; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; color: white; }
.logo { font-weight: 950; font-size: 1.25rem; letter-spacing: -0.03em; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto 32px; }
.teacher-grid { display: grid; grid-template-columns: 1.1fr .7fr; gap: 18px; align-items: start; }
.panel { background: var(--panel); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 10px; font-size: 1.35rem; }
.panel h3 { margin: 22px 0 10px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.panel p { color: var(--muted); margin-top: 0; }
.setup-panel { grid-row: span 2; }
.live-panel { grid-column: span 2; }
.file-drop { display: flex; align-items: center; justify-content: center; min-height: 70px; border: 2px dashed var(--line); border-radius: 18px; background: rgba(224, 242, 254, .65); color: var(--secondary-text); font-weight: 800; margin: 14px 0; }
.file-drop input { display: none; }
textarea { width: 100%; min-height: 180px; border: 1px solid var(--line); border-radius: 18px; padding: 14px; resize: vertical; outline: none; background: white; }
input { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 14px; outline: none; background: white; margin: 7px 0 14px; }
.status-box { min-height: 22px; margin-top: 12px; color: var(--muted); font-size: .95rem; }
.status-box.error { color: var(--red); font-weight: 750; }
.status-box.ok { color: var(--green); font-weight: 750; }
.preview-list, .players-list, .ranking-list, .answers-list { display: grid; gap: 10px; }
.preview-item, .player-row, .ranking-row, .answer-row { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preview-item span, .player-row span, .ranking-row span { color: var(--muted); }
.empty { color: var(--muted); }
.room-code-box { text-align: center; background: linear-gradient(135deg, #ecfeff, #d1fae5); border: 1px solid var(--line); border-radius: 22px; padding: 20px; margin: 16px 0; }
.room-code-box span { display: block; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.room-code-box strong { display: block; font-size: clamp(2.6rem, 7vw, 4.8rem); letter-spacing: .08em; margin-top: 8px; }
.room-panel button { margin-top: 10px; }
.live-header, .quiz-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter { background: var(--secondary); color: var(--secondary-text); padding: 8px 12px; border-radius: 999px; font-weight: 850; }
.question-display { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.question-display h1 { margin: 0 0 16px; font-size: clamp(1.35rem, 3vw, 2.2rem); }
.option-mini { padding: 10px 12px; border-radius: 14px; background: #f8fafc; margin-top: 8px; font-weight: 700; }
.option-mini.correct { background: #dcfce7; color: #166534; }
.answer-row.correct { border-color: rgba(22, 163, 74, .35); }
.answer-row.wrong { border-color: rgba(220, 38, 38, .35); }
.answer-pill { padding: 6px 10px; border-radius: 999px; font-weight: 850; color: white; }
.answer-pill.correct { background: var(--green); }
.answer-pill.wrong { background: var(--red); }

.join-card { text-align: center; }
.join-card .brand-pill, .join-card h1 { text-align: center; display: flex; margin-left: auto; margin-right: auto; width: max-content; }
.join-card h1 { display: block; width: auto; }
.join-card label { display: block; font-weight: 800; color: var(--muted); text-align: center; }
.join-card input { text-align: center; }
.quiz-stage { width: min(1060px, 100%); min-height: 90vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; color: white; }
.quiz-topline { margin-bottom: 18px; font-weight: 900; }
.quiz-topline span { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); padding: 10px 14px; border-radius: 999px; }
.quiz-stage h1 { font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.08; text-align: center; margin: 10px 0 38px; text-shadow: 0 5px 20px rgba(0,0,0,.15); }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.option-card { min-height: 112px; display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 14px; text-align: left; color: white; border-radius: 22px; padding: 18px; box-shadow: 0 16px 38px rgba(0,0,0,.18); font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 850; }
.option-card .letter { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.24); font-weight: 950; }
.option-card[data-letter="A"] { background: #075985; }
.option-card[data-letter="B"] { background: #9a3412; }
.option-card[data-letter="C"] { background: #0f766e; }
.option-card[data-letter="D"] { background: #173d52; }
.option-card.correct { background: var(--green) !important; }
.option-card.wrong { background: var(--red) !important; }
.option-card.disabled { opacity: .56; cursor: default; }
.icon-slot { font-size: 1.7rem; font-weight: 950; }
.feedback-box { margin-top: 18px; background: rgba(255,255,255,.94); color: var(--text); border-radius: 18px; padding: 16px; text-align: center; font-weight: 850; }
.loader { width: 56px; height: 56px; border-radius: 50%; border: 6px solid #dbeafe; border-top-color: var(--primary); margin: 30px auto 0; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .teacher-grid { grid-template-columns: 1fr; }
  .setup-panel, .live-panel { grid-column: auto; grid-row: auto; }
  .topbar { height: auto; padding: 16px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .option-grid { grid-template-columns: 1fr; }
}

/* Atualização: modo de apresentação, ranking entre perguntas e resposta única */
.game-active .setup-panel { display: none; }
.game-active .teacher-grid { grid-template-columns: 360px 1fr; }
.game-active .live-panel { grid-column: 2; grid-row: 1 / span 2; }
.game-active .room-panel { grid-column: 1; }
.game-active .players-panel { grid-column: 1; }

.live-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.counter.subtle { background: #ecfdf5; color: #166534; }
.teacher-details { margin-top: 18px; background: rgba(224, 242, 254, .55); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.teacher-details summary { cursor: pointer; font-weight: 850; color: var(--secondary-text); }
.teacher-details .answers-list { margin-top: 12px; }
.player-row small, .ranking-row small, .answer-row small, .big-ranking-row small { color: var(--muted); font-size: .74rem; margin-left: 6px; font-weight: 800; }
.ranking-row.leader, .big-ranking-row.leader { border-color: rgba(217, 119, 6, .5); background: #fffbeb; }

.presentation-question { padding: clamp(20px, 4vw, 42px); min-height: 520px; display: flex; flex-direction: column; justify-content: center; }
.presentation-meta, .student-question-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.timer-badge { min-width: 86px; text-align: center; padding: 10px 14px; border-radius: 999px; color: white; background: var(--primary); font-weight: 950; letter-spacing: .04em; }
.timer-badge.expired { background: var(--amber); }
.presentation-question h1 { font-size: clamp(2rem, 4.8vw, 4.5rem); line-height: 1.08; letter-spacing: -.04em; margin: 0 0 28px; }
.presentation-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.presentation-options .option-mini { font-size: clamp(1rem, 1.7vw, 1.35rem); min-height: 78px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #f8fafc; }

.ranking-screen { padding: clamp(20px, 4vw, 42px); min-height: 520px; }
.ranking-screen h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); text-align: center; margin-bottom: 26px; }
.big-ranking-list { display: grid; gap: 12px; width: min(900px, 100%); margin: 0 auto; }
.big-ranking-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; font-size: clamp(1rem, 2vw, 1.5rem); }
.rank-pos { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--secondary); color: var(--secondary-text); font-weight: 950; }
.big-ranking-row span:last-child { font-weight: 950; color: var(--primary-dark); }

.student-question-meta { color: rgba(255,255,255,.88); margin: 0 auto 16px; width: min(900px, 100%); }
.student-question-meta .timer-badge { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.28); }
.student-question-meta .timer-badge.expired { background: rgba(217, 119, 6, .92); }
#rankingView .ranking-list, #finishedView .ranking-list { margin-top: 16px; text-align: left; }
#rankingView .ranking-row, #finishedView .ranking-row { font-size: 1rem; }

@media (max-width: 900px) {
  .game-active .teacher-grid { grid-template-columns: 1fr; }
  .game-active .live-panel, .game-active .room-panel, .game-active .players-panel { grid-column: auto; grid-row: auto; }
  .presentation-options { grid-template-columns: 1fr; }
  .presentation-question, .ranking-screen { min-height: auto; }
  .big-ranking-row { grid-template-columns: 44px 1fr; }
  .big-ranking-row span:last-child { grid-column: 2; }
}

/* Ajustes desta versão: posição do aluno em tempo real e melhor adaptação da barra superior */
.quiz-topline { flex-wrap: wrap; }
#studentPosition { background: rgba(255,255,255,.28); }

/* Feedback reforçado para o aluno após resposta única */
.feedback-box { display: grid; gap: 6px; border: 2px solid transparent; }
.feedback-box strong { display: block; font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1.1; }
.feedback-box span { display: block; font-size: 1rem; }
.feedback-box.feedback-correct { background: #dcfce7; color: #14532d; border-color: rgba(22, 163, 74, .45); box-shadow: 0 16px 38px rgba(22, 163, 74, .24); }
.feedback-box.feedback-wrong { background: #fee2e2; color: #7f1d1d; border-color: rgba(220, 38, 38, .45); box-shadow: 0 16px 38px rgba(220, 38, 38, .22); }


/* Etapa adicional: revisão da resposta correta antes do ranking */
.answer-screen { padding: clamp(20px, 4vw, 42px); min-height: 520px; }
.answer-review-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.answer-screen h1 { font-size: clamp(1.8rem, 4.2vw, 4rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 22px; }
.answer-distribution { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.distribution-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.distribution-card.correct { color: #174e2c; border-color: #82c59a; background: #eef9f1; box-shadow: 0 10px 28px rgba(22, 163, 74, .12); }
.distribution-card.incorrect { color: #65342d; border-color: #efb8ad; background: #fff4f2; }
.distribution-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 900; }
.distribution-topline strong { font-size: 1.4rem; color: var(--primary-dark); }
.distribution-topline span { color: var(--muted); }
.distribution-topline .distribution-result { margin-right: auto; color: currentColor; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.distribution-card p { margin: 8px 0 12px; color: var(--text); font-weight: 750; }
.distribution-bar { height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.distribution-bar span { display: block; height: 100%; background: #cf6b5a; border-radius: 999px; }
.distribution-card.correct .distribution-bar span { background: var(--green); }
.answer-review-note { margin-top: 16px; color: var(--muted); font-size: 1rem; }

@media (max-width: 900px) {
  .answer-distribution { grid-template-columns: 1fr; }
  .answer-review-header { align-items: flex-start; flex-direction: column; }
  .answer-screen { min-height: auto; }
}

/* Authoring and readable question presentation */
:root { --question-size: 2.65rem; --option-size: 1.18rem; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 4px; }
input:focus, textarea:focus, select:focus { border-color: #0f766e; box-shadow: 0 0 0 3px #0f766e20; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
select { font: inherit; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.section-eyebrow { color: #0f766e; font-size: .72rem; font-weight: 850; letter-spacing: .14em; margin-bottom: 12px; }
.setup-panel h1 { margin: 0 0 10px; font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -.03em; }
.panel { background: #f7fafb; box-shadow: 0 16px 42px #001a2720; }
.method-picker-label { margin: 24px 0 10px; color: var(--text); font-weight: 800; }
.input-modes { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 20px; }
.mode-btn { display: grid; grid-template-columns: 46px minmax(0, 1fr) 24px; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 1px solid #d8e2e6; border-radius: 15px; background: #fff; color: #294553; text-align: left; box-shadow: 0 5px 16px #173d4209; }
.mode-btn:hover { border-color: #90aaa9; background: #f8fbfa; transform: translateY(-1px); box-shadow: 0 9px 22px #173d4212; }
.mode-btn.active { border-color: #f04a24; background: #fff7f2; color: #173d52; box-shadow: 0 0 0 2px #f04a2418; }
.mode-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; color: #173d52; background: #e8f0f2; }
.mode-copy { display: grid; gap: 3px; }
.mode-copy strong { color: var(--text); font-size: .96rem; }
.mode-copy small { color: var(--muted); font-size: .78rem; font-weight: 550; line-height: 1.45; }
.mode-arrow { width: 18px; height: 18px; color: #6f858d; }
.input-modes.has-selection { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 5px; border-radius: 14px; background: #eceff8; }
.input-modes.has-selection .mode-btn { display: flex; justify-content: center; min-height: 46px; padding: 10px 8px; border: 0; border-radius: 10px; text-align: center; box-shadow: none; transform: none; }
.input-modes.has-selection .mode-btn.active { background: #fff; color: #a8321b; box-shadow: 0 2px 8px #173d4210; }
.input-modes.has-selection :is(.mode-icon, .mode-copy small, .mode-arrow) { display: none; }
.input-modes.has-selection .mode-copy { display: block; }
.input-modes.has-selection .mode-copy strong { color: inherit; font-size: .82rem; }
.mode-badge { display: inline-block; margin-left: 5px; padding: 2px 5px; border-radius: 999px; color: #fff; background: #f04a24; font-size: .58rem; font-weight: 900; letter-spacing: .05em; vertical-align: 2px; }
.file-drop { position: relative; flex-direction: column; gap: 8px; padding: 22px; margin-bottom: 0; text-align: center; cursor: pointer; background: #eff9f6; border-color: #8bbdb5; }
.file-drop input { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop:focus-within { outline: 3px solid #f59e0b; }
.file-drop span:last-child { font-size: .8rem; font-weight: 500; color: #526c70; }
.upload-symbol { font-size: 1.7rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #dceee7; }
.file-drop.dragging { background: #d4efe4; border-color: #0f766e; }
.format-guide { border: 1px solid #d9e5e8; border-radius: 14px; margin: 16px 0 22px; padding: 16px; background: white; }
.format-guide summary { cursor: pointer; font-weight: 800; color: #155e63; }
.format-guide ol { padding-left: 23px; font-size: .9rem; line-height: 1.65; }
.format-guide p { font-size: .86rem; line-height: 1.6; }
.format-example { margin: 12px 0; padding: 18px; background: #132c3d; color: #e1f5eb; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: .83rem/1.7 Consolas, 'Courier New', monospace; }
.field-label { display: block; margin: 14px 0 8px; font-weight: 750; font-size: .9rem; }
#rawQuestions { min-height: 230px; font: .88rem/1.65 Consolas, monospace; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.editor-actions .secondary-btn, .editor-actions .primary-btn { font-size: .85rem; padding: 11px 14px; border-radius: 10px; }
.text-btn { color: #096d6c; background: transparent; padding: 8px; font-weight: 750; border-radius: 8px; font-size: .84rem; }
.text-btn:hover { background: #e2f0ec; }
.manual-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.manual-options label { font-weight: 800; color: #0f766e; }
.manual-options textarea { display: block; min-height: 90px; margin-top: 6px; font-weight: 500; color: var(--text); }
.ai-pane { padding: clamp(18px, 3vw, 28px); border: 1px solid #d8e3e6; border-radius: 18px; background: linear-gradient(145deg, #fbfdfc, #f5f1ff); }
.ai-pane-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ai-pane-heading h3 { margin: 4px 0 8px; font-size: clamp(1.35rem, 2.5vw, 1.9rem); }
.ai-setup-notice { margin: 16px 0; padding: 14px 16px; border-left: 4px solid #f04a24; border-radius: 10px; color: #71301f; background: #fff1eb; font-weight: 700; }
.ai-file-drop { margin-top: 18px; background: #fff; }
.ai-file-drop:has(input:disabled) { cursor: progress; opacity: .68; }
.ai-pane #aiSourceText { min-height: 210px; }
.ai-settings-grid { display: grid; grid-template-columns: .65fr 1.2fr 1.35fr; gap: 12px; margin: 18px 0; }
.ai-settings-grid label { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.ai-settings-grid input, .ai-settings-grid select { width: 100%; min-width: 0; color: var(--text); background: #fff; }
.ai-privacy-note { margin: 15px 0; padding: 12px 14px; border-radius: 10px; background: #eef3f5; }
.ai-consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.ai-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.ai-consent a { color: #096d6c; font-weight: 750; }
.ai-progress { display: grid; gap: 12px; margin: 14px 0; padding: 16px; border: 1px solid #cfdde1; border-radius: 14px; background: #fff; }
.ai-progress-heading { display: flex; align-items: center; gap: 12px; }
.ai-progress-heading div { display: grid; gap: 3px; min-width: 0; }
.ai-progress-heading strong { font-size: .9rem; }
.ai-progress-heading span { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.ai-progress-spinner { width: 24px; height: 24px; flex: none; border: 3px solid #d8e5e5; border-top-color: #f04a24; border-radius: 50%; animation: ai-spin .8s linear infinite; }
.ai-progress-meter { height: 8px; overflow: hidden; border-radius: 999px; background: #e7ecef; }
.ai-progress-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f04a24, #ff835f); transition: width .35s ease; }
.ai-cancel-btn { justify-self: end; padding: 5px 8px; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
#manualStatement { font: .95rem/1.6 Consolas, monospace; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; }
.preview-heading h3 { margin: 0; }
.preview-heading .counter { font-size: .75rem; }
.preview-list { margin-top: 14px; }
.preview-item { align-items: flex-start; flex-wrap: wrap; }
.preview-number { display: grid; place-items: center; background: #e5f3ec; color: #137465 !important; border-radius: 10px; width: 30px; height: 30px; font-weight: 800; flex-shrink: 0; }
.preview-copy { flex: 1; min-width: 160px; }
.preview-copy strong { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-copy > span { display: block; margin-top: 6px; font-size: .77rem; }
.preview-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.parse-errors { background: #fff2ed; border: 1px solid #f6ccbe; color: #8e3829; padding: 16px 16px 16px 34px; border-radius: 12px; font-size: .85rem; line-height: 1.6; }
.parse-errors li + li { margin-top: 8px; }
.resume-panel { padding: 14px; background: #edf3f6; border-radius: 14px; font-size: .88rem; }
.resume-controls { display: flex; gap: 8px; align-items: center; }
.resume-controls input { min-width: 0; margin: 8px 0; }
.resume-controls button { margin: 0; padding: 12px; border-radius: 12px; }
.resume-panel p { margin: 6px 0 0; }
.question-preview-dialog { width: min(1120px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; padding: 20px; border-radius: 24px; background: #f1f6f5; box-shadow: 0 30px 100px #0005; }
.question-preview-dialog::backdrop { background: #071b2bbd; backdrop-filter: blur(5px); }
.preview-dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.preview-dialog-header .secondary-btn { padding: 10px 14px; font-size: .85rem; }
[data-fit-question] { --fit: 1; --question-size: clamp(1.85rem, 2.7vw, 2.7rem); --option-size: clamp(1.08rem, 1.55vw, 1.35rem); min-width: 0; }
[data-density="comfortable"] { --question-size: clamp(1.6rem, 2.35vw, 2.25rem); --option-size: 1.1rem; }
[data-density="dense"] { --question-size: clamp(1.35rem, 1.9vw, 1.8rem); --option-size: 1.02rem; }
.presentation-question { min-height: 0; padding: clamp(20px, 3vw, 38px); border-radius: 22px; background: #fff; justify-content: flex-start; }
.question-statement { font-size: max(1.2rem, calc(var(--question-size) * var(--fit))); font-weight: 750; line-height: 1.3; letter-spacing: -.025em; text-align: left; margin: 2px 0 28px; }
.rich-text { min-width: 0; overflow-wrap: anywhere; }
.text-paragraph { display: block; white-space: pre-wrap; }
.text-paragraph + .text-paragraph { margin-top: .7em; }
.inline-code { background: #0e766e14; color: #0d6965; padding: .12em .3em; border: 1px solid #0f766e25; border-radius: 5px; font-size: .87em; font-family: Consolas, 'Courier New', monospace; font-weight: 600; }
.code-block { display: block; text-align: left; margin: 16px 0; border: 1px solid #2e4658; border-radius: 14px; overflow: hidden; background: #122536; color: #e3f5ee; letter-spacing: 0; font-weight: 450; box-shadow: 0 8px 24px #0b213313; }
.code-label { display: block; padding: 8px 16px; background: #1b3447; color: #91b7c3; font: 650 .7rem/1.5 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.code-block > code { display: block; font: max(.9rem, calc(1.03rem * var(--fit, 1)))/1.65 Consolas, 'Courier New', monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; padding: 16px 20px; }
.presentation-options { gap: 12px; }
.presentation-options .option-mini { margin: 0; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 14px; padding: 18px; border-radius: 15px; min-height: 74px; font-size: max(1rem, calc(var(--option-size) * var(--fit))); font-weight: 600; background: #f5f8fa; border-color: #e1e8eb; line-height: 1.5; }
.question-preview-options .option-mini.correct { color: #174e2c; border-color: #82c59a; background: #eef9f1; }
.question-preview-options .option-mini.incorrect { color: #65342d; border-color: #efb8ad; background: #fff4f2; }
.option-letter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; background: #deebf5; color: #226398; }
.option-mini:nth-child(2) .option-letter { background: #fae9d9; color: #a35118; }
.option-mini:nth-child(3) .option-letter { background: #d9eee5; color: #176447; }
.option-mini:nth-child(4) .option-letter { background: #e6e3f8; color: #6550a2; }
.game-active .teacher-grid { grid-template-columns: 280px minmax(0,1fr); }
.game-active .live-panel { min-width: 0; }
.presentation-meta { font-size: .77rem; letter-spacing: .09em; }
.presentation-mode .teacher-grid { grid-template-columns: 1fr; }
.presentation-mode .room-panel { grid-column: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; }
.presentation-mode .room-panel > :is(h2, .resume-panel, .room-code-box, #createRoomBtn, #startBtn, #exportBtn, #teacherStatus, p, #newRoomBtn) { display: none; }
.presentation-mode .room-panel button { width: auto; margin: 0; }
.presentation-mode .live-panel { grid-column: 1; grid-row: auto; }
.presentation-mode .players-panel, .presentation-mode .live-panel > h3, .presentation-mode #rankingList, .presentation-mode .teacher-details { display: none; }
.presentation-mode .live-header { margin-bottom: 12px; }
.quiz-stage { width: min(1120px,100%); min-height: 0; padding: clamp(18px,3vw,36px); background: #f8fafb; border: 1px solid #ffffff60; border-radius: 26px; box-shadow: 0 20px 60px #00172344; color: var(--text); }
.student-shell { align-content: center; padding: 24px; }
.quiz-topline { font-size: .83rem; gap: 8px; margin-bottom: 26px; }
.quiz-topline span, #studentPosition { background: #e8f1f2; border: 0; color: #38616d; padding: 8px 12px; }
.student-question-meta { color: #637784; font-size: .75rem; margin-bottom: 14px; }
.student-question-meta .timer-badge { background: #0f766e; min-width: 72px; padding: 8px 12px; }
.quiz-stage .option-grid { gap: 12px; }
.option-card { min-height: 88px; grid-template-columns: 34px minmax(0,1fr) 20px; gap: 12px; border-radius: 15px; padding: 18px; font-size: max(1rem, calc(var(--option-size) * var(--fit))); font-weight: 600; box-shadow: 0 4px 12px #173b4b0c; border: 1px solid #dce6eb; color: #17334a; line-height: 1.5; }
.option-card[data-letter="A"], .option-card[data-letter="B"], .option-card[data-letter="C"], .option-card[data-letter="D"] { background: #fff; }
.option-card:hover:not(:disabled) { border-color: #0f766e; background: #eff8f5; }
.option-card .letter { width: 34px; height: 34px; font-size: .9rem; border-radius: 10px; background: #deebf5; color: #226398; }
.option-card[data-letter="B"] .letter { background: #fae9d9; color: #a35118; }
.option-card[data-letter="C"] .letter { background: #d9eee5; color: #176447; }
.option-card[data-letter="D"] .letter { background: #e6e3f8; color: #6550a2; }
.option-card.correct, .option-card.wrong { color: white; }
.option-card.disabled { opacity: .8; }
.option-card .code-block { margin: 8px 0; }
.option-card .code-block > code { padding: 12px; font-size: .9rem; }
.feedback-box { box-shadow: none; font-size: .95rem; }
.feedback-box strong { font-size: 1.2rem; }
.feedback-box > strong { display: block; white-space: nowrap; overflow-wrap: normal; }
.ranking-awaiting { text-align: center !important; margin: 18px 0; }
.connection-status { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 10; padding: 14px 20px; border-radius: 12px; max-width: min(640px, 94vw); background: #fff2da; color: #7c480d; box-shadow: 0 8px 30px #0003; }
.answer-screen { min-height: 0; }
.answer-screen .question-statement { font-size: clamp(1.35rem,2.6vw,2.4rem); }
.distribution-card .rich-text { margin: 12px 0; font-size: max(1.05rem, calc(var(--option-size, 1.12rem) * var(--fit, 1))); font-weight: 600; line-height: 1.5; }
@media (max-width: 900px) {
  .game-active .teacher-grid { grid-template-columns: 1fr; }
  .presentation-options { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .student-shell { padding: 12px; align-content: start; }
  .quiz-stage { border-radius: 20px; padding: 20px 16px; }
  .question-statement { font-size: 1.55rem; margin-bottom: 20px; }
  [data-density="dense"] .question-statement { font-size: 1.25rem; }
  .option-card { padding: 14px 12px; grid-template-columns: 30px minmax(0,1fr) 16px; gap: 9px; }
  .manual-options { grid-template-columns: 1fr; }
  .input-modes, .input-modes.has-selection { grid-template-columns: 1fr; }
  .input-modes.has-selection { gap: 4px; }
  .mode-btn { padding: 13px 14px; }
  .ai-pane-heading { display: block; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .preview-item { gap: 10px; }
  .preview-actions { width: 100%; }
  .home-card, .join-card, .wait-card { padding: 26px 22px; }
  .code-block > code { padding: 14px; }
  .panel { padding: 18px; }
  .question-preview-dialog { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Keep the room controls together even when the import guide is expanded. */
.teacher-sidebar { display: grid; gap: 18px; align-content: start; min-width: 0; }
.teacher-sidebar > .panel { min-width: 0; max-width: 100%; }
.game-active .teacher-grid { grid-template-columns: minmax(0, 350px) minmax(0, 1fr); }
.room-code-box strong { font-size: clamp(2rem, 3vw, 3rem); letter-spacing: .025em; white-space: nowrap; }
.room-panel button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.resume-controls input { flex: 1 1 0; width: 0; }
.resume-controls button { flex: 0 0 auto; }
.setup-panel { grid-row: auto; }
.game-active .teacher-sidebar { grid-column: 1; grid-row: 1; }
.game-active .live-panel { grid-row: 1; }
.presentation-mode .teacher-sidebar { grid-column: 1; grid-row: auto; }
.presentation-mode .live-panel { grid-row: auto; }
.code-block > code { font-size: max(.95rem, calc(1.15rem * var(--fit, 1))); }
@media (max-width: 1100px) {
  .game-active .teacher-sidebar, .game-active .live-panel { grid-column: auto; grid-row: auto; }
  .game-active .teacher-grid { grid-template-columns: minmax(0, 1fr); }
  .game-active .live-panel { grid-column: auto; }
}
@media (max-width: 600px) {
  .code-block > code { font-size: .9rem; line-height: 1.55; }
}

/* Apresentação do professor: camada independente, sem sobrepor os painéis de controle. */
body.presentation-open { overflow: hidden; }
body.presentation-open > .topbar,
body.presentation-open > main { visibility: hidden; pointer-events: none; }
.presentation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: clamp(14px, 2.5vw, 30px);
  color: #eaf7f4;
  background: radial-gradient(circle at 50% -20%, #1d6265 0%, #0c3b48 48%, #071f2e 100%);
  overflow: auto;
}
.presentation-overlay.hidden { display: none; }
.presentation-overlay:fullscreen { padding: clamp(18px, 3vw, 44px); }
.presentation-overlay-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: min(1500px, 100%); margin: 0 auto clamp(16px, 3vh, 34px); }
.presentation-brand { color: #fff; font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 950; text-decoration: none; letter-spacing: -.02em; }
.presentation-session { display: flex; align-items: center; justify-content: center; gap: 10px; justify-self: center; }
.presentation-room { padding: 8px 14px; border: 1px solid #ffffff38; border-radius: 999px; color: #cbe9e3; font-size: clamp(.78rem, 1.2vw, 1rem); font-weight: 750; white-space: nowrap; }
.presentation-room strong { margin-left: 5px; color: #fff; font-size: 1.08em; letter-spacing: .1em; }
.presentation-answered { padding: 8px 14px; border: 1px solid #b9f5da88; border-radius: 999px; color: #082f2f; background: #b9f5da; font-size: clamp(.78rem, 1.2vw, 1rem); font-weight: 850; white-space: nowrap; }
.presentation-overlay-actions { display: flex; justify-content: flex-end; gap: 8px; }
.presentation-action { padding: 9px 13px; border: 1px solid #ffffff40; border-radius: 10px; color: #fff; background: #ffffff16; font-size: .8rem; font-weight: 800; }
.presentation-action:hover { background: #ffffff2b; }
.presentation-action:disabled { cursor: not-allowed; opacity: .42; }
.presentation-icon-action { display: grid; place-items: center; width: 42px; height: 38px; padding: 0; }
.presentation-icon-action .ui-icon { width: 20px; height: 20px; }
.presentation-icon-action[aria-pressed="true"] { color: #073844; border-color: #f7c948; background: #f7c948; box-shadow: 0 0 0 4px #f7c94826; }
.presentation-icon-action[aria-pressed="true"]:hover { background: #ffe28a; }
.presentation-stage-wrap { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; width: min(1500px, 100%); min-height: 0; margin: 0 auto; padding: 0 clamp(30px, 6vw, 100px); }
.presentation-canvas-wrap { position: relative; width: min(1280px, 100%); max-height: calc(100dvh - 150px); }
.presentation-stage { width: 100%; max-height: calc(100dvh - 150px); overflow: auto; border-radius: 24px; color: var(--text); }
.presentation-ink-canvas { position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%; border-radius: 24px; pointer-events: none; }
.presentation-ink-canvas.is-active { cursor: crosshair; pointer-events: auto; touch-action: none; }
.presentation-stage.question-display { box-shadow: 0 28px 90px #00131f66; }
.presentation-stage .question-statement,
.presentation-stage .answer-review-header,
.presentation-stage .big-ranking-row,
.presentation-stage .answer-review-note { color: var(--text); }
.presentation-stage .presentation-options .option-mini { color: var(--text); }
.presentation-stage .presentation-question,
.presentation-stage .answer-screen,
.presentation-stage .ranking-screen { min-height: min(680px, calc(100dvh - 170px)); }
.presentation-nav { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); display: grid; place-items: center; width: clamp(50px, 5vw, 72px); height: clamp(50px, 5vw, 72px); border: 2px solid #ffffffb8; border-radius: 50%; color: #073844; background: #f7c948; box-shadow: 0 12px 30px #00131f66, 0 0 0 5px #f7c94822; line-height: 1; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.presentation-back { left: clamp(4px, 1.5vw, 24px); }
.presentation-next { right: clamp(4px, 1.5vw, 24px); }
.presentation-next-icon { width: clamp(24px, 2.4vw, 34px); height: clamp(24px, 2.4vw, 34px); }
.presentation-nav-icon { width: clamp(24px, 2.4vw, 34px); height: clamp(24px, 2.4vw, 34px); }
.presentation-nav:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); background: #ffe28a; box-shadow: 0 14px 34px #00131f77, 0 0 0 7px #f7c94833; }
.presentation-nav:disabled { cursor: not-allowed; opacity: .32; }
.presentation-hint { margin: clamp(12px, 2vh, 20px) auto 0; color: #b9d9d4; font-size: .78rem; text-align: center; }
@media (max-width: 700px) {
  .presentation-overlay { padding: 12px; }
  .presentation-overlay-header { grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 10px; }
  .presentation-session { grid-column: 1 / -1; grid-row: 2; justify-self: start; justify-content: flex-start; flex-wrap: wrap; }
  .presentation-overlay-actions { grid-column: 2; grid-row: 1; gap: 5px; }
  .presentation-action { padding: 8px 9px; }
  .presentation-icon-action { width: 38px; height: 36px; padding: 0; }
  .presentation-stage-wrap { padding: 0 30px 0 0; }
  .presentation-canvas-wrap,
  .presentation-stage { max-height: calc(100dvh - 145px); border-radius: 18px; }
  .presentation-ink-canvas { border-radius: 18px; }
  .presentation-stage .presentation-question,
  .presentation-stage .answer-screen,
  .presentation-stage .ranking-screen { min-height: auto; }
  .presentation-back { left: 0; }
  .presentation-next { right: 0; }
  .presentation-nav { width: 46px; height: 46px; }
  .presentation-hint { font-size: .7rem; }
}

/* Fluxo guiado do professor: questões primeiro, sala depois. */
.teacher-progress { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; }
.progress-step { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid #ffffff49; border-radius: 999px; color: #d0e6e5; font-size: .86rem; font-weight: 800; }
.progress-step b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #ffffff30; color: #fff; }
.progress-step.current { background: #fff; border-color: #fff; color: #12535a; }
.progress-step.current b { background: #0f766e; color: #fff; }
.teacher-auth-status { grid-column: 1 / -1; margin: 0; padding: 0 4px; color: #e6f5f2; }
.teacher-auth-status.error { color: #ffe7df; }
.teacher-auth-status:empty { display: none; }
.step-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-footer p { flex: 1 1 100%; margin: 0; }
.step-footer .primary-btn { margin-left: auto; }
.room-setup-intro { padding: 14px 16px; border: 1px solid #dbe8e6; border-radius: 16px; background: #eff8f5; margin: 10px 0 18px; }
.room-panel h1 { margin: 0 0 10px; font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -.03em; }
.room-setup-intro > p:first-child { font-weight: 800; color: #175e5c; }
.room-setup-intro input { margin-bottom: 5px; }
.room-setup-intro .text-btn { padding-left: 0; }
.optional-note { color: var(--muted); font-size: .8rem; font-weight: 500; }
.quiz-library-panel { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr); align-items: end; gap: 14px 22px; margin-top: 22px; padding: 18px; border: 1px solid #dbe8e6; border-radius: 16px; background: #f5faf8; }
.quiz-library-panel h3 { margin: 3px 0 5px; }
.quiz-library-panel p { margin: 0; }
.quiz-library-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.quiz-library-fields label { grid-column: 1 / -1; }
.quiz-library-fields input { min-width: 0; margin: 0; }
.quiz-library-panel > .google-signin-btn { justify-self: start; }
.quiz-library-panel .status-box { grid-column: 1 / -1; }
.room-created .room-setup-intro { display: none; }
.room-created #createRoomBtn, .room-created .resume-panel { display: none; }
body:not(.room-created) .room-code-box,
body:not(.room-created) #startBtn,
body:not(.room-created) #nextBtn,
body:not(.room-created) #finishBtn,
body:not(.room-created) .room-panel > .small-note { display: none; }
body.room-created:not(.game-active) #nextBtn,
body.room-created:not(.game-active) #finishBtn { display: none; }
body.game-active #startBtn { display: none; }
body.game-finished #nextBtn, body.game-finished #finishBtn { display: none; }
body[data-teacher-step="questions"]:not(.game-active) .teacher-sidebar,
body[data-teacher-step="questions"]:not(.game-active) .live-panel { display: none; }
body[data-teacher-step="questions"]:not(.game-active) .teacher-grid { grid-template-columns: minmax(0, 1fr); }
body[data-teacher-step="questions"]:not(.game-active) .setup-panel { grid-column: 1; width: min(940px, 100%); margin: 0 auto; }
body[data-teacher-step="room"]:not(.game-active) .setup-panel { display: none; }
body[data-teacher-step="room"]:not(.room-created) .live-panel,
body[data-teacher-step="room"]:not(.room-created) .players-panel { display: none; }
body[data-teacher-step="room"]:not(.room-created) .teacher-grid { grid-template-columns: minmax(0, 1fr); }
body[data-teacher-step="room"]:not(.room-created) .teacher-sidebar { grid-column: 1; width: min(680px, 100%); margin: 0 auto; }
body.room-created:not(.game-active) .teacher-grid { grid-template-columns: minmax(0, 350px) minmax(0, 1fr); }
body.room-created:not(.game-active) .teacher-sidebar { grid-column: 1; grid-row: auto; }
body.room-created:not(.game-active) .live-panel { grid-column: 2; grid-row: auto; min-width: 0; }
body.game-active .teacher-progress, body.game-active .teacher-auth-status { display: none; }
@media (max-width: 900px) {
  body.room-created:not(.game-active) .teacher-grid { grid-template-columns: minmax(0, 1fr); }
  body.room-created:not(.game-active) .teacher-sidebar,
  body.room-created:not(.game-active) .live-panel { grid-column: 1; }
}
@media (max-width: 600px) {
  .teacher-progress { gap: 6px; }
  .progress-step { font-size: .75rem; padding: 8px 10px; }
  .step-footer .primary-btn { width: 100%; }
  .quiz-library-panel, .quiz-library-fields { grid-template-columns: 1fr; }
  .quiz-library-panel > .google-signin-btn, .quiz-library-fields .secondary-btn { width: 100%; }
}

/* Biblioteca de quizzes e página pública. */
.library-shell { width: min(1080px, calc(100% - 32px)); }
.library-panel { padding: clamp(24px, 4vw, 48px); }
.library-panel h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.04em; }
.library-panel > p { max-width: 720px; line-height: 1.65; }
.library-guest { margin-top: 28px; padding: 24px; border: 1px solid #cbe6df; border-radius: 18px; background: #eff9f5; }
.library-guest h2 { margin: 0 0 8px; }
.library-account { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; margin: 24px 0; border-radius: 16px; background: #edf7f4; }
.library-account span, .library-account small { display: block; color: var(--muted); }
.library-account strong { display: block; margin: 2px 0; }
.library-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.library-list-heading h2 { margin: 0; }
.saved-quiz-list { display: grid; gap: 14px; }
.saved-quiz-card { display: grid; gap: 18px; padding: 20px; border: 1px solid #dce9e7; border-radius: 18px; background: #fff; }
.saved-quiz-card h3 { margin: 0 0 6px; font-size: 1.18rem; overflow-wrap: anywhere; }
.saved-quiz-card p { margin: 0; font-size: .88rem; }
.saved-quiz-copy { min-width: 0; }
.saved-quiz-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved-quiz-actions .primary-btn, .saved-quiz-actions .secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 14px; border-radius: 11px; font-size: .83rem; }
.saved-quiz-actions .ui-icon { width: 17px; height: 17px; }
.action-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; color: #285b68; background: #e5eff2; font-size: .7rem; }
.quiz-more-menu { position: relative; margin-left: auto; }
.quiz-more-menu summary { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #d6dfea; border-radius: 11px; color: #52617c; background: #fff; cursor: pointer; list-style: none; }
.quiz-more-menu summary::-webkit-details-marker { display: none; }
.quiz-more-menu summary:hover, .quiz-more-menu[open] summary { color: #173d52; border-color: #9eb1bd; background: #f3f6f7; }
.quiz-more-menu summary .ui-icon { width: 20px; height: 20px; }
.quiz-more-menu > div { position: absolute; z-index: 8; right: 0; top: calc(100% + 7px); width: 170px; padding: 7px; border: 1px solid #e0e5ef; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px #14283a24; }
.quiz-more-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; border-radius: 8px; color: #a91919; background: transparent; font-weight: 750; text-align: left; }
.quiz-more-menu button:hover { background: #fff1f1; }
.library-empty { padding: 28px; border: 1px dashed #b7d3ca; border-radius: 18px; text-align: center; background: #f7fbf9; }
.library-empty p { margin: 8px 0 16px; }
body.landing { display: block; }
.not-found-shell { max-width: 680px; margin: 12vh auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 17px 0; color: #fff; }
.public-header nav { display: flex; gap: 10px; flex-wrap: wrap; }
.public-header nav a { padding: 9px 12px; border-radius: 10px; font-weight: 750; }
.public-header nav a:hover { background: #ffffff22; }
.public-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.public-hero { padding: clamp(28px, 5vw, 62px) 0; color: #fff; }
.public-hero .brand-pill { background: #ffffff24; color: #e7f9f6; }
.public-hero h1 { max-width: 760px; margin: 17px 0; font-size: clamp(2.15rem, 3.5vw, 3.35rem); line-height: 1.09; letter-spacing: -.045em; }
.public-hero p { max-width: 650px; font-size: clamp(1rem, 1.45vw, 1.16rem); line-height: 1.65; color: #d3ece7; }
.public-hero .home-actions { justify-content: flex-start; }
.public-section { margin: 24px 0; padding: clamp(24px, 4vw, 42px); border-radius: 24px; background: #f8fbfa; }
.public-section h2 { margin: 0 0 20px; font-size: clamp(1.65rem, 3vw, 2.3rem); letter-spacing: -.035em; }
.public-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.public-steps article { padding: 20px; border: 1px solid #dbe9e6; border-radius: 16px; background: #fff; }
.public-steps b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #075f59; background: #dff4ec; }
.public-steps h3 { margin: 14px 0 7px; }
.public-steps p, .public-section p { line-height: 1.65; }
.public-faq details { padding: 14px 0; border-bottom: 1px solid #dce9e6; }
.public-faq summary { cursor: pointer; font-weight: 800; }
.public-faq details p { margin: 8px 0 0; }
.public-footer { width: min(1180px, calc(100% - 32px)); margin: 30px auto; color: #d5eae7; font-size: .87rem; }
@media (max-width: 700px) {
  .public-header { align-items: flex-start; flex-direction: column; }
  .public-steps { grid-template-columns: 1fr; }
  .saved-quiz-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .saved-quiz-actions > * { width: 100%; }
  .saved-quiz-actions .saved-quiz-primary { grid-column: 1 / -1; }
  .quiz-more-menu { margin-left: 0; }
  .quiz-more-menu summary { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; }
  .quiz-more-menu summary::after { content: 'Mais'; font-size: .83rem; font-weight: 800; }
}
@media (max-width: 430px) {
  .saved-quiz-actions { grid-template-columns: 1fr; }
  .saved-quiz-actions .saved-quiz-primary { grid-column: auto; }
}

/* Entrada do professor e apresentação mais clara das ações principais. */
.skip-link { position: fixed; z-index: 10000; top: 12px; left: 12px; padding: 12px 16px; border-radius: 12px; color: #102a43; background: #fff; font-weight: 800; box-shadow: 0 8px 24px #00131f55; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.public-header nav .header-login { margin-left: 8px; padding: 10px 18px; border: 1px solid #ffffffa8; background: #ffffff14; }
.public-header nav .header-login:hover { background: #ffffff28; }
body:not(.game-active) #presentationBtn,
body:not(.game-active) #exportBtn { display: none; }
.file-drop { position: relative; }
.file-drop input { display: block; position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); }

.public-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.public-hero h1 { font-size: clamp(2.15rem, 3.5vw, 3.35rem); }
.hero-preview { padding: clamp(20px, 3vw, 30px); border: 1px solid #d6eae6; border-radius: 26px; background: #fff; color: var(--text); box-shadow: 0 24px 70px #001c2e66; transform: rotate(1deg); }
.hero-preview-top { display: flex; justify-content: space-between; gap: 10px; color: #365d69; font-size: .72rem; font-weight: 900; letter-spacing: .06em; }
.hero-preview-top span:last-child { padding: 5px 8px; border-radius: 999px; color: #0b5954; background: #e0f5ed; letter-spacing: 0; }
.hero-preview h2 { margin: 20px 0; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.2; letter-spacing: -.03em; }
.hero-preview-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-preview-options div { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dce9e7; border-radius: 13px; background: #f7fbfa; font-weight: 750; }
.hero-preview-options b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #075985; background: #e0f2fe; }
.hero-preview-options div:nth-child(2) b { color: #9a3412; background: #ffedd5; }
.hero-preview-options div:nth-child(3) b { color: #0f766e; background: #dff4ec; }
.hero-preview-options div:nth-child(4) b { color: #173d52; background: #e7eff1; }
.hero-preview p { margin: 20px 0 0; color: var(--muted); font-size: .88rem; }

.teacher-home-shell { width: min(1060px, calc(100% - 32px)); margin: clamp(12px, 3vw, 40px) auto 48px; }
.teacher-home-shell .panel { padding: clamp(24px, 4.5vw, 52px); }
.teacher-home-shell h1 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.12; letter-spacing: -.045em; }
.welcome-lead { max-width: 680px; font-size: 1.08rem; line-height: 1.6; }
.welcome-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.welcome-option { display: flex; flex-direction: column; align-items: flex-start; min-height: 310px; padding: clamp(20px, 3vw, 30px); border: 1px solid #cde3de; border-radius: 20px; background: #eff9f5; }
.welcome-option.welcome-anonymous { background: #f3f8fb; border-color: #d1e5ee; }
.welcome-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #085f57; background: #d8f2e7; font-size: 1.5rem; font-weight: 900; }
.welcome-anonymous .welcome-icon { color: #075985; background: #dceff9; }
.welcome-option h2 { margin: 20px 0 8px; font-size: 1.5rem; }
.welcome-option p { flex: 1; line-height: 1.6; }
.welcome-option .primary-btn, .welcome-option .secondary-btn { min-height: 48px; }
.welcome-option small { display: block; margin-top: 12px; color: var(--muted); line-height: 1.5; }
.welcome-member-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.welcome-member-top > div:first-child { flex: 1 1 420px; }
.welcome-account { flex: 0 1 250px; padding: 16px 20px; border: 1px solid #d5e9e3; border-radius: 16px; background: #f3faf7; }
.welcome-account span, .welcome-account small { display: block; color: var(--muted); }
.welcome-account strong { display: block; margin: 4px 0; overflow-wrap: anywhere; }
.welcome-account .text-btn { margin-top: 8px; padding-left: 0; }
.welcome-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0 32px; }
.welcome-action { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid #d0e5e0; border-radius: 18px; background: #f7fbfa; transition: transform .12s ease, box-shadow .12s ease; }
.welcome-action:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #123d4022; }
.welcome-action-primary { border-color: #b8dbd0; background: #eff9f5; }
.welcome-action strong { font-size: 1.2rem; }
.welcome-action small { color: var(--muted); line-height: 1.5; }
.welcome-recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.welcome-recent-heading h2 { margin: 0; }
.welcome-recent-list { display: grid; gap: 10px; margin-top: 14px; }
.welcome-recent-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid #dce9e7; border-radius: 15px; background: #fff; }
.welcome-recent-card h3 { margin: 0 0 5px; font-size: 1.06rem; text-transform: none; letter-spacing: 0; color: var(--text); overflow-wrap: anywhere; }
.welcome-recent-card p { margin: 0; font-size: .9rem; }
.welcome-recent-card .secondary-btn { padding: 10px 15px; border-radius: 11px; }
.import-short-guide { margin: 16px 0 4px; line-height: 1.6; }
.import-quick-actions { margin: 8px 0; }
.import-quick-actions + .format-guide { margin-top: 12px; }
@media (max-width: 850px) {
  .public-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-preview { max-width: 560px; transform: none; }
}
@media (max-width: 400px) {
  .public-hero h1 { font-size: 2.05rem; }
}
@media (max-width: 650px) {
  .welcome-options, .welcome-quick-actions { grid-template-columns: 1fr; }
  .welcome-option { min-height: auto; }
  .welcome-option p { flex: auto; }
  .welcome-recent-card .secondary-btn { width: 100%; }
}

/* Visual claro e navegação de conta para professores. */
body.student-page { background: radial-gradient(circle at 65% -10%, #245a68 0%, #173f50 46%, #102b3c 100%); }
.topbar, .public-header { color: var(--text); }
.logo, .presentation-brand, .student-brand { display: inline-flex; align-items: center; gap: 8px; }
.logo { font-weight: 800; letter-spacing: -.035em; }
.brand-mark { display: block; width: 78px; height: 71px; overflow: hidden; border-radius: 12px; background: transparent; flex: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.presentation-brand .brand-mark { width: 72px; height: 66px; border: 1px solid #ffffff2b; }
.student-brand { justify-content: center; width: max-content; margin: 0 auto 4px; color: var(--text); font-size: 1.05rem; font-weight: 800; letter-spacing: -.03em; }
.student-brand .brand-mark { width: 132px; height: 120px; border-radius: 18px; }
.student-page .student-brand { color: var(--text); }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn { min-height: 44px; border-radius: 12px; font-weight: 700; }
.primary-btn { box-shadow: 0 9px 20px #173d5224; }
.primary-btn:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 12px 25px #173d5231; }
.ghost-btn { color: var(--text); background: #ffffffc7; border: 1px solid #d9dfec; }
.ghost-btn:hover:not(:disabled) { background: #fff; }
.panel, .public-section { background: #fff; border: 1px solid #e3e7f0; }
.panel h2, .public-section h2 { font-weight: 740; }
.section-eyebrow { color: #c63b20; font-weight: 800; }
.teacher-auth-status { color: var(--muted); }
.teacher-auth-status.error { color: var(--red); }
.teacher-progress .progress-step { border-color: #d9dfec; color: #596681; background: #ffffffad; }
.teacher-progress .progress-step b { color: #173d52; background: #e6eff1; }
.teacher-progress .progress-step.current { border-color: #173d52; color: #fff; background: #173d52; }
.teacher-progress .progress-step.current b { color: #173d52; background: #fff; }
.public-header nav a:hover { background: #fff0e9; }
.public-header nav .header-login { margin-left: 8px; color: #fff; border-color: #173d52; background: #173d52; }
.public-header nav .header-login:hover { color: #fff; background: #0d2c3d; }
.public-hero { color: var(--text); }
.public-hero .brand-pill { color: #a8321b; background: #fff0e9; }
.public-hero h1, .teacher-home-shell h1, .library-panel h1 { font-weight: 760; }
.public-hero p { color: var(--muted); }
.hero-preview { border-color: #e3e7f0; box-shadow: 0 25px 65px #35387620; transform: none; }
.hero-preview-top { color: #596681; }
.hero-preview-top span:last-child { color: #8f2a16; background: #fff0e9; }
.hero-preview-options div { border-color: #e1e6f0; background: #f9faff; }
.hero-preview p { color: var(--muted); }
.public-steps article { border-color: #e1e6f0; }
.public-steps b { color: #14283a; background: #f04a24; }
.public-footer { color: #52617c; }
.site-credit { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; font-size: .86rem; }
.teacher-home-page .site-credit, .library-shell + .site-credit, .teacher-credit { width: min(1060px, calc(100% - 32px)); justify-content: center; text-align: center; }
.footer-credit { display: grid; gap: 4px; line-height: 1.45; }
.footer-credit small { color: #71808a; font-size: .78rem; }
body.game-active .teacher-credit { display: none; }
.home-auth-status { width: min(1180px, calc(100% - 32px)); margin: 0 auto; color: var(--muted); }
.home-auth-status:empty { display: none; }

.welcome-option { border-color: #cfe1dc; background: #f2faf7; }
.welcome-option.welcome-anonymous { border-color: #f0d9ce; background: #fff7f2; }
.welcome-option h2, .welcome-action strong { font-weight: 740; }
.welcome-icon { color: #173d52; background: #e7eff1; }
.welcome-anonymous .welcome-icon { color: #a8321b; background: #ffe6da; }
.welcome-action { border-color: #d8e4e2; background: #f8fbfa; }
.welcome-action-primary { border-color: #f0d9ce; background: #fff7f2; }
.welcome-action:hover { box-shadow: 0 12px 25px #173d5218; }
.welcome-member-top { display: block; }
.welcome-member-top h1 { max-width: 850px; }
.welcome-member-top p { font-size: 1.05rem; }
.welcome-recent-card, .saved-quiz-card { border-color: #e0e5ef; }
.welcome-recent-card h3 { color: var(--text); }
.library-guest, .library-empty { border-color: #d3e3df; background: #f4faf8; }
.room-setup-intro { border-color: #f0d9ce; background: #fff8f4; }
.room-setup-intro > p:first-child { color: #a8321b; }
.room-code-box { border-color: #d3e3df; background: linear-gradient(135deg, #fff8f3, #eaf6f2); }
.input-modes.has-selection { background: #eceff8; }
.mode-btn.active { color: #a8321b; }
.file-drop { color: #173d52; border-color: #9eb4bc; background: #f7faf9; }
.file-drop.dragging { border-color: #f04a24; background: #fff2ec; }
.upload-symbol { color: #173d52; background: #e7eff1; }
.format-guide { border-color: #e0e4f0; }
.format-guide summary, .text-btn { color: #a8321b; }
.text-btn:hover { background: #fff0e9; }
input:focus, textarea:focus, select:focus { border-color: #f04a24; box-shadow: 0 0 0 3px #f04a2420; }
:focus-visible, .file-drop:focus-within { outline-color: #f04a24; }
.presentation-overlay { color: #f7fbfc; background: radial-gradient(circle at 50% -20%, #245a68 0%, #173f50 50%, #102b3c 100%); }
.presentation-room { color: #e4e7ff; }
.presentation-hint { color: #dbe0ff; }

.ui-icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.account-menu { position: relative; z-index: 30; }
.account-menu summary { display: flex; align-items: center; gap: 6px; min-width: 56px; height: 48px; padding: 4px 8px 4px 4px; border: 1px solid #d9dfec; border-radius: 999px; background: #fff; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { border-color: #9eb4bc; box-shadow: 0 6px 18px #173d5217; }
.account-avatar { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; color: #fff; background: #173d52; font-size: .95rem; font-weight: 800; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-chevron { width: 14px; height: 14px; color: #52617c; }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.account-popover { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: min(280px, calc(100vw - 24px)); padding: 8px; border: 1px solid #e0e4f0; border-radius: 16px; background: #fff; box-shadow: 0 18px 45px #20294429; color: var(--text); }
.account-popover-user { padding: 12px 12px 14px; border-bottom: 1px solid #e6e9f1; }
.account-popover-user strong, .account-popover-user small { display: block; overflow-wrap: anywhere; }
.account-popover-user strong { font-size: .95rem; }
.account-popover-user small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.account-popover a, .account-popover button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 9px 10px; border-radius: 9px; background: transparent; color: var(--text); font-size: .9rem; font-weight: 650; text-align: left; }
.account-popover a:hover, .account-popover button:hover:not(:disabled) { background: #f3f4ff; }
.account-popover button { cursor: pointer; }
.account-popover button .ui-icon, .account-popover a .ui-icon { width: 18px; height: 18px; color: #2c6674; }
.google-signin-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid #747775; border-radius: 999px; color: #1f1f1f; background: #fff; box-shadow: 0 4px 12px #20294412; font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: .9rem; font-weight: 650; }
.google-signin-btn::before { content: ''; display: block; width: 20px; height: 20px; flex: none; background: center / contain no-repeat url('https://developers.google.com/static/identity/images/g-logo.png'); }
.google-signin-btn:hover:not(:disabled) { color: #1f1f1f; background: #f7f8fb; border-color: #4f5251; box-shadow: 0 6px 15px #2029441a; }

.history-dialog { width: min(760px, calc(100% - 32px)); max-height: min(760px, calc(100dvh - 32px)); padding: 0; border: 1px solid #dfe5ef; border-radius: 22px; color: var(--text); background: #fff; box-shadow: 0 24px 80px #14283a42; }
.history-dialog::backdrop { background: #14283a80; backdrop-filter: blur(3px); }
.history-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid #e6e9f1; }
.history-dialog-head h2 { margin: 6px 0 0; color: #14283a; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #d9dfec; border-radius: 50%; color: #52617c; background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.icon-btn:hover { border-color: #173d52; color: #173d52; background: #f3f6f7; }
.history-list { display: grid; gap: 10px; padding: 20px 26px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; border: 1px solid #e0e5ef; border-radius: 14px; background: #f9fbfc; }
.history-item strong, .history-item small { display: block; }
.history-item strong { color: #14283a; }
.history-item small { margin-top: 4px; color: #63737d; font-size: .82rem; }
.history-item-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.history-delete-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #a91919; background: transparent; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.history-delete-btn:hover { border-color: #f4cccc; background: #fff1f1; }
.application-details { margin: 0 26px 26px; padding: 18px; border: 1px solid #d3e3df; border-radius: 16px; background: #f4faf8; }
.application-details-head h3 { margin: 0; color: #14283a; font-size: 1.05rem; }
.application-details-head p { margin: 5px 0 14px; color: #63737d; font-size: .86rem; }
.history-ranking { display: grid; gap: 7px; }
.history-ranking-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; }
.history-ranking-row b { color: #2c6674; }
.history-ranking-row span { overflow-wrap: anywhere; font-weight: 700; }
.history-ranking-row small { color: #63737d; font-size: .78rem; }
.history-loading { margin: 0; color: #63737d; }
.study-share-body { display: grid; gap: 18px; padding: 22px 26px 26px; }
.study-share-body > p { margin: 0; color: var(--muted); line-height: 1.6; }
.study-share-callout { display: grid; gap: 6px; padding: 16px; border: 1px solid #d9e5e2; border-radius: 14px; background: #f4faf8; }
.study-share-callout span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.study-share-status { display: inline-flex; width: max-content; margin-bottom: 12px; padding: 6px 10px; border-radius: 999px; color: #14532d; background: #dcfce7; font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.study-share-body label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.study-share-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.study-share-link-row input { min-width: 0; margin: 0; padding: 12px 14px; border-radius: 12px; color: #294452; background: #f7f9fa; }
.study-share-link-row .secondary-btn { padding: 12px 16px; border-radius: 12px; }
.study-share-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.study-share-actions > * { padding: 11px 15px; border-radius: 12px; font-size: .84rem; }

/* Estudo autônomo por link: sem sala, ranking ou gravação de respostas. */
.study-shell { width: 100%; }
.study-intro .student-brand { margin: 0 auto 18px; }
.study-intro > p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.study-note { margin: 22px 0; padding: 15px 16px; border: 1px solid #d6e4e1; border-radius: 14px; color: #36545e; background: #f3f8f7; font-size: .9rem; line-height: 1.55; }
.study-quiz { gap: 0; min-height: auto; }
.study-quiz-header { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #dfe7e9; }
.study-mini-brand { flex: none; }
.study-mini-brand img { display: block; width: 54px; height: 54px; object-fit: cover; border-radius: 13px; }
.study-quiz-header > div { display: grid; gap: 3px; min-width: 0; }
.study-quiz-header strong { overflow-wrap: anywhere; color: var(--text); font-size: 1rem; }
.study-quiz-header span { color: var(--muted); font-size: .8rem; font-weight: 750; }
.study-quiz .question-statement { margin-top: 0; }
.study-nav-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.study-next { margin-left: auto; }
.study-finish-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.study-finished #studyResult { font-size: 1.15rem; line-height: 1.6; }
@media (max-width: 620px) {
  .history-dialog { width: calc(100% - 20px); }
  .history-dialog-head, .history-list { padding-left: 18px; padding-right: 18px; }
  .history-item { align-items: stretch; flex-direction: column; }
  .history-item-actions { align-items: stretch; flex-direction: column; }
  .history-item-actions .secondary-btn, .history-item-actions .text-btn { width: 100%; }
  .application-details { margin-left: 18px; margin-right: 18px; }
  .history-ranking-row { grid-template-columns: 34px minmax(0, 1fr); }
  .history-ranking-row small { grid-column: 2; }
  .study-share-body { padding-left: 18px; padding-right: 18px; }
  .study-share-link-row { grid-template-columns: 1fr; }
  .study-share-actions, .study-share-actions > * { width: 100%; }
  .study-nav-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-nav-actions > * { width: 100%; }
}
@media (max-width: 700px) {
  .public-header nav { width: 100%; justify-content: flex-end; }
  .public-header nav .header-login { margin-left: 0; }
}
@media (max-width: 900px) {
  .topbar .top-actions { width: 100%; justify-content: flex-end; }
}

/* Identidade Vai de Quiz e vitrine pública. */
.topbar { min-height: 86px; height: auto; }
.topbar .brand-mark { width: 82px; height: 75px; }
.presentation-brand .brand-mark { width: 60px; height: 55px; }

body.landing {
  overflow-x: hidden;
  color: #14283a;
  background:
    radial-gradient(circle at 84% 7%, #f6c9b5 0, #f6c9b500 25%),
    radial-gradient(circle at 7% 30%, #dcebed 0, #dcebed00 27%),
    #fbfaf6;
}
.landing .public-header { position: relative; z-index: 10; padding: 12px 0; }
.landing .public-header .brand-mark { width: 118px; height: 108px; border-radius: 18px; box-shadow: 0 12px 30px #14283a12; }
.landing .public-header nav { align-items: center; }
.landing .public-header nav a { color: #263b49; font-size: .91rem; font-weight: 750; }
.landing .public-header nav a:hover { color: #14283a; background: #fff0e9; }
.landing .public-header nav .header-login { min-height: 44px; padding: 10px 18px; color: #fff; border: 1px solid #173d52; background: #173d52; box-shadow: 0 8px 18px #173d5220; }
.landing .public-header nav .header-login:hover { color: #fff; background: #0d2c3d; }
.landing .public-main { width: min(1180px, calc(100% - 32px)); }

.landing .public-hero { position: relative; grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr); gap: clamp(38px, 6vw, 78px); min-height: 560px; padding: clamp(32px, 5vw, 64px) 0 clamp(56px, 7vw, 88px); }
.landing .public-hero::before { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; top: 0; left: -180px; border: 2px dashed #f04a2460; border-radius: 50%; }
.landing .public-hero-copy { min-width: 0; }
.hero-ai-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; padding: 7px 11px; border: 1px solid #f5b49f; border-radius: 999px; color: #9b321d; background: #fff1eb; font-size: .75rem; font-weight: 850; letter-spacing: .035em; }
.hero-ai-badge .ui-icon { width: 16px; height: 16px; }
.landing .public-hero h1 { max-width: 700px; margin: 0 0 22px; color: #14283a; font-size: clamp(2.35rem, 3.8vw, 3.65rem); line-height: 1.04; font-weight: 850; letter-spacing: -.05em; text-wrap: balance; }
.landing .public-hero p { max-width: 635px; margin: 0; color: #4d6170; font-size: clamp(1.02rem, 1.45vw, 1.16rem); line-height: 1.7; }
.landing .home-actions { justify-content: flex-start; gap: 12px; margin-top: 28px; }
.landing .primary-btn { min-height: 50px; padding: 13px 21px; color: #fff; background: #173d52; box-shadow: 0 12px 26px #173d5230; }
.landing .primary-btn:hover:not(:disabled) { color: #fff; background: #0d2c3d; box-shadow: 0 15px 30px #173d523d; }
.landing .secondary-btn { min-height: 50px; padding: 12px 20px; color: #14283a; border: 1px solid #d7cfc0; background: #fff; }
.landing .secondary-btn:hover:not(:disabled) { border-color: #f04a24; background: #fff7f2; }
.hero-proof { display: flex; gap: 10px 20px; flex-wrap: wrap; padding: 0; margin: 24px 0 0; color: #526472; font-size: .85rem; list-style: none; }
.hero-proof li { display: inline-flex; align-items: center; gap: 7px; }
.hero-proof span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #14283a; background: #f5ad8d; font-size: .72rem; font-weight: 900; }

.landing .hero-preview { position: relative; z-index: 1; padding: clamp(24px, 3vw, 34px); border: 2px solid #173d52; border-radius: 26px; background: #fffefa; box-shadow: 13px 15px 0 #f04a24, 0 28px 65px #173d5224; transform: rotate(1.1deg); }
.landing .hero-preview::after { content: '?'; position: absolute; z-index: -1; top: -55px; right: -32px; display: grid; place-items: center; width: 82px; height: 82px; border-radius: 25px; color: #fff; background: #173d52; font-size: 2.4rem; font-weight: 900; transform: rotate(8deg); }
.landing .hero-preview-top { color: #536874; letter-spacing: .035em; }
.landing .hero-preview-top strong { color: #14283a; letter-spacing: .13em; }
.landing .hero-preview-top span:last-child { color: #87301e; background: #ffe8dc; }
.landing .hero-preview h2 { margin: 24px 0; color: #14283a; font-size: clamp(1.55rem, 2.45vw, 2.25rem); }
.landing .hero-preview-options div { position: relative; border-color: #dce4e5; background: #f8faf9; }
.landing .hero-preview-options .preview-selected { color: #14283a; border-color: #f04a24; background: #fff0e9; box-shadow: inset 0 0 0 1px #f04a24; }
.landing .hero-preview-options .preview-selected > span { margin-left: auto; color: #a8321b; font-weight: 900; }
.landing .hero-preview p { display: flex; align-items: center; gap: 9px; color: #586a75; }
.preview-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #f04a24; box-shadow: 0 0 0 5px #f04a2420; }

.feature-ribbon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 28px; overflow: hidden; border: 1px solid #dfd8ca; border-radius: 22px; background: #fff; box-shadow: 0 16px 42px #173d520d; }
.feature-ribbon article { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 22px 24px; }
.feature-ribbon article + article { border-left: 1px solid #e7e0d4; }
.feature-ribbon .feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #a8321b; background: #fff0e9; flex: none; }
.feature-ribbon article:nth-child(2) .feature-icon { color: #fff; background: #173d52; }
.feature-ribbon article:nth-child(3) .feature-icon { color: #14283a; background: #eee5d2; }
.feature-ribbon strong, .feature-ribbon small { display: block; }
.feature-ribbon strong { color: #14283a; font-size: .96rem; }
.feature-ribbon small { margin-top: 3px; color: #63737d; line-height: 1.4; }

.landing .public-section { margin: 28px 0; padding: clamp(30px, 4.5vw, 54px); border: 1px solid #e4ddd1; border-radius: 28px; background: #fff; box-shadow: 0 16px 45px #173d520b; }
.section-heading { max-width: 720px; margin-bottom: 28px; }
.section-heading > span, .section-tag, .public-cta > div > span { color: #c63b20; font-size: .75rem; font-weight: 900; letter-spacing: .12em; }
.landing .section-heading h2, .landing .reuse-copy h2, .landing .public-cta h2 { margin: 8px 0 10px; color: #14283a; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; }
.landing .section-heading p { margin: 0; color: #5a6c77; }
.landing .public-steps { gap: 16px; }
.landing .public-steps article { position: relative; min-height: 224px; padding: 25px; overflow: hidden; border: 1px solid #dfe5e4; border-radius: 20px; background: #f9fbfa; }
.landing .public-steps article::after { content: ''; position: absolute; width: 78px; height: 78px; right: -34px; bottom: -35px; border-radius: 50%; background: #f04a2414; }
.landing .public-steps article:nth-child(2)::after { background: #173d5214; }
.landing .public-steps article:nth-child(3)::after { background: #d7c8aa35; }
.landing .public-steps b { width: 42px; height: 42px; border-radius: 13px; color: #14283a; background: #f5ad8d; }
.landing .public-steps article:nth-child(2) b { color: #fff; background: #173d52; }
.landing .public-steps article:nth-child(3) b { color: #14283a; background: #e9dfca; }
.landing .public-steps h3 { color: #14283a; font-size: 1.16rem; }
.landing .public-steps p { margin-bottom: 0; color: #5a6c77; }

.landing .reuse-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); align-items: center; gap: clamp(34px, 6vw, 74px); color: #fff; border-color: #173d52; background: #173d52; }
.landing .reuse-copy .section-tag { color: #ffd8c7; }
.landing .reuse-copy h2 { color: #fff; }
.landing .reuse-copy p { color: #d8e4e7; }
.landing .reuse-copy .secondary-btn { margin-top: 10px; color: #14283a; border-color: #fff; background: #fff; }
.library-preview { padding: 16px; border: 1px solid #ffffff38; border-radius: 22px; background: #f7f4ec; box-shadow: 12px 12px 0 #f04a24; color: #14283a; transform: rotate(-1deg); }
.library-preview-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 15px; }
.library-preview-head span { font-weight: 850; }
.library-preview-head b { padding: 6px 9px; border-radius: 999px; color: #8f2a16; background: #ffe3d5; font-size: .72rem; }
.library-preview article { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid #e0ddd4; border-radius: 15px; background: #fff; }
.library-preview article + article { margin-top: 9px; }
.library-preview article strong, .library-preview article small { display: block; }
.library-preview article small { margin-top: 3px; color: #687984; }
.saved-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: #173d52; font-weight: 900; }
.saved-icon.orange { color: #14283a; background: #f5ad8d; }
.saved-icon.sand { color: #14283a; background: #e9dfca; }

.landing .public-faq { max-width: 900px; margin-left: auto; margin-right: auto; }
.landing .public-faq .section-heading { margin-bottom: 8px; }
.landing .public-faq details { padding: 18px 2px; border-bottom-color: #e7e0d4; }
.landing .public-faq summary { color: #14283a; font-size: 1.02rem; }
.landing .public-faq details p { color: #5a6c77; }

.public-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: 28px 0; padding: clamp(30px, 4.5vw, 54px); overflow: hidden; border: 2px solid #14283a; border-radius: 28px; color: #071a25; background: #f04a24; box-shadow: 10px 10px 0 #173d52; }
.landing .public-cta h2 { max-width: 670px; margin-bottom: 0; color: #071a25; }
.landing .public-cta > div > span { color: #071a25; }
.landing .public-cta .home-actions { flex: none; margin: 0; }
.landing .public-cta .primary-btn { color: #fff; background: #14283a; }
.landing .public-cta .secondary-btn { color: #14283a; border-color: #14283a; background: #fff8ee; }

.landing-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 20px 0 30px; border-top: 1px solid #ded6c7; color: #536470; }
.footer-logo img { display: block; width: 76px; height: auto; border-radius: 11px; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 10px 18px; flex-wrap: wrap; }
.landing-footer nav { display: flex; align-items: center; justify-content: center; gap: 9px 18px; flex-wrap: wrap; }
.landing-footer nav a { font-weight: 700; }
.landing-footer nav a:hover { color: #a8321b; }
.footer-social { display: flex; align-items: center; gap: 7px; }
.footer-social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d9d4ca; border-radius: 50%; color: #354b57; background: #fff; }
.footer-social a:hover { color: #fff; border-color: #173d52; background: #173d52; transform: translateY(-1px); }
.footer-social .ui-icon { width: 19px; height: 19px; }
.landing-footer > span { text-align: right; }

.legal-shell { width: min(860px, calc(100% - 32px)); margin: 24px auto 60px; padding: clamp(28px, 5vw, 58px); border: 1px solid #e4ddd1; border-radius: 28px; background: #fff; box-shadow: 0 18px 50px #173d520c; }
.legal-shell h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.045em; }
.legal-shell h2 { margin: 30px 0 8px; font-size: 1.25rem; }
.legal-shell p, .legal-shell li { color: #536470; line-height: 1.7; }
.legal-shell .legal-updated { color: #a8321b; font-size: .82rem; font-weight: 800; letter-spacing: .05em; }

@media (max-width: 920px) {
  .landing .public-hero { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .landing .hero-preview { max-width: 650px; }
  .landing .reuse-section { grid-template-columns: minmax(0, 1fr); }
  .public-cta { align-items: flex-start; flex-direction: column; }
  .landing .public-cta .home-actions { width: 100%; }
}
@media (max-width: 760px) {
  .feature-ribbon { grid-template-columns: 1fr; }
  .feature-ribbon article + article { border-top: 1px solid #e7e0d4; border-left: 0; }
  .landing-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .landing-footer > span { text-align: center; }
}
@media (max-width: 700px) {
  .landing .public-header { align-items: center; flex-direction: row; }
  .landing .public-header .brand-mark { width: 94px; height: 86px; border-radius: 14px; }
  .landing .public-header nav { width: auto; margin-left: auto; }
  .landing .public-header nav > a[href^="#"] { display: none; }
  .landing .public-header nav > a:not(.header-login) { padding: 9px 8px; }
  .landing .public-header nav .header-login { margin-left: 0; padding: 9px 13px; }
  .landing .public-hero { gap: 46px; padding-top: 26px; }
  .landing .public-hero h1 { font-size: clamp(2.25rem, 11vw, 3.1rem); }
  .landing .hero-preview { margin-right: 10px; box-shadow: 9px 10px 0 #f04a24, 0 22px 50px #173d521c; transform: none; }
  .landing .hero-preview::after { top: -42px; right: -18px; width: 64px; height: 64px; border-radius: 19px; font-size: 1.9rem; }
  .landing .home-actions > * { width: 100%; }
  .hero-proof { display: grid; grid-template-columns: 1fr; }
  .landing .public-section, .public-cta { border-radius: 22px; }
  .library-preview { box-shadow: 8px 8px 0 #f04a24; transform: none; }
}
@media (max-width: 390px) {
  .landing .public-header nav > a:not(.header-login) { font-size: .82rem; }
  .landing .public-header nav .header-login { font-size: .82rem; }
  .landing .hero-preview-options { grid-template-columns: 1fr; }
  .landing .public-hero h1 { font-size: 2.16rem; }
  .library-preview article { grid-template-columns: 38px 1fr; }
  .library-preview article > span:last-child { display: none; }
}

/* Feedback curto e sala de espera para compartilhamento com a turma. */
.inline-feedback {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  margin: 8px 0;
  padding: 9px 13px;
  border: 1px solid #d7e2e5;
  border-radius: 999px;
  color: #294553;
  background: #f0f5f5;
  font-size: .86rem;
  font-weight: 650;
}
.inline-feedback.ok::before { content: '✓'; margin-right: 7px; color: #16705f; font-weight: 900; }
.status-box.inline-feedback.ok { color: #294553; }
.status-box.teacher-auth-status.ok { color: #294553; }
.inline-feedback.error { color: #8d2e20; border-color: #f0c9be; background: #fff3ef; }
.inline-feedback.error::before { content: '!'; display: grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 50%; color: #fff; background: #b83d27; font-size: .72rem; font-weight: 900; }
.inline-feedback:empty { display: none; }

.room-lobby-lead,
.room-ready-actions,
.players-lobby-note { display: none; }
.resume-panel {
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-top: 1px solid #e4e8ed;
  border-radius: 0;
  background: transparent;
}
.resume-panel summary {
  width: max-content;
  max-width: 100%;
  padding: 14px 0 4px;
  color: #687984;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
}
.resume-panel summary:hover { color: #a8321b; }
.resume-panel-content { margin-top: 8px; padding: 13px; border: 1px solid #e1e6e9; border-radius: 13px; background: #f7f9f9; }
.resume-panel-content p { margin: 0 0 5px; font-size: .85rem; }
.resume-panel-content small { display: block; color: #687984; font-size: .75rem; }
.resume-controls { margin-top: 3px; }

.players-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.players-panel-heading h2 { margin: 3px 0 0; }
.players-count-badge { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; color: #fff; background: #173d52; font-weight: 850; }
body.room-created:not(.game-active) .teacher-progress,
body.room-created:not(.game-active) .teacher-auth-status,
body.room-created:not(.game-active) .live-panel { display: none; }
body.room-created:not(.game-active) .teacher-grid { grid-template-columns: minmax(0, 1fr); }
body.room-created:not(.game-active) .teacher-sidebar {
  grid-column: 1;
  width: min(1120px, 100%);
  margin: 8px auto 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 20px;
}
body.room-created:not(.game-active) .room-panel,
body.room-created:not(.game-active) .players-panel { padding: clamp(24px, 4vw, 42px); border-radius: 28px; }
body.room-created:not(.game-active) .room-panel { display: flex; flex-direction: column; }
body.room-created .room-panel h1 { text-align: center; }
body.room-created:not(.game-active) .room-panel h1 { margin: 0 auto 7px; font-size: clamp(2rem, 4vw, 3.2rem); text-align: center; }
body.room-created:not(.game-active) .room-lobby-lead { display: block; max-width: 660px; margin: 0 auto 18px; font-size: clamp(.98rem, 1.4vw, 1.08rem); line-height: 1.55; text-align: center; }
body.room-created:not(.game-active) .room-lobby-lead span { display: block; }
body.room-created:not(.game-active) .room-code-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  margin: 6px 0 14px;
  padding: clamp(24px, 4vw, 38px);
  border: 0;
  border-radius: 24px;
  color: #fff;
  background: #173d52;
  box-shadow: 10px 10px 0 #f04a24;
}
body.room-created:not(.game-active) .room-code-copy { min-width: 0; }
body.room-created:not(.game-active) .room-join-instruction { margin: 0 0 14px; color: #fff; font-size: clamp(.9rem, 1.3vw, 1rem); line-height: 1.45; text-align: center; }
body.room-created:not(.game-active) .room-join-instruction b { color: #fff; }
body.room-created:not(.game-active) .room-code-label { color: #ffd7c9; }
body.room-created:not(.game-active) .room-code-box strong { margin: 10px 0 7px; color: #fff; font-size: clamp(3.2rem, 6vw, 5rem); letter-spacing: .07em; line-height: 1; white-space: nowrap; }
.room-qr-card { padding: 9px; border-radius: 16px; color: #173d52; background: #fff; box-shadow: 0 10px 24px rgba(5, 30, 43, .2); }
.room-qr-code { width: 100%; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 8px; }
.room-qr-code svg { display: block; width: 100%; height: 100%; }
.room-qr-code:not(:has(svg)) { color: #526472; font-size: .7rem; font-weight: 750; }
body.room-created:not(.game-active) .room-qr-card > span { margin-top: 6px; color: #173d52; font-size: .66rem; font-weight: 850; letter-spacing: .04em; line-height: 1.2; text-transform: uppercase; }
body.room-created:not(.game-active) .room-ready-actions { display: block; margin-top: 0; }
body.room-created:not(.game-active) #startBtn {
  width: 100%;
  min-height: 62px;
  margin: 0;
  gap: 12px;
  border: 2px solid #173d52;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #f04a24;
  font-size: 1.08rem;
}
body.room-created:not(.game-active) #startBtn .ui-icon { width: 22px; height: 22px; transition: transform .15s ease; }
body.room-created:not(.game-active) #startBtn:hover:not(:disabled) .ui-icon { transform: translateX(4px); }
body.room-created:not(.game-active) .players-lobby-note { display: block; margin-bottom: 16px; line-height: 1.5; }
body.room-created:not(.game-active) .players-list { max-height: 390px; overflow: auto; }
body.room-created:not(.game-active) .player-row span { display: none; }
body.room-created:not(.game-active) .player-row { min-height: 54px; border-color: #dfe8e6; background: #f8fbfa; }
body.game-active .room-ready-actions,
body.game-active .room-lobby-lead,
body.game-active .players-lobby-note,
body.game-active .room-join-instruction,
body.game-active .room-qr-card { display: none; }

@media (max-width: 900px) {
  body.room-created:not(.game-active) .teacher-sidebar { grid-template-columns: minmax(0, 1fr); }
  body.room-created:not(.game-active) .players-panel { min-height: 220px; }
}
@media (max-width: 520px) {
  body.room-created:not(.game-active) .room-panel,
  body.room-created:not(.game-active) .players-panel { padding: 20px; border-radius: 22px; }
  body.room-created:not(.game-active) .room-code-box { grid-template-columns: 1fr; justify-items: center; }
  body.room-created:not(.game-active) .room-code-copy { width: 100%; }
  body.room-created:not(.game-active) .room-qr-card { width: 132px; }
  body.room-created:not(.game-active) .room-code-box { box-shadow: 7px 7px 0 #f04a24; }
  body.room-created:not(.game-active) .room-code-box strong { font-size: clamp(3.4rem, 19vw, 5rem); }
}

/* Painel administrativo */
.admin-page { min-height: 100vh; color: #14283a; background: #f5f2eb; }
.admin-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 8px max(20px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid #ded8cc;
  background: rgba(255, 254, 250, .94);
  backdrop-filter: blur(14px);
}
.admin-topbar .logo { display: block; line-height: 0; }
.admin-topbar .brand-mark { display: block; width: 70px; height: 64px; overflow: hidden; border-radius: 12px; }
.admin-topbar .brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.admin-topbar .top-actions { display: flex; align-items: center; gap: 10px; }
.admin-shell { width: min(1280px, calc(100% - 36px)); min-height: calc(100vh - 190px); margin: 34px auto 60px; }
.admin-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: min(620px, 100%);
  margin: 8vh auto 0;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid #ded8cc;
  border-radius: 30px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(23, 61, 82, .1);
  text-align: center;
}
.admin-state h1 { margin: 9px 0 10px; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
.admin-state p { max-width: 470px; margin: 0 0 24px; color: #5b6c77; }
.admin-state .status-box { width: 100%; margin-top: 18px; }
.admin-mark { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 16px; border-radius: 19px; color: #fff; background: #173d52; box-shadow: 6px 6px 0 #f04a24; font-size: 1.45rem; font-weight: 900; }
.admin-mark-error { color: #7f2315; background: #ffd8ce; box-shadow: 6px 6px 0 #ba3a23; }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.admin-heading h1 { margin: 7px 0 5px; font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: .98; letter-spacing: -.055em; }
.admin-heading p, .admin-card-heading p { margin: 0; color: #60717b; }
.admin-page .section-eyebrow { color: #ba351d; font-size: .74rem; font-weight: 900; letter-spacing: .14em; }
.admin-page > .public-footer { width: min(1280px, calc(100% - 36px)); margin: 0 auto; border-top: 1px solid #ded8cc; }

.admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.admin-metric { position: relative; min-height: 164px; padding: 23px; overflow: hidden; border: 1px solid #dbe1df; border-radius: 21px; background: #fff; box-shadow: 0 12px 34px rgba(23, 61, 82, .055); }
.admin-metric::after { content: ''; position: absolute; right: -27px; bottom: -34px; width: 92px; height: 92px; border-radius: 50%; background: rgba(240, 74, 36, .09); }
.admin-metric:nth-child(3n + 2)::after { background: rgba(23, 61, 82, .08); }
.admin-metric:nth-child(3n)::after { background: rgba(225, 204, 161, .25); }
.admin-metric span, .admin-metric small { display: block; }
.admin-metric span { min-height: 34px; color: #536873; font-size: .82rem; font-weight: 780; text-transform: uppercase; letter-spacing: .055em; }
.admin-metric strong { display: block; margin: 8px 0 7px; color: #14283a; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; letter-spacing: -.04em; }
.admin-metric small { position: relative; z-index: 1; color: #667680; line-height: 1.4; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-card { margin: 16px 0; padding: clamp(22px, 3vw, 31px); border: 1px solid #dde2df; border-radius: 23px; background: #fff; box-shadow: 0 12px 36px rgba(23, 61, 82, .045); }
.admin-grid > .admin-card { margin: 0; min-width: 0; }
.admin-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.admin-card-heading h2 { margin: 5px 0 4px; color: #14283a; font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.025em; }
.admin-card-heading .secondary-btn { flex: none; }
.admin-card h3 { margin: 0 0 12px; color: #334b59; font-size: .94rem; }
.admin-list { display: grid; gap: 8px; min-width: 0; }
.admin-list-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; padding: 13px 14px; border: 1px solid #e4e8e6; border-radius: 14px; background: #f9fbfa; }
.admin-list-row > div { min-width: 0; }
.admin-list-row strong, .admin-list-row small { display: block; }
.admin-list-row strong { min-width: 0; overflow: hidden; color: #203b4a; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-row small { margin-top: 3px; color: #667780; line-height: 1.35; }
.admin-list-row b { flex: none; color: #9e301c; font-size: .88rem; }
.admin-empty { margin: 12px 0; color: #6b7b84; }

.admin-bar-chart { display: grid; grid-template-columns: repeat(14, minmax(12px, 1fr)); align-items: end; gap: 5px; min-height: 215px; padding-top: 16px; overflow: hidden; }
.admin-bar-column { display: grid; grid-template-rows: 21px 135px 26px; align-items: end; justify-items: center; height: 182px; min-width: 0; }
.admin-bar-column span { align-self: start; color: #526b77; font-size: .7rem; font-weight: 800; }
.admin-bar-column i { width: min(18px, 80%); min-height: 4px; border-radius: 7px 7px 3px 3px; background: #f04a24; box-shadow: 0 5px 12px rgba(240, 74, 36, .18); }
.admin-bar-column small { align-self: end; color: #71818a; font-size: .58rem; transform: rotate(-48deg); transform-origin: center; white-space: nowrap; }
.admin-breakdown { display: grid; gap: 20px; padding-top: 10px; }
.admin-breakdown > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 16px; }
.admin-breakdown span { color: #526873; font-weight: 750; }
.admin-breakdown b { color: #14283a; }
.admin-breakdown i { grid-column: 1 / -1; height: 9px; overflow: hidden; border-radius: 99px; background: #eaf0ee; }
.admin-breakdown em { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: #173d52; }
.admin-breakdown > div:nth-child(2) em { background: #f04a24; }
.admin-breakdown > div:nth-child(3) em { background: #c7a863; }

.admin-table-wrap { overflow-x: auto; border: 1px solid #e0e5e3; border-radius: 16px; }
.admin-table { width: 100%; min-width: 780px; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid #e7eae8; text-align: left; }
.admin-table th { color: #526873; background: #f6f8f7; font-size: .75rem; text-transform: uppercase; letter-spacing: .055em; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td { color: #3b5360; font-size: .9rem; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { margin-top: 3px; color: #73818a; }

.admin-analytics-card { border-top: 4px solid #f04a24; }
.admin-search-card { border-top: 4px solid #173d52; }
.admin-analytics-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin: 17px 0; }
.admin-analytics-metric { min-width: 0; padding: 16px 14px; border-radius: 15px; background: #f3f6f5; }
.admin-analytics-metric span, .admin-analytics-metric small { display: block; color: #61727c; font-size: .72rem; }
.admin-analytics-metric span { min-height: 32px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.admin-analytics-metric strong { display: block; margin: 3px 0; overflow: hidden; color: #14283a; font-size: 1.65rem; line-height: 1.1; text-overflow: ellipsis; }
.admin-event-list { display: grid; gap: 7px; margin-top: 20px; }
.admin-event-list h3 { margin: 0 0 4px; }
.admin-analytics-details { margin-top: 22px; }
.admin-analytics-details > div { min-width: 0; }
.admin-analytics-details .admin-list-row strong { max-width: min(460px, 34vw); }
.admin-search-grid { margin-top: 22px; }
.admin-search-grid > div { min-width: 0; }
.admin-search-grid .admin-list-row strong { max-width: min(430px, 34vw); }
.admin-access-form { margin-bottom: 18px; }
.admin-access-form label { display: block; margin-bottom: 7px; color: #405966; font-size: .84rem; font-weight: 800; }
.admin-access-form > div { display: flex; gap: 10px; }
.admin-access-form input { flex: 1; min-width: 0; min-height: 48px; padding: 11px 14px; border: 1px solid #cfd9d8; border-radius: 13px; color: #14283a; background: #fff; font: inherit; }
.admin-access-form input:focus { outline: 3px solid rgba(240, 74, 36, .18); border-color: #d54122; }
.admin-console-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.admin-console-links a { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 13px; border: 1px solid #d7dfdd; border-radius: 15px; color: #173d52; background: #f8faf9; font-weight: 800; text-align: center; }
.admin-console-links a:hover { border-color: #f04a24; background: #fff5f0; transform: translateY(-1px); }
.admin-footnote { max-width: 760px; margin: 20px auto 0; color: #697983; font-size: .8rem; line-height: 1.5; text-align: center; }
.admin-page .status-box:empty { display: none; }

@media (max-width: 980px) {
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-analytics-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-console-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .admin-shell { width: min(100% - 24px, 1280px); margin-top: 24px; }
  .admin-heading, .admin-card-heading { align-items: stretch; flex-direction: column; }
  .admin-heading .secondary-btn, .admin-card-heading .secondary-btn { width: 100%; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-search-grid .admin-list-row strong { max-width: 60vw; }
  .admin-analytics-details .admin-list-row strong { max-width: 60vw; }
  .admin-page > .public-footer { width: calc(100% - 24px); }
}
@media (max-width: 560px) {
  .admin-topbar { min-height: 68px; padding: 7px 12px; }
  .admin-topbar .brand-mark { width: 58px; height: 53px; }
  .admin-topbar .top-actions { gap: 6px; }
  .admin-topbar .ghost-btn { padding: 9px 10px; font-size: .78rem; }
  .admin-metrics { grid-template-columns: minmax(0, 1fr); }
  .admin-metric { min-height: 142px; }
  .admin-analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-access-form > div { flex-direction: column; }
  .admin-console-links { grid-template-columns: minmax(0, 1fr); }
  .admin-list-row { align-items: flex-start; }
  .admin-search-grid .admin-list-row strong { max-width: 52vw; }
  .admin-analytics-details .admin-list-row strong { max-width: 52vw; }
  .admin-state { margin-top: 5vh; padding: 30px 20px; border-radius: 23px; }
}
