/*
 * MOS Battery — Rails Application Stylesheet
 * Stack: CSS local; sem dependências críticas de rede em tempo de execução.
 */

/* ─── Font & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #e0e7ff;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --neutral:       #64748b;
}

/* Compatibilidade local das utilidades usadas nas telas migradas. Substitui o
   runtime Tailwind CDN para manter renderização determinística e offline. */
.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }.inline-flex { display: inline-flex; }.grid { display: grid; }
.flex-1 { flex: 1 1 0%; }.flex-col { flex-direction: column; }.flex-wrap { flex-wrap: wrap; }.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }.justify-between { justify-content: space-between; }
.grid-cols-1 { grid-template-columns: repeat(1,minmax(0,1fr)); }.grid-cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.col-span-2 { grid-column: span 2/span 2; }
.gap-1 { gap: .25rem; }.gap-1\.5 { gap: .375rem; }.gap-2 { gap: .5rem; }.gap-3 { gap: .75rem; }.gap-4 { gap: 1rem; }
.w-full { width: 100%; }.h-full { height: 100%; }.w-5 { width: 1.25rem; }.w-9 { width: 2.25rem; }.w-12 { width: 3rem; }.w-16 { width: 4rem; }.w-20 { width: 5rem; }.w-24 { width: 6rem; }
.h-9 { height: 2.25rem; }.h-12 { height: 3rem; }.h-16 { height: 4rem; }.h-20 { height: 5rem; }.h-24 { height: 6rem; }
.min-h-screen { min-height: 100vh; }.max-w-sm { max-width: 24rem; }.max-w-md { max-width: 28rem; }.max-w-lg { max-width: 32rem; }.max-w-2xl { max-width: 42rem; }.max-w-3xl { max-width: 48rem; }.max-w-4xl { max-width: 56rem; }.max-w-5xl { max-width: 64rem; }.max-w-6xl { max-width: 72rem; }
.mx-auto { margin-inline: auto; }.mt-auto { margin-top: auto; }.ml-1 { margin-left: .25rem; }.mr-1 { margin-right: .25rem; }
.mt-1 { margin-top: .25rem; }.mt-2 { margin-top: .5rem; }.mt-3 { margin-top: .75rem; }.mt-4 { margin-top: 1rem; }.mt-6 { margin-top: 1.5rem; }
.mb-0\.5 { margin-bottom: .125rem; }.mb-1 { margin-bottom: .25rem; }.mb-2 { margin-bottom: .5rem; }.mb-3 { margin-bottom: .75rem; }.mb-4 { margin-bottom: 1rem; }.mb-5 { margin-bottom: 1.25rem; }.mb-6 { margin-bottom: 1.5rem; }.mb-7 { margin-bottom: 1.75rem; }.mb-8 { margin-bottom: 2rem; }
.p-3 { padding: .75rem; }.p-4 { padding: 1rem; }.p-5 { padding: 1.25rem; }.p-6 { padding: 1.5rem; }.p-8 { padding: 2rem; }.p-10 { padding: 2.5rem; }
.px-1\.5 { padding-inline: .375rem; }.px-2 { padding-inline: .5rem; }.px-3 { padding-inline: .75rem; }.px-4 { padding-inline: 1rem; }.px-6 { padding-inline: 1.5rem; }.px-10 { padding-inline: 2.5rem; }
.py-0\.5 { padding-block: .125rem; }.py-1 { padding-block: .25rem; }.py-2 { padding-block: .5rem; }.py-3 { padding-block: .75rem; }.py-4 { padding-block: 1rem; }.py-5 { padding-block: 1.25rem; }.py-6 { padding-block: 1.5rem; }.py-8 { padding-block: 2rem; }.py-10 { padding-block: 2.5rem; }.pt-6 { padding-top: 1.5rem; }
.space-y-1 > * + * { margin-top: .25rem; }.space-y-2 > * + * { margin-top: .5rem; }.space-y-3 > * + * { margin-top: .75rem; }.space-y-5 > * + * { margin-top: 1.25rem; }
.relative { position: relative; }.overflow-hidden { overflow: hidden; }.overflow-x-auto { overflow-x: auto; }.overflow-y-auto { overflow-y: auto; }
.rounded-lg { border-radius: .5rem; }.rounded-xl { border-radius: .75rem; }.rounded-2xl { border-radius: 1rem; }.rounded-full { border-radius: 9999px; }
.border { border: 1px solid #e2e8f0; }.border-2 { border-width: 2px; }.border-b { border-bottom: 1px solid #e2e8f0; }.border-t { border-top: 1px solid #e2e8f0; }.border-none { border: 0; }
.border-slate-50 { border-color: #f8fafc; }.border-slate-100 { border-color: #f1f5f9; }.border-slate-200 { border-color: #e2e8f0; }.border-amber-200 { border-color: #fde68a; }.border-red-200 { border-color: #fecaca; }
.bg-transparent { background: transparent; }.bg-white { background: #fff; }.bg-slate-50 { background: #f8fafc; }.bg-slate-100 { background: #f1f5f9; }.bg-slate-200 { background: #e2e8f0; }.bg-indigo-50 { background: #eef2ff; }.bg-indigo-100 { background: #e0e7ff; }.bg-indigo-600 { background: #4f46e5; }.bg-green-50 { background: #f0fdf4; }.bg-green-100 { background: #dcfce7; }.bg-red-50 { background: #fef2f2; }.bg-red-100 { background: #fee2e2; }.bg-amber-50 { background: #fffbeb; }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right,#f8fafc,#fff,#eef2ff); }
.divide-y > * + * { border-top: 1px solid #e2e8f0; }.divide-slate-50 > * + * { border-color: #f8fafc; }.divide-slate-100 > * + * { border-color: #f1f5f9; }.divide-amber-100 > * + * { border-color: #fef3c7; }.last\:border-0:last-child { border: 0; }
.text-center { text-align: center; }.text-left { text-align: left; }.text-right { text-align: right; }
.text-xs { font-size: .75rem; }.text-sm { font-size: .875rem; }.text-lg { font-size: 1.125rem; }.text-xl { font-size: 1.25rem; }.text-2xl { font-size: 1.5rem; }.text-3xl { font-size: 1.875rem; }
.font-normal { font-weight: 400; }.font-medium { font-weight: 500; }.font-semibold { font-weight: 600; }.font-bold { font-weight: 700; }.font-extrabold { font-weight: 800; }.font-black { font-weight: 900; }.font-mono { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
.text-white { color: #fff; }.text-slate-300 { color: #cbd5e1; }.text-slate-400 { color: #94a3b8; }.text-slate-500 { color: #64748b; }.text-slate-600 { color: #475569; }.text-slate-700 { color: #334155; }.text-slate-800 { color: #1e293b; }.text-indigo-400 { color: #818cf8; }.text-indigo-500 { color: #6366f1; }.text-indigo-600 { color: #4f46e5; }.text-indigo-700 { color: #4338ca; }.text-indigo-800 { color: #3730a3; }.text-green-700 { color: #15803d; }.text-red-700 { color: #b91c1c; }.text-amber-600 { color: #d97706; }.text-amber-700 { color: #b45309; }.text-amber-800 { color: #92400e; }
.leading-relaxed { line-height: 1.625; }.tracking-widest { letter-spacing: .1em; }.uppercase { text-transform: uppercase; }.underline { text-decoration: underline; }.whitespace-nowrap { white-space: nowrap; }.whitespace-pre-wrap { white-space: pre-wrap; }
.shadow-sm { box-shadow: 0 1px 2px rgba(15,23,42,.06); }.shadow-md { box-shadow: 0 4px 8px rgba(15,23,42,.1); }.shadow-lg { box-shadow: 0 10px 18px rgba(15,23,42,.12); }.shadow-inner { box-shadow: inset 0 2px 4px rgba(15,23,42,.06); }
.cursor-pointer { cursor: pointer; }.object-cover { object-fit: cover; }.outline-none { outline: 2px solid transparent; }.transition-all,.transition-colors { transition: all .15s ease; }
.hover\:bg-indigo-700:hover { background: #4338ca; }.hover\:bg-slate-50:hover { background: #f8fafc; }.hover\:text-indigo-600:hover { color: #4f46e5; }
.focus\:outline-none:focus { outline: 2px solid transparent; }.focus\:border-indigo-500:focus { border-color: #6366f1; }.focus\:ring-2:focus { box-shadow: 0 0 0 2px #fff,0 0 0 4px #6366f1; }
@media (min-width: 768px) { .md\:grid-cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }.md\:grid-cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }.md\:grid-cols-5 { grid-template-columns: repeat(5,minmax(0,1fr)); }.md\:col-span-3 { grid-column: span 3/span 3; } }

/* ─── Animações ─────────────────────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

.slide-up { animation: slideUp 0.35s cubic-bezier(0.22,1,0.36,1) both; }
.fade-in  { animation: fadeIn  0.4s ease both; }

/* ─── Flash messages ────────────────────────────────────────────────────────── */
#flash-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.flash {
  padding: 0.75rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideUp 0.3s ease both;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.flash--notice {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.flash--alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ─── Progress bar ──────────────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* ─── Btn utilities (complemento ao Tailwind inline) ───────────────────────── */
.btn-primary {
  background: var(--primary);
  color: white;
  font-weight: 700;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover   { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active  { transform: translateY(0); }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── Saída segura do participante ─────────────────────────────────────────── */
.participant-exit-trigger {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  color: #334155;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  font: 700 .8125rem/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.participant-exit-trigger:hover { border-color: #818cf8; background: #f8fafc; box-shadow: 0 10px 28px rgba(15, 23, 42, .16); }
.participant-exit-trigger:focus-visible,
.exit-dialog__button:focus-visible { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 3px; }

.exit-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}
.exit-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.exit-dialog__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 800;
}
.exit-dialog__icon--question { color: #4338ca; background: #eef2ff; }
.exit-dialog__icon--warning { color: #b45309; background: #fff7ed; }
.exit-dialog__eyebrow { margin: 0 0 7px; color: #6366f1; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.exit-dialog h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.exit-dialog > p:not(.exit-dialog__eyebrow) { margin: 0; color: #475569; font-size: 15px; line-height: 1.6; }
.exit-dialog__notice { margin-top: 18px; padding: 13px 14px; border: 1px solid #fed7aa; border-radius: 12px; color: #9a3412; background: #fff7ed; font-size: 13px; line-height: 1.5; }
.exit-dialog__actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.exit-dialog__actions form { margin: 0; }
.exit-dialog__button { min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font: 700 13px/1 'Inter', system-ui, sans-serif; cursor: pointer; }
.exit-dialog__button--primary { color: #3730a3; border-color: #c7d2fe; background: #eef2ff; }
.exit-dialog__button--secondary { color: #475569; border-color: #cbd5e1; background: #fff; }
.exit-dialog__button--danger { color: #fff; background: #b91c1c; }
.exit-dialog__button--danger:hover { background: #991b1b; }
.exit-dialog__button:disabled { opacity: .6; cursor: wait; }

@media (max-width: 560px) {
  .participant-exit-trigger { top: 10px; right: 10px; }
  .exit-dialog { padding: 24px 20px; }
  .exit-dialog__actions, .exit-dialog__actions form, .exit-dialog__button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .participant-exit-trigger, .exit-dialog__button { transition: none; }
}

/* ─── Instrumentos restritos do pesquisador ───────────────────────────────── */
.instrument-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.instrument-header h1 { margin: 10px 0 4px; color: #1e293b; font-size: 1.75rem; }
.instrument-header p { margin: 0; color: #64748b; }
.instrument-card { padding: 24px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.instrument-card h2 { margin: 0 0 14px; color: #1e293b; font-size: 1.125rem; }
.instrument-warning, .instrument-restricted { margin: 18px 0 24px; padding: 16px 18px; border-radius: 12px; color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; line-height: 1.55; }
.instrument-restricted { color: #7f1d1d; background: #fef2f2; border-color: #fecaca; }
.instrument-form { display: grid; gap: 18px; }
.instrument-form label, .instrument-form legend { display: grid; gap: 7px; color: #334155; font-size: .875rem; font-weight: 700; }
.instrument-form input:not([type=radio]), .instrument-form select, .instrument-form textarea, .inline-correction-form input, .inline-correction-form select { min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; color: #0f172a; background: #fff; font: inherit; }
.instrument-form textarea { min-height: 96px; resize: vertical; }
.instrument-form input:focus, .instrument-form select:focus, .instrument-form textarea:focus { outline: 3px solid rgba(79,70,229,.2); border-color: #6366f1; }
.instrument-form small { color: #64748b; font-weight: 400; line-height: 1.4; }
.instrument-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.instrument-radio { display: inline-flex !important; grid-template-columns: auto 1fr; align-items: center; min-height: 44px; margin-right: 20px; }
.instrument-errors { padding: 12px 14px; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; background: #fef2f2; }
.instrument-status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; color: #475569; background: #f1f5f9; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.instrument-status--reviewed, .instrument-status--authorized { color: #92400e; background: #fef3c7; }
.instrument-status--completed { color: #166534; background: #dcfce7; }
.instrument-eyebrow { margin: 0 0 6px; color: #6366f1; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.instrument-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.metric-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; gap: 10px; }
.metric-list div { padding: 12px; border-radius: 10px; background: #f8fafc; }
.metric-list dt { color: #64748b; font-size: .75rem; font-weight: 700; }.metric-list dd { margin: 4px 0 0; color: #1e293b; font-size: 1.4rem; font-weight: 800; }
.instrument-table { width: 100%; border-collapse: collapse; font-size: .875rem; }.instrument-table th, .instrument-table td { padding: 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }.instrument-table th { color: #64748b; background: #f8fafc; font-size: .75rem; text-transform: uppercase; }
.inline-correction-form { display: grid; grid-template-columns: 100px minmax(180px,1fr) auto; gap: 8px; }
.instrument-small-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: #4f46e5; font-weight: 700; cursor: pointer; text-decoration: none; }
.instrument-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.audit-list { color: #475569; line-height: 1.6; }.audit-list code { color: #6366f1; }
.instrument-record-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; color: #334155; text-decoration: none; }.instrument-record-link:hover { border-color: #a5b4fc; background: #f8fafc; }.instrument-record-link:focus-visible { outline: 3px solid rgba(79,70,229,.25); }
.instrument-table caption { padding: 10px 0; color: #475569; font-weight: 700; text-align: left; }
.tri-detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.tri-detail-list div { min-width: 0; padding: 12px; border-radius: 10px; background: #f8fafc; overflow-wrap: anywhere; }
.tri-detail-list dt { color: #64748b; font-size: .75rem; font-weight: 700; }.tri-detail-list dd { margin: 4px 0 0; color: #0f172a; font-weight: 700; }
.role-checkboxes { display: flex; flex-wrap: wrap; gap: 8px 16px; }.role-checkboxes label { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.access-role-form { padding-block: 18px; border-bottom: 1px solid #e2e8f0; }
.btn-primary, button, a { touch-action: manipulation; }
.btn-primary:focus-visible, .instrument-small-button:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(79,70,229,.42); outline-offset: 3px; }
@media (max-width: 700px) { .instrument-form-grid, .instrument-metrics, .tri-detail-list { grid-template-columns: 1fr; }.inline-correction-form { grid-template-columns: 1fr; }.instrument-header { flex-direction: column; flex-wrap: wrap; }.metric-list { grid-template-columns: 1fr; }.instrument-actions > *, .instrument-small-button { width: 100%; }.instrument-record-link { align-items: flex-start; flex-direction: column; } }

/* ─── Experiments — timer bar ──────────────────────────────────────────────── */
.timer-bar {
  height: 6px;
  border-radius: 9999px;
  background: var(--primary);
  transition: width 0.1s linear;
}
.timer-bar--warning { background: var(--warning); }
.timer-bar--danger  { background: var(--danger); }

/* ─── MOS Proximal ────────────────────────────────────────────────────────── */
.experiment-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 72px 20px 36px;
  color: #0f172a;
  background: radial-gradient(circle at 85% 10%, #e0e7ff 0, transparent 30%), linear-gradient(145deg, #f8fafc, #fff 55%, #eef2ff);
}
.experiment-page--intro { padding-block: 36px; }
.experiment-shell { width: min(100%, 880px); }
.experiment-header { margin-bottom: 18px; padding: 20px 22px; border: 1px solid #e2e8f0; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 12px 34px rgba(15,23,42,.07); }
.experiment-header > div:first-child { display: inline-block; }
.experiment-header h1 { margin: 2px 0 0; font-size: 22px; }
.experiment-eyebrow { margin: 0; color: #4f46e5; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.experiment-progress-copy { float: right; display: flex; align-items: baseline; gap: 10px; color: #64748b; font-size: 13px; }
.experiment-progress-copy strong { color: #312e81; font-size: 17px; font-variant-numeric: tabular-nums; }
.experiment-progress-track { clear: both; height: 8px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.experiment-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #7c3aed); transition: width .25s ease-out; }
.experiment-stage { min-height: 360px; display: grid; place-items: center; position: relative; padding: 38px; border: 1px solid #e2e8f0; border-radius: 22px; background: #fff; box-shadow: 0 22px 60px rgba(15,23,42,.1); }
.experiment-phase { width: 100%; text-align: center; animation: fadeIn .2s ease-out both; }
.experiment-phase[hidden] { display: none; }
.experiment-phase__label { margin: 0 0 22px; color: #64748b; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.experiment-friend-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.experiment-friend-list span { padding: 14px 22px; color: #3730a3; border: 1px solid #c7d2fe; border-radius: 16px; background: #eef2ff; font-size: clamp(18px,3vw,24px); font-weight: 800; }
.experiment-fixation { color: #475569; font: 300 120px/1 'Inter',system-ui,sans-serif; user-select: none; }
.experiment-trait { color: #4338ca; font-size: clamp(30px,5vw,48px); line-height: 1.15; }
.experiment-timer { width: 100%; height: 7px; margin-bottom: 30px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.experiment-timer span { display: block; width: 100%; height: 100%; border-radius: inherit; background: #4f46e5; transform: scaleX(1); transform-origin: left; }
.experiment-timer span.is-running { animation: experimentCountdown 4s linear forwards; }
@keyframes experimentCountdown { to { transform: scaleX(0); background: #d97706; } }
.experiment-probe { width: fit-content; margin: 0 auto 28px; padding: 18px 30px; color: #1e293b; border-radius: 16px; background: #f1f5f9; font-size: clamp(27px,5vw,38px); font-weight: 800; }
.experiment-response-actions { display: flex; justify-content: center; gap: 14px; }
.experiment-response { min-width: 170px; min-height: 54px; padding: 0 20px; border: 1px solid; border-radius: 13px; font: 800 16px/1 'Inter',sans-serif; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.experiment-response:hover { transform: translateY(-1px); }
.experiment-response:focus-visible { outline: 3px solid rgba(79,70,229,.35); outline-offset: 3px; }
.experiment-response:disabled { opacity: .5; cursor: wait; transform: none; }
.experiment-response--false { color: #9f1239; border-color: #fecdd3; background: #fff1f2; }
.experiment-response--true { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.experiment-key-hint { margin: 14px 0 0; color: #94a3b8; font-size: 12px; }
.experiment-saving { display: inline-flex; align-items: center; gap: 12px; color: #475569; font-weight: 700; }
.experiment-saving span { width: 22px; height: 22px; border: 3px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 50%; animation: experimentSpin .7s linear infinite; }
@keyframes experimentSpin { to { transform: rotate(360deg); } }
.experiment-error { position: absolute; right: 24px; bottom: 20px; left: 24px; padding: 12px 14px; color: #991b1b; border: 1px solid #fecaca; border-radius: 11px; background: #fef2f2; font-size: 13px; }
.experiment-error[hidden] { display: none; }
.experiment-intro { width: min(100%, 620px); padding: 44px; text-align: center; border: 1px solid #e2e8f0; border-radius: 24px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.12); }
.experiment-intro__icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 20px; color: #4f46e5; border-radius: 20px; background: #eef2ff; }
.experiment-intro__icon--success { color: #047857; background: #ecfdf5; }
.experiment-intro h1 { margin: 8px 0 14px; font-size: clamp(30px,5vw,42px); letter-spacing: -.035em; }
.experiment-intro > p:not(.experiment-eyebrow) { max-width: 520px; margin: 0 auto; color: #475569; font-size: 16px; line-height: 1.7; }
.experiment-instructions { display: grid; gap: 5px; margin: 26px 0; padding: 16px 18px; text-align: left; color: #475569; border: 1px solid #e0e7ff; border-radius: 14px; background: #f8faff; font-size: 13px; line-height: 1.5; }
.experiment-instructions strong { color: #312e81; }
.experiment-primary-action,.experiment-secondary-action { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; padding: 0 24px; border-radius: 13px; font-weight: 800; text-decoration: none; }
.experiment-primary-action { color: #fff; background: linear-gradient(135deg,#5b4ae5,#4338ca); box-shadow: 0 12px 26px rgba(67,56,202,.25); }
.experiment-secondary-action { color: #3730a3; border: 1px solid #c7d2fe; background: #eef2ff; }
.experiment-primary-action:focus-visible,.experiment-secondary-action:focus-visible { outline: 3px solid rgba(79,70,229,.35); outline-offset: 3px; }

@media (max-width: 600px) {
  .experiment-page { padding: 76px 12px 24px; }
  .experiment-stage { min-height: 390px; padding: 28px 16px; }
  .experiment-header { padding: 16px; }
  .experiment-progress-copy { float: none; justify-content: space-between; margin-top: 12px; }
  .experiment-response-actions { flex-direction: column; }
  .experiment-response { width: 100%; }
  .experiment-intro { padding: 34px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .experiment-progress-track span,.experiment-response { transition: none; }
  .experiment-phase { animation: none; }
}

/* ─── MOS Distal ──────────────────────────────────────────────────────────── */
.distal-intro-page { place-items: start center; }
.distal-intro { width: min(100%, 920px); }
.distal-character-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: 28px 0 20px; }
.distal-character { min-width: 0; padding: 12px 8px; border: 1px solid #e2e8f0; border-radius: 15px; background: #f8fafc; }
.distal-character img { width: 72px; height: 72px; display: block; margin: 0 auto 8px; object-fit: contain; }
.distal-character strong { color: #1e293b; font-size: 13px; }
.distal-narratives { display: grid; gap: 8px; padding: 18px; text-align: left; border: 1px solid #e0e7ff; border-radius: 15px; background: #f8faff; }
.distal-narratives p { margin: 0; color: #475569; font-size: 13px; line-height: 1.5; }
.distal-narratives strong { color: #312e81; }
.distal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.distal-relation { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.distal-relation--positive { color: #047857; border: 1px solid #a7f3d0; background: #ecfdf5; }
.distal-relation--negative { color: #be123c; border: 1px solid #fecdd3; background: #fff1f2; }
.experiment-stage--distal { min-height: 470px; overflow: hidden; }
.experiment-example-badge { position: absolute; top: 18px; left: 20px; padding: 5px 10px; color: #3730a3; border: 1px solid #c7d2fe; border-radius: 999px; background: #eef2ff; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.experiment-example-badge[hidden] { display: none; }
.distal-chain { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.distal-chain__node { flex: 0 1 110px; min-width: 74px; display: grid; justify-items: center; gap: 7px; }
.distal-chain__node img { width: clamp(58px,8vw,86px); height: clamp(58px,8vw,86px); object-fit: contain; border: 1px solid #e2e8f0; border-radius: 50%; background: #f8fafc; }
.distal-chain__node strong { font-size: 13px; }
.distal-link { flex: 0 1 72px; display: grid; justify-items: center; gap: 6px; min-width: 35px; }
.distal-link__line { color: #94a3b8; font-size: 24px; line-height: 1; }
.distal-sentiment { width: fit-content; margin: 26px auto 0; padding: 13px 18px; color: #475569; border: 1px solid #e2e8f0; border-radius: 13px; background: #f8fafc; font-size: 15px; }
.distal-sentiment strong { color: #0f172a; }
.distal-sentiment .is-positive { color: #047857; font-weight: 800; }
.distal-sentiment .is-negative { color: #be123c; font-weight: 800; }
.distal-probe-avatar { width: 94px; height: 94px; display: block; margin: 0 auto 14px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 50%; background: #f8fafc; }
.distal-question { margin: 0 0 24px; color: #1e293b; font-size: clamp(24px,4vw,34px); font-weight: 800; letter-spacing: -.025em; }
.distal-scale { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.distal-scale[hidden],.distal-binary-actions[hidden] { display: none; }
.distal-scale button { min-height: 72px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 8px; color: #334155; border: 1px solid #cbd5e1; border-radius: 13px; background: #fff; cursor: pointer; }
.distal-scale button:hover { border-color: #818cf8; background: #f8faff; }
.distal-scale button:focus-visible { outline: 3px solid rgba(79,70,229,.35); outline-offset: 3px; }
.distal-scale button:disabled { opacity: .5; cursor: wait; }
.distal-scale strong { color: #4338ca; font-size: 20px; }
.distal-scale span { font-size: 11px; line-height: 1.2; }
.experiment-feedback { width: min(100%,440px); display: grid; gap: 8px; margin: auto; padding: 30px; border: 1px solid; border-radius: 18px; }
.experiment-feedback strong { font-size: 24px; }
.experiment-feedback span { font-size: 14px; }
.experiment-feedback.is-correct { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.experiment-feedback.is-incorrect { color: #9f1239; border-color: #fecdd3; background: #fff1f2; }
.distal-transition { max-width: 500px; margin: auto; }
.distal-transition > span { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; color: #047857; border-radius: 18px; background: #ecfdf5; font-size: 28px; font-weight: 800; }
.distal-transition h2 { margin: 0 0 10px; font-size: 28px; }
.distal-transition p { margin: 0 auto 24px; color: #475569; font-size: 15px; line-height: 1.6; }
.distal-transition button { border: 0; cursor: pointer; }

/* MOC Verbal — hierarquia visual do protótipo canônico v2. */
.experiment-stage--verbal { min-height: 384px; overflow: hidden; padding: 32px; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.experiment-page:has(.experiment-stage--verbal) .experiment-shell { width: min(100%, 1024px); }
.experiment-stage--verbal .experiment-phase { animation: fadeIn .4s ease both; }
.verbal-character-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 24px; }
.verbal-character { --character-color: #e2e8f0; min-width: 160px; display: grid; justify-items: center; gap: 8px; color: var(--character-color); }
.verbal-character__frame { width: 160px; height: 160px; display: grid; place-items: center; border: 2px solid var(--character-color); border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(15,23,42,.1); transition: box-shadow .18s ease, transform .18s ease; }
.verbal-character img { width: 128px; height: 128px; object-fit: contain; }
.verbal-character strong { color: var(--character-color); font-size: 16px; }
.verbal-character.is-anchor .verbal-character__frame { animation: verbalAnchorPulse 1.5s ease-in-out infinite; }
.verbal-anchor-icon { width: 28px; height: 28px; display: grid; place-items: center; margin-top: 2px; color: #fff; border-radius: 50%; background: #fbbf24; box-shadow: 0 3px 8px rgba(146,64,14,.18); }
.verbal-target { display: grid; place-items: center; margin-bottom: 26px; }
.verbal-target .verbal-character { min-width: 224px; }
.verbal-target .verbal-character__frame { width: 224px; height: 224px; }
.verbal-target .verbal-character img { width: 192px; height: 192px; }
.verbal-target .verbal-character strong { font-size: 17px; }
.verbal-question { margin: 0 0 14px; color: #334155; font-size: 17px; font-weight: 700; }
.verbal-position-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.verbal-position-button { width: 66px; height: 66px; color: #4338ca; border: 2px solid #a5b4fc; border-radius: 17px; background: #eef2ff; font: 800 28px/1 'Inter',sans-serif; cursor: pointer; box-shadow: 0 7px 18px rgba(67,56,202,.1); transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.verbal-position-button:hover { transform: translateY(-2px); border-color: #6366f1; background: #e0e7ff; }
.verbal-position-button:focus-visible { outline: 3px solid rgba(79,70,229,.35); outline-offset: 3px; }
.verbal-position-button:disabled { opacity: .5; cursor: wait; transform: none; }

/* MOC Não Verbal — cubos espaciais sem nomes ou numeração. */
.experiment-shell--cubes { width: min(100%, 980px); }
.experiment-stage--cubes { min-height: 620px; gap: 18px; padding: 28px; overflow: hidden; }
.cube-phase-label { margin: 0; color: #3730a3; font-size: clamp(17px,2.4vw,21px); font-weight: 800; text-align: center; }
.cube-board { --moc-cube-color: #000000; width: min(100%, 760px); aspect-ratio: 4 / 3; position: relative; border: 1px solid #dbe3ee; border-radius: 22px; background: #f8fafc; box-shadow: inset 0 1px 2px rgba(15,23,42,.04); outline: none; }
.cube-board.corsi-board { width: min(100%, 720px); aspect-ratio: 1 / 1; }
.cube-board:focus-visible { outline: 3px solid rgba(79,70,229,.28); outline-offset: 4px; }
.moc-cube-position { position: absolute; transform: translate(-50%,-50%); }
.moc-cube { position: relative; width: clamp(58px,8vw,86px); height: clamp(58px,8vw,86px); display: block; padding: 0; border: 5px solid transparent; border-radius: 14px; background: var(--moc-cube-color); box-shadow: 0 9px 18px rgba(15,23,42,.18); cursor: pointer; touch-action: manipulation; transition: border-color .12s ease-out, box-shadow .12s ease-out, transform .12s ease-out; }
.moc-cube:disabled { opacity: 1; cursor: default; }
.moc-cube.is-active,.moc-cube.is-acknowledged { border-color: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.2),0 10px 22px rgba(15,23,42,.2); transform: scale(1.04); }
.moc-cube:focus-visible { outline: 4px solid #4f46e5; outline-offset: 5px; }
.moc-cube.corsi-character { width: clamp(92px,13vw,176px); height: clamp(92px,13vw,176px); border-width: 3px; background: #fff; }
.moc-cube.corsi-character img { width: 92%; height: 92%; object-fit: contain; pointer-events: none; user-select: none; }
.moc-cube.corsi-character.is-acknowledged { border-color: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.2),0 10px 22px rgba(15,23,42,.2); }
.corsi-order-badge { position: absolute; top: -10px; right: -10px; min-width: 28px; height: 28px; padding: 0 7px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: #15803d; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; box-shadow: 0 3px 9px rgba(15,23,42,.25); }
.corsi-feedback { min-width: 220px; padding: 24px 32px; border-radius: 18px; text-align: center; font-size: clamp(28px,5vw,44px); font-weight: 850; }
.corsi-feedback.is-correct { background: #dcfce7; color: #166534; }
.corsi-feedback.is-incorrect { background: #fee2e2; color: #991b1b; }
.corsi-results { display: grid; gap: 12px; width: 100%; margin: 8px 0 20px; }
.corsi-results div { display: flex; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; }
.corsi-results span { color: #475569; }
.cube-response-progress { margin: 0; color: #475569; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.exp4-safe-state { max-width: 680px; margin-inline: auto; text-align: center; }
.exp4-safe-state h1,.exp4-safe-state h2 { margin: 0; color: #0f172a; font-size: clamp(23px,4vw,32px); }
.exp4-safe-state p { max-width: 58ch; margin: 8px auto 20px; color: #475569; line-height: 1.65; }

@media (max-width: 620px) {
  .experiment-stage--cubes { min-height: 500px; padding: 20px 12px; }
  .cube-board { width: 100%; min-height: 390px; aspect-ratio: auto; border-radius: 17px; }
  .cube-board.corsi-board { min-height: 0; aspect-ratio: 1 / 1; }
  .moc-cube { width: clamp(50px,15vw,68px); height: clamp(50px,15vw,68px); border-width: 4px; border-radius: 11px; }
  .moc-cube.corsi-character { width: clamp(66px,22vw,98px); height: clamp(66px,22vw,98px); }
  .corsi-results div { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide-up,.fade-in,.flash { animation: none !important; }
  .moc-cube { transition: border-color .01ms linear, box-shadow .01ms linear; }
  .moc-cube.is-active,.moc-cube.is-acknowledged { transform: none; }
}
@keyframes verbalAnchorPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4); }
  50% { box-shadow: 0 0 0 12px rgba(79,70,229,0); }
}

@media (max-width: 720px) {
  .distal-character-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .distal-chain { flex-wrap: wrap; row-gap: 16px; }
  .distal-link { flex-basis: 38px; }
  .distal-scale { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 460px) {
  .distal-character-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .distal-chain__node { flex-basis: 78px; }
  .distal-link { min-width: 28px; }
  .distal-relation { font-size: 8px; }
  .verbal-character-grid { gap: 13px; }
  .verbal-character { min-width: 116px; }
  .verbal-character__frame { width: 116px; height: 116px; }
  .verbal-character img { width: 96px; height: 96px; }
  .verbal-target .verbal-character { min-width: 184px; }
  .verbal-target .verbal-character__frame { width: 184px; height: 184px; }
  .verbal-target .verbal-character img { width: 156px; height: 156px; }
  .verbal-position-button { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .distal-scale button { transition: none; }
  .verbal-character__frame,.verbal-position-button { transition: none; animation: none !important; }
}
