/* ════════════════════════════════════════
   CÂMERA — Botão por classe
════════════════════════════════════════ */
.btn-camera-open {
  width: 100%;
  margin-top: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-camera-open:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88,166,255,.06);
}

/* Variante do botão de câmera na seção de teste — aparece ao lado do drop-zone */
.test-input-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.test-input-row #test-drop-zone {
  flex: 1;
}
.btn-camera-test {
  width: auto !important;
  margin-top: 0 !important;
  flex-shrink: 0;
  padding: 12px 18px;
  font-size: .9rem;
  border-radius: 10px;
  white-space: nowrap;
}

/* ════════════════════════════════════════
   CÂMERA — Modal
════════════════════════════════════════ */
.modal-box-camera {
  max-width: 520px;
}

#camera-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}

#camera-video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

#camera-canvas {
  display: none;
}

#camera-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  color: var(--muted);
  background: rgba(0,0,0,.6);
  text-align: center;
  padding: 16px;
}
#camera-status.hidden { display: none; }

#btn-camera-snap {
  min-width: 160px;
}
#btn-camera-snap.snap-flash {
  background: var(--green) !important;
}

/* ── Flash branco ao tirar foto ── */
#camera-flash {
  position: absolute; inset: 0;
  background: #fff;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0s;
}
#camera-flash.active {
  animation: camera-flash-anim 0.45s ease-out forwards;
}
@keyframes camera-flash-anim {
  0%   { opacity: 0.85; }
  100% { opacity: 0; }
}

/* ── Tooltip "Foto tirada!" ── */
#camera-snap-toast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 20, 30, 0.88);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 11;
  transition: opacity 0s, transform 0s;
}
#camera-snap-toast.show {
  animation: snap-toast-anim 1.8s ease forwards;
}
@keyframes snap-toast-anim {
  0%   { opacity: 0;   transform: translateX(-50%) translateY(8px); }
  12%  { opacity: 1;   transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1;   transform: translateX(-50%) translateY(0); }
  100% { opacity: 0;   transform: translateX(-50%) translateY(-6px); }
}

/* (lobby antigo removido — ver lobby v2 acima) */



/* ════════════════════════════════════════
   LOBBY v2 — lista de IAs
════════════════════════════════════════ */
#screen-lobby {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}
#screen-lobby.hidden { display: none !important; }

#lobby-main {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex; flex-direction: column; gap: 28px;
}

#lobby-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

#lobby-logo {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
}

#lobby-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}

#lobby-sub {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Estados: loading / error / empty */
.lobby-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  line-height: 1.6;
}

/* Seções por turma */
.lobby-section {
  display: flex; flex-direction: column; gap: 12px;
}

.lobby-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.lobby-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* Card de IA */
.lobby-ia-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 14px;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .18s, background .18s, transform .12s;
  color: var(--text);
  font-family: inherit;
}
.lobby-ia-card:hover {
  border-color: var(--accent);
  background: rgba(88,166,255,.07);
  transform: translateY(-2px);
}
.lobby-ia-card:active { transform: scale(.98); }

.lobby-ia-name {
  font-size: .97rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-ia-classes {
  font-size: .76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-ia-meta {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 2px;
}

.lobby-ia-badge {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}
.lobby-ia-badge.acc  { background: rgba(63,185,80,.15); color: var(--green); }
.lobby-ia-badge.imgs { background: rgba(88,166,255,.12); color: var(--accent); }

/* ── Overlay de desbloqueio ── */
#lobby-unlock-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
#lobby-unlock-overlay.hidden { display: none !important; }

@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

#lobby-unlock-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 36px 28px;
  max-width: 400px; width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

#lobby-unlock-ia-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

#lobby-unlock-ia-meta {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: -6px;
}

.lobby-unlock-hint {
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.lobby-unlock-forgot {
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.lobby-unlock-forgot strong { color: var(--accent); }

.lobby-unlock-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 4px;
}

/* ════════════════════════════════════════
   PREVIEW — painel do professor
════════════════════════════════════════ */
#screen-preview {
  min-height: 100vh;
  background: var(--bg);
  display: flex; flex-direction: column;
}
#screen-preview.hidden { display: none !important; }

#preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  gap: 16px;
}

