/* ==========================================================================
   Acaac.IA — identidade visual
   Amarelo-acácia (a flor-pompom) sobre o verde profundo das folhas, fundo
   sálvia bem claro. Títulos em Bricolage Grotesque; texto em Atkinson
   Hyperlegible, desenhada para máxima legibilidade.
   ========================================================================== */

:root {
  --bg: #f3f7ef;
  --surface: #ffffff;
  --ink: #16271e;
  --ink-2: #4a5b50;
  --line: #d8e2d0;
  --leaf: #1f4d36;
  --leaf-2: #2f7a4b;
  --leaf-soft: #e2eedb;
  --sun: #f2c200;
  --sun-deep: #c99a00;
  --sun-soft: #fff4c2;
  --sun-hover: #ffd21f;
  --sun-ink: #6b5200;
  --on-sun: var(--ink);
  --danger: #b3261e;
  --danger-soft: #fde8e6;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(22, 39, 30, .06), 0 8px 24px -12px rgba(22, 39, 30, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; display: flex; flex-direction: column; }
main > .wrap, main > .auth { width: 100%; }
main > .auth { flex: 1; }
img { max-width: 100%; }
a { color: var(--leaf); text-underline-offset: 3px; }
a:hover { color: var(--leaf-2); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; color: var(--ink); letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
.lede { color: var(--ink-2); font-size: 1.05rem; margin: 6px 0 0; max-width: 56ch; }
.muted { color: var(--ink-2); font-size: .94rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 32px; padding-bottom: 56px; }

:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); color: var(--on-sun); padding: 8px 14px; border-radius: 999px; z-index: 50; }
.skip:focus { left: 12px; }

/* ---------- Cabeçalho ---------- */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(242,194,0,.35), 0 6px 20px -14px rgba(22,39,30,.35); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo img { width: 40px; height: 40px; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -.03em; color: var(--leaf); }

/* ---------- Botões ---------- */
button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--leaf);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { background: var(--leaf-soft); color: var(--leaf); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sun); border-color: var(--sun); color: var(--on-sun); box-shadow: 0 3px 0 var(--sun-deep); }
.btn-primary:hover { background: var(--sun-hover); color: var(--on-sun); }
.btn-primary:active { box-shadow: 0 1px 0 var(--sun-deep); transform: translateY(2px); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 4px 14px; font-size: .94rem; }
.btn-lg { min-height: 54px; padding: 10px 28px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
form.inline { display: inline; }

form.is-loading .btn-primary { pointer-events: none; }
form.is-loading .btn-primary::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid rgba(22, 39, 30, .25); border-top-color: var(--ink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span.label { display: block; font-weight: 700; margin-bottom: 4px; }
.field .hint { display: block; color: var(--ink-2); font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input:not([type]), textarea {
  display: block; width: 100%; min-height: 46px; padding: 10px 14px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px;
}
/* Lista suspensa (select): um só visual em todo o aplicativo, igual ao dos campos de texto, com seta própria */
select { -webkit-appearance: none; appearance: none; font: inherit; color: var(--ink); max-width: 100%; cursor: pointer;
  padding: 10px 40px 10px 14px; border: 2px solid var(--line); border-radius: 12px;
  background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231f4d36' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; }
select:hover { border-color: var(--leaf-2); }
select:focus-visible { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(47,122,75,.2); }
select:disabled { opacity: .6; cursor: not-allowed; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--leaf-2); box-shadow: 0 0 0 4px rgba(47, 122, 75, .18); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--sun-soft); border-radius: var(--r-md); margin-bottom: 22px; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--leaf); flex: none; }

.flash { background: var(--sun-soft); border-left: 6px solid var(--sun); padding: 12px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 20px 0 0; }

/* ---------- Entrada (login e cadastro) ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; flex: 1; }
.auth-art {
  position: relative; overflow: hidden; background: var(--sun-soft);
  padding: 56px 48px 0; display: flex; flex-direction: column; justify-content: flex-start;
}
.auth-art h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); max-width: 14ch; font-weight: 800; letter-spacing: -.03em; }
.auth-art .lede { color: var(--ink); opacity: .82; margin-top: 18px; font-size: 1.15rem; max-width: 40ch; }
.auth-art .sprig { margin: auto -48px -4px auto; width: min(460px, 82%); pointer-events: none; display: block; padding-top: 24px; }
.auth-art .brand-line { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.auth-art .brand-line img { width: 52px; height: 52px; }
.auth-art .brand-line .brand-word { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--leaf); letter-spacing: -.03em; }
.auth-demo { position: absolute; top: 18px; right: 18px; z-index: 2; }
.auth-form { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-form .btn-primary { width: 100%; margin-top: 4px; }
.auth-alt { margin-top: 22px; text-align: center; }

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

/* ---------- Alunos ---------- */
.search { display: block; max-width: 420px; margin-bottom: 20px; }
.student-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.student-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .15s ease, transform .15s ease;
}
.student-card:hover { border-color: var(--sun); transform: translateY(-2px); color: var(--ink); }
.avatar {
  flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; background: var(--sun); color: var(--on-sun);
}
.student-grid li:nth-child(3n+2) .avatar { background: var(--leaf); color: #fff; }
.student-grid li:nth-child(3n+3) .avatar { background: var(--leaf-soft); color: var(--leaf); }
.student-info { display: flex; flex-direction: column; min-width: 0; }
.student-info strong { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-info span { color: var(--ink-2); font-size: .92rem; }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--r-lg); }
.empty img { width: 180px; margin-bottom: 8px; }
.empty h2 { margin-bottom: 8px; }
.empty p { max-width: 44ch; margin: 0 auto 20px; color: var(--ink-2); }

