/* =========================================================================
   Rumbo — estilo inspirado en las guías de diseño de Apple
   - Tipografía del sistema con tracking según tamaño
   - Superficies limpias, profundidad sutil, materiales translúcidos
   - Feedback inmediato al presionar (pointer-down), sin esperas
   - Respeta movimiento / transparencia reducidos y alto contraste
   ========================================================================= */

:root {
  color-scheme: light dark;

  /* Superficies */
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, .12);       /* relleno de controles (iOS tertiary fill) */
  --fill-strong: rgba(120, 120, 128, .2);
  --line: rgba(0, 0, 0, .08);
  --material: rgba(250, 250, 252, .72);   /* barra translúcida */

  /* Texto */
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;

  /* Acento: azul del sistema */
  --brand: #0071e3;
  --brand-hover: #0077ed;
  --brand-2: #0071e3;
  --brand-soft: rgba(0, 113, 227, .1);
  --on-brand: #ffffff;

  /* Estados */
  --green: #248a3d;
  --orange: #c93400;
  --red: #d70015;

  /* Forma y profundidad */
  --radius: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .06), 0 24px 60px rgba(0, 0, 0, .16);
  --ring: 0 0 0 4px rgba(0, 113, 227, .28);

  /* Movimiento: curva sin rebote (equivale a un resorte críticamente amortiguado) */
  --ease: cubic-bezier(.25, 1, .5, 1);
  --fast: 120ms;
  --med: 280ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --fill: rgba(118, 118, 128, .24);
    --fill-strong: rgba(118, 118, 128, .36);
    --line: rgba(255, 255, 255, .1);
    --material: rgba(22, 22, 23, .72);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #8e8e93;
    --brand: #0a84ff;
    --brand-hover: #409cff;
    --brand-2: #0a84ff;
    --brand-soft: rgba(10, 132, 255, .2);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 28px rgba(0, 0, 0, .5);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .6);
    --ring: 0 0 0 4px rgba(10, 132, 255, .4);
  }
}

/* ============================ Base ============================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;           /* 17px, tamaño base de Apple */
  line-height: 1.47;
  letter-spacing: -.011em;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}
::selection { background: var(--brand-soft); }

.container { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }

/* Tipografía: tracking negativo y leading ajustado al crecer */
h1, h2, h3 { margin: 0 0 .5rem; color: var(--text); }
h1 { font-size: clamp(2rem, 5.4vw, 2.75rem); line-height: 1.08; font-weight: 700; letter-spacing: -.028em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.5rem); line-height: 1.17; font-weight: 700; letter-spacing: -.021em; }
h3 { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; letter-spacing: -.016em; }
.lead { font-size: clamp(1.1rem, 2.4vw, 1.3rem); line-height: 1.4; color: var(--muted); letter-spacing: -.016em; margin: .25rem auto 0; max-width: 34em; }
.muted { color: var(--muted); font-size: .94rem; margin: .25rem 0; letter-spacing: -.008em; }
.step { font-size: .82rem; font-weight: 600; color: var(--brand); letter-spacing: 0; margin: 0 0 6px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================ Tarjetas ============================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 20px;
}
.fade { animation: rise var(--med) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }

/* ============================ Botones ============================ */
.btn {
  font: inherit; font-size: 1rem; font-weight: 500; letter-spacing: -.01em; cursor: pointer;
  border-radius: 980px; padding: 11px 22px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, opacity var(--fast) ease, box-shadow var(--fast) ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* Feedback al presionar: instantáneo */
.btn:active:not(:disabled) { transform: scale(.97); transition-duration: 60ms; }
.btn:disabled { opacity: .32; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn.ghost { background: var(--fill); color: var(--brand); }
.btn.ghost:hover:not(:disabled) { background: var(--fill-strong); }
.btn.big { width: 100%; padding: 15px 22px; font-size: 1.0625rem; font-weight: 600; margin-top: 14px; border-radius: var(--radius-md); }
.btn.small { padding: 6px 14px; font-size: .82rem; }

/* ============================ Intro ============================ */
.intro, .section-intro { text-align: center; }
.intro { padding-top: 40px; }
.logo, .big-icon {
  font-size: 2.6rem; width: 76px; height: 76px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 20px;
  background: linear-gradient(180deg, var(--card), var(--bg));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .08), inset 0 0 0 1px var(--line);
}
.pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0; }
.pills li { background: var(--fill); color: var(--text); border-radius: 980px; padding: 6px 14px; font-size: .88rem; font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 26px 0; background: var(--line); border-radius: var(--radius-md); overflow: hidden; }
.facts div { background: var(--card); padding: 14px 6px; }
.facts strong { display: block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.facts span { font-size: .8rem; color: var(--muted); }

/* Campos */
.field { display: block; text-align: left; margin-bottom: 8px; }
.field > span { display: block; font-weight: 600; margin: 0 0 6px 2px; font-size: .88rem; color: var(--muted); letter-spacing: -.005em; }
.field em { font-weight: 400; font-style: normal; color: var(--faint); }
.field input, .field select, .career-pick input {
  width: 100%; font: inherit; font-size: 1.0625rem; padding: 13px 16px; border-radius: 12px;
  border: 1px solid transparent; background: var(--fill); color: var(--text);
  transition: box-shadow var(--fast) ease, background-color var(--fast) ease;
  -webkit-appearance: none; appearance: none;
}
.field select {
  margin-bottom: 12px; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field input::placeholder, .career-pick input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .career-pick input:focus { outline: none; background: var(--card); box-shadow: inset 0 0 0 1px var(--brand), var(--ring); }
.intro .btn.ghost { margin-top: 10px; }
.note { font-size: .82rem; color: var(--faint); margin: 20px auto 0; max-width: 34em; line-height: 1.45; }

/* ============================ Progreso ============================ */
.progress { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 20px; }
.segs { display: flex; gap: 4px; }
.seg { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); font-size: .88rem; opacity: .45; transition: opacity var(--med) var(--ease), box-shadow var(--med) var(--ease); }
.seg.done { opacity: .85; }
.seg.current { opacity: 1; background: var(--card); box-shadow: 0 0 0 2px var(--brand), 0 2px 8px rgba(0, 0, 0, .08); }
.bar { height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; background: var(--brand); border-radius: 99px; transition: width var(--med) var(--ease); }
.count { font-size: .82rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ============================ Pregunta ============================ */
.q-section { font-size: .82rem; font-weight: 600; color: var(--brand); margin: 0; }
.q-prompt { color: var(--muted); margin: 12px 0 0; font-size: .98rem; }
.q-text { font-size: clamp(1.4rem, 3.6vw, 1.75rem); line-height: 1.2; letter-spacing: -.022em; font-weight: 600; margin: 6px 0 26px; min-height: 2.4em; }

/* Escala Likert: botones con relleno, selección sólida */
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lk {
  font: inherit; cursor: pointer; background: var(--fill); color: var(--text);
  border: 0; border-radius: var(--radius-md); padding: 16px 4px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, color var(--fast) ease, box-shadow var(--fast) ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lk:hover:not(:disabled) { background: var(--fill-strong); }
.lk:active:not(:disabled) { transform: scale(.95); transition-duration: 60ms; }
.lk:focus-visible { outline: none; box-shadow: var(--ring); }
.lk.selected, .lk.selected:hover { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 14px rgba(0, 113, 227, .3); }
.lk-emoji { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.lk-label { font-size: .76rem; font-weight: 500; text-align: center; letter-spacing: 0; line-height: 1.2; }

/* Opciones de elección (filas tipo lista agrupada) */
.choices { display: grid; gap: 8px; }
.choice {
  font: inherit; text-align: left; cursor: pointer; background: var(--fill); color: var(--text);
  border: 0; border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; line-height: 1.35;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, color var(--fast) ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.choice:hover:not(:disabled) { background: var(--fill-strong); }
.choice:active:not(:disabled) { transform: scale(.985); transition-duration: 60ms; }
.choice:focus-visible { outline: none; box-shadow: var(--ring); }
.choice.selected, .choice.selected:hover { background: var(--brand); color: var(--on-brand); }
.key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 600; font-size: .82rem; background: var(--card); color: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.selected .key { color: var(--brand); }
.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 8px; }
.hint { font-size: .78rem; color: var(--faint); }

/* ============================ Resultados ============================ */
.hero { text-align: center; position: relative; overflow: hidden; padding-top: 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 180px; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
}
.hero > * { position: relative; }
.code { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.code span {
  width: 56px; height: 56px; border-radius: 16px; color: #fff; font-weight: 700; font-size: 1.6rem;
  display: grid; place-items: center; letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px rgba(0, 0, 0, .14);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tags span { background: var(--fill); border-radius: 980px; padding: 6px 13px; font-size: .86rem; font-weight: 500; }

.hbar { display: grid; grid-template-columns: 170px 1fr 44px; gap: 12px; align-items: center; margin: 12px 0; }
.hbar-label { font-weight: 500; font-size: .92rem; }
.hbar-track { height: 8px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; transform-origin: left; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hbar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }

.detail { margin-top: 16px; }
.detail summary, .counselor summary {
  cursor: pointer; color: var(--brand); font-weight: 500; font-size: .94rem;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.detail summary::-webkit-details-marker, .counselor summary::-webkit-details-marker { display: none; }
.detail summary::after, .counselor summary::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--med) var(--ease);
}
details[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

.tbl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .86rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; }

.areas { display: grid; gap: 10px; margin-top: 14px; }
.area { display: flex; gap: 14px; align-items: flex-start; background: var(--fill); border-radius: var(--radius-md); padding: 16px; }
.area.first { background: var(--brand-soft); }
.area-emoji { font-size: 1.9rem; line-height: 1; }
.area-name { font-weight: 600; letter-spacing: -.012em; }
.badge { background: var(--brand); color: var(--on-brand); border-radius: 980px; padding: 2px 9px; font-size: .74rem; font-weight: 600; margin-left: 6px; font-variant-numeric: tabular-nums; vertical-align: 1px; }

.careers { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: c; }
.careers li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); counter-increment: c; }
.careers li:last-child { border-bottom: 0; }
.careers li::before {
  content: counter(c); flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--fill); color: var(--muted); font-weight: 600; font-size: .8rem;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.careers li:nth-child(-n+3)::before { background: var(--brand); color: var(--on-brand); }
.c-main { flex: 1; min-width: 0; }
.c-name { font-weight: 600; letter-spacing: -.012em; }
.c-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.nivel { font-weight: 600; }
.nivel.tec { color: var(--orange); }
.nivel.larga { color: var(--red); }
.ccode b { font-weight: 700; }
.ring {
  --p: 50; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: .78rem; font-weight: 700; position: relative; isolation: isolate; font-variant-numeric: tabular-nums;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--fill) 0);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--card); z-index: -1; }