#preview-list {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex; flex-direction: column; gap: 36px;
}

.preview-section {}

.preview-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

.preview-count {
  background: var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.preview-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}

.preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text);
  vertical-align: middle;
}

.preview-table tr:last-child td { border-bottom: none; }

.preview-table tr:hover td { background: rgba(255,255,255,.025); }

.preview-nome   { font-weight: 700; }
.preview-classes { color: var(--muted); font-size: .82rem; }

.preview-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .92rem;
  font-weight: 700;
  background: rgba(88,166,255,.12);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: .06em;
  display: inline-block;
}

.preview-acc { font-weight: 700; }
.acc-good    { color: var(--green); }
.acc-mid     { color: var(--yellow); }

/* ── Reset & Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d1117;
  --panel:    #161b22;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #8b949e;
  --accent:   #58a6ff;
  --green:    #3fb950;
  --red:      #f85149;
  --yellow:   #d29922;
  --purple:   #bc8cff;
  --radius:   12px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ════════════════════════════════════════
   OVERLAYS
════════════════════════════════════════ */

/* Carregando */
#loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  transition: opacity .4s;
}
#loading-overlay.hidden { display: none; }
#loading-box {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#loading-title { font-size: 1.1rem; font-weight: 700; }
#loading-sub   { font-size: .85rem; color: var(--muted); }
#loading-step  { font-size: .8rem; color: var(--accent); min-height: 1.2em; }

/* ════════════════════════════════════════
   OVERLAY DE TREINAMENTO — redesign
════════════════════════════════════════ */
#training-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 8, 14, 0.97);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  backdrop-filter: blur(6px);
}
#training-overlay.hidden { display: none; }

/* Canvas de partículas de fundo */
#training-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

/* Card central */
#training-box {
  position: relative;
  background: linear-gradient(160deg, #161b22 0%, #0d1117 100%);
  border: 1px solid rgba(88,166,255,.25);
  border-radius: 24px;
  padding: 48px 56px 44px;
  text-align: center;
  min-width: 380px;
  max-width: 440px;
  width: 90vw;
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
  box-shadow:
    0 0 0 1px rgba(88,166,255,.08),
    0 32px 80px rgba(0,0,0,.7),
    0 0 80px rgba(88,166,255,.06) inset;
}

/* ── Ícone com anéis rotativos ── */
#training-icon-wrap {
  position: relative;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#training-ring-outer {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(88,166,255,.3);
  animation: spin-ring 1.4s linear infinite;
}
#training-ring-inner {
  position: absolute; inset: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--purple);
  border-left-color: rgba(188,140,255,.3);
  animation: spin-ring 1s linear infinite reverse;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }

#training-icon {
  font-size: 2.4rem;
  animation: brain-pulse 2s ease-in-out infinite;
  z-index: 1;
  line-height: 1;
}
@keyframes brain-pulse {
  0%,100% { transform: scale(1);    filter: brightness(1); }
  50%      { transform: scale(1.08); filter: brightness(1.2); }
}

/* ── Textos ── */
#training-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.2;
}
#training-message {
  font-size: .88rem;
  color: var(--accent);
  min-height: 1.3em;
  transition: opacity .3s;
  font-weight: 500;
}

/* ── Barra de progresso ── */
#training-bar-section {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
}
#training-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: visible;
  position: relative;
}
#training-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--purple) 100%);
  border-radius: 99px;
  transition: width .3s cubic-bezier(.4,0,.2,1);
  position: relative;
}
#training-bar::after {
  content: '';
  position: absolute;
  right: -1px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px 3px rgba(88,166,255,.5);
  opacity: 0;
  transition: opacity .2s;
}
#training-bar.active::after { opacity: 1; }

