/* ==========================================================================
   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;
  --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(--ink); 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); }
.logo-tag { font-size: .85rem; color: var(--ink-2); border-left: 2px solid var(--sun); padding-left: 10px; line-height: 1.1; }

/* ---------- 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(--ink); box-shadow: 0 3px 0 var(--sun-deep); }
.btn-primary:hover { background: #ffd21f; color: var(--ink); }
.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: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;
}
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-form { 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(--ink);
}
.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: #6b5200; }
.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(--ink); }

.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; }
input.title-input { max-width: 640px; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; border-color: transparent; background: transparent; padding-left: 0; letter-spacing: -.015em; }
input.title-input:hover { border-color: var(--line); padding-left: 14px; }
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: #6b5200; 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; }
  .logo-tag, .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(--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(--ink); 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: rgba(255,255,255,.7); color: var(--ink); cursor: pointer; min-height: 36px; }
.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(--ink); }
.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: #6b5200; }
.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(--ink); border-color: transparent; }
.tools .speak-btn:hover:not(:disabled) { background: #ffd21f; }
.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 12px; border: 2px solid var(--line); border-radius: 12px; font: inherit; background: #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 { 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; }
#rec-all.recording { background: #c0392b; border-color: #c0392b; color: #fff; animation: recpulse 1.2s ease-in-out infinite; }
@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.recording { background: #c0392b; border-color: #c0392b; color: #fff; animation: recpulse 1.2s ease-in-out infinite; }
.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) { #rec-all.recording, .field-mic.recording, textarea.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%; } }