/* ---------- Perfil do aluno ---------- */
.profile-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--surface); border-radius: var(--r-lg); padding: 24px; margin-bottom: 28px; box-shadow: var(--shadow); }
.profile-hero .avatar { width: 76px; height: 76px; font-size: 2.2rem; }
.profile-hero .who { flex: 1 1 260px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: .9rem; font-weight: 700; background: var(--leaf-soft); color: var(--leaf); }
.chip.warn { background: var(--sun-soft); color: var(--sun-ink); }
.chip.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-2); }
.chip.warn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun-deep); }
.ring {
  --p: 0; width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--sun) calc(var(--p) * 1%), var(--leaf-soft) 0);
}
.ring span { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.ring-wrap { display: flex; align-items: center; gap: 12px; }
.ring-wrap p { margin: 0; line-height: 1.3; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.board-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.board-card { background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; height: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumb { aspect-ratio: 1; background: var(--bg); border-radius: 12px; display: grid; place-items: center; overflow: hidden; font-size: .7rem; color: var(--ink-2); text-align: center; padding: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.board-card h3 { word-break: break-word; }
.board-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.board-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.badge { font-size: .82rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--line); color: var(--ink-2); }
.badge.confirmed { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.badge.ia { background: var(--sun); border-color: var(--sun); color: var(--on-sun); }

.profile-panel { background: var(--surface); border-radius: var(--r-lg); padding: 8px 20px; box-shadow: var(--shadow); }
.profile-panel details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.profile-panel details:last-of-type { border-bottom: 0; }
.profile-panel summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.profile-panel summary::after { content: "+"; color: var(--leaf-2); font-size: 1.3rem; line-height: 1; }
.profile-panel details[open] summary::after { content: "–"; }
.profile-panel details p { margin: 8px 0 0; white-space: pre-wrap; color: var(--ink-2); }
.profile-panel .missing summary { color: var(--ink-2); font-weight: 400; }
.profile-panel .edit-link { display: block; padding: 12px 0; font-weight: 700; }

/* ---------- Novo board ---------- */
.options { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.option { background: var(--surface); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); }
.option.featured { border-top: 8px solid var(--sun); }
.option h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.option h2 svg { width: 28px; height: 28px; color: var(--sun-deep); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.suggestion { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 14px; cursor: pointer; color: var(--leaf); font-weight: 700; font-size: .94rem; }
.suggestion:hover { background: var(--sun-soft); border-color: var(--sun); }
.dictate { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; }
.inline-fields { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.inline-fields .field { flex: 0 0 150px; margin: 0; }

/* ---------- Editor de board ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
textarea.title-input, input.title-input { width: 100%; max-width: 860px; resize: none; overflow: hidden; line-height: 1.2; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; border-color: transparent; background: transparent; padding-left: 0; letter-spacing: -.015em; }
textarea.title-input:hover, input.title-input:hover { border-color: var(--line); padding-left: 14px; }
textarea.title-input:focus, input.title-input:focus { padding-left: 14px; background: var(--surface); }
.cards { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card-edit { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 10px; text-align: center; }
.card-edit:has(.noimg) { border-style: dashed; border-color: var(--sun-deep); background: var(--sun-soft); }
.card-edit img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; }
.noimg { width: 100%; aspect-ratio: 1; display: grid; place-items: center; font-size: .85rem; color: var(--sun-ink); font-weight: 700; }
.card-edit input { font-size: .88rem; margin-top: 6px; min-height: 40px; padding: 6px 2px; text-align: center; font-weight: 700; border-color: transparent; background: transparent; }
.card-edit input:hover, .card-edit input:focus { background: var(--surface); border-color: var(--line); }
.actionbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 0; }
.actionbar .status { color: var(--ink-2); font-size: .94rem; }
.search-panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.search-panel h2 { margin-bottom: 12px; }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; max-height: 60vh; overflow: auto; }
.result { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--ink); }
.result:hover { border-color: var(--sun); background: var(--sun-soft); }
.result img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.ai-note { background: var(--sun-soft); border-radius: var(--r-md); padding: 12px 16px; margin: 14px 0 0; font-size: .96rem; }

/* ---------- Modo de uso (o aluno) ---------- */
.use-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; flex-wrap: wrap; }
.sentence {
  position: sticky; top: 64px; z-index: 10; display: flex; gap: 12px; align-items: center; margin: 14px 0 20px;
  background: var(--surface); border: 3px solid var(--sun); border-radius: var(--r-lg); padding: 10px 12px; min-height: 112px; box-shadow: var(--shadow);
}
.sentence-cards { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 88px; }
.sentence-cards:empty::before { content: "Toque nos cartões para montar a frase"; color: var(--ink-2); }
.sentence .btn { flex: none; }
.cards.use { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; padding-bottom: 48px; }
.cards.use li { display: flex; }
.card-btn {
  height: 100%; display: flex; flex-direction: column; justify-content: center; width: 100%; padding: 12px; cursor: pointer; background: var(--surface); border: 3px solid var(--line); border-radius: 28px;
  transition: transform .1s ease, border-color .1s ease, background .1s ease;
}
.card-btn:hover { border-color: var(--sun); }
.card-btn:active { transform: scale(.96); background: var(--sun-soft); border-color: var(--sun-deep); }
.card-face { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.card-face img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.card-face.small { font-size: .85rem; width: 84px; background: var(--bg); border-radius: 14px; padding: 4px; }

/* ---------- Erro ---------- */
.error-page { text-align: center; padding: 72px 20px; }
.error-page img { width: 160px; margin-bottom: 12px; }
.error-page p { color: var(--ink-2); max-width: 44ch; margin: 10px auto 24px; }

/* ---------- Rodapé ---------- */
.site-footer { margin-top: 56px; padding: 0 0 40px; color: var(--ink-2); font-size: .88rem; text-align: center; }
.site-footer .foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 36px; position: relative; }
.foot::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(520px, 80%); height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sun) 30%, var(--sun) 70%, transparent); }
.foot-logo { width: 180px; max-width: 60%; height: auto; opacity: .92; }
.foot-org { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--leaf); letter-spacing: .01em; }
.foot-org span { font-weight: 500; color: var(--ink-2); }
.foot-credit { margin: 4px 0 0; max-width: 56ch; font-size: .8rem; color: var(--ink-2); opacity: .85; }
.foot-credit a { color: inherit; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 0; }
  .auth-art .brand-line { margin-bottom: 22px; }
  .auth-art .sprig { width: 230px; margin: -10px -24px -4px auto; padding-top: 0; }
  .columns, .editor, .options { grid-template-columns: 1fr; }
  .search-panel { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-user { display: none; }
  .wrap { padding: 0 16px; }
  .page { padding-top: 22px; }
  .profile-hero { padding: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.use { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-face { font-size: 1.15rem; }
  .sentence { top: 64px; min-height: 0; flex-wrap: wrap; padding: 10px; }
  .sentence-cards { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; min-height: 96px; padding-bottom: 4px; }
  .card-face.small { flex: none; }
  .sentence .btn { flex: 1; }
  .card-edit input { font-size: .85rem; padding: 6px 2px; }
  .actionbar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); margin: 0 -16px; padding: 12px 16px; z-index: 5; }
  .actionbar .btn-primary { flex: 1 1 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.card-face:not(.small):not(:has(img)) { min-height: 150px; justify-content: center; font-size: 1.6rem; text-align: center; }
.logo-hidden { display: none; }
.page-auth .site-header { display: none; }

/* ---------- Marca: Acaac.IA ----------
   O "caa" escondido no meio do nome é o CAA; o ".IA" no fim é a IA.
   O "caa" vai em marca-texto amarelo, com letras verdes. */
.wordmark .dot { color: var(--sun-deep); margin: 0 .01em; }
.wordmark .ia { font-weight: 800; color: var(--leaf-2); }
.wordmark .caa {
  color: var(--caa-ink, var(--leaf)); background: var(--sun); border-radius: .12em; padding: 0 .06em; margin: 0 .02em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- Avatares ---------- */
.avatar.avatar-img { background: var(--leaf-soft) !important; padding: 0; overflow: hidden; }
.avatar.avatar-img img { width: 100%; height: 100%; display: block; }
.avatar.sm { width: 40px; height: 40px; font-size: 1.1rem; }
.profile-hero .avatar.xl { width: 88px; height: 88px; font-size: 2.4rem; }
.avatar-picker legend { font-weight: 700; padding: 0; }
.avatar-picker { border: 0; padding: 0; margin: 0 0 22px; }
.avatar-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 6px; }
.avatar-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; font-size: .9rem; }
.avatar-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.avatar-opt img { width: 56px; height: 56px; }
.avatar-opt:hover { border-color: var(--sun); }
.avatar-opt:has(input:checked) { border-color: var(--leaf-2); background: var(--leaf-soft); font-weight: 700; }
.avatar-opt:has(input:focus-visible) { outline: 3px solid var(--leaf); outline-offset: 2px; }

/* ---------- Painel ---------- */
.dash { display: grid; gap: 16px; margin-bottom: 32px; }
.kpis { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi-hero { background: var(--leaf); color: #fff; }
.kpi-num { font-family: var(--font-display); font-weight: 800; font-size: 3.5rem; line-height: 1; letter-spacing: -.03em; }
.kpi-num.sm { font-size: 2rem; }
.kpi-label { font-weight: 700; }
.kpi-sub { color: var(--ink-2); font-size: .92rem; }
.kpi-hero .kpi-sub { color: #cfe3d4; }
.meter { display: block; height: 8px; border-radius: 999px; background: var(--leaf-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--leaf-2); border-radius: 999px; }
.kpi .meter { margin-top: 8px; }
.dash-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.2rem; }
.legend { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; font-size: .92rem; color: var(--ink-2); flex-wrap: wrap; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-a, .cbar-a { background: #2f7a4b; }
.sw-b, .cbar-b { background: #c99a00; }
.chart { margin: 0; position: relative; }
.plot { display: grid; grid-template-columns: 32px 1fr; height: 200px; }
.yaxis { display: flex; flex-direction: column; justify-content: space-between; font-size: .78rem; color: var(--ink-2); padding-bottom: 22px; line-height: 1; text-align: right; padding-right: 8px; }
.cols { position: relative; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; }
.grid-lines { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.grid-lines i { border-top: 1px solid var(--line); height: 0; }
.day { position: relative; display: flex; flex-direction: column; min-width: 0; outline-offset: -2px; border-radius: 6px; }
.day:hover, .day:focus-visible { background: rgba(47, 122, 75, .07); }
.bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.cbar { position: relative; width: 100%; max-width: 12px; border-radius: 4px 4px 0 0; min-height: 0; }
.cbar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: .8rem; color: var(--ink); padding-bottom: 2px; }
.xlab { height: 22px; text-align: center; font-size: .78rem; color: var(--ink-2); padding-top: 4px; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: #fff; font-size: .85rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); }
.table-view { margin-top: 12px; font-size: .92rem; }
.table-view summary { cursor: pointer; color: var(--leaf); font-weight: 700; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
.table-view table { border-collapse: collapse; width: 100%; }
.table-view th, .table-view td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); font-weight: 400; }
.table-view thead th { font-weight: 700; }
.chart-empty { padding: 28px 8px; text-align: center; color: var(--ink-2); }
.chart-empty p { margin: 4px 0; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.rank-pic { width: 40px; height: 40px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.rank-pic img { width: 100%; height: 100%; object-fit: contain; }
.rank-body { min-width: 0; display: grid; gap: 4px; }
.rank-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.rank-track { height: 10px; }
.rank-bar { display: block; height: 100%; background: #2f7a4b; border-radius: 0 4px 4px 0; min-width: 4px; }
.rank-count { font-family: var(--font-display); font-weight: 800; min-width: 2ch; text-align: right; }
.attention ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.attention li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.att-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.att-text span { color: var(--ink-2); font-size: .92rem; }
.list-head { margin-bottom: 12px; }
.student-info .mini { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.student-info .mini .meter { flex: 1; height: 6px; }
.student-info .mini small { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.student-info .week { font-size: .85rem; margin-top: 2px; }
.student-card .student-info { flex: 1; }

/* ---------- Frase falada com IA ---------- */
.spoken { margin: 14px 0 0; padding: 16px 18px; background: var(--sun-soft); border-radius: var(--r-lg); display: grid; gap: 10px; }
.spoken[hidden] { display: none; }
.spoken-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spoken-text { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.2; flex: 1 1 240px; }
.badge { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--leaf); color: #fff; }
.badge.plain { background: var(--leaf-soft); color: var(--leaf); }
.alts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alts .btn { font-weight: 400; }
.alts-label { color: var(--ink-2); font-size: .92rem; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--leaf); }
.use-tools { display: flex; justify-content: flex-end; padding-top: 10px; }

@media (max-width: 960px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-num { font-size: 3rem; }
  .plot { height: 170px; }
  .legend { gap: 10px; }
  .spoken-text { font-size: 1.35rem; }
}
@media (max-width: 640px) { .logo-word { font-size: 1.3rem; } .logo img { width: 32px; height: 32px; } .hide-sm { display: none; } }
.sub-head { font-size: 1.2rem; margin: 28px 0 6px; padding-top: 22px; border-top: 1px solid var(--line); }


/* ---------- Menu superior em abas ---------- */
.topnav { display: flex; align-items: center; gap: 10px; }
.tabs { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; background: var(--leaf-soft); border-radius: 999px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px 8px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 700; color: var(--leaf); white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.tab:hover { background: rgba(255,255,255,.7); color: var(--leaf); }
.tab.is-active { background: var(--leaf); color: #fff; box-shadow: 0 2px 6px -2px rgba(31,77,54,.5); }
.tab.is-active svg { fill: var(--sun); }
.tab.is-active:hover { background: var(--leaf); color: #fff; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; margin: 0 4px 0 6px; color: var(--ink-2); font-size: .94rem; max-width: 18ch; }
.nav-user i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: var(--on-sun); font-style: normal; font-weight: 800; font-family: var(--font-display); }
.nav-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-exit {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--leaf);
}
.btn-exit svg { width: 18px; height: 18px; fill: currentColor; }
.btn-exit:hover { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* Detalhes de acabamento */
.page-head h1 { position: relative; }
.page-head h1::after { content: ""; display: block; width: 44px; height: 5px; margin-top: 8px; border-radius: 99px; background: var(--sun); }
.student-card, .board-card, .panel, .kpi { transition: box-shadow .2s ease, transform .15s ease, border-color .15s ease; }
.panel:hover, .kpi:hover { box-shadow: 0 1px 2px rgba(22,39,30,.06), 0 14px 30px -14px rgba(22,39,30,.28); }
body { background-image: radial-gradient(900px 340px at 85% -80px, rgba(242,194,0,.16), transparent 70%); background-repeat: no-repeat; }

@media (max-width: 640px) {
  .nav-user { display: none; }
  .logo { gap: 6px; }
  .logo-word { font-size: 1.15rem !important; }
  .logo img { width: 28px !important; height: 28px !important; }
  .tabs { padding: 3px; gap: 2px; }
  .tab { padding: 6px 10px; font-size: .9rem; }
  .tab svg { display: none; }
  .btn-exit { padding: 6px 10px; font-size: .9rem; }
  .bar { gap: 8px; }
  .btn-exit svg { display: none; }
  .topnav { gap: 6px; }
}

/* ---------- Chaves de cor Fitzgerald ---------- */
[data-cls="pessoa"] { --fz-bg: #FFE45C; --fz-edge: #D9B800; }
[data-cls="verbo"] { --fz-bg: #9BE0A0; --fz-edge: #3FA84F; }
[data-cls="substantivo"] { --fz-bg: #FFC074; --fz-edge: #E08A1E; }
[data-cls="adjetivo"] { --fz-bg: #9CCFF5; --fz-edge: #3A8FD1; }
[data-cls="adverbio"] { --fz-bg: #D8B592; --fz-edge: #A67C52; }
[data-cls="preposicao"] { --fz-bg: #F8B4D9; --fz-edge: #D9619F; }
[data-cls="pergunta"] { --fz-bg: #CDB4F2; --fz-edge: #8A5CD6; }
[data-cls="negacao"] { --fz-bg: #F58E8E; --fz-edge: #D13B3B; }
[data-cls="outro"] { --fz-bg: #EEF0F2; --fz-edge: #B8BEC4; }
.no-fitz [data-cls] { --fz-bg: var(--surface); --fz-edge: var(--line); }
.card-edit[data-cls] { background: var(--fz-bg); border-color: var(--fz-edge); }
.thumb[data-cls] { background: var(--fz-bg); box-shadow: inset 0 -4px 0 var(--fz-edge); }
.card-btn[data-cls] { background: var(--fz-bg); border-color: var(--fz-edge); }
.card-btn[data-cls]:hover { border-color: var(--ink); }
.card-btn[data-cls]:active { background: var(--fz-bg); filter: brightness(.93); border-color: var(--ink); }
.card-face.small[data-cls] { background: var(--fz-bg); box-shadow: inset 0 -4px 0 var(--fz-edge); }
.card-face img { border-radius: 14px; }

.cls-select { font: inherit; font-size: .8rem; font-weight: 700; width: 100%; margin-top: 4px; padding: 5px 6px; border-radius: 10px;
  border: 2px solid var(--fz-edge); background-color: rgba(255,255,255,.7); color: var(--ink); cursor: pointer; min-height: 36px; padding-right: 22px; background-size: 14px; background-position: right 4px center; }
.fitz-legend { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 16px; margin-top: 14px; }
.fitz-legend summary { cursor: pointer; font-weight: 700; color: var(--leaf); }
.fitz-legend ul { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; }
.fitz-legend li { display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.fitz-legend li i { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid; }
.fitz-legend small { display: block; color: var(--ink-2); font-size: .8rem; }

/* ---------- Ouvir o cartão ---------- */
.speak-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--leaf); cursor: pointer; display: grid; place-items: center; padding: 0; }
.speak-btn svg { width: 20px; height: 20px; }
.speak-btn:hover:not(:disabled) { background: var(--sun-soft); border-color: var(--sun); }
.speak-btn:disabled { opacity: .35; cursor: default; }
.speak-btn.playing, .btn.playing { background: var(--sun); border-color: var(--sun-deep); color: var(--on-sun); }
.result-wrap { position: relative; display: flex; }
.result-wrap .result { width: 100%; }
.speak-btn.on-result { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; }
.btn .ico { width: 18px; height: 18px; fill: currentColor; }
.btn { gap: 8px; }

/* ---------- Uso offline e tablet ---------- */
.offline-chip { margin-right: auto; font-size: .88rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--sun-soft); color: var(--sun-ink); }
.offline-chip.ok { background: var(--leaf-soft); color: var(--leaf); }
.use-tools { align-items: center; gap: 18px; flex-wrap: wrap; }
.saved-boards { list-style: none; margin: 0 auto 18px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
button, a, .card-btn, select, summary { touch-action: manipulation; }
.card-btn, .card-face, .sentence { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
.site-header { padding-top: env(safe-area-inset-top); }
.site-footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
@media (display-mode: standalone) { .site-footer { margin-top: 32px; } }
@media (min-width: 641px) and (max-width: 1100px) and (pointer: coarse) {
  .cards.use { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
  .card-face { font-size: 1.5rem; }
  .btn, .tab, .btn-exit { min-height: 46px; }
}
.alts[hidden], .spoken[hidden], .offline-chip[hidden] { display: none; }
@media (max-width: 640px) {
  .cls-select { font-size: .74rem; padding: 4px 2px; }
}

/* ---------- Barra de ações do cartão (editor) ---------- */
.tools {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 8px; overflow: hidden;
  background: rgba(255, 255, 255, .78); border: 2px solid var(--fz-edge, var(--line)); border-radius: 999px;
}
.tools button {
  display: grid; place-items: center; height: 38px; min-width: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--leaf); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.tools button + button { border-left: 2px solid var(--fz-edge, var(--line)); }
.tools button svg { width: 20px; height: 20px; fill: currentColor; }
.tools button:hover:not(:disabled) { background: var(--leaf-soft); }
.tools button:focus-visible { outline-offset: -4px; }
.tools button:disabled { opacity: .3; cursor: default; }
.tools .speak-btn { width: auto; height: 38px; border-radius: 0; background: var(--sun); color: var(--on-sun); border-color: transparent; }
.tools .speak-btn:hover:not(:disabled) { background: var(--sun-hover); }
.tools .speak-btn.playing { background: var(--leaf); color: #fff; }
.tools .btn-remove:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }

/* ---------- Textos dos pictogramas em caixa alta ----------
   Só na exibição: o texto salvo e o que a voz fala continuam como digitados
   (alguns sintetizadores soletram palavras curtas em maiúsculas, como "EU"). */
.card-face span, .card-edit input, .result span, .thumb, .rank-name, .noimg {
  text-transform: uppercase; letter-spacing: .02em;
}
.card-face { font-size: 1.2rem; }
.card-face.small { font-size: .72rem; }
.card-edit input { font-size: .82rem; }
@media (min-width: 641px) and (max-width: 1100px) and (pointer: coarse) { .card-face { font-size: 1.3rem; } }
@media (max-width: 640px) { .card-face { font-size: 1.02rem; } }

/* Frase falada e alternativas também em caixa alta (a voz usa o texto original) */
.spoken-text, .alts .btn, .fitz-legend small, .cls-select option { text-transform: uppercase; }
.spoken-text { letter-spacing: .02em; font-size: 1.45rem; }
.alts .btn { letter-spacing: .02em; font-size: .85rem; }
.fitz-legend small { letter-spacing: .02em; }
@media (max-width: 640px) { .spoken-text { font-size: 1.2rem; } }
#search:not(:placeholder-shown) { text-transform: uppercase; letter-spacing: .02em; }

/* ---- painel de voz ---- */
.voice-panel { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); margin: 0 0 16px; box-shadow: var(--shadow); }
.voice-panel > summary { cursor: pointer; padding: 12px 18px; font-weight: 800; font-family: var(--font-display); display: flex; gap: 8px; align-items: center; list-style: none; color: var(--leaf); }
.voice-panel > summary::-webkit-details-marker { display: none; }
.voice-panel > summary::after { content: "⌄"; margin-left: auto; transition: transform .2s; }
.voice-panel[open] > summary::after { transform: rotate(180deg); }
.voice-panel .ico { width: 20px; height: 20px; fill: currentColor; }
.voice-body { padding: 0 18px 16px; display: grid; gap: 14px; }
.voice-note { margin: 0; }
.voice-row { display: grid; gap: 6px; }
.voice-row select { padding: 10px 40px 10px 12px; border: 2px solid var(--line); border-radius: 12px; font: inherit; background-color: #fff; max-width: 420px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; width: fit-content; max-width: 100%; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 16px; font-weight: 700; }
.seg input:checked + span { background: var(--leaf); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: -3px; }
.voice-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.voice-sliders label { display: grid; gap: 4px; }
.voice-sliders input[type=range] { width: 100%; accent-color: var(--leaf-2); height: 32px; }
.voice-sliders output { font-weight: 800; color: var(--leaf); margin-left: 6px; }
.range-ends { display: flex; justify-content: space-between; color: var(--ink-2); }
.voice-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.chip:hover { border-color: var(--leaf-2); }

/* ---- preenchimento por áudio ---- */
.audio-card { background: linear-gradient(135deg, var(--sun-soft), #fff); border: 2px solid var(--sun); border-radius: var(--r-lg); padding: 18px 20px; margin: 0 0 22px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.audio-card[hidden] { display: none; }
.audio-head { display: flex; gap: 14px; align-items: flex-start; }
.audio-head h2 { margin: 0 0 2px; }
.audio-head p { margin: 0; }
.audio-ico { color: var(--on-sun); font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--sun); border-radius: 50%; flex: none; }
.audio-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.audio-actions .btn { cursor: pointer; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,.55); } 50% { box-shadow: 0 0 0 10px rgba(192,57,43,0); } }
.audio-status { margin: 0; min-height: 1.4em; font-weight: 700; }
.audio-status[data-kind="ok"] { color: var(--leaf-2); }
.audio-status[data-kind="warn"] { color: #8a5a00; }
.audio-status[data-kind="err"] { color: #b3261e; }
.audio-status[data-kind="busy"] { color: var(--leaf); }
.audio-privacy { margin: 0; font-size: .88rem; }
.field.has-mic { position: relative; }
.field-mic { position: absolute; top: -4px; right: 0; display: inline-flex; gap: 4px; align-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 1.1rem; justify-content: center; }
.field-mic:hover { border-color: var(--sun); background: var(--sun-soft); }
.field-mic small { font-weight: 800; }
textarea.filled-by-audio, input.filled-by-audio { animation: audioflash 1.8s ease-out; }
@keyframes audioflash { 0% { background: #fff3b0; box-shadow: 0 0 0 4px rgba(242,194,0,.6); } 100% { background: #fff; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { textarea.filled-by-audio, input.filled-by-audio { animation: none; } }
.avatar-opt.suggested { animation: audioflash 1.8s ease-out; border-radius: 16px; }

.table-card { border: 2px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.table-card .table-scroll { margin: 0; }
.story-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: auto; }
.story-table th, .story-table td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--line); font-weight: 400; }
.story-table tbody tr:last-child > * { border-bottom: 0; }
.story-table thead th { background: var(--sun-soft); color: var(--leaf); font-family: var(--font-display); font-weight: 800; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; border-bottom: 2px solid var(--line); }
.story-table tbody tr:nth-child(even) > * { background: #fafbf7; }
.story-table tbody tr:hover > * { background: var(--sun-soft); }
.story-table .t-left { text-align: left; }
.story-table .t-center { text-align: center; }
.story-table .t-title { font-weight: 700; }
.t-titlebox { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.t-name { line-height: 1.3; }
.story-table .t-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--sun-soft); font-size: 1.05rem; }
.t-student { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 600; }
.pill-num { display: inline-block; min-width: 2.2em; padding: 3px 12px; border-radius: 999px; background: #e6f2ea; color: var(--leaf); font-family: var(--font-display); font-weight: 800; }
.stars-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.stars-row { letter-spacing: 2px; font-size: 1.15rem; }
.stars-row i { font-style: normal; color: #d9d6c3; }
.stars-row i.on { color: var(--sun); text-shadow: 0 1px 0 var(--sun-deep); }
.first-cell { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.mini-meter { display: inline-block; width: 96px; height: 10px; border-radius: 5px; background: #e9eee8; overflow: hidden; }
.mini-meter > span { display: block; height: 100%; background: #2f7a4b; border-radius: 5px; }


/* pictograma indisponível */
.img-fallback { display: grid; place-items: center; width: 100%; aspect-ratio: 1; min-height: 28px; color: #b5b08f; background: repeating-linear-gradient(45deg, #faf8ea, #faf8ea 8px, #f3efd2 8px, #f3efd2 16px); border-radius: 12px; }
.img-fallback svg { width: 42%; max-width: 48px; fill: currentColor; }
.rank-pic .img-fallback, .thumb .img-fallback { border-radius: 8px; aspect-ratio: auto; height: 100%; }

.pw-match { margin: -8px 0 14px; font-weight: 700; font-size: .92rem; }
.pw-match.ok { color: var(--leaf-2); }
.pw-match.bad { color: #b3261e; }

.search-row{display:flex;gap:8px;align-items:stretch;margin:0}
.search-row input{flex:1;min-width:0}
.search-row .btn{flex:none;white-space:nowrap}

.btn.is-busy, button.is-busy, .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
#upload-btn.is-busy { opacity: .55; pointer-events: none; cursor: progress; }
form.is-loading .btn { cursor: progress; }

/* ---- janela de confirmação ---- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(30rem, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  overflow: auto; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -12px rgba(22,39,30,.45);
  margin: auto; animation: modal-in .18s ease-out; }
dialog.modal::backdrop { background: rgba(22,39,30,.5); backdrop-filter: blur(2px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.modal { animation: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 12px; }
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sun-soft); font-size: 1.4rem; flex: none; }
.modal-danger .modal-icon { background: var(--danger-soft); }
.modal-title { margin: 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; }
.modal-body { padding: 0 24px 4px; display: grid; gap: 14px; }
.modal-msg { margin: 0; color: var(--ink-2); line-height: 1.45; }
.modal-group { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; }
.modal-group-label { font-size: .9rem; }
.modal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-chip { background: var(--sun-soft); border: 1px solid var(--sun-deep); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: .92rem; text-transform: uppercase; }
.modal-hint { margin: 0; font-size: .92rem; color: var(--ink-2); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }
.modal .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal .btn-danger:hover { background: var(--danger); filter: brightness(1.08); color: #fff; }
@media (max-width: 480px) { .modal-actions .btn { flex: 1 1 100%; } }

.title-wrap { flex: 1 1 100%; min-width: 0; }

.auth-art .expansion { margin: 0 0 14px; font-size: .95rem; letter-spacing: .01em; color: var(--ink-2); }
.auth-art .expansion b { color: var(--leaf); font-weight: 800; font-size: 1.05em; }
.auth-art .lede strong { color: var(--leaf); }
.auth-art .lede-2 { font-size: 1rem; opacity: .75; margin-top: 12px; }
.foot-expansion { margin-top: 6px; }

/* ---- próximo passo sugerido ---- */
.next-step { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--leaf-2); border-radius: var(--r-lg);
  padding: 18px 20px; margin: 0 0 18px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.next-up { border-left-color: var(--sun-deep); }
.next-down { border-left-color: #5b8bd6; }
.next-none { border-left-color: var(--line); }
.next-head { display: flex; align-items: center; gap: 12px; }
.next-ico { font-size: 1.8rem; width: 48px; height: 48px; border-radius: 50%; background: var(--sun-soft); display: grid; place-items: center; flex: none; }
.next-head h3 { margin: 0; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.next-title { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.next-reason { margin: 0; color: var(--ink); line-height: 1.45; }
.next-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-size: .92rem; }
.next-stats strong { color: var(--leaf); font-size: 1.1em; }
.next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.level-fields { display: grid; gap: 14px; margin-top: 4px; }
.level-fields select { font: inherit; width: 100%; padding: 10px 40px 10px 12px; border: 2px solid var(--line); border-radius: 12px; background-color: var(--surface); color: var(--ink); }
.suggestion-note { margin: 12px 0 0; }

/* ---- página "Como funciona" ---- */
.how { max-width: 920px; }
.how-hero { padding: 8px 0 20px; }
.how-kicker { margin: 0; color: var(--leaf-2); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.how-hero h1 { margin: 4px 0 6px; }
.expansion-line { margin: 0 0 14px; color: var(--ink-2); }
.expansion-line b { color: var(--leaf); font-weight: 800; }
.how-hero .lede strong { color: var(--leaf); }
.how-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.how-nav a { padding: 6px 14px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); font-weight: 700; text-decoration: none; font-size: .92rem; }
.how-nav a:hover { background: var(--sun-soft); }
.how-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 8px 0 28px; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.how-card > span { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.how-card h2 { font-size: 1.2rem; margin: 0 0 6px; }
.how-card p { margin: 0; color: var(--ink-2); }
.how-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px; scroll-margin-top: 90px; }
.how-section > h2 { margin-top: 0; }
.how-section h3 { margin: 22px 0 6px; font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.how-intro { color: var(--ink-2); }
.how-list { padding-left: 1.1rem; display: grid; gap: 10px; }
.how-note { background: var(--sun-soft); border-radius: var(--r-md); padding: 12px 14px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.tag.ok { background: var(--leaf-soft); color: var(--leaf); }
.tag.plan { background: #e3ecfb; color: #2c4f8f; }
.how-table-wrap { overflow-x: auto; margin: 8px 0; }
.how-table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.how-table th, .how-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.how-table th { background: var(--bg); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.auth-art .how-link { margin: 18px 0 0; }
.auth-art .how-link a { font-weight: 700; color: var(--leaf); }
@media (max-width: 560px) { .how-section { padding: 18px 16px; } }

@media (max-width: 640px) {
  .tab.tab-help span { display: none; }
  .tab.tab-help svg { display: block; width: 20px; height: 20px; }
  .tab.tab-help { padding: 6px 10px; }
}

.how-steps { padding-left: 1.2rem; display: grid; gap: 10px; margin: 8px 0 0; }
.how-steps li::marker { font-weight: 800; color: var(--leaf); }

.live-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--leaf-2); border-radius: var(--r-lg); padding: 16px 18px; margin: 0 0 16px; }
.live-card h3 { margin: 0 0 4px; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.live-log { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 10px; font-size: .9rem; }
.live-log ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
@media (max-width: 640px) { .live-card { grid-template-columns: 1fr; } }

.how-emoji { display: inline-block; margin-right: 2px; font-size: 1.15em; line-height: 1; }

.how-refs { padding-left: 1.1rem; display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.how-refs a { color: var(--leaf); }

/* ---- interruptor (liga/desliga) ---- */
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; background: #c9d3c8; transition: background .2s; margin-top: 1px; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22,39,30,.35); transition: transform .2s; }
.toggle input:checked + .track { background: var(--leaf-2); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--accent, #f2c200); outline-offset: 2px; }
.toggle .t-text { display: grid; gap: 2px; }
.toggle .t-text strong { font-size: .98rem; }
.toggle .t-text small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.options-bar { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin: 0 0 16px; }

/* ---- abas por categoria (cores Fitzgerald) ---- */
/* Abas estilo fichário: a aba ativa se une ao corpo (painel) da mesma cor */
.cat-tabs { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding: 4px 2px 0; margin: 0 0 -3px; position: relative; z-index: 1; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cat-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 16px; border-radius: 14px 14px 0 0; border: 3px solid var(--edge); background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; opacity: .85; }
.cat-tab:hover { opacity: 1; }
.cat-tab i { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--edge); }
.cat-tab small { font-weight: 700; opacity: .7; }
.cat-tab[aria-selected="true"] { opacity: 1; background: color-mix(in srgb, var(--bg) 55%, #fff); border-bottom-color: color-mix(in srgb, var(--bg) 55%, #fff); min-height: 50px; }
.cat-tab:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.cat-panel { border: 3px solid var(--edge); border-radius: 0 16px 16px 16px; background: color-mix(in srgb, var(--bg) 55%, #fff); }
body.no-fitz .cat-panel { --bg: #eef2ec !important; --edge: #9aa89b !important; }
body.no-fitz .cat-tab { --bg: #eef2ec !important; --edge: #9aa89b !important; }

/* ---- pictogramas próprios ---- */
.custom-upload { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.custom-upload summary { cursor: pointer; font-weight: 800; color: var(--leaf); }
.custom-upload form { display: grid; gap: 10px; margin-top: 10px; }
.custom-upload .cu-preview { width: 96px; height: 96px; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; overflow: hidden; color: var(--muted); font-size: .8rem; text-align: center; }
.custom-upload .cu-preview img { width: 100%; height: 100%; object-fit: contain; }
.custom-upload .cu-status { font-size: .9rem; min-height: 1.2em; }
.custom-upload .cu-status.err { color: #a12525; }
.result .mine, .sres .mine { position: absolute; top: 4px; left: 4px; background: var(--leaf); color: #fff; border-radius: 999px; font-size: .62rem; font-weight: 800; padding: 1px 7px; letter-spacing: .03em; }
.result, .sres { position: relative; }
.cp-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.cp-card img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; }
.cp-card .cp-name { font-weight: 800; overflow-wrap: anywhere; }
.tray-tabs { flex: none; max-width: 1000px; width: calc(100% - 2 * clamp(10px, 3vw, 28px)); align-self: center; padding: 2px 0 0; margin: 0 0 -3px; }
.tray-grid.cat-panel { width: calc(100% - 2 * clamp(10px, 3vw, 28px)); padding: 12px; margin: 0 auto 14px; flex: 1; }
.tray-tabs .cat-tab { min-height: 42px; padding: 4px 14px; }
.custom-upload select, .custom-upload input[type="file"] { font: inherit; width: 100%; padding: 10px 40px 10px 12px; border: 2px solid var(--line); border-radius: 12px; background-color: #fff; color: var(--ink); }
.custom-upload input[type="file"] { padding-right: 12px; }
.custom-upload input[type="file"]::file-selector-button { font: inherit; font-weight: 700; margin-right: 10px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--leaf); color: #fff; cursor: pointer; }
.cu-terms { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: .88rem; display: grid; gap: 6px; }
.cu-terms ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; color: var(--ink-2); }
.cu-accept { display: flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
.cu-accept input { width: 20px; height: 20px; accent-color: var(--leaf); }

/* Escolha da biblioteca de pictogramas */
.lib-host { margin: 0 0 10px; }
.lib-picker { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.lib-title { white-space: nowrap; font-size: .85rem; font-weight: 700; color: var(--ink-2, #3b5346); }
.lib-opt { position: relative; cursor: pointer; }
.lib-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lib-opt span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 2px solid #c9d3c8; background: #fff; font-weight: 700; font-size: .92rem; color: #3b5346; transition: background .15s, border-color .15s, color .15s; }
.lib-opt:hover span { border-color: var(--leaf-2, #3f8f5f); }
.lib-opt input:checked + span { background: var(--leaf-2, #3f8f5f); border-color: var(--leaf-2, #3f8f5f); color: #fff; }
.lib-opt input:focus-visible + span { outline: 3px solid var(--accent, #f2c200); outline-offset: 2px; }
.lib-hint { display: block; margin-top: 4px; color: #5d7266; font-size: .8rem; }
.result img, .sres img { background: #fff; }

/* Etiqueta de origem do pictograma (só na edição) */
.card-edit, .mini, .result, .sres { position: relative; }
.src-tag { position: absolute; top: 4px; left: 4px; z-index: 1; pointer-events: none; border-radius: 999px; font-size: .56rem; font-weight: 800; letter-spacing: .03em; padding: 1px 6px; color: #fff; background: #5d7266; }
.src-custom { background: var(--leaf, #1f4d36); }
.src-mulberry { background: #7a4fb5; }
.src-arasaac { background: #2f6f9f; }

.cards.use.cat-panel { padding: 16px 16px 24px; margin: 0 0 40px; }

.lib-field { border: 0; padding: 0; margin: 14px 0 6px; min-width: 0; }
.lib-field legend { padding: 0; }
.lib-field .lib-picker { margin-top: 6px; }

/* Escolha do personagem (emoji) */
.emoji-btn { display: inline-flex; align-items: center; gap: 12px; padding: 6px 16px 6px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.emoji-btn:hover { border-color: var(--leaf-2, #3f8f5f); }
.emoji-btn:focus-visible { outline: 3px solid var(--accent, #f2c200); outline-offset: 2px; }
.emoji-cur { font-size: 2.2rem; line-height: 1; }
.emoji-change { font-weight: 800; color: var(--leaf); font-size: .9rem; }
dialog.emoji-dlg { width: min(38rem, calc(100vw - 24px)); }
.emoji-dlg .modal-body { display: grid; gap: 10px; }
.emoji-dlg input[type="search"] { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; }
.emoji-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-tab { font: inherit; font-weight: 700; font-size: .85rem; padding: 5px 10px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.emoji-tab[aria-selected="true"] { background: var(--leaf-2, #3f8f5f); border-color: var(--leaf-2, #3f8f5f); color: #fff; }
.emoji-note { margin: 0; font-size: .85rem; min-height: 1.2em; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.emoji-opt { font-size: 1.9rem; line-height: 1; padding: 8px 0; border: 2px solid transparent; border-radius: 12px; background: #f3f7ef; cursor: pointer; }
.emoji-opt:hover, .emoji-opt:focus-visible { border-color: var(--leaf-2, #3f8f5f); outline: none; }
.emoji-opt.on { border-color: var(--leaf); background: var(--sun-soft); }

/* Página Quem somos: logos na mesma tela e no mesmo verde */
.about { max-width: 820px; }
.about-text { font-size: 1.08rem; line-height: 1.6; }
.about-text p { margin: 0 0 14px; }
.about-text strong { color: var(--leaf); }
.about-logos { list-style: none; margin: 28px 0 8px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.about-logos img { width: 150px; height: auto; aspect-ratio: 30 / 13; }
@media (max-width: 640px) { .about-logos img { width: 120px; } .about-logos { gap: 4px 8px; } }

/* Escolha do tom de pele e do cabelo (pictogramas do ARASAAC) */
.look-picker { margin-top: 8px; }
.look-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.look-title { min-width: 5.5rem; font-size: .85rem; font-weight: 700; color: var(--ink-2, #3b5346); }
.look-opt { position: relative; cursor: pointer; }
.look-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.look-dot { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c9d3c8; box-shadow: inset 0 0 0 2px #fff; }
.look-none { background: repeating-linear-gradient(45deg, #fff 0 4px, #e3e9e2 4px 8px); }
.look-opt:hover .look-dot { border-color: var(--leaf-2, #3f8f5f); }
.look-opt input:checked + .look-dot { border-color: var(--leaf, #1f4d36); border-width: 3px; }
.look-opt input:focus-visible + .look-dot { outline: 3px solid var(--accent, #f2c200); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.form-back { margin: 24px 0 8px; }

/* Botão por cartão: tom de pele e cabelo daquele pictograma */
.look-pop { display: inline-block; position: relative; }
.look-pop.on-card, .look-pop.on-mini { position: absolute; top: 6px; right: 6px; z-index: 3; }
.look-pop > summary { list-style: none; opacity: .94; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line, #d7dfd3); background: #fff; color: var(--leaf, #1f4d36); }
.look-pop > summary::-webkit-details-marker { display: none; }
.look-pop > summary svg { width: 20px; height: 20px; }
.look-pop[open] > summary { background: var(--leaf, #1f4d36); color: #fff; border-color: var(--leaf, #1f4d36); }
.look-pop > summary:focus-visible { outline: 3px solid var(--accent, #f2c200); outline-offset: 2px; }
.look-pop .look-panel { position: fixed; z-index: 60; width: 260px; max-width: calc(100vw - 16px); padding: 10px 12px; background: #fff; border: 2px solid var(--line, #d7dfd3); border-radius: 14px; box-shadow: 0 10px 28px rgba(31, 77, 54, .22); }
.look-pop .look-title { min-width: 3.6rem; }
.look-pop .look-dot { width: 26px; height: 26px; }
.mini .look-pop > summary, .tiny-like { width: 32px; height: 32px; }
.mini .look-pop > summary svg { width: 16px; height: 16px; }

.chips .edit-profile-btn { display: inline-flex; align-items: center; gap: 6px; }
.chips .edit-profile-btn svg { width: 16px; height: 16px; }

.voice-actions .chip.is-active { background: var(--leaf, #1f4d36); border-color: var(--leaf, #1f4d36); color: #fff; }
.voice-actions .chip.is-active::before { content: "✓"; font-weight: 800; }

/* ---- ADM e Biblioteca ---- */
.tab.tab-admin { background: #efe6fa; color: #5b3a8c; }
.tab.tab-admin:hover { background: #e2d3f5; color: #4a2c78; }
.tab.tab-admin svg { fill: currentColor; }
.tab.tab-admin.is-active { background: #5b3a8c; color: #fff; box-shadow: 0 2px 6px -2px rgba(91,58,140,.55); }
.tab.tab-admin.is-active svg { fill: #fff; }
.admin-sub { display: flex; gap: 8px; margin: 4px 0 18px; flex-wrap: wrap; }
.admin-sub a { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line, #d7dfd3); background: #fff; text-decoration: none; font-weight: 800; color: var(--leaf, #1f4d36); }
.admin-sub a.is-active { background: #5b3a8c; border-color: #5b3a8c; color: #fff; }
.table-wrap { overflow-x: auto; background: var(--surface, #fff); border-radius: var(--r-lg, 18px); box-shadow: var(--shadow); padding: 6px 10px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #5d7266; padding: 10px 8px; }
.admin-table td { padding: 10px 8px; border-top: 1px solid var(--line, #e3e9e2); vertical-align: middle; }
.admin-table tr.is-blocked td { opacity: .65; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions form { margin: 0; }
.badge.adm { background: #5b3a8c; color: #fff; }
.badge.blocked { background: #b3261e; color: #fff; }
.btn-danger-text { color: #b3261e; }
@media (max-width: 720px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: block; border-top: 1px solid var(--line, #e3e9e2); padding: 8px 0; }
  .admin-table td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 6px; }
  .admin-table td::before { content: attr(data-label); font-weight: 700; color: #5d7266; }
  .admin-actions { justify-content: flex-start; }
}
.lib-admin { margin: 0 0 28px; }
.lib-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.lib-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface, #fff); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); }
.lib-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-row-actions form { margin: 0; }
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 10px 0 28px; }
.lib-cards .board-card h3 { margin: 10px 0 6px; }
.thumbs.one { display: block; }
.thumb.big { height: 110px; font-size: 3rem; display: flex; align-items: center; justify-content: center; }
.thumb.big img { max-height: 100%; }
.lib-add { background: var(--surface, #fff); border-radius: 16px; padding: 14px 18px; margin: 0 0 18px; box-shadow: var(--shadow); }
.lib-add-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.lib-add-form .field { margin: 0; min-width: 220px; }
.cards.view-only { margin-top: 8px; }
.card-btn.static { cursor: default; }
.lib-scenes { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lib-scene { background: var(--surface, #fff); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.lib-scene-head { display: flex; gap: 12px; }
.lib-char { font-size: 2.2rem; }
.lib-narr { margin: 0 0 4px; font-style: italic; }
.lib-opts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0 0; }
.lib-opts .mini { width: 84px; }

/* ---- Teclado virtual / texto digitado ---- */
.card-face[data-cls="typed"], .card[data-cls="typed"] { background: #fff; border: 2px dashed var(--leaf-2, #3f8f5f); justify-content: center; }
.card-face[data-cls="typed"] span, .card[data-cls="typed"] span { font-size: 1.15rem; font-weight: 800; word-break: break-word; text-align: center; padding: 6px; }
.type-btn { margin: 0; }
#answer-zone .dictate-msg { margin: 6px 0 0; text-align: center; }
dialog.vk { border: 0; padding: 0; width: min(760px, 100vw); max-width: 100vw; margin: auto auto 0; border-radius: 22px 22px 0 0; background: #f3f7ef; box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
dialog.vk::backdrop { background: rgba(20, 40, 30, .45); }
.vk-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; }
.vk-title { font-size: 1.05rem; color: var(--leaf, #1f4d36); }
.vk-close { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line, #d7dfd3); background: #fff; font-size: 1.1rem; cursor: pointer; }
.vk-display { margin: 4px 14px 10px; min-height: 64px; padding: 10px 14px; background: #fff; border: 2px solid var(--leaf-2, #3f8f5f); border-radius: 14px; font-size: 1.7rem; font-weight: 700; word-break: break-word; display: flex; align-items: center; flex-wrap: wrap; }
.vk-ph { color: #9aa99f; font-weight: 500; }
.vk-caret { display: inline-block; width: 2px; height: 1.6rem; background: var(--leaf, #1f4d36); margin-left: 2px; animation: vkblink 1s steps(1) infinite; }
@keyframes vkblink { 50% { opacity: 0; } }
.vk-keys { padding: 0 10px 14px; display: grid; gap: 7px; }
.vk-row { display: flex; gap: 6px; justify-content: center; }
.vk-key { flex: 1 1 0; min-width: 0; height: 56px; border-radius: 12px; border: 2px solid #c9d3c8; background: #fff; font: inherit; font-size: 1.35rem; font-weight: 700; color: var(--ink, #14281e); cursor: pointer; box-shadow: 0 2px 0 #c9d3c8; }
.vk-key:active { transform: translateY(2px); box-shadow: none; background: var(--leaf-soft, #e3efe6); }
.vk-acc .vk-key { height: 44px; font-size: 1.15rem; background: #fbf7e6; }
.vk-wide { flex: 1.5 1 0; }
.vk-wide.on { background: var(--leaf, #1f4d36); color: #fff; border-color: var(--leaf, #1f4d36); }
.vk-space { flex: 4 1 0; font-size: 1rem; }
.vk-ok { flex: 2 1 0; background: var(--sun, #f2c200); border-color: var(--sun-deep, #d4a700); box-shadow: 0 2px 0 var(--sun-deep, #d4a700); font-size: 1.1rem; }
.vk-ok:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 520px) { .vk-key { height: 50px; font-size: 1.2rem; } .vk-display { font-size: 1.4rem; } }

/* ---- busca de imagens na internet (pictograma próprio) ---- */
.cu-modes { display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.cu-mode { border: 2px solid var(--line, #d7dfd3); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.cu-mode.on { background: var(--leaf, #1f4d36); border-color: var(--leaf, #1f4d36); color: #fff; }
.cu-web-bar { display: flex; gap: 8px; }
.cu-web-bar input { flex: 1; }
.cu-free { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .92rem; }
.cu-web-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.cu-web-item { padding: 4px; border: 3px solid transparent; border-radius: 12px; background: #fff; cursor: pointer; aspect-ratio: 1; }
.cu-web-item img { width: 100%; height: 100%; object-fit: contain; }
.cu-web-item.sel { border-color: var(--leaf-2, #3f8f5f); background: var(--leaf-soft, #e3efe6); }
.card-face[data-cls="typed"] span, .card[data-cls="typed"] span { text-transform: none; }

/* Celular: barra em duas linhas (logo + Sair; abaixo, as abas rolando se faltar espaço) */
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .topnav { display: contents; }
  .topnav .inline { order: 2; margin-left: auto; }
  .logo { order: 1; }
  .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
  .site-header .tab-help span { display: inline; }
  .sentence { top: 108px; }
}

@media (min-width: 641px) and (max-width: 1320px) {
  .nav-user { display: none; }
  .tab { padding: 8px 14px 8px 12px; gap: 6px; }
  .logo { flex: none; }
}

/* ---------- Seletor de aluno estilizado ---------- */
.select-pill { position: relative; display: inline-block; min-width: 240px; max-width: 100%; }
.select-pill select {
  appearance: none; -webkit-appearance: none; width: 100%; font: inherit; font-weight: 700; color: var(--leaf);
  padding: 12px 46px 12px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  box-shadow: 0 2px 0 var(--line); transition: border-color .15s, box-shadow .15s;
}
.select-pill select:hover { border-color: var(--leaf-2); }
.select-pill select:focus-visible { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(47,122,75,.25); }
.select-pill::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%;
  background: var(--leaf-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231f4d36' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") center/22px no-repeat; pointer-events: none;
}
.lib-add-form { align-items: flex-end; }
.lib-add-form .label { display: block; margin-bottom: 6px; }
.lib-add-form .btn { align-self: flex-end; }
.lib-add-form small { align-self: center; }

/* ---------- Adaptar item da Biblioteca ao aluno ---------- */
.adapt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 18px; border-radius: 16px;
  background: #e6f1fb; border: 2px solid #b9d7f1; }
.adapt-bar.is-adapted { background: #e9f6ee; border-color: #b6dcc3; }
.adapt-ico { font-size: 1.6rem; }
.adapt-text { flex: 1 1 260px; display: grid; gap: 2px; }
.adapt-text strong { color: var(--ink); }
.adapt-text span { color: var(--ink-2); font-size: .95rem; }
.btn-adapt { background: #1e6f9f; border-color: #1e6f9f; color: #fff; box-shadow: 0 3px 0 #14506f; }
.btn-adapt:hover { background: #185c85; border-color: #185c85; color: #fff; }
.btn-adapt:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-reset { background: #fff; border-color: #1e6f9f; color: #14506f; }
.btn-reset:hover { background: #e6f1fb; }

/* ---------- Janela de copiar para outro aluno ---------- */
dialog.copy-dialog { border: 0; padding: 0; border-radius: var(--r-lg); width: min(30rem, calc(100vw - 32px)); background: var(--surface); box-shadow: 0 24px 60px -12px rgba(22,39,30,.45); }
dialog.copy-dialog::backdrop { background: rgba(22,39,30,.5); backdrop-filter: blur(2px); }
dialog.copy-dialog form { padding: 24px; display: grid; gap: 14px; }
dialog.copy-dialog h2 { margin: 0; font-size: 1.3rem; }
dialog.copy-dialog .field { margin: 0; }
dialog.copy-dialog .label { display: block; margin-bottom: 6px; }
dialog.copy-dialog .select-pill { display: block; }
.copy-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#copy-what { margin: 0; font-weight: 700; color: var(--ink); }
#student-grid { margin-bottom: 32px; }
.list-head { margin-top: 4px; }

/* ---------- Informações de indicação da Biblioteca ---------- */
.badge.warn { background: var(--sun-soft); color: #7a5a00; }
.libinfo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.li-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--leaf-soft); color: var(--leaf); }
.li-chip.li-age { background: var(--sun-soft); color: var(--sun-ink); }
.li-chip.li-aut { background: #e6f1fb; color: #14506f; }
.li-chip.li-lev { background: #efe6fb; color: #4a2a86; }
.li-chip.li-trait-chip { background: #fff; border: 1.5px solid var(--line); font-weight: 600; color: var(--ink-2); }
.libinfo-box { background: var(--surface); border-radius: 16px; padding: 16px 20px; margin: 0 0 18px; box-shadow: var(--shadow); }
.libinfo-box h2 { margin: 0 0 4px; font-size: 1.15rem; }
.libinfo-box dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.libinfo-box dt { font-weight: 700; color: var(--ink-2); }
.libinfo-box dd { margin: 0; }
@media (max-width: 640px) { .libinfo-box dl { grid-template-columns: 1fr; gap: 0; } .libinfo-box dd { margin-bottom: 8px; } }
.libinfo-form { background: #f4effb; border: 2px solid #d9c9f2; border-radius: 16px; padding: 16px 20px; margin: 0 0 16px; }
.libinfo-form h2 { margin: 0 0 4px; font-size: 1.15rem; color: #3d2276; }
.libinfo-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.li-grid { display: grid; gap: 14px; margin-top: 10px; }
.li-age { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.li-age legend { width: 100%; padding: 0; margin-bottom: 4px; }
.li-age input { width: 110px; font: inherit; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; }
.li-opts { display: grid; gap: 6px; }
.li-opts legend, .li-traits legend { padding: 0; margin-bottom: 6px; }
.li-opt { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.li-opt:has(input:checked) { border-color: #6a3fc0; background: #f9f6ff; }
.li-opt small { display: block; color: var(--ink-2); }
.li-traits { display: flex; flex-wrap: wrap; gap: 8px; }
.li-traits legend { width: 100%; }
.li-trait { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.li-trait:has(input:checked) { border-color: #6a3fc0; background: #f9f6ff; font-weight: 700; }
.li-notes { margin: 0; }
.libinfo-form .status.ok { color: var(--leaf-2); }
.libinfo-form .status.err { color: var(--danger); }

/* ---------- Identificador único do item ---------- */
.item-code { display: inline-flex; align-items: center; gap: 2px; padding: 3px 10px 3px 6px; border-radius: 8px; background: #1d2b24; color: #ffe27a;
  font: 700 .85rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; white-space: nowrap; vertical-align: middle; user-select: all; }
.item-code i { font-style: normal; opacity: .65; margin-right: 1px; }
.use-head .item-code { margin-right: auto; margin-left: 10px; }
.board-card > .item-code { margin: 0 0 6px; }

/* ---------- Indicações entre profissionais ---------- */
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: #d4380d; color: #fff; font-size: .75rem; font-weight: 800; }
.share-box { background: #fff7e0; border: 2px solid #f0d27a; border-radius: 16px; padding: 14px 18px; margin: 0 0 20px; }
.share-box h2 { margin: 0 0 2px; font-size: 1.2rem; }
.share-box .count { background: #d4380d; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: .85rem; vertical-align: middle; }
.share-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 10px 14px; }
.share-info { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; flex: 1 1 280px; }
.share-sent { margin: 0 0 20px; background: var(--surface); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); }
.share-sent summary { cursor: pointer; font-weight: 700; color: var(--leaf); }
.btn-share { border-color: #6a3fc0; color: #4a2a86; }
.btn-share:hover { background: #f4effb; }
.share-reject { margin-left: auto; align-self: flex-end; }
.lib-add { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.page-head .title-wrap > .item-code { margin-top: 10px; }

/* ---------- ADM: consumo de IA ---------- */
.admin-sub a.is-active { box-shadow: 0 3px 0 #3d2566; }
.admin-sub a { transition: background .15s, border-color .15s; }
.admin-sub a:not(.is-active):hover { border-color: #5b3a8c; color: #5b3a8c; }
.admin-table td.num, .admin-table th:has(+ th.num) { font-variant-numeric: tabular-nums; }
.admin-table td.num { text-align: right; white-space: nowrap; }
.user-link { color: inherit; text-decoration: none; border-bottom: 2px dotted #b59be0; }
.user-link:hover { color: #5b3a8c; border-bottom-style: solid; }
.ai-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 22px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
.ai-kpis ~ h2, .ai-kpis ~ .table-wrap + h2 { margin: 26px 0 10px; }
.admin-table th { white-space: nowrap; }

/* ---------- Biblioteca: avaliação e filtros ---------- */
.rating-ro { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.rating-ro.none small { color: var(--ink-2); }
.stars-ro { position: relative; display: inline-block; color: #d6d9d2; letter-spacing: 1px; font-size: 1.05rem; line-height: 1; }
.stars-ro-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f2a900; }
.rating-ro b { font-size: .95rem; }
.rating-ro small { color: var(--ink-2); }
.rate-box { display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; justify-content: space-between; background: var(--surface); border-radius: 16px; padding: 14px 20px; margin: 0 0 18px; box-shadow: var(--shadow); }
.rate-box h2 { margin: 0 0 4px; font-size: 1.15rem; }
.rate-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rate-stars { display: inline-flex; gap: 2px; }
.rate-star { border: 0; background: none; cursor: pointer; font-size: 2.1rem; line-height: 1; padding: 2px 3px; color: #d6d9d2; transition: transform .1s, color .1s; }
.rate-star.on { color: #f2a900; }
.rate-star.hover { color: #ffc93d; transform: scale(1.1); }
.rate-star:focus-visible { outline: 3px solid rgba(47,122,75,.5); border-radius: 8px; }
.lib-filters { background: var(--surface); border-radius: 16px; padding: 4px 18px; margin: 0 0 20px; box-shadow: var(--shadow); }
.lib-filters summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 0; font-weight: 800; color: var(--leaf); list-style: none; }
.lib-filters summary::-webkit-details-marker { display: none; }
.lib-filters summary small { margin-left: auto; font-weight: 600; }
.lf-on { background: #5b3a8c; color: #fff; border-radius: 999px; padding: 1px 10px; font-size: .78rem; }
.lf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; margin: 4px 0 12px; }
.lf-grid .field { margin: 0; }
.lf-grid .label { display: block; margin-bottom: 6px; }
.lf-grid input[type=search], .lf-grid input[type=number] { width: 100%; font: inherit; padding: 11px 14px; border: 2px solid var(--line); border-radius: 999px; background: #fff; }
.lf-grid .select-pill { display: block; min-width: 0; }
.lf-traits { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.lf-traits legend { width: 100%; padding: 0; margin-bottom: 6px; }
.lf-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; }
.lib-empty { background: var(--sun-soft); border-radius: 12px; padding: 12px 16px; font-weight: 700; }

/* ---------- Ícones e padrão de botões (revisão geral) ---------- */
svg.ico.ln { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -.2em; }
.btn svg.ico.ln { width: 18px; height: 18px; }
.btn-lg svg.ico.ln { width: 22px; height: 22px; }
.big-btn svg.ico.ln, .help-btn svg.ico.ln { width: 1.1em; height: 1.1em; margin-right: 4px; }
.hud-btn svg.ico.ln { width: 22px; height: 22px; }
.big-btn, .help-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.btn-sm svg.ico.ln { width: 16px; height: 16px; }
/* adicionar e editar: amarelo (já em .btn-primary); excluir e ações destrutivas: vermelho */
.btn-danger, .btn-danger-text { color: var(--danger); background: var(--danger-soft); border-color: #f0b7b2; }
.btn-danger:hover, .btn-danger-text:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.btn-quiet.btn-danger-text { background: var(--danger-soft); border-color: #f0b7b2; }
.modal .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.nowrap { white-space: nowrap; }
.badge.you { background: #eef3ea; color: #3f5a4a; border: 1px solid #d7dfd3; font-size: .75rem; padding: 2px 10px; margin-left: 6px; vertical-align: middle; }
/* ações do ADM em usuários: três botões sempre visíveis */
.admin-actions .act-row { display: flex; flex-wrap: nowrap; gap: 8px; }
.admin-actions .act-row form { margin: 0; }
.btn.act { white-space: nowrap; font-weight: 800; }
.btn.act:disabled { opacity: .4; }
.btn.act-block { color: #8a4b00; background: #fff3dc; border-color: #f0c987; }
.btn.act-block:hover:not(:disabled) { background: #e08a00; border-color: #e08a00; color: #fff; }
.btn.act-unblock { color: #1f6b3a; background: #e4f4ea; border-color: #a9d8b9; }
.btn.act-unblock:hover:not(:disabled) { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.btn.act-adm { color: #4a2a86; background: #f1eafb; border-color: #cdb9ee; }
.btn.act-adm:hover:not(:disabled) { background: #5b3a8c; border-color: #5b3a8c; color: #fff; }
.btn.btn-danger.act:hover:not(:disabled) { background: var(--danger); color: #fff; }
@media (max-width: 1100px) { .admin-actions .act-row { flex-wrap: wrap; } }
.admin-sub a { display: inline-flex; align-items: center; gap: 8px; }
.lib-filters summary span { display: inline-flex; align-items: center; gap: 8px; }
.admin-actions .act-row { gap: 6px; }
.btn.act { padding: 4px 11px; font-size: .88rem; }
.admin-table th, .admin-table td { padding-left: 6px; padding-right: 6px; }
@media (max-width: 1240px) { .admin-actions .act-row { flex-wrap: wrap; max-width: 260px; } }

/* ---------- Tirar um pictograma da frase (modo de uso) ---------- */
.sent-item { position: relative; display: inline-flex; }
.sent-item .card-face.small { padding-top: 10px; }
.sent-x {
  position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #f0b7b2; background: var(--danger-soft); color: var(--danger); cursor: pointer; padding: 0; box-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.sent-x svg.ico.ln { width: 16px; height: 16px; stroke-width: 3; }
.sent-x:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.sent-x:active { transform: scale(.92); }
@media (max-width: 760px) { .sentence-cards { padding-top: 10px; } .sent-x { width: 36px; height: 36px; } }
/* botão de som no topo */
.sound-toggle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--leaf); cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; }
.sound-toggle:hover { background: var(--leaf-soft); }
.sound-toggle svg.ico.ln { width: 20px; height: 20px; }
.sound-toggle .off, .sound-toggle[aria-pressed="false"] .on { display: none; }
.sound-toggle[aria-pressed="false"] .off { display: inline-grid; }
.sound-toggle[aria-pressed="false"] { color: #8b8869; background: #f1efe0; }
@media (max-width: 640px) {
  .topnav .sound-toggle { order: 2; margin-left: auto; width: 36px; height: 36px; }
  .topnav .inline { margin-left: 0; }
}

/* ---------- Botões compactos: ações de cartões e do ADM em uma linha só ---------- */
.admin-actions .act-row { gap: 4px; flex-wrap: nowrap; max-width: none; }
.btn.act { min-height: 30px; padding: 2px 8px; font-size: .8rem; gap: 4px; }
.btn.act svg.ico.ln { width: 14px; height: 14px; }
.admin-table th, .admin-table td { padding-left: 5px; padding-right: 5px; }
.admin-table th { font-size: .72rem; letter-spacing: .03em; }
.admin-table td[data-label="E-mail"] { overflow-wrap: anywhere; min-width: 130px; }
@media (min-width: 641px) and (max-width: 1240px) { .admin-actions .act-row { flex-wrap: wrap; max-width: 240px; } }

/* ---------- Quebra-gelos ---------- */
.ice-box { margin-top: 14px; }
.ice-title { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-weight: 700; }
.ice-title svg.ico.ln { width: 18px; height: 18px; color: #b58900; }
.suggestions { margin-bottom: 8px; }
.suggestion-student { border-color: #cdb9ee; background: #f6f1fc; color: #4a2a86; }
.suggestion-student:hover { background: #ebe0fa; border-color: #5b3a8c; }
.ib-admin { margin: 22px 0; }
.ib-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ib-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: #fff; border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--shadow); }
.ib-edit, .ib-new { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; flex: 1; }
.ib-new { background: #fff; border: 2px dashed var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.ib-edit label, .ib-new label { display: grid; gap: 4px; min-width: 180px; }
.ib-edit label.grow, .ib-new label.grow { flex: 1; min-width: 240px; }
.ib-edit input, .ib-new input { width: 100%; }
.ib-student { margin: 22px 0; padding: 16px; background: #f6f1fc; border: 2px solid #e1d3f5; border-radius: var(--r-lg); }
.ib-student h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.15rem; color: #4a2a86; }
#ib-rows { display: grid; gap: 8px; margin: 12px 0; }
.ib-line { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .ib-line { grid-template-columns: 1fr; } }
.board-card { container-type: inline-size; }
.board-card .board-actions { gap: 4px; }
.board-card .board-actions .btn { padding: 3px 8px; font-size: .8rem; gap: 4px; }
.board-card .board-actions .btn svg.ico.ln { width: 14px; height: 14px; }
/* cartão estreito: Copiar e Compartilhar viram só o ícone (o texto continua na dica e para leitores de tela) */
@container (max-width: 400px) { .board-card .board-actions .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

.story-info .board-actions { margin-top: 10px; gap: 6px; }
.ib-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ib-auto { font-size: .88rem; margin: 10px 0 0; }
.ib-chips { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.ib-chips li { background: #f6f1fc; border-radius: 10px; padding: 6px 10px; }
.ib-chips b { color: #4a2a86; margin-right: 4px; }

/* ---------- Paginação ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: center; margin: 16px 0; }
.pager-pages { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.pager-pages .pg-n, .pager-pages .pg-now { min-width: 36px; height: 36px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; font-weight: 800; text-decoration: none; }
.pager-pages .pg-n { border: 2px solid var(--line); background: #fff; color: var(--leaf); }
.pager-pages .pg-n:hover { background: var(--leaf-soft); }
.pager-pages .pg-now { background: var(--leaf); color: #fff; border: 2px solid var(--leaf); }
.pager-pages .gap { color: var(--ink-2); padding: 0 2px; }
.pager .is-off { opacity: .4; cursor: default; }
.pager-info { width: 100%; text-align: center; font-size: .85rem; }
@media (min-width: 700px) { .pager-info { width: auto; margin-left: 8px; } }
@media (max-width: 460px) { .pager .pg-lbl { display: none; } }

/* ---- Publicação na Biblioteca (autoria, selos, janela de compartilhar, fila do ADM) */
.lib-by { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: .88rem; color: var(--ink-2); }
.lib-by .ico { width: 15px; height: 15px; flex: none; }
.badge.lib-pub { display: inline-flex; align-items: center; gap: 4px; background: var(--leaf-soft); color: var(--leaf); }
.badge.lib-wait { display: inline-flex; align-items: center; gap: 4px; background: #fff3cd; color: #6b4e00; }
.badge .ico { width: 13px; height: 13px; }
.share-tabs { margin: 8px 0 14px; }
.share-tabs .cu-mode { display: inline-flex; align-items: center; gap: 6px; }
.share-tabs .cu-mode .ico { width: 16px; height: 16px; }
.copy-dialog [hidden] { display: none !important; }
.tab-badge.adm-badge { background: #b3261e; }
.sub-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.sub-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--shadow); }
.sub-row .sub-info { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; }
.sub-row .sub-info strong { overflow-wrap: anywhere; }
.sub-review { background: var(--surface); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow); margin: 14px 0; display: grid; gap: 12px; }
.sub-review .li-grid { margin-top: 4px; }
.sub-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.sub-reject { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 4px; }
.sub-reject input { min-width: 220px; }
.share-count { white-space: nowrap; }

/* Janela de compartilhar: título, abas e painéis dentro do mesmo respiro (os formulários não têm margem própria aqui) */
dialog#share-dialog { padding: 24px; }
dialog#share-dialog form { padding: 0; }
dialog#share-dialog > * + * { margin-top: 14px; }
dialog#share-dialog > h2 + .muted { margin-top: 4px; }
dialog#share-dialog #pane-lib { display: grid; gap: 14px; }
dialog#share-dialog #pane-lib[hidden] { display: none; }
dialog#share-dialog .share-tabs { margin: 14px 0 0; }
dialog#share-dialog .ai-note { margin: 0; }

/* janela de compartilhar: o espaçamento fica na própria janela (tem título, abas e dois painéis) */
dialog.copy-dialog.share { padding: 24px; }
dialog.copy-dialog.share[open] { display: grid; gap: 14px; align-content: start; max-height: calc(100vh - 32px); overflow-y: auto; }
dialog.copy-dialog.share form { padding: 0; }
dialog.copy-dialog.share .share-tabs { margin: 0; }
dialog.copy-dialog.share #pane-lib { display: grid; gap: 14px; }

/* Gráficos de uso da IA no detalhe do usuário: 7 colunas, uma série cada */
.cols.c7 { grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cols.c7 .cbar { max-width: 38px; }
.cols .limit-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #b3261e; pointer-events: none; }
.cols .limit-line span { position: absolute; right: 0; bottom: 2px; font-size: .75rem; color: #b3261e; font-weight: 700; background: var(--surface); padding: 0 4px; }
.ai-trend { display: grid; gap: 16px; margin: 14px 0; }
.ai-trend .panel { background: var(--surface); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow); }
.ai-trend .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-trend h2, .ai-trend h3 { margin: 0; font-size: 1.1rem; }
@media (min-width: 900px) { .ai-trend .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }

/* terceiro gráfico (linha inteira): duas colunas por dia, rótulos com tokens e % */
.cols.c7.io { gap: 10px; }
.cols.c7.io .cbar { max-width: 44px; }
.cols.c7.io .bars { gap: 4px; }
.cols.c7.io .cbar em { font-size: .74rem; line-height: 1.15; text-align: center; white-space: nowrap; }
.cols.c7.io .cbar em small { display: block; font-weight: 600; font-size: .7rem; color: var(--ink-2); }
.io-panel .plot { height: 240px; }
@media (max-width: 700px) { .cols.c7.io .cbar em { display: none; } }

.sw-c, .cbar-c { background: #2a6fb0; }
.sw-d, .cbar-d { background: #b5532c; }
.ai-trend .two + .two, .ai-trend > .two { margin-top: 0; }
.io-panel .plot { height: 240px; }
.cols.c7.io .cbar { max-width: 34px; }
.cols.c7.io .cbar em { font-size: .7rem; }

/* Uso por tipo de requisição (30 dias) */
.purpose-panel { grid-column: 1 / -1; width: 100%; }
.purpose-chart { display: grid; gap: 14px; margin: 10px 0; position: relative; }
.prow { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 12px; align-items: center; }
.pname { font-weight: 600; overflow-wrap: anywhere; }
.pbars { display: grid; gap: 4px; }
.pline { display: flex; align-items: center; gap: 8px; min-height: 16px; }
.hbar { display: block; height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; }
.pline em { font-style: normal; font-size: .82rem; white-space: nowrap; color: var(--ink); }
.pline em small { color: var(--ink-2); font-size: .78rem; }
.pline .hbar { flex: 0 1 auto; max-width: calc(100% - 120px); }
@media (max-width: 700px) { .prow { grid-template-columns: 1fr; gap: 4px; } }

/* Temas de cor (só para quem está logado): trocam apenas a cor da flor da acácia e o que combina com ela. */
html[data-theme="rosa"] { --sun: #f48fb8; --sun-deep: #c2477f; --sun-soft: #ffe4ee; --sun-hover: #f7a6c6; --sun-ink: #7a1f48; }
html[data-theme="vermelha"] { --sun: #d93b3b; --sun-deep: #a52424; --sun-soft: #ffe3e0; --sun-hover: #e5524f; --sun-ink: #7a1616; --on-sun: #fff; --caa-ink: #fff; }
.theme-pick fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.theme-pick legend { padding: 0; }
.theme-opts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; cursor: pointer; }
.theme-opt i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.theme-opt input:checked + span { border-color: var(--leaf); box-shadow: 0 0 0 2px var(--leaf); }
.theme-opt input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }

.admin-table th.num { text-align: right; white-space: nowrap; }
.admin-table td.num { padding-right: 18px; }
.admin-table th.num { padding-right: 18px; }

.input-btn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.input-btn input { flex: 0 1 auto; }
.input-btn .btn { flex: none; }
.rates-form, #limites .sub-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; }
.rates-form .field, #limites .sub-actions .field { flex: 0 1 auto; width: auto; margin: 0; }
.input-btn { flex-wrap: nowrap; }
.input-btn input { width: 12rem; max-width: 100%; }
@media (max-width: 560px) { .input-btn { flex-wrap: wrap; } }
html[data-theme="branca"] { --sun: #ffffff; --sun-deep: #9fada3; --sun-soft: #f1f5ee; --sun-hover: #f4f7f2; --sun-ink: #3d4a42; }
html[data-theme="branca"] .btn-primary, html[data-theme="branca"] .big-btn, html[data-theme="branca"] .tools .speak-btn { border: 2px solid var(--sun-deep); }
html[data-theme="branca"] .wordmark .caa { box-shadow: 0 0 0 1px var(--sun-deep); }
html[data-theme="branca"] .nav-user i, html[data-theme="branca"] .student-avatar, html[data-theme="branca"] .audio-ico, html[data-theme="branca"] .scene-num, html[data-theme="branca"] .new-pill { box-shadow: inset 0 0 0 1.5px var(--sun-deep); }
html[data-theme="branca"] .page-head h1::after { box-shadow: 0 0 0 1px var(--sun-deep); }

/* Ditar pictogramas */
.dictate-row { margin: 0 0 8px; }
.dictate-msg { margin: 4px 0 10px; }

.sentence-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }

/* ---------- Demonstração pública ---------- */
.demo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 6px; padding: 12px 14px; background: var(--sun-soft); border: 1px solid var(--sun); border-radius: 12px; font-size: .95rem; }
.demo-note svg { flex: none; width: 20px; height: 20px; fill: currentColor; margin-top: 2px; }
.demo-themes { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.demo-theme { border: 2px solid var(--leaf); background: #fff; color: var(--leaf); font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.demo-theme[aria-selected="true"] { background: var(--leaf); color: #fff; }
.demo-desc { margin: 2px 0 6px; }

/* ---------- Tamanho dos pictogramas: g (padrão, sem atributo), m (médio), p (pequeno) ---------- */
.psize { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.psize-label { font-weight: 700; margin-right: 4px; }
.psize button { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--leaf); background: #fff; color: var(--leaf); font: inherit; font-weight: 700; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.psize button svg { width: 16px; height: 16px; }
.psize button[data-size="m"] svg { width: 13px; height: 13px; }
.psize button[data-size="p"] svg { width: 10px; height: 10px; }
.psize button[aria-pressed="true"] { background: var(--leaf); color: #fff; }
html[data-psize="m"] { --ps: .72; --psf: 1.12rem; --pss: .78rem; }
html[data-psize="p"] { --ps: .52; --psf: .95rem; --pss: .7rem; }
html[data-psize] .cards { grid-template-columns: repeat(auto-fill, minmax(max(96px, calc(150px * var(--ps))), 1fr)); gap: calc(12px * var(--ps) + 4px); }
html[data-psize] .cards.use { grid-template-columns: repeat(auto-fill, minmax(max(104px, calc(190px * var(--ps))), 1fr)); gap: calc(16px * var(--ps) + 4px); }
html[data-psize] .card-btn { padding: calc(12px * var(--ps) + 2px); border-radius: calc(28px * var(--ps) + 8px); }
html[data-psize] .card-face:not(.small) { font-size: var(--psf); }
html[data-psize] .card-face:not(.small):not(:has(img)) { min-height: max(80px, calc(150px * var(--ps))); }
html[data-psize] .card-edit { padding: calc(10px * var(--ps) + 3px); }
@media (max-width: 640px) {
  html[data-psize="m"] .cards, html[data-psize="m"] .cards.use { grid-template-columns: repeat(3, 1fr); }
  html[data-psize="p"] .cards, html[data-psize="p"] .cards.use { grid-template-columns: repeat(4, 1fr); }
  html[data-psize="p"] .card-face:not(.small) { font-size: .8rem; }
}
.auth-form .auth-alt { margin: 22px 0 8px; }
.auth-signup { width: 100%; justify-content: center; border: 2px solid var(--leaf); color: var(--leaf); background: #fff; font-weight: 800; }
.auth-signup:hover { background: var(--leaf); color: #fff; }

/* Botões que capturam áudio: todos ficam vermelhos e pulsam enquanto escutam; os outros botões de captura ficam desativados */
.recording, .listening, .btn.recording, .btn.listening, .field-mic.recording, #mic.recording, #rec-all.recording, .dictate-btn.listening {
  background: #c0392b; border-color: #c0392b; color: #fff; animation: recpulse 1.2s ease-in-out infinite; }
.recording:hover, .listening:hover { background: #a93226; border-color: #a93226; color: #fff; }
.dictate-btn:disabled[data-mic-locked], .btn:disabled[data-mic-locked], #mic:disabled[data-mic-locked] { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .recording, .listening { animation: none; } }

.back-row { margin: 16px 0 0; }
.auth-form .back-row { margin: 0 0 18px; }

/* Modo bloqueio */
.lock-chip { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.lock-chip svg { width: 20px; height: 20px; }
.toggle .t-text strong svg { width: 1em; height: 1em; vertical-align: -2px; margin-right: 4px; }
.lock-form { margin: 18px 0; padding-top: 6px; border-top: 1px solid var(--line, #dde5dc); scroll-margin-top: 80px; }
dialog.copy-dialog .error { color: #b3261e; margin: 0; font-weight: 700; }

/* Tutorial guiado */
.tutorial-row { margin: 0 0 10px; }
.tut { position: fixed; inset: 0; z-index: 9000; }
.tut-spot { position: fixed; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(10,22,16,.74), 0 0 0 3px #ffe27a, 0 0 28px 8px rgba(255,226,122,.55); transition: top .2s, left .2s, width .2s, height .2s; }
.tut-card { position: fixed; z-index: 1; width: min(24rem, calc(100vw - 20px)); background: var(--surface, #fff); border-radius: var(--r-lg, 18px); padding: 18px; display: grid; gap: 8px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.55); }
.tut-card h3 { margin: 0; font-size: 1.15rem; }
.tut-card p { margin: 0; }
.tut-count { color: var(--muted); font-size: .82rem; font-weight: 700; }
.tut-text { line-height: 1.45; }
.tut-nav, .tut-more { display: flex; gap: 8px; flex-wrap: wrap; }
.tut-nav { justify-content: space-between; margin-top: 4px; }
.tut-more { border-top: 1px solid var(--line, #dde5dc); padding-top: 8px; }
@media (prefers-reduced-motion: reduce) { .tut-spot { transition: none; } }

/* Campo de data: mesmo visual dos demais campos, com ícone de calendário próprio */
input[type=date] { -webkit-appearance: none; appearance: none; min-width: 12.5rem; cursor: pointer; line-height: 1.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4d36' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 22px; padding-right: 46px; }
input[type=date]:hover { border-color: var(--leaf-2); }
input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
input[type=date]::-webkit-datetime-edit { padding: 0; }
input[type=date]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type=date]::-webkit-datetime-edit-day-field:focus, input[type=date]::-webkit-datetime-edit-month-field:focus, input[type=date]::-webkit-datetime-edit-year-field:focus { background: var(--sun-soft, #fff3c4); color: var(--ink); border-radius: 6px; outline: none; }
input[type=date]:invalid:not(:focus):not(:placeholder-shown) { border-color: #b3261e; }
.field:has(input[type=date]) { position: relative; }
.field:has(input[type=date]) input[type=date] { position: relative; }
#birth-age { display: inline-block; align-self: start; background: var(--leaf-soft, #e4f1e8); color: var(--leaf, #1f4d36); font-weight: 700; font-size: .85rem; padding: 3px 10px; border-radius: 999px; }

.badge.pending { background: var(--sun-soft, #fff3c4); color: #7a5a00; border: 1px solid #e8c84a; }