#training-bar-glow {
  position: absolute;
  top: 50%; left: 0;
  width: 60px; height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(88,166,255,.4));
  transform: translateY(-50%);
  animation: bar-shimmer 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bar-shimmer {
  0%   { left: -60px; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: calc(100% + 60px); opacity: 0; }
}

#training-pct {
  font-size: .88rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Stats em linha ── */
#training-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 12px 0;
  width: 100%;
}
.training-stat {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 12px;
}
.training-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
}
.training-stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
}
.training-stat-value {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.training-stat-acc { color: var(--green); }

/* ── Estado: concluído ── */
#training-done {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fadeSlideIn .4s ease;
}
#training-done-icon { font-size: 2.2rem; }
#training-done-text {
  font-size: 1rem; font-weight: 700; color: var(--green);
}

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#header-left { display: flex; align-items: center; gap: 14px; }
#header-right { display: flex; align-items: center; gap: 8px; }
#header-title { font-size: 1.1rem; font-weight: 700; }
#header-badge {
  font-size: .72rem; color: var(--muted);
  background: #21262d; padding: 3px 10px;
  border-radius: 20px; border: 1px solid var(--border);
}
#btn-back {
  color: var(--muted);
  border-color: transparent;
}
#btn-back:hover { color: var(--text); border-color: var(--border); }

/* ════════════════════════════════════════
   BOTÕES GLOBAIS
════════════════════════════════════════ */
.btn-primary {
  background: var(--accent); color: #0d1117;
  border: none; border-radius: 8px;
  padding: 11px 24px; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { opacity: .85; }
.btn-primary:active:not(:disabled) { transform: scale(.97); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }

.btn-secondary-sm {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px;
  padding: 9px 18px; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  white-space: nowrap;
}
.btn-secondary-sm:hover { background: rgba(88,166,255,.08); }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; font-size: .85rem;
  cursor: pointer; transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

/* ════════════════════════════════════════
   TELA DE COLETA
════════════════════════════════════════ */
#screen-collect {
  display: flex; flex-direction: column;
  padding: 24px; gap: 18px;
  flex: 1;
}

#collect-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
#collect-instructions {
  font-size: .88rem; color: var(--muted);
  max-width: 600px; line-height: 1.5;
}
#collect-instructions strong { color: var(--text); }
#collect-instructions em     { color: var(--accent); font-style: normal; }
#collect-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Hint de treino */
.train-hint {
  font-size: .85rem; color: var(--yellow); font-weight: 600;
  padding: 8px 14px;
  background: rgba(210,153,34,.08);
  border: 1px solid rgba(210,153,34,.25);
  border-radius: 8px;
}
.train-hint.ready {
  color: var(--green);
  background: rgba(63,185,80,.08);
  border-color: rgba(63,185,80,.25);
}

/* Grade de classes */
#classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* Cartão de classe */
.class-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cls-color, var(--accent));
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.class-card-header {
  display: flex; align-items: center; gap: 8px;
}
.class-color-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.class-name-input {
  flex: 1; background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: .98rem; font-weight: 700;
  outline: none; padding: 2px 4px;
  transition: border-color .2s;
}
.class-name-input:focus { border-bottom-color: var(--accent); }

.btn-delete-class {
  background: none; border: none;
  color: var(--muted); font-size: .85rem;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: color .2s, background .2s;
}
.btn-delete-class:hover { color: var(--red); background: rgba(248,81,73,.1); }

/* Progresso de amostras */
.sample-count-label {
  font-size: .78rem; color: var(--muted); transition: color .2s;
}
.sample-count-label.ready { color: var(--cls-color, var(--green)); }

.sample-progress-wrap {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.sample-progress-fill {
  height: 100%; border-radius: 2px;
  background: var(--cls-color, var(--accent));
  transition: width .25s ease;
}

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  font-size: .85rem; color: var(--muted);
  line-height: 1.5;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--cls-color, var(--accent));
  background: rgba(88,166,255,.05);
  color: var(--text);
}
.drop-zone-single { border-color: var(--border); }
.drop-zone-single:hover { border-color: var(--accent); }