.others { columns: 2; padding-left: 18px; margin-top: 12px; font-size: .94rem; }
.others li { margin-bottom: 6px; break-inside: avoid; }

.trait { margin-bottom: 10px; }
.trait p { margin-top: -6px; }
.advice { padding: 0; list-style: none; display: grid; gap: 10px; }
.advice li { background: var(--fill); border-radius: var(--radius-md); padding: 14px 16px; line-height: 1.45; }
.disclaimer { font-size: .84rem; color: var(--muted); background: var(--fill); border-radius: var(--radius-md); padding: 12px 14px; margin-top: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 12px; }

.footer { text-align: center; font-size: .78rem; color: var(--faint); padding: 0 16px 28px; }

/* ============================ Pausa y validación ============================ */
.tips { text-align: left; background: var(--fill); border-radius: var(--radius-md); padding: 16px 18px; margin: 0 0 20px; }
.tips h3 { margin: 0 0 8px; font-size: .98rem; }
.tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .94rem; line-height: 1.4; }
.pledge {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--brand-soft);
  border-radius: var(--radius-md); padding: 14px 16px; margin: 16px 0 4px; cursor: pointer; font-size: .95rem; line-height: 1.4;
}
.pledge input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; cursor: pointer; }

.readbar { height: 3px; background: var(--fill); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.readbar div { height: 100%; width: 100%; background: var(--brand); opacity: .6; transform-origin: left; animation: readfill linear forwards; }
@keyframes readfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.opts { transition: opacity var(--med) var(--ease); }
.opts.locked { opacity: .4; }
.opts button:disabled { cursor: wait; }
.lk:disabled:hover, .choice:disabled:hover, .pc:disabled:hover { background: var(--fill); }
.question.is-check .q-text { color: var(--brand); }

/* Este o aquel */
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.pc {
  font: inherit; cursor: pointer; text-align: left; background: var(--fill); color: var(--text); border: 0;
  border-radius: 18px; padding: 20px 18px; display: flex; gap: 12px; align-items: center;
  font-weight: 500; font-size: 1.02rem; line-height: 1.35;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, color var(--fast) ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pc:hover:not(:disabled) { background: var(--fill-strong); }
.pc:active:not(:disabled) { transform: scale(.98); transition-duration: 60ms; }
.pc:focus-visible { outline: none; box-shadow: var(--ring); }
.pc.selected, .pc.selected:hover { background: var(--brand); color: var(--on-brand); }
.or { align-self: center; color: var(--faint); font-weight: 500; font-size: .85rem; }

.course-icon { font-size: 1.3em; }
.course-row { margin-bottom: 16px; }
.row-label { font-weight: 600; font-size: .86rem; color: var(--muted); margin: 0 0 8px 2px; }
.likert.four { grid-template-columns: repeat(4, 1fr); }

.career-pick .row, .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .92rem; cursor: pointer; border: 0; background: var(--fill); color: var(--text);
  border-radius: 980px; padding: 8px 15px; font-weight: 500;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, color var(--fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { background: var(--fill-strong); }
.chip:active { transform: scale(.96); transition-duration: 60ms; }
.chip:focus-visible { outline: none; box-shadow: var(--ring); }
.chip small { font-weight: 400; color: var(--muted); }
.chip.on, .chip.on:hover { background: var(--brand); color: var(--on-brand); }
.chip.on small { color: var(--on-brand); opacity: .8; }

.insight { background: var(--brand-soft); border-radius: var(--radius-md); padding: 14px 16px; font-size: .95rem; line-height: 1.45; }

/* Toast: material flotante */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%); max-width: min(520px, calc(100% - 32px));
  background: var(--material); color: var(--text);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  padding: 13px 20px; border-radius: 18px; box-shadow: var(--shadow-lg); font-size: .94rem; line-height: 1.4;
  animation: toast-in var(--med) var(--ease) both; transition: opacity .4s ease, transform .4s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.out { opacity: 0; transform: translate(-50%, 8px) scale(.98); }

/* Pausa de respiración: oscurecer para enfocar */
.breath {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  animation: fadein var(--med) var(--ease) both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.breath-card {
  background: var(--card); border-radius: 28px; padding: 32px 28px; max-width: 420px; text-align: center;
  box-shadow: var(--shadow-lg); animation: sheet-in 420ms var(--ease) both;
}
@keyframes sheet-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.breath-circle {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #64d2ff, var(--brand));
  box-shadow: 0 10px 30px rgba(0, 113, 227, .35);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(.62); opacity: .6; } 50% { transform: scale(1); opacity: 1; } }
.breath-count { font-size: 2.2rem; font-weight: 700; color: var(--brand); margin: 6px 0 0; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ============================ Resultados v2 ============================ */
.alert { box-shadow: inset 0 0 0 1.5px var(--red), var(--shadow); }
.alert h2 { color: var(--red); }
.validity .vscore { display: flex; gap: 20px; align-items: center; }
.vlabel { font-size: 1.1rem; margin: 0; font-weight: 600; }
.ring.big { --rc: var(--brand); width: 88px; height: 88px; font-size: 1.45rem; letter-spacing: -.02em; background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--fill) 0); }
.ring.big::before { inset: 8px; }
.vlist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: .92rem; }
.vlist .ok { color: var(--text); }
.vlist .ok::first-letter { color: var(--green); }
.vlist .bad { color: var(--red); }