.drop-zone-content { pointer-events: none; }
.drop-icon { font-size: 1.6rem; margin-bottom: 6px; }

.file-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}

/* ── Grade de thumbnails ── */
.thumb-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 200px; overflow-y: auto;
}
.thumb-wrap {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.thumb-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.thumb-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(13,17,23,.8); color: var(--red);
  border: none; border-radius: 4px;
  width: 18px; height: 18px; font-size: .7rem;
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
  line-height: 1;
}
.thumb-wrap:hover .thumb-remove { display: flex; }

/* ════════════════════════════════════════
   TELA DE RESULTADOS
════════════════════════════════════════ */
#screen-results {
  padding: 24px;
  display: flex; flex-direction: column; gap: 28px;
}

#results-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
#results-title { font-size: 1.4rem; font-weight: 700; }
#results-sub   { font-size: .88rem; color: var(--muted); margin-top: 4px; }
#results-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Cards de resumo */
#summary-cards {
  display: flex; flex-wrap: wrap; gap: 14px;
}
.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  min-width: 120px;
  text-align: center;
}
.summary-card.card-error { border-color: rgba(248,81,73,.4); }
.summary-value {
  font-size: 1.8rem; font-weight: 800;
  color: var(--accent);
}
.summary-card.card-error .summary-value { color: var(--red); }
.summary-label {
  font-size: .78rem; color: var(--muted); margin-top: 4px;
}

/* Seções de resultado */
.results-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.results-section h3 {
  font-size: 1rem; font-weight: 700;
}
.section-hint {
  font-size: .85rem; color: var(--muted);
}

/* ── Seções colapsáveis ── */
.results-section.collapsible {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 18px 24px;
  text-align: left;
  border-radius: var(--radius);
  transition: background .15s;
}
.section-header:hover {
  background: rgba(255,255,255,.035);
}
.section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
}

.section-chevron {
  font-size: .9rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .25s ease;
  line-height: 1;
}
.section-header[aria-expanded="false"] .section-chevron {
  transform: rotate(-90deg);
}

.section-body {
  padding: 0 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* animação de altura */
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .28s ease, opacity .28s ease;
  opacity: 1;
}
.section-body.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}
.section-body > * {
  /* necessário para o grid-template-rows funcionar */
  overflow: hidden;
}
.section-body:not(.collapsed) > * {
  overflow: visible;
}

/* Barras de acurácia por classe */
.acc-bar-row {
  display: flex; align-items: center; gap: 12px;
}
.acc-bar-label {
  width: 200px; display: flex;
  flex-direction: column; gap: 2px;
  flex-shrink: 0;
}
.acc-bar-stats { font-size: .75rem; color: var(--muted); }
.acc-bar-track {
  flex: 1; height: 10px;
  background: var(--border);
  border-radius: 5px; overflow: hidden;
}
.acc-bar-fill {
  height: 100%; border-radius: 5px;
  transition: width .4s ease;
}
.acc-bar-pct {
  width: 44px; text-align: right;
  font-size: .88rem; font-weight: 700;
}

/* Galeria de erros */
#error-gallery {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.error-card {
  background: var(--bg);
  border: 1px solid rgba(248,81,73,.35);
  border-radius: 10px; overflow: hidden;
  width: 130px; flex-shrink: 0;
}
.error-card img {
  width: 100%; height: 90px; object-fit: cover; display: block;
}
.error-info {
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.error-true  { font-size: .75rem; color: var(--green); }
.error-pred  { font-size: .75rem; }
.error-conf  {
  font-size: .7rem; color: var(--muted);
  margin-left: 4px;
}

/* Área de teste com imagem nova */
#test-result {
  display: flex; align-items: flex-start; gap: 20px;
  flex-wrap: wrap;
}
#test-img {
  width: 160px; height: 160px;
  object-fit: cover; border-radius: 10px;
  border: 2px solid var(--border);
}
#test-pred-bars {
  flex: 1; min-width: 200px;
  display: flex; flex-direction: column; gap: 8px;
}
.test-winner {
  font-size: 1.3rem; font-weight: 800;
  margin-bottom: 4px;
}

/* Barras de previsão (teste) */
.pred-bar-row {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; opacity: .6;
  transition: opacity .2s;
}
.pred-bar-row.active { opacity: 1; }
.pred-bar-label {
  width: 100px; text-align: right;
  font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.pred-bar-track {
  flex: 1; height: 7px;
  background: rgba(255,255,255,.1);
  border-radius: 4px; overflow: hidden;
}
.pred-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width .15s ease;
}
.pred-bar-pct {
  width: 36px; font-size: .75rem; color: var(--muted);
}

/* ════════════════════════════════════════
   ADVERSARIAL — Painel "Avançado"
════════════════════════════════════════ */

.adv-panel {
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Botão toggle */
.adv-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--yellow);
  color: var(--yellow);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: background .2s;
}
.adv-toggle:hover { background: rgba(210,153,34,.08); }
.adv-toggle-arrow { font-size: .75rem; opacity: .7; }

/* Corpo do painel (collapsible) */
.adv-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(210,153,34,.04);
  border: 1px solid rgba(210,153,34,.18);
  border-radius: 10px;
  padding: 18px;
}

.adv-hint {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Botões de seleção de classe */
.adv-class-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adv-class-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--cls-color, var(--border));
  color: var(--cls-color, var(--text));
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .1s;
}
.adv-class-btn:hover {
  background: color-mix(in srgb, var(--cls-color, var(--accent)) 12%, transparent);
}
.adv-class-btn--active {
  background: color-mix(in srgb, var(--cls-color, var(--accent)) 20%, transparent);
  border-width: 2px;
}
.adv-class-btn--predicted {
  opacity: .45;
  cursor: default;
}
.adv-class-btn:active { transform: scale(.96); }

/* Slider de intensidade */
.adv-intensity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adv-intensity-label {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 68px;
}
.adv-slider {
  flex: 1;
  accent-color: var(--yellow);
  cursor: pointer;
}
.adv-intensity-val {
  font-size: .78rem;
  color: var(--yellow);
  font-weight: 600;
  min-width: 72px;
  text-align: right;
}

/* Botão iniciar */
.btn-adv-run {
  background: var(--yellow);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity .2s, transform .1s;
}
.btn-adv-run:hover:not(:disabled) { opacity: .85; }
.btn-adv-run:active:not(:disabled) { transform: scale(.97); }
.btn-adv-run:disabled { opacity: .35; cursor: not-allowed; }

/* Resultado (imagens + progresso) */
.adv-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adv-images {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.adv-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.adv-img-wrap img,
.adv-img-wrap canvas {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  display: block;
}

.adv-img-label {
  font-size: .75rem;
  color: var(--muted);
}

/* Barra de confiança */
.adv-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adv-progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}
.adv-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--yellow);
  transition: width .08s linear, background .3s;
}
.adv-confidence {
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}

.adv-caption {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Strip de frames — filmagem da distorção */
.adv-strip-label {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 4px;
}
.adv-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.adv-strip::-webkit-scrollbar { height: 4px; }
.adv-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 99px; }