.unis { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.uni { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 980px; background: var(--fill); color: var(--muted); cursor: help; letter-spacing: .01em; }
.uni.pub { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.uni.on { background: var(--brand); color: var(--on-brand); }
.uni.muted-chip { cursor: default; font-weight: 500; }

.unis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.uni-card { background: var(--fill); border-radius: var(--radius-md); padding: 16px; }
.uni-card h3 { margin: 0 0 8px; font-size: .98rem; }
.uni-card h3 a { color: var(--brand); }
.uni-card small { color: var(--muted); font-weight: 400; }
.uni-card ol { margin: 0; padding-left: 18px; font-size: .9rem; }
.uni-card li { margin: 5px 0; }
.uni-card li span { margin-right: 6px; }
.uni-card li b { color: var(--brand); font-size: .8rem; font-variant-numeric: tabular-nums; }
.note-box { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; }

.likert.fb { margin-top: 10px; }
.counselor h3 { font-size: .94rem; margin: 20px 0 6px; }
.flags { padding-left: 18px; font-size: .9rem; }
.flags b { color: var(--red); }
.counselor .btn { margin-top: 16px; }
.sources ul { padding-left: 18px; font-size: .9rem; }

/* ============================ Cuenta / login ============================ */
.auth { max-width: 440px; margin: 6vh auto 20px; text-align: center; padding: 40px 32px 32px; }
.auth h1 { margin-bottom: .35rem; }
.auth .lead { font-size: 1.02rem; }
.auth form { margin-top: 4px; }
.auth .field { margin-bottom: 10px; }
.auth .field input { margin-bottom: 0; }
.captcha { display: flex; justify-content: center; min-height: 70px; margin: 22px 0 8px; }
.btn.google {
  text-decoration: none; background: var(--card); color: var(--text); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--fill-strong);
}
.btn.google:hover:not(.disabled) { background: var(--fill); text-decoration: none; }
.btn.google.disabled { opacity: .4; cursor: not-allowed; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--faint); font-size: .82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Control segmentado estilo iOS */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--fill); border-radius: 10px; padding: 2px; margin: 12px 0 18px; }
.tabs:has(.tab[hidden]) { grid-template-columns: 1fr; }
.tab {
  font: inherit; font-size: .9rem; font-weight: 500; border: 0; background: transparent; color: var(--text);
  padding: 7px; border-radius: 8px; cursor: pointer; transition: background-color var(--fast) ease, box-shadow var(--fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.tab.on { background: var(--card); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
.tab:focus-visible { outline: none; box-shadow: var(--ring); }
.form-msg { min-height: 1.3em; color: var(--red); font-size: .88rem; margin: 6px 2px 0; text-align: left; line-height: 1.4; }

/* Barra superior translúcida (el contenido se desplaza por debajo) */
.userbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--line);
}
.userbar-in {
  max-width: 760px; margin: 0 auto; padding: 10px 16px; min-height: 52px;
  display: flex; align-items: center; gap: 12px; font-size: .84rem; color: var(--muted);
}
.userbar .brand { font-weight: 600; color: var(--text); font-size: .98rem; letter-spacing: -.016em; white-space: nowrap; text-decoration: none; }
.userbar .sync { margin-right: auto; }
.userbar .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.userbar .sync { font-weight: 500; white-space: nowrap; color: var(--faint); }
.userbar .sync.err { color: var(--red); }
.saved-at { font-size: .85rem; color: var(--muted); }


/* ============================ Login por pasos ============================ */
.step-title { font-weight: 600; font-size: 1rem; letter-spacing: -.012em; margin: 4px 0 14px; text-align: left; color: var(--text); }
.input-row { position: relative; display: block; }
.input-row input { padding-right: 92px; }
.link-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .88rem; font-weight: 500; color: var(--brand); background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.link-btn:hover { background: var(--brand-soft); }
.link-btn:active { opacity: .6; }
.link-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.field.locked input { color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.form-msg.ok { color: var(--green); }
#nameField, #passField { animation: rise var(--med) var(--ease) both; }

/* ============================ Navegación ============================ */
.nav-links { display: flex; gap: 2px; }
.nav-link {
  color: var(--text); text-decoration: none; font-weight: 500; font-size: .86rem; white-space: nowrap;
  padding: 6px 11px; border-radius: 980px; transition: background-color var(--fast) ease;
}
.nav-link:hover { background: var(--fill); text-decoration: none; }
.nav-link:active { transform: scale(.97); }
.nav-link.on { background: var(--brand-soft); color: var(--brand); }
.brand-tag { font-size: .68rem; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; margin-left: 4px; vertical-align: 2px; }

/* ============================ Listas (estilo lista agrupada iOS) ============================ */
.list { background: var(--fill); border-radius: var(--radius-md); overflow: hidden; margin: 18px 0 6px; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px; color: var(--text); text-decoration: none;
  position: relative; transition: background-color var(--fast) ease;
}
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.list-row:hover { background: var(--fill); text-decoration: none; }
.list-row:active { background: var(--fill-strong); }
.list-row:focus-visible { outline: none; box-shadow: inset var(--ring); }
.list-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.5rem; }
.list-icon .ring { width: 38px; height: 38px; font-size: .62rem; }
.list-icon .ring::before { inset: 4px; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-title { font-weight: 600; letter-spacing: -.012em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-sub { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.list-end { flex: none; display: flex; align-items: center; gap: 10px; }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--faint); border-top: 2px solid var(--faint); transform: rotate(45deg); opacity: .7; display: inline-block; }
.pill-status {
  display: inline-block; font-size: .72rem; font-weight: 600; white-space: nowrap; padding: 3px 9px; border-radius: 980px;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.mini-code { display: inline-flex; gap: 3px; }
.mini-code i { font-style: normal; color: #fff; font-weight: 700; font-size: .7rem; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; }
.empty { text-align: center; padding: 24px 0 8px; }
.empty .big-icon { margin-bottom: 12px; }
.empty .ring.big { margin: 4px auto 14px; }

/* Cabecera al ver una evaluación guardada */
.viewbar { padding: 14px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.back-link { font-weight: 500; white-space: nowrap; }
.view-meta { display: flex; flex-direction: column; gap: 1px; font-size: .92rem; min-width: 0; }
.view-meta .muted { margin: 0; font-size: .82rem; }
.view-owner { color: var(--text); }

/* ============================ Panel admin ============================ */
.container.wide, .userbar-in.wide { max-width: 1120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 4px 20px; }
.page-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .84rem; color: var(--muted); font-weight: 500; }
.stat small { font-size: .74rem; color: var(--green); font-weight: 600; }
.stat.warn strong, .stat.warn small { color: var(--red); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }
.sub-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }
.rank { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 9px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 42px; gap: 12px; align-items: center; font-size: .9rem; }
.rank li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank b { text-align: right; font-variant-numeric: tabular-nums; font-size: .86rem; }
.mini-bar { height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 99px; animation: grow .8s var(--ease) both; transform-origin: left; }
.spark { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; height: 120px; align-items: end; margin-top: 12px; }
.spark span { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.spark i { display: block; width: 100%; background: var(--brand); border-radius: 5px 5px 2px 2px; min-height: 3px; transform-origin: bottom; animation: rise-bar .7s var(--ease) both; }
.spark em { font-style: normal; font-size: .66rem; color: var(--faint); font-variant-numeric: tabular-nums; }
@keyframes rise-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.admin-tabs { max-width: 420px; margin: 0 0 18px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.search {
  flex: 1 1 240px; font: inherit; font-size: .95rem; padding: 10px 14px 10px 36px; border-radius: 10px; border: 0;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text); -webkit-appearance: none; appearance: none;
}
.search:focus { outline: none; box-shadow: var(--ring); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -8px; padding: 0 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 720px; }
table.data.compact { min-width: 560px; font-size: .82rem; }
table.data th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; transition: background-color var(--fast) ease; }
table.data tr.clickable:hover td { background: var(--fill); }
table.data tr.clickable:focus-visible { outline: none; box-shadow: inset var(--ring); }
table.data td:last-child { text-align: right; white-space: nowrap; }
table.data td:last-child .pill-status { margin-right: 10px; }
.cell-main { font-weight: 600; letter-spacing: -.01em; }
.cell-sub { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.center { text-align: center !important; padding: 28px !important; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; color: var(--muted); }
.btn.more { display: flex; margin: 16px auto 0; }
.btn.danger { color: var(--red); }

/* Hoja lateral (detalle de usuario): entra y sale por la derecha */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity 260ms var(--ease); }
.sheet-scrim.in { opacity: 1; }
.sheet {
  position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(640px, 100%);
  background: var(--card); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 320ms var(--ease);
}
.sheet.in { transform: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px;
  background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--line); position: sticky; top: 0;
}
.sheet-head h2 { margin: 0; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 6px 22px 32px; overflow-y: auto; overscroll-behavior: contain; }
body.sheet-open { overflow: hidden; }
.facts-list { margin: 14px 0; background: var(--fill); border-radius: var(--radius-md); padding: 4px 14px; }
.facts-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: .9rem; }
.facts-list div + div { border-top: 1px solid var(--line); }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; text-align: right; font-weight: 500; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet .list { margin-top: 8px; }

/* ============================ Responsive ============================ */
@media (max-width: 560px) {
  .container { padding-top: 16px; }
  .card { padding: 24px 18px; border-radius: 20px; }
  .intro, .hero { padding-top: 28px; }
  .auth { padding: 32px 20px 24px; margin-top: 3vh; }
  .pair { grid-template-columns: 1fr; }
  .or { justify-self: center; }
  .validity .vscore { flex-direction: column; text-align: center; }
  .likert { gap: 5px; }
  .lk { padding: 13px 2px 11px; border-radius: 12px; }
  .lk-label { font-size: .66rem; }
  .hint { display: none; }
  .hbar { grid-template-columns: 110px 1fr 34px; gap: 8px; }
  .hbar-label { font-size: .82rem; }
  .segs .seg { width: 24px; height: 24px; font-size: .72rem; }
  .others { columns: 1; }
  .tbl { font-size: .74rem; }
  .userbar .who, .userbar .lbl { display: none; }
  .userbar .sync { font-size: .74rem; }
  .viewbar { padding: 12px 16px; gap: 10px; }
  .list-row + .list-row::before { left: 14px; }
  .list-end .pill-status { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .sheet-body { padding: 6px 16px 28px; }
  .sheet-head { padding: 14px 16px; }
  .code span { width: 50px; height: 50px; font-size: 1.4rem; }
}

/* ============================ Accesibilidad ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .fade, .breath-card, .toast { animation: fadein 200ms ease both !important; }
  .breath-circle { animation: none !important; transform: none; }
  .sheet { transition: opacity 200ms ease !important; transform: none !important; opacity: 0; }
  .sheet.in { opacity: 1; }
  .hbar-fill { animation: none !important; }
  .btn:active, .lk:active, .choice:active, .pc:active, .chip:active { transform: none !important; }
  .readbar div { animation-duration: inherit; }
}
@media (prefers-reduced-transparency: reduce) {
  .userbar, .toast, .sheet-head { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .breath { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .3); --muted: #3a3a3c; --faint: #48484a; --fill: rgba(120, 120, 128, .2); }
  .card { box-shadow: 0 0 0 1px var(--line); }
  .lk, .choice, .pc, .chip, .field input, .field select { box-shadow: inset 0 0 0 1px var(--line); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --line: rgba(255, 255, 255, .4); --muted: #d1d1d6; --faint: #c7c7cc; }
}

/* ============================ Impresión ============================ */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .userbar { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; border: 1px solid #ddd; }
  details > summary { display: none; }
  details { display: block; }
  .readbar, .toast, .breath { display: none !important; }
  .hbar-fill { animation: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