.adv-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.adv-strip-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: block;
  object-fit: cover;
  cursor: default;
  transition: border-color .3s;
}
.adv-strip-pct {
  font-size: .68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════
   GRAD-CAM — Botão e visualização
════════════════════════════════════════ */

/* Scores por região */
.gcam-scores {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gcam-scores-title {
  font-size: .78rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.gcam-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gcam-score-rank {
  font-size: .7rem;
  color: var(--muted);
  min-width: 20px;
  font-variant-numeric: tabular-nums;
}
.gcam-score-label {
  font-size: .72rem;
  color: var(--muted);
  min-width: 72px;
}
.gcam-score-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}
.gcam-score-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.gcam-score-pct {
  font-size: .72rem;
  font-weight: 700;
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.gradcam-section {
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-inspect {
  background: transparent;
  border: 1.5px solid var(--purple);
  color: var(--purple);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  align-self: flex-start;
}
.btn-inspect:hover:not(:disabled) {
  background: rgba(188,140,255,.1);
}
.btn-inspect:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.gradcam-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeSlideIn .3s ease;
}

.gradcam-images {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.gradcam-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gradcam-img-wrap img,
.gradcam-img-wrap canvas {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--border);
  display: block;
}

.gradcam-img-wrap canvas {
  border-color: var(--purple);
}

.gradcam-label {
  font-size: .73rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.gradcam-caption {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
  background: rgba(188,140,255,.06);
  border: 1px solid rgba(188,140,255,.2);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  padding: 10px 14px;
}
.gradcam-caption strong { color: var(--text); }
.gradcam-caption em     { color: var(--purple); font-style: normal; }

/* ════════════════════════════════════════
   NENHUMA DESSAS — feedback mundo fechado
════════════════════════════════════════ */
.test-none-block {
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
}

/* Label "O que você quer fazer?" */
.test-actions-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

/* Grid de ações */
.test-actions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Botão "Adicionar como Classe X" */
.btn-action-add-class {
  background: transparent;
  border: 1.5px solid rgba(var(--cls-color, 88,166,255), .45);
  border-color: color-mix(in srgb, var(--cls-color, #58a6ff) 60%, transparent);
  color: var(--cls-color, #58a6ff);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .2s;
}
.btn-action-add-class:hover {
  background: color-mix(in srgb, var(--cls-color, #58a6ff) 12%, transparent);
}
.btn-action-add-class:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.btn-action-add-class strong {
  font-weight: 700;
}

/* Feedback após ação */
.test-action-feedback {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 600;
}
.test-action-feedback.hidden { display: none; }
.feedback-ok  { background: rgba(63,185,80,.12); color: #3fb950; border: 1px solid rgba(63,185,80,.3); }
.feedback-err { background: rgba(248,81,73,.12);  color: #f85149; border: 1px solid rgba(248,81,73,.3); }

.btn-test-none {
  background: transparent;
  border: 1px solid rgba(255, 90, 90, .45);
  color: #ff6b6b;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-test-none:hover {
  background: rgba(255, 90, 90, .08);
  border-color: rgba(255, 90, 90, .7);
}

.test-none-explanation {
  margin-top: 12px;
  background: rgba(255, 200, 60, .06);
  border: 1px solid rgba(255, 200, 60, .2);
  border-left: 3px solid #f5a623;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.test-none-explanation.hidden { display: none; }

.test-none-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.test-none-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.test-none-body {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.test-none-body strong { color: var(--text); }
.test-none-body em     { color: #f5a623; font-style: normal; font-weight: 600; }
.test-none-cta {
  font-size: .82rem;
  color: var(--text);
  margin: 4px 0 0;
}
.test-none-cta strong { color: #58a6ff; }

/* ════════════════════════════════════════
   BIAS TIP
════════════════════════════════════════ */
#bias-tip {
  font-size: .84rem;
  color: var(--muted);
  background: rgba(88,166,255,.06);
  border: 1px solid rgba(88,166,255,.2);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.55;
}
#bias-tip strong { color: var(--text); }
#bias-tip em     { color: var(--accent); font-style: normal; font-weight: 600; }

/* ════════════════════════════════════════
   RESTORE BANNER
════════════════════════════════════════ */
#restore-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(63,185,80,.08);
  border: 1px solid rgba(63,185,80,.3);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .88rem;
}
.restore-info { flex: 1; color: var(--green); font-weight: 600; min-width: 0; }
.btn-sm { padding: 7px 14px !important; font-size: .82rem !important; flex-shrink: 0; }

/* ════════════════════════════════════════
   OVERFIT ALERT
════════════════════════════════════════ */
.overfit-alert {
  grid-column: 1 / -1;
  width: 100%;
  background: rgba(210,153,34,.08);
  border: 1px solid rgba(210,153,34,.35);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.55;
  margin-top: 4px;
}
.overfit-alert strong { color: var(--yellow); }
.overfit-alert em     { font-style: normal; color: var(--accent); }

/* ════════════════════════════════════════
   MODAIS
════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,17,23,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  min-width: 340px;
  max-width: 460px;
  width: 90vw;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
}
.modal-box h3 { font-size: 1.2rem; font-weight: 700; }
.modal-sub    { font-size: .85rem; color: var(--muted); margin-top: -8px; line-height: 1.5; }

.modal-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--muted);
}
.modal-label input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .95rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s;
}
.modal-label input:focus { border-color: var(--accent); }

.modal-error {
  font-size: .82rem;
  color: var(--red);
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.25);
  border-radius: 6px;
  padding: 8px 12px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 4px;
}

/* Modal de código gerado */
.code-box-icon { font-size: 2.2rem; text-align: center; }
.code-display  {
  font-size: 2.6rem; font-weight: 800;
  letter-spacing: .25em;
  text-align: center;
  color: var(--accent);
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  font-family: 'Courier New', monospace;
}
.code-hint { font-size: .78rem; color: var(--muted); margin-bottom: -8px; }
.code-link  {
  font-size: .75rem;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

/* Modal de carregar sessão */
.code-input {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 1.4rem !important;
  text-align: center;
  font-family: 'Courier New', monospace !important;
}

/* ════════════════════════════════════════
   GALERIA DE ERROS — barras de confiança
════════════════════════════════════════ */
.error-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: border-color .2s;
}
.error-card:hover { border-color: var(--accent); }
.error-card img {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.error-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.error-verdict {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem;
  flex-wrap: wrap;
}
.error-true  { color: var(--green); font-size: .82rem; }
.error-arrow { color: var(--muted); font-size: .8rem; }
.error-pred  { font-size: .82rem; }
.error-caption {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}
.error-probs { display: flex; flex-direction: column; gap: 5px; }
.error-prob-row {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem;
}
.error-prob-row.prob-row-pred { font-weight: 700; }
.error-prob-row.prob-row-true { opacity: .7; }
.error-prob-label {
  width: 130px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.error-prob-track {
  flex: 1; height: 8px;
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  overflow: hidden;
}
.error-prob-fill {
  height: 100%; border-radius: 4px;
  transition: width .4s ease;
}
.error-prob-pct {
  width: 36px; text-align: right;
  color: var(--muted); font-size: .75rem; flex-shrink: 0;
}

/* ════════════════════════════════════════
   ANÁLISE DE BIAS VISUAL
════════════════════════════════════════ */
.bias-loading {
  color: var(--muted); font-size: .88rem; padding: 12px 0;
}
.bias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.bias-card {
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.bias-card-warn { border-color: rgba(210,153,34,.45); background: rgba(210,153,34,.04); }
.bias-card-ok   { border-color: rgba(63,185,80,.3); }

.bias-card-header {
  font-weight: 700; font-size: .92rem;
  display: flex; align-items: center; gap: 7px;
}
.bias-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.bias-badge-warn {
  margin-left: auto;
  font-size: .7rem; font-weight: 600;
  background: rgba(210,153,34,.15);
  color: var(--yellow); border-radius: 4px;
  padding: 2px 7px;
}
.bias-badge-ok {
  margin-left: auto;
  font-size: .7rem; font-weight: 600;
  background: rgba(63,185,80,.1);
  color: var(--green); border-radius: 4px;
  padding: 2px 7px;
}
.bias-row {
  display: flex; justify-content: space-between;
  font-size: .78rem; gap: 8px;
}
.bias-key { color: var(--muted); }
.bias-val { color: var(--text); font-weight: 500; text-align: right; }

.bias-warnings {
  background: rgba(210,153,34,.06);
  border: 1px solid rgba(210,153,34,.3);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.bias-warning-item {
  font-size: .82rem; color: var(--text); line-height: 1.5;
}
.bias-tip {
  font-size: .82rem; color: var(--muted);
  margin-top: 4px; line-height: 1.5;
}
.bias-tip strong { color: var(--accent); }
.bias-ok-msg {
  font-size: .85rem;
  color: var(--green);
  padding: 10px 14px;
  background: rgba(63,185,80,.07);
  border: 1px solid rgba(63,185,80,.25);
  border-radius: 8px;
}

/* ════════════════════════════════════════
   MAPA PCA 2D
════════════════════════════════════════ */
#pca-canvas {
  display: block;
  width: 100%;
  max-width: 700px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1117;
}

/* ── Imagens do professor (seção de teste) ── */
#prof-images-section {
  margin-bottom: 20px;
}
.prof-images-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.prof-images-title {
  font-size: .9rem; font-weight: 700; color: var(--text);
}
.btn-reload-prof {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: .75rem;
  cursor: pointer; font-family: inherit;
  transition: color .18s, border-color .18s;
}
.btn-reload-prof:hover { color: var(--text); border-color: var(--muted); }

.prof-images-state {
  font-size: .82rem; color: var(--muted);
  padding: 10px 0;
}
.prof-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.prof-img-thumb {
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  cursor: pointer; transition: border-color .18s, transform .12s;
  display: flex; flex-direction: column;
}
.prof-img-thumb:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.prof-img-thumb.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(63,185,80,.3);
}
.prof-img-thumb img {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover; display: block;
}
.prof-img-thumb-label {
  padding: 4px 8px;
  font-size: .7rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.test-divider {
  text-align: center;
  color: var(--muted); font-size: .8rem;
  margin: 18px 0 14px;
  position: relative;
}

/* ════════════════════════════════════════
   IMAGENS DO PROFESSOR
════════════════════════════════════════ */
#prof-images-section {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 18px;
}

.prof-images-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.prof-images-title {
  font-size: .92rem; font-weight: 600; color: var(--text);
}

.btn-reload-prof {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .8rem; padding: 4px 10px; cursor: pointer;
  transition: border-color .18s, color .18s;
}
.btn-reload-prof:hover {
  border-color: var(--accent); color: var(--accent);
}

.prof-images-state {
  font-size: .85rem; color: var(--muted); padding: 8px 0;
}

.prof-images-list {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px;
}

.prof-img-thumb {
  width: 90px; cursor: pointer;
  border: 2px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: border-color .18s, transform .15s;
  text-align: center;
}
.prof-img-thumb:hover   { border-color: var(--accent); transform: scale(1.04); }
.prof-img-thumb.active  { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.prof-img-thumb img     { width: 100%; height: 72px; object-fit: cover; display: block; }
.prof-img-thumb-label   { font-size: .7rem; color: var(--muted); padding: 3px 4px; background: var(--card-bg); }
.prof-img-thumb--private { border-color: var(--purple); }
.prof-img-thumb--private:hover { border-color: var(--purple); filter: brightness(1.1); }
.prof-img-thumb-badge   { font-size: .65rem; color: var(--purple); padding: 2px 4px 4px; text-align: center; background: var(--card-bg); font-weight: 600; }

/* ── Responsividade ── */
@media (max-width: 640px) {
  #classes-grid { grid-template-columns: 1fr; }
  .acc-bar-label { width: 120px; }
  .summary-card  { min-width: 90px; padding: 14px 16px; }
  #test-result   { flex-direction: column; }
  .error-card    { flex-direction: column; }
  .error-card img { width: 100%; height: 180px; }
  .bias-grid     { grid-template-columns: 1fr; }
}
