:root {
  --bg: #0f1115;
  --bg-elev: #161922;
  --bg-input: #1d2230;
  --border: #2a2f3d;
  --text: #e6e8ee;
  --muted: #8b91a3;
  --accent: #F48FB1;
  --user: #2a3245;
  --link: #7aa8ff;
  --green: #6cd28a;
  --yellow: #f0c850;
  --red: #ff6b8a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, "SF Pro Text", Inter, system-ui, sans-serif;
  /* dvh = dynamic viewport height: se ajusta a las barras dinámicas de iOS Safari */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* Evita gestures de zoom involuntarios en iOS */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
/* Aseguramos que los flex containers respeten el alto del viewport */
.tab-panel { min-height: 0; }
main#chat, .match-sections, .me-layout, .sim-chat, .sim-feedback {
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
/* Safe areas para iPhone con notch/dynamic island */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Force font-size >= 16px en TODOS los inputs (Safari iOS solo zoomea si <16) */
input, textarea, select, button {
  font-size: 16px !important;
}
body { display: flex; flex-direction: column; }

/* ─── Header con tabs ─── */
header {
  border-bottom: 1px solid #e8dfd3;
  background: #f8f2ec; /* cream — matchea el fondo transparente del logo */
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 100;
}
header .token-badge {
  background: rgba(244, 143, 177, 0.18);
  color: #c64a72;
  border: 1px solid rgba(244, 143, 177, 0.45);
}
header .token-badge:hover {
  background: rgba(244, 143, 177, 0.28);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
h1 { margin: 0; font-size: 1.05rem; font-weight: 700; }

/* Brand en header: icon HACE de letra S, "wayly" continúa pegado a la derecha.
   Sin gap — el conjunto se lee como una palabra integrada.
   Alineación robusta: ambos elementos tienen MISMA altura y line-height
   para que cross-browser/font el centrado funcione igual. */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  height: 32px;
}
.brand-full {
  height: 28px;
  width: auto;
  display: block;
}
@media (max-width: 480px) {
  .brand-full { height: 24px; }
}

/* Token badge en header */
.token-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-soft, rgba(214,51,108,0.12));
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.token-badge:hover {
  background: var(--accent-soft-hover, rgba(214,51,108,0.2));
}
.token-badge .ico-sm {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  margin: 0;
}

/* ─── Modal "Tu cuenta" ─── */
.user-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
}
.user-modal[hidden] { display: none; }
.user-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}
.user-modal-panel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  max-height: 90dvh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.user-modal-head {
  display: flex; justify-content: space-between; align-items: center;
}
.user-modal-head h3 { margin: 0; font-size: 1.05rem; }
.user-modal-x {
  width: 32px; height: 32px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.06);
  color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.uc-balance {
  background: linear-gradient(135deg, rgba(244,143,177,0.18), rgba(201,164,255,0.15));
  border: 1px solid rgba(244,143,177,0.3);
  border-radius: 12px;
  padding: 1rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
}
.uc-balance-num {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.uc-balance-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.uc-section {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.uc-section h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.uc-action {
  align-self: flex-start;
}

.tabs { display: flex; gap: 0.4rem; }
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); background: var(--bg-input); border-color: var(--border); }

.tab-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.tab-panel.active { display: flex; }

/* ─── Buttons / inputs comunes ─── */
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
button.ghost:hover { color: var(--text); border-color: var(--muted); }

button.primary {
  background: var(--accent);
  color: #1a0f0a;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary:hover:not(:disabled) { filter: brightness(1.07); }

input, textarea, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  font: inherit;
  /* 16px previene el zoom automático de Safari iOS al enfocar inputs */
  font-size: 16px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; font-family: inherit; }
label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.85rem; color: var(--muted);
  margin-bottom: 0.5rem;
}
label input, label textarea, label select { color: var(--text); }

/* ─── PRACTICAR ─── */
.practice-bar {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0.7rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.practice-bar .muted { color: var(--muted); flex-shrink: 0; }
.practice-bar .specialty {
  flex: 1 1 100%;
  order: 99;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
  white-space: normal;
  line-height: 1.3;
  margin-top: 0.2rem;
}
.practice-bar #coach-select { flex-shrink: 0; max-width: 60vw; }
.practice-bar #btn-clear { margin-left: auto; flex-shrink: 0; }
#coach-select {
  background: var(--bg-input);
  color: var(--accent);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

main#chat {
  flex: 1; overflow-y: auto;
  padding: 0.5rem 1rem 1.5rem;
}
#messages {
  max-width: 760px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 1rem;
}

.msg { display: flex; gap: 0.7rem; align-items: flex-start; }
.msg .role {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  flex-shrink: 0; width: 64px; padding-top: 0.4rem;
}
.msg .bubble {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  overflow-wrap: anywhere;
}
.msg.user .bubble { background: var(--user); }
.bubble p { margin: 0.3rem 0; }
.bubble p:first-child { margin-top: 0; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0.4rem 0; padding-left: 1.2rem; }
.bubble li { margin: 0.15rem 0; }

/* Blockquotes en mensajes del panel = mensajes literales para mandar a ella.
   Llevan un botón "copiar" en la esquina top-right. */
.bubble blockquote {
  position: relative;
  margin: 0.5rem 0;
  padding: 0.6rem 2.5rem 0.6rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: rgba(244, 143, 177, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: normal;
}
.bubble blockquote p { margin: 0; }
.copy-blockquote {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.copy-blockquote:hover {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}
.copy-blockquote .ico-sm {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  margin: 0;
}
.copy-blockquote.copied {
  color: var(--green, #6cd28a);
  border-color: var(--green, #6cd28a);
}
.bubble strong { color: #fff; }
.bubble code { background: #0a0c11; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
.bubble a { color: var(--link); }
.bubble a.cite {
  font-size: 0.8rem;
  background: rgba(244, 143, 177, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(244, 143, 177, 0.3);
}
.bubble a.cite:hover { background: rgba(244, 143, 177, 0.22); }
.bubble h1, .bubble h2, .bubble h3 {
  margin: 0.6rem 0 0.3rem;
  font-size: 1.05rem;
}

.cursor::after {
  content: "▍"; color: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.error {
  background: #3a1d24; border: 1px solid #6b2c3a; color: #ffb3bf;
  padding: 0.6rem 0.9rem; border-radius: 8px; font-size: 0.9rem;
}

.empty {
  max-width: 760px; margin: 2rem auto;
  color: var(--muted); text-align: center;
}
.suggestions { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.suggestion {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  padding: 0.55rem 0.95rem; border-radius: 999px; cursor: pointer; font-size: 0.88rem;
}
.suggestion:hover { border-color: var(--accent); color: var(--accent); }

form#form {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0.8rem 1rem;
  padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
  flex-shrink: 0;
  display: flex; gap: 0.6rem;
  max-width: 760px; margin: 0 auto; width: 100%;
}
#input { flex: 1; max-height: 200px; }
#send {
  background: var(--accent); color: #1a0f0a; border: none;
  padding: 0 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer;
}
#send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── MATCHES ─── */
.matches-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1; overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

/* FAB botón para crear chica (visible solo en mobile cuando estás en lista) */
.fab-new {
  display: none;
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a0f0a;
  border: none;
  font-size: 1.7rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 50;
  line-height: 1;
}
.fab-new:active { transform: scale(0.95); }

/* Botón ← back en match header (oculto en desktop, visible en mobile) */
.md-back {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  margin-right: -0.3rem;
  flex-shrink: 0;
}
.matches-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.matches-list { display: flex; flex-direction: column; gap: 0.4rem; }
.match-card {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.match-card:hover { border-color: var(--muted); }
.match-card.active { border-color: var(--accent); background: var(--bg-input); }
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%; background: var(--bg-input);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: var(--muted); font-size: 0.95rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-card .meta { flex: 1; min-width: 0; }
.match-card .name { font-weight: 600; font-size: 0.92rem; }
.match-card .status-line {
  font-size: 0.72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Level chip (sustituye al status manual; se calcula auto) ─── */
.level-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}
.level-chip.tone-red    { color: #ff6b8a; border-color: rgba(255, 107, 138, 0.4); background: rgba(255, 107, 138, 0.08); }
.level-chip.tone-amber  { color: #f5a25d; border-color: rgba(245, 162, 93, 0.4); background: rgba(245, 162, 93, 0.08); }
.level-chip.tone-blue   { color: #5a9eff; border-color: rgba(90, 158, 255, 0.4); background: rgba(90, 158, 255, 0.08); }
.level-chip.tone-green  { color: #6cd28a; border-color: rgba(108, 210, 138, 0.4); background: rgba(108, 210, 138, 0.08); }
.level-chip.tone-violet { color: #c9a4ff; border-color: rgba(201, 164, 255, 0.4); background: rgba(201, 164, 255, 0.08); }
.level-chip.tone-muted  { color: var(--muted); }

/* Foto principal del header clicable → abre editor de enfoque */
.match-photo.editable { cursor: pointer; position: relative; }
.match-photo.editable::after {
  content: "⤢";
  position: absolute;
  bottom: -2px; right: -2px;
  width: 18px; height: 18px; line-height: 16px;
  background: rgba(0,0,0,0.75); color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.match-photo.editable:hover::after { opacity: 1; }
@media (hover: none) {
  .match-photo.editable::after { opacity: 1; }
}

/* ─── Nivel de juego: badge en card + card en detail ─── */
.game-badge {
  flex-shrink: 0;
  min-width: 2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.game-badge.tone-red    { color: #ff6b8a; border-color: rgba(255, 107, 138, 0.4); background: rgba(255, 107, 138, 0.08); }
.game-badge.tone-amber  { color: #f5a25d; border-color: rgba(245, 162, 93, 0.4); background: rgba(245, 162, 93, 0.08); }
.game-badge.tone-blue   { color: #5a9eff; border-color: rgba(90, 158, 255, 0.4); background: rgba(90, 158, 255, 0.08); }
.game-badge.tone-green  { color: #6cd28a; border-color: rgba(108, 210, 138, 0.4); background: rgba(108, 210, 138, 0.08); }
.game-badge.tone-violet { color: #c9a4ff; border-color: rgba(201, 164, 255, 0.4); background: rgba(201, 164, 255, 0.08); }
.game-badge.tone-muted  { color: var(--muted); }

.game-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.game-card.empty { opacity: 0.7; }
.game-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.7rem;
}
.game-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.game-card-level {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.game-card.tone-red    .game-card-level { color: #ff6b8a; background: rgba(255, 107, 138, 0.1); }
.game-card.tone-amber  .game-card-level { color: #f5a25d; background: rgba(245, 162, 93, 0.1); }
.game-card.tone-blue   .game-card-level { color: #5a9eff; background: rgba(90, 158, 255, 0.1); }
.game-card.tone-green  .game-card-level { color: #6cd28a; background: rgba(108, 210, 138, 0.1); }
.game-card.tone-violet .game-card-level { color: #c9a4ff; background: rgba(201, 164, 255, 0.1); }

.game-card-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
}
.game-card-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}
.game-card-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8aa8, #c9a4ff);
  transition: width 0.5s ease;
}
.game-card-bar-fill.tone-red    { background: linear-gradient(90deg, #ff5a78, #ff97aa); }
.game-card-bar-fill.tone-amber  { background: linear-gradient(90deg, #f5a25d, #ffc99a); }
.game-card-bar-fill.tone-blue   { background: linear-gradient(90deg, #5a9eff, #a3c7ff); }
.game-card-bar-fill.tone-green  { background: linear-gradient(90deg, #6cd28a, #b5e8c4); }
.game-card-bar-fill.tone-violet { background: linear-gradient(90deg, #c9a4ff, #e3cdff); }

.game-card-score {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.game-card-score small {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}
.game-card-line {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 0.85rem;
}
.game-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding-top: 0.18rem;
}
.game-card-line.strength .game-card-tag { color: #6cd28a; }
.game-card-line.weakness .game-card-tag { color: #ff8aa8; }

.status-badge {
  font-size: 0.7rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-matched { background: #213048; color: #9ec0f0; }
.status-talking { background: #1f3d2e; color: var(--green); }
.status-dating { background: #3a2542; color: #d99cf5; }
.status-ghosted { background: #3d2828; color: var(--red); }
.status-closed { background: #2a2a2a; color: var(--muted); }

.match-detail {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.empty-detail {
  margin: auto; padding: 2rem; text-align: center;
}
.match-detail-content {
  display: flex; flex-direction: column;
  overflow: hidden; flex: 1;
}
.match-header {
  display: flex; gap: 1rem; padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.match-photo {
  width: 120px; height: 120px;
  border-radius: 12px; background: var(--bg-input);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 2rem;
}
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-info { flex: 1; min-width: 0; }
.match-info h2 {
  margin: 0 0 0.25rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
/* Name input: estilo "naked" — invisible hasta hover/focus */
.md-name-input {
  font-size: 1.1rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  padding: 0.1rem 0.1rem 0.15rem;
  flex: 1;
  min-width: 0;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s;
}
.md-name-input:hover { border-bottom-color: var(--border-strong, var(--border)); }
.md-name-input:focus {
  border-bottom: 1px solid var(--accent);
}

.match-info .where { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.match-info select { font-size: 0.8rem; padding: 0.2rem 0.4rem; color: var(--text); }
.match-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }

.match-sections {
  flex: 1; overflow-y: auto; padding: 1rem 1.2rem 1.5rem;
}
.match-section {
  margin-bottom: 1.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.match-section h3 {
  margin: 0 0 0.5rem; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 700;
}
.analysis-grid { display: grid; gap: 0.4rem; }
.analysis-grid .key { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); }
.analysis-grid .val { font-size: 0.93rem; }
.analysis-grid ul { margin: 0.2rem 0; padding-left: 1.2rem; }
.analysis-grid li { margin: 0.1rem 0; }

.screenshots-list, .photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.screenshot-thumb, .photo-thumb {
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; cursor: pointer;
  background: var(--bg-input);
  position: relative;
  min-height: 140px;
}
.photo-thumb { aspect-ratio: 3 / 4; min-height: 130px; }
.screenshot-thumb img, .photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
}
.photo-thumb.primary { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(244, 143, 177,0.3); }
.photo-thumb .primary-badge {
  position: absolute; bottom: 2px; left: 2px;
  background: var(--accent); color: #1a0f0a;
  font-size: 0.7rem; padding: 0.05rem 0.3rem; border-radius: 4px;
}
.screenshot-thumb .del, .photo-thumb .del {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; line-height: 18px;
  background: rgba(0,0,0,0.7); color: #fff;
  border-radius: 50%; border: none; cursor: pointer;
  font-size: 0.8rem;
  display: none;
}
.screenshot-thumb:hover .del, .photo-thumb:hover .del { display: block; }

/* Loader visible mientras se sube + analiza una foto */
.photo-thumb.uploading {
  background: linear-gradient(135deg, rgba(244,143,177,0.08), rgba(201,164,255,0.06));
  border-color: rgba(244, 143, 177, 0.35);
}
.photo-upload-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0.4rem;
  padding: 0.5rem;
  text-align: center;
}
.photo-upload-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(244, 143, 177, 0.18);
  border-top-color: #F48FB1;
  border-radius: 50%;
  animation: photo-spin 0.9s linear infinite;
}
@keyframes photo-spin {
  to { transform: rotate(360deg); }
}
.photo-upload-name {
  font-size: 0.72rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.photo-upload-step {
  font-size: 0.68rem;
  color: var(--muted);
}
.panel-assessment-loading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.08), rgba(201,164,255,0.05));
  border: 1px solid rgba(244, 143, 177, 0.25);
  border-radius: 12px;
}

/* Botones del header Progreso (sync + reset): tamaño fijo + spinner on loading */
#btn-sync-me, #btn-reset-me {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
#btn-sync-me .ico, #btn-reset-me .ico { width: 18px; height: 18px; }
#btn-sync-me.is-loading,
.md-icon-btn.is-loading {
  color: var(--accent);
  cursor: wait;
  opacity: 1;
}
#btn-sync-me.is-loading .ico,
.md-icon-btn.is-loading .ico {
  animation: spin-refresh 0.9s linear infinite;
}
@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Banner contextual dentro del modal upgrade (al venir de un 402). */
.quota-banner-slot:empty { display: none; }
.quota-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.12), rgba(201,164,255,0.08));
  border: 1px solid rgba(244, 143, 177, 0.3);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0 1rem;
}
.quota-banner-icon { font-size: 1.3rem; line-height: 1; }
.quota-banner-body { flex: 1; min-width: 0; }
.quota-banner-msg {
  font-size: 0.88rem;
  color: #4a3f3a;
  line-height: 1.35;
}
.quota-banner-cost {
  font-size: 0.78rem;
  color: #6a5e58;
  margin-top: 0.3rem;
}
.quota-banner-cost b { color: #c64a72; }
.photo-thumb .focus-btn {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; line-height: 18px;
  background: rgba(0,0,0,0.7); color: #fff;
  border-radius: 50%; border: none; cursor: pointer;
  font-size: 0.85rem;
  display: none;
  padding: 0;
}
.photo-thumb:hover .focus-btn { display: block; }

/* ─── Modal de ajuste de enfoque (focus editor) ─── */
.focus-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
}
.focus-modal[hidden] { display: none; }

/* ─── Feature blur (free user ve features bloqueadas blurry) ─── */
[data-locked-feature] {
  position: relative;
}
.feature-blurred > *:not(.feature-locked-overlay) {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
.feature-locked-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(248,242,236,0.85), rgba(244,143,177,0.18));
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  border-radius: inherit;
  gap: 0.5rem;
}
.feature-lock-icon { font-size: 2rem; }
.feature-lock-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d1d1f;
}
.feature-lock-desc {
  font-size: 0.85rem;
  color: #6a5e58;
  max-width: 280px;
  margin-bottom: 0.5rem;
}
.feature-lock-btn {
  background: #c64a72;
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.feature-lock-btn:hover { background: #a8395f; }

.progress-empty {
  background: linear-gradient(135deg, rgba(244,143,177,0.10), rgba(201,164,255,0.06));
  border: 1px solid rgba(244, 143, 177, 0.25);
  border-radius: 16px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  margin-bottom: 1.2rem;
}
.progress-empty-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.progress-empty-title { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--text); }
.progress-empty-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.5; max-width: 380px; margin: 0 auto 1.1rem; }
.progress-empty-cta-row { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.progress-empty-cta { padding: 0.65rem 1.1rem; border-radius: 999px; font-size: 0.88rem; }

/* ─── Upgrade modal (planes + tokens) ─── */
/* z-index 10500: por encima de lesson/quiz/sim-overlay (9999) y header menus
   (10000) — sin esto, el 402 abre el modal pero queda invisible debajo. */
.upgrade-modal {
  position: fixed; inset: 0; z-index: 10500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.upgrade-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 17, 21, 0.7);
}
.upgrade-panel {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 1.8rem 1.4rem 1.4rem;
  max-width: 720px;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  color: #1d1d1f;
}
.upgrade-x {
  position: absolute; top: 0.7rem; right: 0.9rem;
  width: 34px; height: 34px; border: none; background: rgba(0,0,0,0.05);
  border-radius: 50%; cursor: pointer; font-size: 1.2rem; color: #1d1d1f;
}
.upgrade-title { margin: 0 0 0.3rem; font-size: 1.3rem; }
.upgrade-sub { margin: 0 0 1.2rem; color: #6a5e58; font-size: 0.85rem; }
.upgrade-tabs {
  display: flex; gap: 0.5rem; margin: 0 0 1rem;
  background: #f8f2ec; border-radius: 12px; padding: 0.3rem;
  width: fit-content;
}
.upgrade-tab {
  background: transparent; border: none; padding: 0.5rem 1rem;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  font-size: 0.88rem; color: #6a5e58; font-weight: 600;
}
.upgrade-tab.active { background: #fff; color: #c64a72; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.upgrade-pane[hidden] { display: none; }

.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.8rem;
}
.plan-card {
  position: relative;
  background: #f8f2ec; border: 1px solid #e8dfd3;
  border-radius: 14px; padding: 1.1rem 1rem; display: flex; flex-direction: column;
}
.plan-card.popular { border-color: #c64a72; border-width: 2px; background: #fff8f5; }
.plan-badge {
  position: absolute; top: -10px; right: 12px;
  background: #c64a72; color: #fff; font-size: 0.65rem;
  padding: 0.15rem 0.6rem; border-radius: 999px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.plan-name { font-size: 1rem; font-weight: 700; color: #1d1d1f; }
.plan-price { font-size: 1.8rem; font-weight: 800; color: #c64a72; margin: 0.2rem 0 0.8rem; }
.plan-price small { font-size: 0.7rem; font-weight: 500; color: #6a5e58; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 1rem; }
.plan-feats li { font-size: 0.82rem; color: #3a3a3f; padding: 0.18rem 0 0.18rem 1.1rem; position: relative; }
.plan-feats li::before { content: "✓"; position: absolute; left: 0; color: #c64a72; font-weight: 700; }
.plan-btn {
  background: #c64a72; color: #fff; border: none;
  padding: 0.7rem; border-radius: 10px; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-top: auto;
}
.plan-btn:hover:not(:disabled) { background: #a8395f; }
.plan-btn:disabled { background: #d3b0bd; cursor: wait; }

.upgrade-pack-intro { color: #6a5e58; font-size: 0.85rem; margin: 0 0 0.8rem; }
.pack-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}
.pack-card {
  position: relative;
  background: #f8f2ec; border: 1px solid #e8dfd3;
  border-radius: 14px; padding: 1.1rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pack-card.best { border-color: #6cd28a; border-width: 2px; background: #f3fbf6; }
.pack-card.best .plan-badge { background: #2d8f5a; }
.pack-tokens { font-size: 1.8rem; font-weight: 800; color: #1d1d1f; }
.pack-tokens-label { font-size: 0.72rem; color: #6a5e58; text-transform: uppercase; letter-spacing: 0.06em; }
.pack-price { font-size: 1.3rem; font-weight: 700; color: #c64a72; margin: 0.6rem 0 0.4rem; }
.pack-hint { font-size: 0.75rem; color: #6a5e58; margin-bottom: 1rem; min-height: 2em; }
.pack-btn {
  background: #c64a72; color: #fff; border: none;
  padding: 0.6rem 1.2rem; border-radius: 999px; font-weight: 700; cursor: pointer;
  font-family: inherit; width: 100%;
}
.pack-btn:hover:not(:disabled) { background: #a8395f; }
.pack-btn:disabled { background: #d3b0bd; cursor: wait; }

/* ─── Auth landing (magic link) ─── */
.auth-landing {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem 1.5rem;
  padding-top: max(2.5rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 0% 0%, rgba(244,143,177,0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(244,143,177,0.10), transparent 50%),
    #f8f2ec;
  overflow-y: auto;
  font-family: inherit;
}
.auth-landing-hero {
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.auth-landing-logo {
  height: 56px;
  width: auto;
  margin: 0 auto 1.8rem;
  display: block;
}
@media (max-width: 480px) {
  .auth-landing-logo { height: 44px; }
}
.auth-landing-headline {
  margin: 0 0 0.8rem;
  color: #1d1d1f;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.auth-landing-accent {
  color: #c64a72;
}
.auth-landing-blurb {
  margin: 0;
  color: #6a5e58;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto;
}
.auth-landing-card {
  background: #ffffff;
  border: 1px solid #e8dfd3;
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(196, 156, 134, 0.18);
}
.auth-landing-title {
  margin: 0 0 0.3rem;
  color: #1d1d1f;
  font-size: 1.15rem;
  font-weight: 700;
}
.auth-landing-sub {
  margin: 0 0 1.2rem;
  color: #6a5e58;
  font-size: 0.85rem;
}
.auth-landing-error {
  background: rgba(255, 107, 138, 0.12);
  border: 1px solid rgba(244, 143, 177, 0.4);
  color: #c64a72;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.82rem;
  margin: 0 0 1rem;
}
.auth-landing-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
}
.auth-landing-form input {
  background: #f8f2ec;
  border: 1.5px solid #e8dfd3;
  color: #1d1d1f;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
  text-align: center;
}
.auth-landing-form input::placeholder { color: #b3a89e; }
.auth-landing-form input:focus {
  outline: none;
  border-color: #F48FB1;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(244, 143, 177, 0.15);
}
.auth-landing-form button {
  background: #c64a72;
  color: #ffffff;
  border: none;
  padding: 0.95rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.98rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.1s ease;
}
.auth-landing-form button:hover:not(:disabled) {
  background: #a8395f;
}
.auth-landing-form button:active:not(:disabled) {
  transform: scale(0.98);
}
.auth-landing-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.auth-landing-status {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  min-height: 1.2em;
  color: #6a5e58;
}
.auth-landing-status.ok { color: #2d8f5a; }
.auth-landing-status.err { color: #c64a72; }
.auth-landing-tos {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.8rem;
  color: #6a5e58;
  line-height: 1.45;
  cursor: pointer;
  padding: 0 0.2rem;
}
.auth-landing-tos input[type=checkbox] {
  appearance: auto;
  -webkit-appearance: checkbox;
  margin: 0;
  margin-top: 0.18rem;
  width: 18px;
  height: 18px;
  accent-color: #c64a72;
  flex-shrink: 0;
  cursor: pointer;
}
.auth-landing-tos > span {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.auth-landing-tos a {
  color: #c64a72;
  font-weight: 600;
  text-decoration: underline;
}
.auth-landing-form button:disabled {
  background: #e8c4d2;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
}
.auth-landing-footer {
  margin: 0;
  color: #9b8f87;
  font-size: 0.72rem;
  line-height: 1.45;
}
@media (max-width: 480px) {
  .auth-landing-headline { font-size: 1.7rem; }
}
.focus-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.focus-modal-panel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  max-height: 92dvh;
  display: flex; flex-direction: column; gap: 0.8rem;
  overflow: hidden;
}
.focus-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.focus-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.06);
  color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.focus-editor-wrap {
  position: relative;
  max-height: 60vh;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}
.focus-editor-img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  cursor: crosshair;
  user-select: none;
  -webkit-user-drag: none;
}
.focus-editor-marker {
  position: absolute;
  width: 24px; height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.6), 0 0 12px rgba(255,107,138,0.8);
  background: rgba(255, 107, 138, 0.6);
}
.focus-modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem;
}
.focus-preview-row {
  display: flex; align-items: center; gap: 0.6rem;
}
.focus-preview-circle {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg-input);
}
.focus-preview-circle img {
  width: 100%; height: 100%; object-fit: cover;
}

.notes-textarea {
  width: 100%; min-height: 60px;
  color: var(--text); font-size: 0.9rem;
}

/* ─── MATCH DETAIL SUB-TABS + NUEVO LAYOUT ─── */
.match-header.md-compact {
  padding: 0.55rem 0.8rem;
  gap: 0.6rem;
  align-items: center;
}
.match-header.md-compact .match-photo { width: 48px; height: 48px; border-radius: 50%; }
.match-header.md-compact h2 { font-size: 1rem; margin: 0; }
.match-header.md-compact h2 input { font-size: 1rem; padding: 0.1rem 0.3rem; }
.md-sub { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.15rem; flex-wrap: wrap; }

/* Status chip pill con color tonal por status */
.md-status-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.18rem 0.55rem 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s;
}
.md-status-chip:hover { border-color: var(--accent); }
.md-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.md-status-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
}
.md-status-select option { color: var(--text); background: var(--bg-elev); }

/* Tonos por status */
.md-status-chip[data-status="talking"] {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.32);
}
.md-status-chip[data-status="matched"] {
  background: rgba(249, 168, 37, 0.14);
  color: #b07300;
  border-color: rgba(249, 168, 37, 0.35);
}
.md-status-chip[data-status="dating"] {
  background: rgba(123, 31, 162, 0.12);
  color: #7b1fa2;
  border-color: rgba(123, 31, 162, 0.32);
}
.md-status-chip[data-status="ghosted"] {
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
  border-color: rgba(198, 40, 40, 0.32);
}
.md-status-chip[data-status="closed"] {
  background: var(--bg-input);
  color: var(--muted);
  border-color: var(--border);
}

/* Legacy fallback */
.md-status { font-size: 0.72rem; padding: 0.15rem 0.4rem; background: var(--bg-input); border-radius: 999px; }
.md-where { font-size: 0.72rem; }
.md-menu { padding: 0.3rem 0.6rem; font-size: 1.1rem; }

.md-subtabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0 0.5rem;
  gap: 0.2rem;
  flex-shrink: 0;
}
.md-subtab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: color 0.15s, border-color 0.15s;
}
.md-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.md-subtab:hover { color: var(--text); }

.md-pane {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  min-height: 0;
}
.md-pane.active { display: flex; }
.md-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
  -webkit-overflow-scrolling: touch;
}

.md-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}
.md-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}
.md-card-head h3 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}
.md-card-head .muted { font-size: 0.72rem; }

/* ─── ACCORDIONS ─── */
.md-accordion {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.md-accordion summary {
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  user-select: none;
}
.md-acc-ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  color: var(--accent);
  flex-shrink: 0;
}
.md-acc-action {
  margin-left: auto;
  padding: 0.15rem 0.4rem;
}

/* Flechita flotante para ir al final del chat (minimalista) */
.match-chat { position: relative; }
.chat-scroll-bottom {
  position: absolute;
  right: 0.9rem;
  bottom: 4.5rem;
  width: 36px;
  height: 36px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  opacity: 0.95;
  transition: transform 0.15s, opacity 0.15s, border-color 0.15s;
  z-index: 5;
  padding: 0;
}
.chat-scroll-bottom[hidden] {
  display: none;
}
.chat-scroll-bottom:hover {
  border-color: var(--accent);
  opacity: 1;
}
.chat-scroll-bottom:active { transform: scale(0.92); }
.chat-scroll-bottom svg {
  width: 18px;
  height: 18px;
}

/* Icono compacto refresh en header de match */
.md-icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s;
}
.md-icon-btn:hover { border-color: var(--accent); }
.md-icon-btn:active { transform: scale(0.94); }
.md-icon-btn .ico { width: 18px; height: 18px; stroke: currentColor; }

.ico-sm.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Refresh toast (preview + confirm) ─── */
.refresh-toast {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.refresh-toast[hidden] { display: none; }
.refresh-toast-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.refresh-toast-panel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 1.1rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 520px;
  pointer-events: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  animation: refresh-slide-up 0.22s ease-out;
}
@keyframes refresh-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (min-width: 720px) {
  .refresh-toast { align-items: center; }
  .refresh-toast-panel { border-radius: 18px; }
}

.refresh-toast-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.refresh-toast-head .ico {
  width: 24px; height: 24px; stroke: var(--accent); flex-shrink: 0;
}
.refresh-toast-title {
  font-weight: 700;
  font-size: 1.02rem;
}
.refresh-toast-sub { font-size: 0.78rem; }

.refresh-toast-section { margin-bottom: 0.9rem; }
.refresh-toast-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.refresh-toast-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
}
.refresh-toast-list li strong { color: var(--accent); }
.refresh-toast-list li.warn { color: #c2185b; font-size: 0.82rem; }

.refresh-toast-tokens {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.refresh-toast-tokens.ok { border-color: rgba(46,125,50,0.35); }
.refresh-toast-tokens.warn { border-color: rgba(198,40,40,0.35); }
.refresh-toast-tokens-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.refresh-toast-tokens-num {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.refresh-toast-tokens-sep { color: var(--muted); }
.refresh-toast-badge {
  margin-left: auto;
  background: var(--accent-soft, rgba(214,51,108,0.15));
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.refresh-toast-badge.warn {
  background: rgba(198,40,40,0.15);
  color: #c62828;
}

.refresh-toast-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.refresh-toast-actions button { padding: 0.55rem 1rem; }
.refresh-toast-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.md-accordion summary::-webkit-details-marker { display: none; }
.md-accordion summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.md-accordion[open] summary::after { transform: rotate(180deg); }
.md-accordion summary button.ghost {
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  margin-left: 0.4rem;
}
.md-accordion-body {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.md-perfil-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
  align-items: stretch;
}

/* Practice button — protagonista, con título + subtítulo */
.md-practice-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover, var(--accent)));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(214, 51, 108, 0.22);
  transition: transform 0.12s, box-shadow 0.15s;
  cursor: pointer;
}
.md-practice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(214, 51, 108, 0.3);
}
.md-practice-btn:active { transform: scale(0.985); }
.md-practice-btn .ico {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  flex-shrink: 0;
}
.md-practice-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
  min-width: 0;
}
.md-practice-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-practice-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* Delete button — icono discreto que se vuelve rojo en hover */
.md-danger-btn {
  flex-shrink: 0;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.md-danger-btn:hover {
  background: rgba(198, 40, 40, 0.1);
  border-color: rgba(198, 40, 40, 0.35);
  color: #c62828;
}
.md-danger-btn:active { transform: scale(0.94); }
.md-danger-btn .ico-sm {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  margin: 0;
}

/* ─── CHAT PANE FULL HEIGHT ─── */
.md-chat-full {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.md-chat-full #match-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.8rem;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}
.md-chat-full #match-messages .msg { min-width: 0; }
.md-chat-full #match-messages .bubble {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.md-chat-full #match-messages .bubble pre,
.md-chat-full #match-messages .bubble code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.md-chat-full #match-messages .bubble img,
.md-chat-full #match-messages .bubble table {
  max-width: 100%;
  height: auto;
}
.md-chat-full .md-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.md-chat-form textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border-radius: 22px;
}
.md-chat-form .send-btn {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── STEPS TIMELINE ─── */
.md-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.step-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.6rem;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  position: relative;
}
.step-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 10px 0 0 10px;
}
.step-row.state-done { opacity: 0.55; }
.step-row.state-done::before { background: var(--green); }
.step-row.state-done .step-action { text-decoration: line-through; }
.step-row.state-skipped { opacity: 0.4; }
.step-row.state-skipped::before { background: var(--muted); }
.step-row.state-overdue::before { background: var(--red); }
.step-row.state-today::before { background: var(--yellow); }
.step-row.state-future::before { background: var(--green); }

.step-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 0.3rem;
  min-height: 56px;
}
.step-day { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.step-month { font-size: 0.68rem; text-transform: uppercase; margin-top: 0.15rem; }

.step-content { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.step-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.step-action {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-word;
}
.step-source { font-size: 0.85rem; opacity: 0.7; }
.step-check { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.step-notes { font-size: 0.74rem; line-height: 1.3; }
.step-when { font-size: 0.7rem; font-style: italic; }
.del-step {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.1rem; padding: 0 0.2rem;
  flex-shrink: 0;
}
.del-step:hover { color: var(--red); }

.md-step-add {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

/* ─── Citas registradas (timeline real) ─── */
.md-dates-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.md-date-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.md-date-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.md-date-when {
  font-weight: 700;
  color: var(--text);
}
.md-date-where {
  color: var(--muted);
  font-size: 0.8rem;
}
.del-date {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}
.del-date:hover { color: var(--red, #c62828); }
.md-date-summary {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}
.md-date-tag {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
}
.md-date-tag.tone-green { background: rgba(108,210,138,0.1); border-left: 2px solid #6cd28a; }
.md-date-tag.tone-red { background: rgba(255,107,138,0.1); border-left: 2px solid #ff6b8a; }

.md-date-add {
  flex-direction: column;
  gap: 0.4rem;
}
.md-date-add .md-date-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.md-date-add .md-date-row input { flex: 1; min-width: 120px; }
.md-date-add textarea {
  width: 100%;
  min-height: 50px;
  resize: vertical;
}
.md-date-add button { align-self: flex-start; }
.steps-done-collapsed {
  margin-top: 0.7rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}
.steps-done-collapsed summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.3rem 0;
  list-style: none;
}
.steps-done-collapsed summary::-webkit-details-marker { display: none; }
.steps-done-collapsed summary::before {
  content: "▸";
  margin-right: 0.4rem;
  transition: transform 0.2s;
  display: inline-block;
}
.steps-done-collapsed[open] summary::before { transform: rotate(90deg); }
.steps-done-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.md-step-add input[type=text] { flex: 2; min-width: 160px; }
.md-step-add input[type=date] { flex: 1; min-width: 130px; }
.md-step-add button { padding: 0 1rem; }

/* ─── FACTS CHIPS ─── */
.md-facts-chips {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.facts-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.facts-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  max-width: 100%;
}
.fact-chip .del-fact {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 0.9rem; padding: 0;
  margin-left: 0.2rem;
}
.fact-chip .del-fact:hover { color: var(--red); }

/* TAB PROGRESO (antes Yo) */
.progress-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.progress-header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.progress-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}

/* Stats cards grid */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 0.8rem;
  text-align: center;
}
.stat-card.accent-red { border-color: var(--red); }
.stat-card.accent-green { border-color: var(--green); }
.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.stat-card.accent-red .stat-value { color: var(--red); }
.stat-card.accent-green .stat-value { color: var(--green); }
.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}
.stat-hint { font-size: 0.7rem; margin-top: 0.15rem; }

/* Sparkline */
.spark-bars {
  display: flex;
  gap: 0.2rem;
  align-items: flex-end;
  height: 80px;
}
.spark-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  height: 100%;
}
.spark-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.spark-bar:hover .spark-fill { opacity: 1; }
.spark-bar.today .spark-fill { background: var(--green); opacity: 1; }
.spark-label {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.2rem;
  white-space: nowrap;
}

/* APRENDER — header con título + botón Quiz rápido */
.learn-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.learn-top-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.learn-quick-quiz {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.learn-quick-quiz .ico-sm {
  width: 14px;
  height: 14px;
  margin: 0;
  stroke: currentColor;
}
.learn-quick-quiz:hover {
  background: var(--accent-hover, var(--accent));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.06));
}
.learn-quick-quiz:active { transform: scale(0.96); }

.learn-scroll {
  flex: 1; overflow-y: auto;
  padding: 1rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.learn-intro { font-size: 0.85rem; margin-bottom: 1rem; }

/* Progress dots del quiz multi-pregunta */
.quiz-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.quiz-dots { display: flex; gap: 0.4rem; }
.quiz-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
}
.quiz-dot.current { border-color: var(--accent); background: var(--accent); }
.quiz-dot.correct { background: var(--green); border-color: var(--green); }
.quiz-dot.incorrect { background: var(--red); border-color: var(--red); }
.quiz-progress-text { font-size: 0.78rem; }

/* Recap final */
.quiz-recap { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem; }
.quiz-recap-row {
  display: flex; gap: 0.6rem; align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
}
.quiz-recap-row.correct { border-left-color: var(--green); }
.quiz-recap-row.incorrect { border-left-color: var(--red); }
.quiz-recap-icon { font-weight: 700; flex-shrink: 0; }
.quiz-recap-row.correct .quiz-recap-icon { color: var(--green); }
.quiz-recap-row.incorrect .quiz-recap-icon { color: var(--red); }

/* ─── QUIZ MODAL ─── */
.quiz-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}
.quiz-modal[hidden] { display: none; }
.quiz-modal-inner {
  background: var(--bg);
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.quiz-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.quiz-header #quiz-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.quiz-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  min-height: 0;
}
.quiz-typology-badge {
  display: inline-block;
  background: rgba(244, 143, 177,0.15);
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}
.quiz-scenario-text {
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  padding: 0.9rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.quiz-input-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#quiz-response {
  width: 100%;
  min-height: 100px;
  margin-bottom: 0.6rem;
}
.quiz-submit { width: 100%; padding: 0.85rem; font-size: 1rem; }
.quiz-hint { font-size: 0.78rem; text-align: center; margin-top: 0.6rem; }

/* Result */
.quiz-score-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  background: var(--bg-elev);
  border: 2px solid var(--border);
}
.quiz-score-block.score-excellent { border-color: var(--green); }
.quiz-score-block.score-good { border-color: #7aa8ff; }
.quiz-score-block.score-ok { border-color: var(--yellow); }
.quiz-score-block.score-low { border-color: #f0905e; }
.quiz-score-block.score-bad { border-color: var(--red); }

.quiz-score-circle {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid currentColor;
}
.quiz-score-block.score-excellent .quiz-score-circle { color: var(--green); }
.quiz-score-block.score-good .quiz-score-circle { color: #7aa8ff; }
.quiz-score-block.score-ok .quiz-score-circle { color: var(--yellow); }
.quiz-score-block.score-low .quiz-score-circle { color: #f0905e; }
.quiz-score-block.score-bad .quiz-score-circle { color: var(--red); }
.quiz-score-num { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--text); }
.quiz-score-of100 { font-size: 0.65rem; }
.quiz-score-text { flex: 1; }
.quiz-verdict {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}
.quiz-verdict-label { font-size: 0.88rem; color: var(--muted); }

.quiz-section { margin-bottom: 1rem; }
.quiz-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.quiz-user-response {
  background: var(--user);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  white-space: pre-wrap;
}
.quiz-feedback { margin: 0; line-height: 1.5; }
.quiz-coach-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}
.quiz-coach-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.quiz-coach-name {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.quiz-coach-comment { font-size: 0.92rem; line-height: 1.4; }
.quiz-good ul { color: var(--green); }
.quiz-bad ul { color: var(--red); }
.quiz-good ul, .quiz-bad ul { padding-left: 1.3rem; margin: 0; }
.quiz-good li, .quiz-bad li { margin: 0.2rem 0; font-size: 0.92rem; }
.quiz-alts { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-alt-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}
.quiz-alt-head {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.quiz-alt-num {
  background: var(--accent); color: #1a0f0a;
  font-weight: 700; font-size: 0.7rem;
  padding: 0.08rem 0.5rem; border-radius: 999px;
}
.quiz-alt-style {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}
.quiz-alt-text {
  font-size: 0.95rem;
  margin: 0.3rem 0;
  white-space: pre-wrap;
}
.quiz-alt-why { font-size: 0.78rem; margin: 0.3rem 0 0.6rem; line-height: 1.3; }
.quiz-alt-copy { width: 100%; padding: 0.45rem; font-size: 0.82rem; }
.quiz-actions {
  display: flex; gap: 0.6rem; margin-top: 1.2rem;
  padding-bottom: env(safe-area-inset-bottom);
}
.quiz-actions button { flex: 1; padding: 0.7rem; }

/* ─── QUIZ MULTIPLE CHOICE (nuevo flow) ─── */
.quiz-loading {
  text-align: center;
  padding: 3rem 1rem;
}
.quiz-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-question-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1rem 0 0.6rem;
  font-weight: 600;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
}
.quiz-option:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--bg-input);
}
.quiz-option:not(:disabled):active { transform: scale(0.99); }
.quiz-option:disabled { cursor: default; opacity: 1; }

.quiz-option-letter {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
}
.quiz-option-text { flex: 1; }

.quiz-option.picked { border-width: 2px; }
.quiz-option.correct {
  border-color: var(--green);
  background: rgba(108,210,138,0.08);
}
.quiz-option.correct .quiz-option-letter {
  background: var(--green); color: #0a1a0a; border-color: var(--green);
}
.quiz-option.incorrect {
  border-color: var(--red);
  background: rgba(255,107,138,0.08);
}
.quiz-option.incorrect .quiz-option-letter {
  background: var(--red); color: #2a0a0f; border-color: var(--red);
}
.quiz-option:disabled:not(.correct):not(.incorrect) { opacity: 0.5; }
.quiz-option-expl {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  width: 100%;
}

/* Result banner */
.quiz-result-banner {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 2px solid;
}
.quiz-result-banner.correct {
  border-color: var(--green);
  background: rgba(108,210,138,0.08);
}
.quiz-result-banner.incorrect {
  border-color: var(--red);
  background: rgba(255,107,138,0.08);
}
.quiz-result-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700;
}
.quiz-result-banner.correct .quiz-result-icon {
  background: var(--green); color: #0a1a0a;
}
.quiz-result-banner.incorrect .quiz-result-icon {
  background: var(--red); color: #2a0a0f;
}
.quiz-result-verdict { font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.quiz-result-detail { font-size: 0.88rem; line-height: 1.45; }
.quiz-key-lesson {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}
.quiz-key-lesson-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.quiz-key-lesson-text { font-size: 0.92rem; line-height: 1.45; }

/* Mobile responsive del modal */
@media (max-width: 700px) {
  .quiz-modal-inner { max-width: 100%; }
  .quiz-header { padding: 0.55rem 0.7rem; padding-top: calc(0.55rem + env(safe-area-inset-top)); }
  .quiz-title { font-size: 0.88rem; }
  /* Padding-top extra para que header con sombra no tape la pregunta */
  .quiz-body { padding: 1.2rem 0.8rem; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .quiz-scenario-text { font-size: 0.92rem; padding: 0.7rem 0.8rem; margin-top: 0.3rem; }
  .quiz-option { padding: 0.7rem; font-size: 0.92rem; }
  .quiz-option-letter { width: 28px; height: 28px; font-size: 0.88rem; }
  .quiz-result-banner { padding: 0.8rem; }
  .quiz-result-icon { width: 32px; height: 32px; font-size: 1.15rem; }
}

.lessons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lesson-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.5rem 0.7rem;
}
.lesson-text { font-size: 0.92rem; }
.lesson-meta { font-size: 0.72rem; white-space: nowrap; }
.del-lesson {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
}
.del-lesson:hover { color: var(--red); }

.panel-assessment {
  font-size: 0.92rem;
  line-height: 1.5;
}
.panel-assessment h2 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0.8rem 0 0.3rem;
}
.panel-assessment h2:first-child { margin-top: 0; }
.panel-assessment ul,
.panel-assessment ol { margin: 0.3rem 0 0.6rem; padding-left: 1.4rem; }
.panel-assessment li { margin: 0.3rem 0; line-height: 1.45; }
.panel-assessment li > strong:first-child { display: inline; }
.panel-assessment p { margin: 0.4rem 0; }
.panel-assessment strong { color: var(--text); font-weight: 600; }
.panel-assessment hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.8rem 0;
}

/* chat de coaching dentro de match */
.match-chat {
  display: flex; flex-direction: column; gap: 0.8rem;
}
.match-chat .msg .role { width: 60px; }
.match-chat .form {
  display: flex; gap: 0.5rem; margin-top: 0.5rem;
}
.match-chat textarea {
  flex: 1; min-height: 40px; max-height: 150px;
}
.match-chat .send-btn { padding: 0 1rem; }

.uploader {
  display: inline-block;
}
.uploader input[type="file"] { display: none; }
.uploader label {
  display: inline-block;
  color: var(--accent); cursor: pointer;
  font-size: 0.85rem; margin: 0;
  border: 1px dashed var(--accent);
  padding: 0.4rem 0.7rem; border-radius: 6px;
}
.uploader label:hover { background: rgba(244, 143, 177,0.1); }

/* dialog */
dialog#new-match-dialog {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(400px, 90vw);
}
dialog#new-match-dialog::backdrop { background: rgba(0,0,0,0.5); }
dialog h3 { margin: 0 0 1rem; }
.dialog-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 1rem;
}

/* ─── QUICK SUGGEST (PWA mobile-first) ─── */
.quick-body { overflow: auto; }
.quick-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.quick-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.quick-file-label {
  display: block;
  padding: 1.5rem;
  background: var(--bg-input);
  border: 2px dashed var(--accent);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.quick-file-label input[type="file"] { display: none; }
.quick-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0.6rem 0;
  background: #000;
}
.quick-result-meta { margin-bottom: 0.5rem; }
.quick-match-tag {
  display: inline-block;
  background: rgba(244, 143, 177,0.12);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
}
.quick-result-msg {
  background: var(--bg-input);
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}
.quick-result-lectura {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.88rem;
}
.suggestions-list { display: flex; flex-direction: column; gap: 0.7rem; }
.suggestion-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}
.suggestion-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.suggestion-num {
  background: var(--accent);
  color: #1a0f0a;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.suggestion-tono {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.suggestion-text {
  font-size: 0.98rem;
  margin: 0.3rem 0;
  white-space: pre-wrap;
}
.suggestion-razon {
  font-size: 0.78rem;
  margin: 0.3rem 0 0.6rem;
}
.suggestion-copy {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
}

/* ─── SIMULADOR ─── */
.simulator-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1100; /* por encima del bottom-nav (1000) */
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.simulator-overlay[hidden] { display: none; }

.sim-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.sim-header-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.sim-header .avatar { width: 40px; height: 40px; font-size: 1rem; flex-shrink: 0; }
.sim-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-scenario { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-header-info > div:last-child { min-width: 0; flex: 1; }
@media (max-width: 600px) {
  .sim-header { padding: 0.55rem 0.7rem; padding-top: calc(0.55rem + env(safe-area-inset-top)); gap: 0.4rem; flex-wrap: nowrap; }
  .sim-header .avatar { width: 32px; height: 32px; font-size: 0.85rem; }
  .sim-header-info { gap: 0.45rem; }
  .sim-name { font-size: 0.88rem; }
  .sim-scenario { font-size: 0.7rem; }
  #sim-voice-toggle, #sim-end {
    padding: 0.4rem 0.55rem;
    line-height: 1;
    flex-shrink: 0;
    font-size: 1rem;
  }
  /* Oculta texto del botón en mobile, deja solo el emoji */
  #sim-voice-toggle .btn-text, #sim-end .btn-text { display: none; }
  #sim-close { padding: 0.4rem 0.6rem; font-size: 1.1rem; flex-shrink: 0; }
}
/* Chat scroll: que la zona de mensajes y form sean visibles en mobile */
.sim-chat {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding: 0.8rem 1rem;
  padding-bottom: 1rem;
}
.sim-form {
  flex-shrink: 0;
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
}

.sim-scenario-picker {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 600px) {
  /* Padding-bottom amplio para que el último scenario no quede bajo bottom-nav */
  .sim-scenario-picker { padding: 1.2rem 1rem 6rem; }
  .sim-scenario-picker h2 { font-size: 1.05rem; margin: 0 0 0.9rem; }
}
.sim-scenario-picker h2 { margin: 0 0 1.2rem; font-size: 1.2rem; text-align: center; }
.sim-scenario-card {
  display: block; width: 100%;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  margin-bottom: 0.6rem;
}
.sim-scenario-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.sim-scenario-label { font-weight: 600; margin-bottom: 0.2rem; }
.sim-scenario-desc { font-size: 0.83rem; }

.sim-chat {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
#sim-messages {
  max-width: 600px; width: 100%;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 0.5rem;
}
.sim-context {
  max-width: 600px; width: 100%;
  margin: 1rem auto 0;
  font-size: 0.75rem;
  text-align: center;
  font-style: italic;
  padding-bottom: 0.5rem;
}

.sim-msg {
  display: flex;
  width: 100%;
}
.sim-msg.user { justify-content: flex-end; }
.sim-msg.npc { justify-content: flex-start; }
.sim-bubble {
  max-width: 75%;
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 0.95rem;
}
.sim-msg.user .sim-bubble {
  background: var(--accent);
  color: #1a0f0a;
  border-bottom-right-radius: 4px;
}
.sim-msg.npc .sim-bubble {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.sim-action {
  font-style: italic;
  color: var(--muted);
  font-size: 0.88em;
  opacity: 0.8;
}
.sim-action::before { content: ""; }
.sim-action::after { content: ""; }
.sim-msg.user .sim-action {
  color: #5a3a2e;
  opacity: 0.7;
}

.sim-form {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.sim-form button#sim-mic {
  font-size: 1.1rem;
  padding: 0 0.7rem;
  flex-shrink: 0;
}
.sim-form textarea {
  flex: 1;
  background: var(--bg-input);
  resize: none;
  max-height: 150px;
}
#sim-voice-toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sim-feedback {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1rem 3rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.sim-feedback h2 {
  margin-top: 0;
  color: var(--accent);
}
.sim-feedback h3 {
  color: var(--accent);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
}
.sim-feedback ul { padding-left: 1.3rem; }
.sim-feedback li { margin: 0.2rem 0; }
.sim-feedback strong { color: #fff; }

@media (max-width: 700px) {
  .header-inner { padding: 0.6rem 0.7rem; gap: 0.6rem; }
  h1 { font-size: 0.95rem; }
  .tab-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }

  /* Master-detail: en mobile solo se ve UNA vista a la vez */
  .matches-layout { grid-template-columns: 1fr; }
  .matches-sidebar {
    border-right: none;
    border-bottom: none;
    max-height: none;
    padding: 1rem;
    height: 100%;
  }
  .matches-sidebar #btn-new-match { display: none; }
  .match-detail { display: none; }

  /* Cuando hay match seleccionada → ocultar lista, mostrar detail full */
  body.match-selected .matches-sidebar { display: none; }
  body.match-selected .match-detail { display: flex; flex-direction: column; height: 100%; }

  /* FAB visible solo cuando NO hay match seleccionada (estás viendo lista) */
  body:not(.match-selected) .fab-new { display: flex; align-items: center; justify-content: center; }
  /* Y solo cuando estás en el tab matches */
  body:not([data-tab="matches"]) .fab-new { display: none; }

  /* Mostrar el botón back en mobile */
  .md-back { display: inline-block; }

  .match-header { padding: 0.8rem; gap: 0.7rem; }
  .match-photo { width: 80px; height: 80px; border-radius: 10px; }
  .match-info h2 { font-size: 1.05rem; }
  .match-info h2 input { font-size: 1.05rem; }
  .match-sections { padding: 0.8rem 0.7rem 1.5rem; }
  .match-section { padding: 0.7rem 0.8rem; }

  .practice-bar { padding: 0.5rem 0.7rem 0.3rem; }
  main#chat { padding: 0.3rem 0.7rem 1rem; }
  form#form { padding: 0.6rem 0.7rem; }

  .msg .role { width: 44px; font-size: 0.62rem; padding-top: 0.5rem; }
  .bubble { padding: 0.6rem 0.75rem; }

  .screenshots-list, .photos-gallery {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.4rem;
  }
  .screenshot-thumb, .photo-thumb { min-height: 120px; }

  .fact-item { font-size: 0.85rem; padding: 0.35rem 0.5rem; gap: 0.4rem; }
}

/* ─── SESIONES DEL SIMULADOR (UX rediseñada) ─── */
.sim-empty {
  text-align: center;
  padding: 1.5rem 1rem;
}
.sim-sessions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sim-session-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.sim-session-card:hover { border-color: var(--accent); }
.sim-session-card:active { transform: scale(0.99); }
.sim-session-card.ended { border-left-color: var(--green); }
.sim-session-card.active { border-left-color: var(--accent); }
.sim-card-icon {
  font-size: 1.5rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev);
  border-radius: 10px;
}
.sim-card-body { min-width: 0; }
.sim-card-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-card-meta {
  display: flex; gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
  flex-wrap: wrap;
}
.sim-card-tail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.sim-card-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.sim-card-badge.ended { background: rgba(108,210,138,0.15); color: var(--green); }
.sim-card-badge.active { background: rgba(244, 143, 177,0.15); color: var(--accent); }
.sim-card-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.sim-card-del:hover { color: var(--red); background: rgba(255,107,138,0.1); }

.sim-detail-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex; justify-content: center;
}
.sim-detail-inner {
  background: var(--bg);
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column;
  height: 100dvh;
  min-height: 0;
}
.sim-detail-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 2;
}
.sim-detail-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sim-detail-title-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.sim-detail-icon {
  font-size: 1.5rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input);
  border-radius: 10px;
  flex-shrink: 0;
}
.sim-detail-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-detail-sub {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.sim-detail-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.65rem 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.sim-detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sim-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.sim-detail-pane { display: none; }
.sim-detail-pane.active { display: block; }

.sim-bubble-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.7rem;
  max-width: 85%;
}
.sim-bubble-row.user { margin-left: auto; align-items: flex-end; }
.sim-bubble-row.npc { margin-right: auto; align-items: flex-start; }
.sim-bubble-author {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0.5rem 0.15rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}
.sim-bubble-msg {
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.sim-bubble-row.user .sim-bubble-msg {
  background: var(--accent);
  color: #1a0f0a;
  border-bottom-right-radius: 4px;
}
.sim-bubble-row.npc .sim-bubble-msg {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.sim-feedback-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.1rem;
  font-size: 0.93rem;
  line-height: 1.55;
}
.sim-feedback-block h2 {
  font-size: 1rem;
  color: var(--accent);
  margin: 0.8rem 0 0.4rem;
}
.sim-feedback-block h2:first-child { margin-top: 0; }
.sim-feedback-block h3 {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.6rem 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sim-feedback-block ul { padding-left: 1.3rem; }
.sim-feedback-block li { margin: 0.2rem 0; }
.sim-feedback-empty {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.sim-feedback-empty p { margin: 0.5rem 0; }

@media (max-width: 700px) {
  .sim-detail-title { font-size: 0.88rem; }
  .sim-detail-sub { font-size: 0.68rem; }
  .sim-detail-tab { font-size: 0.82rem; padding: 0.55rem 0.3rem; }
  .sim-detail-body { padding: 0.8rem; }
  .sim-bubble-msg { font-size: 0.9rem; padding: 0.5rem 0.75rem; }
  .sim-feedback-block { padding: 0.8rem 0.9rem; font-size: 0.88rem; }
  .sim-card-icon { width: 38px; height: 38px; font-size: 1.3rem; }
  .sim-session-card { grid-template-columns: 38px 1fr auto; padding: 0.5rem 0.6rem; }
  .sim-card-title { font-size: 0.88rem; }
  .sim-card-meta { font-size: 0.68rem; }
}

/* ─── DESKTOP (≥ 760px) — sesiones simulador ─── */
@media (min-width: 760px) {
  /* Lista de sesiones: grid 2 columnas en desktop */
  .sim-sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.7rem;
  }
  .sim-session-card { padding: 0.8rem 0.95rem; }
  .sim-card-icon { width: 50px; height: 50px; font-size: 1.7rem; border-radius: 12px; }
  .sim-card-title { font-size: 0.98rem; }
  .sim-card-meta { font-size: 0.78rem; }

  /* Modal: máximo ancho mayor, más respiración */
  .sim-detail-modal { background: rgba(0,0,0,0.55); align-items: center; padding: 2rem; }
  .sim-detail-inner {
    max-width: 920px;
    max-height: 88dvh;
    height: 88dvh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
  }
  .sim-detail-header {
    padding: 0.9rem 1.2rem;
    padding-top: 0.9rem;  /* en desktop no hay notch */
  }
  .sim-detail-icon { width: 44px; height: 44px; font-size: 1.7rem; }
  .sim-detail-title { font-size: 1.05rem; }
  .sim-detail-sub { font-size: 0.82rem; }
  .sim-detail-tab { font-size: 0.92rem; padding: 0.85rem 1rem; }
  .sim-detail-body { padding: 1.5rem 2rem; padding-bottom: 1.5rem; }

  /* Bubbles más estrechas en desktop (no abarcar toda la pantalla) */
  .sim-bubble-row { max-width: 68%; }
  .sim-bubble-msg { font-size: 0.94rem; padding: 0.6rem 0.95rem; }

  /* Feedback con más respiración */
  .sim-feedback-block {
    padding: 1.5rem 1.8rem;
    font-size: 0.95rem;
    max-width: 720px;
    margin: 0 auto;
  }
  .sim-feedback-block h2 { font-size: 1.1rem; margin: 1.2rem 0 0.5rem; }
  .sim-feedback-block h2:first-child { margin-top: 0; }
  .sim-feedback-block h3 { font-size: 0.95rem; }
}

/* ≥ 1100px — usar 3 columnas en lista de sesiones */
@media (min-width: 1100px) {
  .sim-sessions-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Sesiones abandonadas */
.sim-session-card.abandoned {
  border-left-color: var(--muted);
  opacity: 0.7;
}
.sim-card-badge.abandoned {
  background: rgba(139,145,163,0.15);
  color: var(--muted);
}

/* ════════════════════════════════════════════════════════════════════════════ */
/* ─── REDISEÑO 2026-05-21 — askpetal-inspired (light + rose + clean) ─────── */
/* ════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #fbfaf7;
  --bg-elev: #ffffff;
  --bg-input: #f5f3ef;
  --border: #ece8df;
  --border-strong: #d9d3c5;
  --text: #1a1a1a;
  --text-soft: #4a4a4a;
  --muted: #8a8478;
  --accent: #d6336c;
  --accent-soft: #fce4ec;
  --accent-hover: #ad1457;
  --user: #fce4ec;
  --user-text: #4a0017;
  --link: #1976d2;
  --green: #2e7d32;
  --green-soft: #e8f5e9;
  --yellow: #f9a825;
  --yellow-soft: #fff8e1;
  --red: #c62828;
  --red-soft: #ffebee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --radius-md: 12px;
  --radius-lg: 16px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
}

/* Header & tabs */
header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner h1 {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tab-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--bg-input); }
.tab-btn.active { color: #fff; background: var(--accent); }

/* Buttons */
button.ghost {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.15s;
}
button.ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Inputs */
input, textarea, select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Practice bar */
.practice-bar #coach-select {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
}
#coach-select { background: var(--accent-soft); color: var(--accent); }

/* Suggestions */
.suggestion {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.suggestion:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Message bubbles */
.msg .bubble {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.msg.user .bubble {
  background: var(--user);
  color: var(--user-text);
  border-color: var(--accent-soft);
}
.bubble strong { color: var(--text); font-weight: 600; }
.bubble code {
  background: var(--bg-input);
  color: var(--accent-hover);
  border-radius: 4px;
}
.bubble a.cite {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 500;
}
.bubble a.cite:hover { background: var(--accent); color: #fff; }

/* Match card sidebar */
.match-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.match-card:hover { border-color: var(--accent); transform: translateX(2px); }
.match-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}
.avatar {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Status badges */
.status-matched { background: #e3f2fd; color: #1976d2; }
.status-talking { background: var(--green-soft); color: var(--green); }
.status-dating { background: var(--accent-soft); color: var(--accent); }
.status-ghosted { background: var(--red-soft); color: var(--red); }
.status-closed { background: var(--bg-input); color: var(--muted); }

/* Match sections / cards */
.match-section, .md-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.match-section h3, .md-card-head h3 {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Sub-tabs match detail */
.md-subtabs { background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.md-subtab {
  color: var(--muted);
  font-weight: 500;
  padding: 0.85rem 0.4rem;
}
.md-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Accordions */
.md-accordion {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.md-accordion summary { color: var(--text); }

/* Match chat full */
.md-chat-full .md-chat-form { background: var(--bg-elev); border-top: 1px solid var(--border); }
.md-chat-form textarea { border-radius: 24px; }
.md-chat-form .send-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
}
.md-chat-form .send-btn:hover:not(:disabled) { background: var(--accent-hover); }

/* Steps timeline */
.step-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.step-date-block {
  background: var(--accent-soft);
  color: var(--accent);
}
.step-day { color: var(--accent); }
.step-row.state-overdue::before { background: var(--red); }
.step-row.state-today::before { background: var(--yellow); }
.step-row.state-future::before { background: var(--green); }
.step-row.state-done::before { background: var(--green); }

/* Facts chips */
.fact-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.fact-chip:hover { border-color: var(--accent); }
.fact-cat {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Notes textarea */
.notes-textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

/* Panel assessment */
.panel-assessment h2 { color: var(--accent); }

/* Empty detail */
.empty-detail { color: var(--muted); }

/* Form (practicar) */
form#form { background: var(--bg-elev); border-top: 1px solid var(--border); }

/* Quiz modal */
.quiz-modal { background: rgba(20, 10, 15, 0.55); }
.quiz-modal-inner { background: var(--bg); }
.quiz-header { background: var(--bg-elev); }
.quiz-scenario-text {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.quiz-option {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.quiz-option:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quiz-option-letter {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1.5px solid var(--accent-soft);
}
.quiz-option.correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.quiz-option.correct .quiz-option-letter {
  background: var(--green); color: #fff; border-color: var(--green);
}
.quiz-option.incorrect {
  border-color: var(--red);
  background: var(--red-soft);
}
.quiz-option.incorrect .quiz-option-letter {
  background: var(--red); color: #fff; border-color: var(--red);
}
.quiz-result-banner.correct { background: var(--green-soft); border-color: var(--green); }
.quiz-result-banner.incorrect { background: var(--red-soft); border-color: var(--red); }
.quiz-result-banner.correct .quiz-result-icon { background: var(--green); color: #fff; }
.quiz-result-banner.incorrect .quiz-result-icon { background: var(--red); color: #fff; }
.quiz-key-lesson { background: var(--bg-elev); border-left: 3px solid var(--accent); }
.quiz-spinner { border-top-color: var(--accent); }

/* Progress dots */
.quiz-dot.current { background: var(--accent); border-color: var(--accent); }
.quiz-dot.correct { background: var(--green); border-color: var(--green); }
.quiz-dot.incorrect { background: var(--red); border-color: var(--red); }

/* Stats cards */
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat-card.accent-red { border-color: var(--red); }
.stat-card.accent-green { border-color: var(--green); }
.stat-value { color: var(--accent); font-weight: 700; }
.stat-card.accent-red .stat-value { color: var(--red); }
.stat-card.accent-green .stat-value { color: var(--green); }
.stat-label { color: var(--text-soft); font-weight: 600; }

/* Spark chart */
.spark-fill { background: var(--accent); opacity: 0.7; }
.spark-bar.today .spark-fill { background: var(--green); opacity: 1; }

/* FAB */
.fab-new {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

/* Simulator overlay */
.simulator-overlay { background: var(--bg); }
.sim-header { background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.sim-scenario-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sim-scenario-card:hover { border-color: var(--accent); }
.sim-bubble-row.user .sim-bubble-msg { background: var(--accent); color: #fff; }
.sim-bubble-row.npc .sim-bubble-msg { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }

/* Sim sessions cards */
.sim-session-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sim-card-icon { background: var(--accent-soft); }
.sim-card-badge.ended { background: var(--green-soft); color: var(--green); }
.sim-card-badge.active { background: var(--accent-soft); color: var(--accent); }
.sim-card-badge.abandoned { background: var(--bg-input); color: var(--muted); }

/* Quick suggest */
.quick-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.quick-file-label {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  color: var(--accent);
  border-radius: var(--radius-md);
}
.quick-file-label:hover { background: var(--accent); color: #fff; }
.suggestion-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.suggestion-num { background: var(--accent); color: #fff; }

/* Cursor blink */
.cursor::after { color: var(--accent); }

/* Photo thumb / screenshot thumb */
.photo-thumb.primary { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.photo-thumb .primary-badge { background: var(--accent); color: #fff; }

/* Topic context picker */
.topic-context-picker {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.topic-context-picker select {
  background: var(--accent-soft);
  color: var(--accent);
}

/* New match dialog */
dialog#new-match-dialog {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
dialog#new-match-dialog::backdrop { background: rgba(20,10,15,0.45); }

/* ════════════════════════════════════════════════════════════════════════════ */
/* ─── 2026 BOTTOM NAV + SVG ICONS (Tinder/Apple Music style) ─────────────── */
/* ════════════════════════════════════════════════════════════════════════════ */

/* SVG icons inline reusables */
.ico { width: 22px; height: 22px; flex-shrink: 0; }

/* Header simplificado (sin tabs ahora) */
.header-inner { padding: 0.85rem 1.3rem; }
header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, #b71c5c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-inner .tabs { display: none; }  /* las viejas tabs ya no se usan */

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
}
.bottom-tab .ico {
  width: 24px; height: 24px;
  stroke-width: 1.75;
  transition: transform 0.2s, stroke-width 0.2s;
}
.bottom-tab span {
  font-size: 11px;
  letter-spacing: 0.01em;
}
.bottom-tab.active { color: var(--accent); }
.bottom-tab.active .ico {
  stroke-width: 2.15;
  transform: scale(1.05);
}
.bottom-tab.active::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 3px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
}

/* Reservar espacio inferior para el contenido sobre el bottom nav.
   Altura real del bottom-nav: ~60px de contenido (10+24+4+11+12) + safe-area-inset-bottom.
   Ajustado a 60px para no dejar espacio blanco visible debajo del contenido en PWA. */
.tab-panel.active {
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}
/* Excepción: el simulator overlay full-screen no necesita ese padding */
.simulator-overlay { padding-bottom: 0 !important; }
.simulator-overlay .tab-panel { padding-bottom: 0; }

/* Excepción: el chat full del match detail tiene su propio input fixed,
   le quitamos el padding-bottom para que el form quede pegado al bottom-nav */
.match-detail .md-pane[data-pane="chat"] { padding-bottom: 0; }

/* En desktop ancho, podemos opcionalmente mantener bottom-nav (consistencia)
   o mostrarla más compacta. Mantengo bottom en ambos por simplicidad y look unificado. */
@media (min-width: 900px) {
  .bottom-nav-inner { max-width: 480px; }
  .bottom-tab span { font-size: 12px; }
}

/* Override quick-body que tenía overflow: auto, ahora respeta bottom-nav */
.quick-body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* SVG icons en sub-tabs y botones */
.ico-sm { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; }
.ico-xs { width: 12px; height: 12px; vertical-align: middle; margin-right: 3px; flex-shrink: 0; }
.md-subtab {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
}
.icon-btn {
  width: 44px; height: 44px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.icon-btn .ico { margin: 0; }

/* Sim form ya tiene su layout, asegurar icon-btn */
.sim-form .icon-btn { flex-shrink: 0; }
#sim-voice-toggle {
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  display: inline-flex; align-items: center; gap: 5px;
}

/* Headers Match detail compact con back redondo */
.md-back {
  width: 38px; height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.md-back .ico { width: 18px; height: 18px; }

/* FAB icon size */
.fab-new svg { width: 24px; height: 24px; }

/* ─── Bottom nav FIX: override tab-btn legacy + más compacta ─── */
.bottom-nav .bottom-tab,
.bottom-nav .bottom-tab.active,
.bottom-nav .bottom-tab:hover {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 7px 0 9px;
}
.bottom-nav .bottom-tab { color: var(--muted) !important; }
.bottom-nav .bottom-tab.active { color: var(--accent) !important; }
.bottom-nav .bottom-tab.active .ico { stroke-width: 2.2; transform: scale(1.04); }
.bottom-nav .bottom-tab .ico { width: 22px; height: 22px; transition: transform 0.18s, stroke-width 0.18s; }
.bottom-nav .bottom-tab span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
}
.bottom-nav .bottom-tab.active::after {
  width: 26px; height: 2.5px;
  top: 0; left: 50%;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
}

/* Padding-bottom del contenido más ajustado a la nueva altura */
.tab-panel.active { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
.quick-body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .bottom-nav-inner { max-width: 460px; }
  .bottom-nav .bottom-tab span { font-size: 11px; }
}

/* FAB encima del bottom-nav, no debajo */
.fab-new {
  bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  right: calc(1rem + env(safe-area-inset-right)) !important;
}

/* Fuente de las opciones del quiz más pequeña y aireada */
.quiz-option {
  padding: 0.65rem 0.8rem !important;
  font-size: 0.88rem !important;
  line-height: 1.4;
}
.quiz-option-letter {
  width: 26px !important;
  height: 26px !important;
  font-size: 0.78rem !important;
}
.quiz-option-text {
  font-size: 0.88rem !important;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .quiz-option { font-size: 0.85rem !important; padding: 0.6rem 0.7rem !important; }
  .quiz-option-text { font-size: 0.85rem !important; }
  .quiz-option-letter { width: 24px !important; height: 24px !important; font-size: 0.72rem !important; }
}

/* El resultado banner se inserta al FINAL ahora, separado del progress */
.quiz-result-wrap { margin-top: 1rem; }
.quiz-result-banner {
  margin-bottom: 0.8rem;
}

/* Progress dots: separar del scenario text */
.quiz-progress { margin-bottom: 1rem; }

/* ─── New match modal (custom, no <dialog>) ─── */
.match-modal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.match-modal[hidden] { display: none; }
.match-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 10, 15, 0.55);
  backdrop-filter: blur(4px);
}
.match-modal-panel {
  position: relative;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,0.35));
  padding: 1.2rem 1.2rem 1.5rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.match-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.8rem;
}
.match-modal-head h3 { margin: 0; }
.match-modal-panel form label {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.match-modal-panel form input[type="text"],
.match-modal-panel form input:not([type="file"]),
.match-modal-panel form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  font-size: 16px;          /* >=16px evita auto-zoom iOS Safari */
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.match-modal-panel form input[type="file"] {
  font-size: 14px;
  margin-top: 0.3rem;
}
.match-modal-panel .dialog-actions {
  display: flex; gap: 0.6rem; justify-content: flex-end;
  margin-top: 1rem;
}
.match-modal-panel .dialog-actions button {
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .match-modal-panel {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* Header del banner de resultado del quiz */
.quiz-result-header {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
  text-align: center;
}
.quiz-result-wrap { margin-top: 0.4rem; }

/* ════════════════════════════════════════════════════════════════════════════ */
/* ─── PROGRESO 2026: chip cards, data viz, streak hero ─────────────────────── */
/* ════════════════════════════════════════════════════════════════════════════ */

.progress-scroll { padding-bottom: 6rem; }

.progress-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1rem;
  margin-top: 1rem;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.8rem; gap: 0.6rem;
}
.section-head h3 { margin: 0; font-size: 1rem; }
.section-sub { font-size: 0.75rem; }

/* ─── Quiz stats por categoría ─── */
.quiz-stats-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.quiz-stats-pct {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.quiz-stats-info { display: flex; flex-direction: column; gap: 0.15rem; }
.quiz-stats-label { font-weight: 600; font-size: 0.95rem; }
.quiz-stats-sub { font-size: 0.78rem; }
.quiz-stats-block { margin-bottom: 0.9rem; }
.quiz-stats-block:last-child { margin-bottom: 0; }
.quiz-stats-block-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.quiz-stat-row {
  display: grid;
  grid-template-columns: auto 1fr auto 80px auto;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}
.quiz-stat-emoji { font-size: 1rem; }
.quiz-stat-name {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quiz-stat-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 40px;
}
.quiz-stat-pct.good { color: #2e7d32; }
.quiz-stat-pct.ok { color: #f9a825; }
.quiz-stat-pct.bad { color: #c62828; }
.quiz-stat-bar {
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.quiz-stat-fill { height: 100%; }
.quiz-stat-fill.good { background: linear-gradient(90deg, #2e7d32, #66bb6a); }
.quiz-stat-fill.ok { background: linear-gradient(90deg, #f9a825, #ffb74d); }
.quiz-stat-fill.bad { background: linear-gradient(90deg, #c62828, #ef5350); }
.quiz-stat-num {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* ─── Rings del temario (las 6 situaciones) ─── */
.temario-rings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.8rem;
}
@media (max-width: 380px) {
  .temario-rings-grid { grid-template-columns: repeat(2, 1fr); }
}
.temario-ring-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.temario-ring-card:hover { border-color: var(--accent); }
.temario-ring-card:active { transform: scale(0.98); }
.temario-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--ring-deg, 0deg), var(--bg-input) 0);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.temario-ring-inner {
  background: var(--bg-elev);
  border-radius: 50%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}
.temario-ring-emoji { font-size: 1.2rem; line-height: 1; }
.temario-ring-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.temario-ring-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}
.temario-ring-num {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

/* ─── Resumen temario en Progreso ─── */
.temario-summary-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.temario-summary-pct {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.temario-summary-info { display: flex; flex-direction: column; gap: 0.15rem; }
.temario-summary-label { font-weight: 600; font-size: 0.95rem; }
.temario-summary-sub { font-size: 0.78rem; }
.temario-summary-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.temario-summary-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
}
.temario-summary-icon { font-size: 1.05rem; }
.temario-summary-name { font-weight: 500; min-width: 80px; }
.temario-summary-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.temario-summary-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent)));
}
.temario-summary-num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ─── Perfil aprendido: tabs + cuerpo dinámico ─── */
.profile-dim-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.5rem;
}
.profile-dim-tabs::-webkit-scrollbar { display: none; }
.profile-dim-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.profile-dim-tab-ico { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.profile-dim-tab-count {
  background: var(--accent-soft, rgba(214,51,108,0.15));
  color: var(--accent);
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.2rem;
}
.profile-dim-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.profile-dim-tab.active .profile-dim-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.profile-dim-body {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.profile-dim-text {
  font-size: 0.92rem;
  line-height: 1.5;
}
/* Bullets para dimensiones tipo "text" — convertir prosa en lista visual */
.profile-dim-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.profile-dim-bullets li {
  position: relative;
  padding: 0.4rem 0.6rem 0.4rem 1.4rem;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.profile-dim-bullets li::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.profile-dim-bullets.tone-green li::before { background: #2e7d32; }
.profile-dim-bullets.tone-rose li::before { background: #c2185b; }
.profile-dim-bullets.tone-red li::before { background: #c62828; }
.profile-dim-bullets.tone-amber li::before { background: #f9a825; }
.profile-dim-bullets.tone-violet li::before { background: #7b1fa2; }
.profile-dim-bullets.tone-blue li::before { background: #1976d2; }

.profile-dim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.profile-dim-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
/* tonos: chip con leve tint de fondo + borde, no solo borde */
.profile-dim-chips.tone-green .profile-dim-chip { border-color: rgba(46,125,50,0.35); background: rgba(46,125,50,0.08); }
.profile-dim-chips.tone-rose .profile-dim-chip { border-color: rgba(194,24,91,0.35); background: rgba(194,24,91,0.08); }
.profile-dim-chips.tone-red .profile-dim-chip { border-color: rgba(198,40,40,0.35); background: rgba(198,40,40,0.08); }
.profile-dim-chips.tone-amber .profile-dim-chip { border-color: rgba(249,168,37,0.35); background: rgba(249,168,37,0.08); }
.profile-dim-chips.tone-violet .profile-dim-chip { border-color: rgba(123,31,162,0.35); background: rgba(123,31,162,0.08); }
.profile-dim-chips.tone-blue .profile-dim-chip { border-color: rgba(25,118,210,0.35); background: rgba(25,118,210,0.08); }

/* ─── Lecciones recientes en carrousel con filtros ─── */
.me-lessons-pills {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.me-lessons-pills::-webkit-scrollbar { display: none; }
.me-lesson-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.me-lesson-pill .ico-sm {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  margin: 0;
}
.me-lesson-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
/* Lista vertical (no carrousel) para que el texto se lea completo. */
.me-lessons-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.3rem;
}

/* Buckets por fecha (Hoy / Esta semana / Antes) */
.me-lessons-bucket {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.4rem;
}
.me-lessons-bucket + .me-lessons-bucket { padding-top: 0.9rem; }
.me-lessons-bucket-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.1rem 0.15rem;
}
.me-lessons-bucket-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.me-lessons-bucket-count {
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--bg-input);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

/* Chip "← Eli" — fuente de la lección */
.me-lesson-source {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-input);
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.me-lesson-source::before {
  content: "←";
  font-size: 0.65rem;
  opacity: 0.7;
}
.me-lesson-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.6rem 0.8rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.me-lesson-card.tone-green { border-left-color: #2e7d32; }
.me-lesson-card.tone-rose { border-left-color: #c2185b; }
.me-lesson-card.tone-amber { border-left-color: #f9a825; }
.me-lesson-card.tone-violet { border-left-color: #7b1fa2; }
.me-lesson-card.tone-blue { border-left-color: #1976d2; }
.me-lesson-card.tone-muted { border-left-color: var(--muted); }

.me-lesson-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Badge pill colorido por categoría (mucho más visual que header gris) */
.me-lesson-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem 0.18rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.me-lesson-badge .me-lesson-ico {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  margin: 0;
}
.me-lesson-badge.tone-green  { background: rgba(46,125,50,0.12);  border-color: rgba(46,125,50,0.4);  color: #2e7d32; }
.me-lesson-badge.tone-rose   { background: rgba(194,24,91,0.12);  border-color: rgba(194,24,91,0.4);  color: #c2185b; }
.me-lesson-badge.tone-amber  { background: rgba(249,168,37,0.15); border-color: rgba(249,168,37,0.4); color: #b87600; }
.me-lesson-badge.tone-violet { background: rgba(123,31,162,0.12); border-color: rgba(123,31,162,0.4); color: #7b1fa2; }
.me-lesson-badge.tone-blue   { background: rgba(25,118,210,0.12); border-color: rgba(25,118,210,0.4); color: #1976d2; }
.me-lesson-badge.tone-muted  { background: var(--bg-input); border-color: var(--border); color: var(--muted); }

.me-lesson-time {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: auto;
  flex-shrink: 0;
}
.me-lesson-card .del-lesson {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
}
.me-lesson-card .del-lesson:hover { color: var(--red, #c62828); }

.me-lesson-text {
  line-height: 1.45;
}

/* ─── Coste / Usage dashboard ─── */
.usage-spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  margin-bottom: 0.8rem;
}
.usage-spark-bar {
  flex: 1;
  background: var(--accent);
  opacity: 0.7;
  border-radius: 2px 2px 0 0;
  min-width: 4px;
}
.usage-row {
  margin-bottom: 0.55rem;
}
.usage-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  margin-bottom: 0.2rem;
}
.usage-feature {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-cost {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  flex-shrink: 0;
}
.usage-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent)));
}

/* ─── Streak hero ─── */
.streak-hero { margin-bottom: 0.4rem; }
.streak-card {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.14), rgba(168, 130, 255, 0.10));
  border: 1px solid rgba(255, 107, 138, 0.22);
}
.streak-flame {
  color: #ff6b8a;
  filter: drop-shadow(0 0 12px rgba(255, 107, 138, 0.45));
}
.streak-text { flex: 0 0 auto; }
.streak-value {
  font-size: 2.2rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, #ff8aa8, #c9a4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.streak-unit { font-size: 0.78rem; font-weight: 500; color: var(--muted); margin-left: 0.35rem; }
.streak-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.2rem; }
.streak-divider { width: 1px; background: var(--border); align-self: stretch; margin: 0 0.3rem; }
.streak-mini { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; min-width: 0; }
.streak-mini-row { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-accent { background: var(--accent, #ff6b8a); }
.dot-muted { background: var(--muted); opacity: 0.5; }

/* ─── Stats chips (top metric grid) ─── */
.stats-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 0.8rem;
}
@media (min-width: 700px) {
  .stats-chips { grid-template-columns: repeat(4, 1fr); }
}
.stat-chip {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.9rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.stat-chip::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--chip-tone, var(--accent));
}
.stat-chip-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--chip-tone-bg, rgba(255, 107, 138, 0.12));
  color: var(--chip-tone, #ff6b8a);
  flex-shrink: 0;
}
.stat-chip-icon svg { width: 20px; height: 20px; }
.stat-chip-body { min-width: 0; flex: 1; }
.stat-chip-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--text); }
.stat-chip-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.3rem; }
.stat-chip-hint { font-size: 0.7rem; color: var(--muted); opacity: 0.85; margin-top: 0.25rem; }

.stat-chip.tone-rose   { --chip-tone: #ff6b8a; --chip-tone-bg: rgba(255, 107, 138, 0.14); }
.stat-chip.tone-amber  { --chip-tone: #f5a25d; --chip-tone-bg: rgba(245, 162, 93, 0.14); }
.stat-chip.tone-violet { --chip-tone: #a882ff; --chip-tone-bg: rgba(168, 130, 255, 0.14); }
.stat-chip.tone-green  { --chip-tone: #6cd28a; --chip-tone-bg: rgba(108, 210, 138, 0.14); }
.stat-chip.tone-red    { --chip-tone: #ff6b8a; --chip-tone-bg: rgba(255, 107, 138, 0.14); }

/* ─── Activity sparkline (SVG nativo, viewBox real) ─── */
.spark-svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.spark-svg-label {
  fill: var(--muted);
  text-anchor: middle;
  font-family: inherit;
}
.spark-svg-label.today {
  fill: #ff6b8a;
  font-weight: 700;
}

/* ─── Horizontal bar rows (status) ─── */
.status-stack {
  display: flex; flex-direction: column; gap: 0.55rem;
}
.status-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2rem;
  align-items: center;
  gap: 0.7rem;
}
.status-row-label {
  font-size: 0.78rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: capitalize;
}

/* En el panel de Usage los labels son más largos ("Mensajes al panel") —
   damos más espacio y permitimos wrap a 2 líneas. */
#usage-breakdown .status-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2.2rem;
  gap: 0.6rem;
  align-items: center;
}
#usage-breakdown .status-row-label {
  white-space: normal;
  text-overflow: clip;
  text-transform: none;
  font-size: 0.82rem;
  line-height: 1.25;
}
@media (max-width: 600px) {
  #usage-breakdown .status-row {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 0.6rem;
  }
  /* Bar ocupa fila propia debajo en mobile */
  #usage-breakdown .status-row-bar { grid-column: 1 / -1; }
  #usage-breakdown .status-row-label { font-size: 0.85rem; }
}
.status-row-bar {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.status-row-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8aa8, #c9a4ff);
  transition: width 0.4s ease;
}
.status-row-val {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  text-align: right;
}

.status-row.tone-active     .status-row-fill { background: linear-gradient(90deg, #6cd28a, #9be3a9); }
.status-row.tone-talking    .status-row-fill { background: linear-gradient(90deg, #ff8aa8, #ffb3c5); }
.status-row.tone-scheduled  .status-row-fill { background: linear-gradient(90deg, #f5a25d, #ffc99a); }
.status-row.tone-dating     .status-row-fill { background: linear-gradient(90deg, #c9a4ff, #e3cdff); }
.status-row.tone-closed     .status-row-fill { background: linear-gradient(90deg, #6cd28a, #b5e8c4); }
.status-row.tone-lost       .status-row-fill { background: linear-gradient(90deg, #ff6b8a, #ffa3b7); opacity: 0.7; }
.status-row.tone-ghosted    .status-row-fill { background: linear-gradient(90deg, #7a7a8c, #a0a0b5); }

/* ─── Donut chart (matches breakdown) ─── */
.donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: center;
}
.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.donut-svg {
  width: 100%; height: 100%;
  display: block;
}
.donut-svg circle {
  transition: stroke-dasharray 0.5s ease;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.donut-center-sub {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.2rem;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.donut-legend-row {
  display: grid;
  grid-template-columns: 0.7rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.donut-legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  display: inline-block;
}
.donut-legend-label {
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-legend-val {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.9rem;
  }
  .donut-chart { width: 150px; height: 150px; }
  .donut-legend {
    width: 100%;
    max-width: 280px;
  }
}

/* ─── Profile chip cloud ─── */
.profile-group { margin-bottom: 1rem; }
.profile-group:last-child { margin-bottom: 0; }
.profile-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.chip-cloud {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.chip {
  display: inline-flex; align-items: center;
  padding: 0.32rem 0.7rem;
  background: rgba(255, 138, 168, 0.10);
  border: 1px solid rgba(255, 138, 168, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.3;
}
.profile-text {
  font-size: 0.88rem; line-height: 1.45; color: var(--text);
  padding: 0.55rem 0.75rem;
  background: rgba(255,255,255,0.025);
  border-left: 2px solid var(--accent, #ff6b8a);
  border-radius: 0 8px 8px 0;
}

/* ─── Lesson cards ─── */
.lesson-cards {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.lesson-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  position: relative;
  border-left: 3px solid var(--card-tone, var(--accent, #ff6b8a));
}
.lesson-card.tone-rose   { --card-tone: #ff6b8a; }
.lesson-card.tone-amber  { --card-tone: #f5a25d; }
.lesson-card.tone-violet { --card-tone: #a882ff; }
.lesson-card.tone-green  { --card-tone: #6cd28a; }
.lesson-card.tone-blue   { --card-tone: #6ab7ff; }
.lesson-card.tone-muted  { --card-tone: #7a7a8c; }

.lesson-card-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.lesson-tag {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  background: var(--card-tone);
  color: #0e0a14;
  border-radius: 999px;
  font-weight: 700;
}
.lesson-time { font-size: 0.72rem; flex: 1; }
.lesson-card-body { font-size: 0.86rem; line-height: 1.45; color: var(--text); }
.del-lesson {
  background: transparent; border: none;
  color: var(--muted); font-size: 1.15rem; line-height: 1;
  padding: 0 0.3rem; cursor: pointer; border-radius: 4px;
}
.del-lesson:hover { color: var(--red, #ff6b8a); background: rgba(255,107,138,0.1); }

@media (max-width: 700px) {
  .status-row { grid-template-columns: 5.5rem 1fr 1.8rem; gap: 0.5rem; }
  .stat-chip-value { font-size: 1.4rem; }
  .streak-card { padding: 0.9rem; gap: 0.7rem; }
  .streak-value { font-size: 1.9rem; }
  .streak-mini-row { font-size: 0.78rem; }
}

/* ─── LECCIONES — flow jerárquico (Situación → Tipología → Temario) ─── */

.learn-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  font-size: 0.82rem;
}
.learn-crumb {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.learn-crumb:hover { border-color: var(--accent); }
.learn-crumb-sep { color: var(--muted); }
.learn-crumb-cur {
  padding: 0.32rem 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

/* Progreso del temario — hero + por situación */
.learn-progress-hero {
  background: linear-gradient(135deg, var(--bg-elev), rgba(244, 143, 177, 0.08));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.learn-progress-hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.learn-progress-hero-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
}
.learn-progress-hero-num {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.learn-progress-hero-num .muted { font-size: 0.85rem; font-weight: 500; }
.learn-progress-hero-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.learn-progress-hero-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent)));
  transition: width 0.4s ease-out;
}
.learn-progress-hero-sub {
  font-size: 0.74rem;
  margin-top: 0.35rem;
}

.situation-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: auto;
  padding-top: 0.4rem;
}
.situation-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}
.situation-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease-out;
}
.situation-progress-num {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex-shrink: 0;
}

/* Carrousel "Para ti hoy" (legacy, conservar por si vuelve) */
.recommended-section {
  margin-bottom: 1.2rem;
}
.recommended-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.4rem;
}
.recommended-head h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--accent);
}
.recommended-sub {
  font-size: 0.75rem;
}
.recommended-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.6rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.recommended-scroll::-webkit-scrollbar { height: 4px; }
.recommended-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.recommended-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: linear-gradient(180deg, var(--bg-elev), rgba(244, 143, 177, 0.04));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
}
.recommended-card:hover { border-color: var(--accent); }
.recommended-card:active { transform: scale(0.985); }
.recommended-card-head {
  display: flex;
  gap: 0.3rem;
  font-size: 1.3rem;
}
.recommended-title {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
}
.recommended-why {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Vista 1 — Situaciones */
.situations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
}
.situation-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
  min-height: 140px;
}
.situation-card:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--bg-elev), rgba(244, 143, 177, 0.06));
}
.situation-card:active { transform: scale(0.985); }
.situation-icon { font-size: 2rem; line-height: 1; }
.situation-label {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.2;
}
.situation-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Header común en vistas 2-3 */
.learn-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.learn-section-head h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
}
.learn-section-head p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.learn-section-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Vista 2 — Tipologías con behavior contextualizado */
.typologies-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
@media (min-width: 720px) {
  .typologies-detail-grid { grid-template-columns: 1fr 1fr; }
}
.typology-detail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.typology-detail-card:hover { border-color: var(--accent); }
.typology-detail-card:active { transform: scale(0.99); }
.typology-detail-card.is-habitat {
  border-color: rgba(244, 143, 177, 0.55);
  box-shadow: 0 0 0 1px rgba(244, 143, 177, 0.18) inset;
}
.typology-detail-card.is-habitat:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(244, 143, 177, 0.35) inset, 0 4px 14px -8px rgba(244, 143, 177, 0.45);
}
/* Bloque "El panel la lee como…" en el panel-assessment del match.
   Display-only. Mismo sistema tipográfico que el resto del producto. */
.typology-read {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.95rem 0;
  padding: 0.5rem 0.85rem 0.55rem 0.85rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(244, 143, 177, 0.09), rgba(244, 143, 177, 0.0) 70%);
  border-radius: 0 8px 8px 0;
}
.typology-read-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.typology-read-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tdc-habitat-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  background: linear-gradient(135deg, var(--accent), #EC407A);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  line-height: 1;
  box-shadow: 0 2px 6px -2px rgba(236, 64, 122, 0.55);
  pointer-events: none;
}
.tdc-head { display: flex; align-items: center; gap: 0.55rem; }
.tdc-icon { font-size: 1.55rem; line-height: 1; }
.tdc-label { font-weight: 600; font-size: 1rem; }
.tdc-desc { margin: 0; font-size: 0.85rem; line-height: 1.45; color: var(--text); }
.tdc-here {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(244, 143, 177, 0.08);
  border: 1px solid rgba(244, 143, 177, 0.22);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.tdc-here-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.tdc-here-text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}
.tdc-cta {
  margin-top: 0.2rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
}

/* Vista 3 — Temario filtrado por situación+tipología */
.topics-flow-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.topic-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  padding-right: 4.5rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  position: relative;
  transition: border-color 0.15s, transform 0.1s;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card:active { transform: scale(0.99); }
.topic-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.topic-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
.topic-label { font-weight: 600; font-size: 0.96rem; }
.topic-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

.lesson-badge {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lesson-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.lesson-badge.partial {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Modal lección: tabs internos */
.lesson-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.lesson-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.lesson-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.lesson-body {
  flex: 1; overflow-y: auto;
  padding: 1rem 1.2rem 2rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.lesson-read {
  font-size: 0.95rem;
  line-height: 1.55;
}
.lesson-read h2 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
  color: var(--accent);
}
.lesson-read h2:first-child { margin-top: 0.4rem; }
.lesson-read ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.lesson-read li { margin-bottom: 0.3rem; }

/* Capa "Para ti" en el modal de lección */
.lesson-personalized {
  background: linear-gradient(180deg, rgba(244, 143, 177, 0.06), transparent);
  border: 1px solid rgba(244, 143, 177, 0.22);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.lesson-personalized-cta { text-align: center; }
.lesson-personalized-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.lesson-personalized-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.lesson-personalized-regen {
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.lesson-personalized h2 {
  font-size: 0.95rem;
  margin: 0.7rem 0 0.3rem;
  color: var(--text);
}
.lesson-personalized h2:first-child { margin-top: 0; }
.lesson-personalized ul,
.lesson-personalized ol { padding-left: 1.2rem; margin: 0.3rem 0; }
.lesson-personalized li { margin-bottom: 0.25rem; }
.lesson-personalized strong { color: var(--accent); font-weight: 600; }

.lesson-podcast { display: flex; flex-direction: column; gap: 0.7rem; }
.lesson-turns {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-top: 0.5rem;
}
.lesson-turn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.lesson-turn-coach {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.lesson-turn-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.lesson-practice {
  display: flex; flex-direction: column; gap: 0.6rem;
  font-size: 0.92rem;
}
.lesson-practice .primary {
  width: 100%;
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
}

@media (max-width: 480px) {
  .situations-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .situation-card { min-height: 130px; padding: 0.9rem; }
  .situation-icon { font-size: 1.7rem; }
  .situation-label { font-size: 0.95rem; }
  .learn-section-head { gap: 0.6rem; }
  .learn-section-icon { font-size: 1.6rem; }
}

/* ─── TAB PERFIL (cuenta + auditoría + ajustes) ─── */
.profile-subtabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0 0.5rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-subtabs::-webkit-scrollbar { display: none; }
.profile-subtab {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-width: max-content;
}
.profile-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ─── Mi cuenta cards ─── */
.account-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.9rem;
}
.account-balance {
  background: linear-gradient(135deg, rgba(244,143,177,0.18), rgba(201,164,255,0.15));
  border-color: rgba(244,143,177,0.3);
  text-align: center;
  padding: 1.4rem 1rem;
}
.account-balance-num {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.account-balance-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.account-balance-detail {
  margin-top: 1rem;
  width: 100%;
  font-size: 0.82rem;
}
.account-balance-detail .balance-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(244,143,177,0.18);
  text-align: left;
}
.account-balance-detail .balance-row:last-of-type { border-bottom: none; }
.account-balance-detail .balance-row span { color: var(--muted); }
.account-balance-detail .balance-row b { color: var(--text); font-weight: 700; }
.balance-hint {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
  line-height: 1.45;
}
.balance-hint b { color: var(--accent); }
.account-balance-cta-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}
.balance-cta {
  flex: 0 1 auto;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .balance-cta {
    flex: 1 1 calc(50% - 0.25rem);
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
  }
}
.account-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.account-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  flex: 1;
}
.account-card-head .ico-md {
  color: var(--accent);
  width: 20px;
  height: 20px;
}
.soon-pill {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
}
.account-soon { opacity: 0.85; }
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.account-row:last-child { border-bottom: none; }
.account-row-label { color: var(--muted); }
.account-row-val { color: var(--text); font-weight: 600; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-plan-val { text-transform: capitalize; }
.account-row-val.muted { color: var(--muted); font-weight: 400; font-style: italic; text-transform: none; }
.account-row-check { color: #6cd28a; font-weight: 600; }
.account-row-soon { opacity: 0.85; }

.account-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.4rem;
  text-align: left;
}
.account-link:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(244,143,177,0.05);
}
.account-link-arrow { color: var(--accent); font-weight: 700; }
.account-link[hidden] { display: none; }

.plan-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}
.plan-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  flex: 0 1 auto;          /* tamaño según contenido, no estirado */
  justify-content: center;
  white-space: nowrap;
  line-height: 1.1;
  text-decoration: none;   /* para los <a> también */
}
.plan-action .ico-sm {
  width: 14px;
  height: 14px;
}
.plan-action-secondary {
  background: rgba(244,143,177,0.10);
  color: var(--accent);
  border: 1px solid rgba(244,143,177,0.35);
}
.plan-action-secondary:hover {
  background: rgba(244,143,177,0.18);
  border-color: rgba(244,143,177,0.55);
}
/* Hint debajo de las acciones — más sutil */
#plan-portal-hint {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.7rem;
}

/* ─── Mi cuenta: link sutil "Gestionar plan y tokens" debajo del balance ─── */
.account-balance-manage {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem auto 0;
  padding: 0.55rem 1.1rem;
  background: rgba(244, 143, 177, 0.16);
  border: 1px solid rgba(244, 143, 177, 0.4);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.account-balance-manage:hover {
  background: rgba(244, 143, 177, 0.25);
  border-color: rgba(244, 143, 177, 0.6);
}
.account-balance-manage .ico-sm {
  width: 15px;
  height: 15px;
}
.account-balance-manage-arrow {
  margin-left: 0.15rem;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}

/* ─── Ajustes: Plan y facturación rediseñado como "tiles" ─── */
.billing-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.billing-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(244,143,177,0.18), rgba(201,164,255,0.15));
  border-radius: 14px;
  flex-shrink: 0;
  color: var(--accent);
}
.billing-card-icon .ico-md {
  width: 24px;
  height: 24px;
  margin: 0;
}
.billing-card-summary {
  flex: 1;
  min-width: 0;
}
.billing-card-plan {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  text-transform: capitalize;
  line-height: 1.2;
}
.billing-card-tokens {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Tiles 2×N grid en desktop, 1 columna en mobile */
.billing-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.billing-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: inherit;
}
.billing-tile:hover {
  border-color: var(--accent);
  background: rgba(244, 143, 177, 0.04);
  transform: translateY(-1px);
}
.billing-tile-accent {
  background: linear-gradient(135deg, rgba(244,143,177,0.12), rgba(201,164,255,0.08));
  border-color: rgba(244, 143, 177, 0.35);
}
.billing-tile-accent:hover {
  background: linear-gradient(135deg, rgba(244,143,177,0.20), rgba(201,164,255,0.14));
}
.billing-tile-danger {
  background: rgba(220, 80, 110, 0.06);
  border-color: rgba(220, 80, 110, 0.30);
}
.billing-tile-danger:hover {
  background: rgba(220, 80, 110, 0.12);
  border-color: rgba(220, 80, 110, 0.50);
}
.billing-tile-danger .billing-tile-icon { color: #d4536d; }
.billing-tile-danger .billing-tile-title { color: #d4536d; }

/* ─── Cómo te ven: preview hero ─── */
.showcase-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0.9rem 0;
}
@media (max-width: 640px) {
  .showcase-channels { grid-template-columns: 1fr; }
}
.showcase-channel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.showcase-channel:hover { border-color: rgba(244,143,177,0.4); }
.showcase-channel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.95rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.12), rgba(201,164,255,0.08));
  border-bottom: 1px solid var(--border);
}
.showcase-channel-head .ico-md { color: var(--accent); width: 20px; height: 20px; }
.showcase-channel-head h3 { margin: 0; font-size: 0.95rem; flex: 1; }
.showcase-channel-preview { padding: 0.9rem; min-height: 140px; }
.showcase-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.7rem; padding: 1rem 0.5rem;
  text-align: center;
}
.showcase-empty .muted { font-size: 0.82rem; line-height: 1.4; margin: 0; }
.showcase-preview-content {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.showcase-preview-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.72rem; line-height: 1.35; gap: 0.5rem;
}
.showcase-preview-line .label {
  color: var(--muted); flex-shrink: 0;
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.showcase-preview-line .val {
  color: var(--text); font-weight: 600; text-align: right; font-size: 0.78rem;
}

/* Score hero — ancla visual. Acentuado para incitar a reevaluarse. */
.showcase-score-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.10), rgba(201,164,255,0.06));
  border: 1px solid rgba(244,143,177,0.22);
  border-radius: 12px;
  margin-bottom: 0.6rem;
}
.showcase-score-hero.high { border-color: rgba(108,210,138,0.40); background: linear-gradient(135deg, rgba(108,210,138,0.12), rgba(108,210,138,0.04)); }
.showcase-score-hero.mid  { border-color: rgba(244,180,120,0.40); background: linear-gradient(135deg, rgba(244,180,120,0.12), rgba(244,180,120,0.04)); }
.showcase-score-hero.low  { border-color: rgba(220,80,110,0.35); background: linear-gradient(135deg, rgba(220,80,110,0.10), rgba(220,80,110,0.03)); }
.showcase-score-num {
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.showcase-score-hero.high .showcase-score-num { color: #4ea668; }
.showcase-score-hero.mid  .showcase-score-num { color: #c98230; }
.showcase-score-hero.low  .showcase-score-num { color: #c43d59; }
.showcase-score-meta { flex: 1; min-width: 0; }
.showcase-score-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}
.showcase-score-hint {
  font-size: 0.73rem;
  color: var(--text);
  line-height: 1.35;
  margin-top: 0.2rem;
  font-weight: 500;
}
.showcase-preview-cta {
  display: flex; gap: 0.45rem; margin-top: 0.4rem;
  flex-wrap: wrap;
}
.showcase-preview-cta button {
  flex: 1; min-width: 100px;
}

/* Historial de auditorías colapsable */
.showcase-history {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}
.showcase-history > summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.4rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.showcase-history > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s;
}
.showcase-history[open] > summary::before { transform: rotate(90deg); }
.showcase-history > summary:hover { color: var(--accent); }
.showcase-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.7rem;
}
@media (max-width: 640px) {
  .showcase-history-grid { grid-template-columns: 1fr; }
}
.showcase-history-col h4 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ─── Match-card: micro ✕ borrar (sólo desktop hover) ─── */
.match-delete-hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 50%;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}
.match-card:hover .match-delete-hover,
.match-delete-hover:focus { opacity: 0.65; }
.match-delete-hover:hover {
  opacity: 1 !important;
  color: #d4536d;
  background: rgba(220, 80, 110, 0.12);
}
.match-delete-hover .ico-xs { width: 11px; height: 11px; margin: 0; }
/* En touch (mobile/tablet) lo dejamos siempre visible con opacity baja —
   tamaño un poco mayor para alcanzar 24px (mínimo táctil iOS) sin parecer
   acción principal. Confirmación con confirm() evita borrado accidental. */
@media (hover: none) {
  .match-delete-hover {
    opacity: 0.45;
    width: 26px;
    height: 26px;
    margin-left: 4px;
  }
  .match-delete-hover .ico-xs { width: 12px; height: 12px; }
}

/* Asegura scrolling en la lista de matches */
#matches-list {
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 180px);
  padding-right: 2px;
}

/* ─── Practicar: hero rediseñado ─── */
.practice-hero {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.10), rgba(201,164,255,0.06));
  border: 1px solid rgba(244,143,177,0.25);
  border-radius: 16px;
  margin: 0.4rem 0 0.9rem;
}
.practice-hero-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  flex-shrink: 0;
}
.practice-hero-icon .ico-md { width: 22px; height: 22px; margin: 0; }
.practice-hero-body { flex: 1; min-width: 0; }
.practice-hero-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.practice-hero-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}
.practice-hero-sub b { color: var(--text); font-weight: 600; }
.practice-cta-row {
  display: flex;
  justify-content: center;
  margin-bottom: 0.6rem;
}
.practice-cta-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
}
.practice-cta-main .ico-sm { width: 16px; height: 16px; margin: 0; }
.practice-hint {
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  margin: 0;
  padding: 0 0.5rem;
}

/* Listado de cambios en preview showcase */
.showcase-preview-changes {
  margin: 0.3rem 0 0; padding-left: 1.1rem;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.45;
}
.showcase-preview-changes li {
  margin: 0.15rem 0;
}

/* ─── Audit detail: hero score grande + panel unificado + CTA final ─── */
.audit-hero {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.3rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.10), rgba(201,164,255,0.06));
  border: 2px solid rgba(244,143,177,0.30);
  border-radius: 18px;
  margin-bottom: 1.2rem;
}
.audit-hero.high { border-color: rgba(108,210,138,0.45); background: linear-gradient(135deg, rgba(108,210,138,0.12), rgba(108,210,138,0.04)); }
.audit-hero.mid  { border-color: rgba(244,180,120,0.45); background: linear-gradient(135deg, rgba(244,180,120,0.12), rgba(244,180,120,0.04)); }
.audit-hero.low  { border-color: rgba(220,80,110,0.40); background: linear-gradient(135deg, rgba(220,80,110,0.10), rgba(220,80,110,0.03)); }
.audit-hero-score {
  display: flex; align-items: baseline; gap: 0.25rem;
  flex-shrink: 0;
}
.audit-hero-num {
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 0.95;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.audit-hero.high .audit-hero-num { color: #4ea668; }
.audit-hero.mid  .audit-hero-num { color: #c98230; }
.audit-hero.low  .audit-hero-num { color: #c43d59; }
.audit-hero-out {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}
.audit-hero-body { flex: 1; min-width: 0; }
.audit-hero-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.audit-hero-hint {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.4;
  margin-top: 0.3rem;
  font-weight: 500;
}
@media (max-width: 480px) {
  .audit-hero { flex-direction: column; align-items: flex-start; padding: 1rem; gap: 0.7rem; }
  .audit-hero-num { font-size: 2.8rem; }
}

/* Narrativa unificada: clean lines en vez de párrafos con strong */
.audit-narrative .audit-verdict {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 0.9rem;
  font-weight: 500;
}
.audit-line {
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}
.audit-line:last-child { padding-bottom: 0; }
.audit-line-label {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.audit-line-val {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

/* Panel unificado — sin nombres ni angulos, solo bullets */
.audit-panel-insights {
  margin: 0;
  padding: 0;
  list-style: none;
}
.audit-panel-insights li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
}
.audit-panel-insights li:last-child { border-bottom: none; }
.audit-panel-insights li::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 1.05rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* CTA final motivacional */
.audit-cta-final {
  margin-top: 1.5rem;
  padding: 1.1rem;
  background: linear-gradient(135deg, rgba(244,143,177,0.10), rgba(201,164,255,0.06));
  border: 1px solid rgba(244,143,177,0.30);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}
.audit-cta-msg {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
  font-weight: 500;
  max-width: 360px;
}
.audit-cta-reaudit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
}
.audit-cta-reaudit .ico-sm { width: 14px; height: 14px; margin: 0; }

.audit-detail-footer {
  display: flex; justify-content: center;
  padding: 1.2rem 0 0.4rem;
  border-top: 1px dashed var(--border);
  margin-top: 1.2rem;
}
.audit-delete-btn-inline {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  background: transparent;
  border: none;
  cursor: pointer;
}
.audit-delete-btn-inline:hover { color: #d4536d; opacity: 1; }
.audit-delete-btn-inline .ico-sm { width: 13px; height: 13px; margin: 0; }

/* Botón copiar inline (sugerencias del panel) */
.inline-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(244,143,177,0.10);
  color: var(--accent);
  border: 1px solid rgba(244,143,177,0.30);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.inline-copy-btn:hover {
  background: rgba(244,143,177,0.20);
  border-color: rgba(244,143,177,0.50);
}
.inline-copy-btn .ico-xs {
  width: 11px;
  height: 11px;
  margin: 0;
}
.inline-copy-btn.copy-feedback-active {
  background: rgba(108,210,138,0.18);
  color: #4ea668;
  border-color: rgba(108,210,138,0.45);
}

/* Copy de mensajes literales en markdown (blockquotes del panel) */
.md-copy-wrap {
  position: relative;
  margin: 0.6rem 0;
}
.md-copy-wrap blockquote {
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: rgba(244,143,177,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
}
.md-copy-btn {
  display: inline-flex;
  margin-top: 0.35rem;
}
.audit-change-actions {
  margin-top: 0.55rem;
  display: flex;
  justify-content: flex-end;
}
.audit-bio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

/* ─── Fix mobile: padding y min-height del showcase preview ─── */
@media (max-width: 480px) {
  .showcase-channels { gap: 0.5rem; }
  .showcase-channel { border-radius: 14px; }
  .showcase-channel-head {
    padding: 0.6rem 0.75rem;
    gap: 0.45rem;
  }
  .showcase-channel-head h3 { font-size: 0.88rem; }
  .showcase-channel-head .ico-md { width: 18px; height: 18px; }
  .showcase-channel-preview {
    padding: 0.7rem 0.75rem;
    min-height: 0;  /* sin min-height en mobile */
  }
  .showcase-empty { padding: 0.6rem 0.4rem; gap: 0.5rem; }
  .showcase-empty .muted { font-size: 0.78rem; }
  .showcase-score-hero {
    padding: 0.65rem 0.75rem;
    gap: 0.6rem;
  }
  .showcase-score-num { font-size: 1.75rem; }
  .showcase-score-hint { font-size: 0.7rem; }
  .showcase-preview-cta {
    flex-direction: column;
    gap: 0.4rem;
  }
  .showcase-preview-cta button {
    width: 100%;
    flex: 1 1 100%;
  }
}
.billing-tile-wide {
  grid-column: 1 / -1;  /* ocupa toda la fila */
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}
.billing-tile-icon {
  color: var(--accent);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.billing-tile-icon .ico-md { width: 22px; height: 22px; }
.billing-tile-wide .billing-tile-icon { margin-right: 0.1rem; }
.billing-tile-wide .billing-tile-title,
.billing-tile-wide .billing-tile-sub {
  display: block;
}
.billing-tile-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.billing-tile-sub {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 480px) {
  .billing-actions-grid {
    grid-template-columns: 1fr;  /* 1 columna en mobile, sin truncado */
    gap: 0.55rem;
  }
  .billing-tile {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 0.9rem;
  }
  .billing-tile-icon {
    margin-right: 0.1rem;
  }
  .billing-card-head {
    gap: 0.7rem;
  }
  .billing-card-icon {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }
}

/* Botón destructivo (Borrar cuenta) */
.plan-action-danger {
  background: rgba(220, 80, 110, 0.10);
  color: #d4536d;
  border: 1px solid rgba(220, 80, 110, 0.35);
}
.plan-action-danger:hover {
  background: rgba(220, 80, 110, 0.18);
  border-color: rgba(220, 80, 110, 0.55);
}

/* Enlaces legales (Términos · Privacidad) — compactos, tipo footer */
.settings-legal-links {
  margin: 0.9rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.settings-legal-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
  padding-bottom: 1px;
}
.settings-legal-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.settings-legal-links span {
  opacity: 0.5;
}

/* Mobile: botones más estrechos, fila completa si no caben */
@media (max-width: 480px) {
  .plan-actions {
    gap: 0.4rem;
  }
  .plan-action {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    flex: 1 1 calc(50% - 0.2rem);   /* 2 por fila por defecto */
    min-width: 0;
  }
  /* Si hay 3 botones, el tercero ocupa fila completa */
  .plan-actions > .plan-action:nth-child(3):last-child {
    flex: 1 1 100%;
  }
  .plan-action span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@keyframes highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(244,143,177,0.6); }
  50%  { box-shadow: 0 0 0 10px rgba(244,143,177,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,143,177,0); }
}
.highlight-pulse {
  animation: highlight-pulse 1.4s ease-out;
  border-color: var(--accent);
}

/* ─── Showcase toggle (dating ↔ Instagram dentro de Mi escaparate) ─── */
.showcase-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  margin: 0.4rem 0 1rem;
  width: max-content;
}
.showcase-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.showcase-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.showcase-toggle-btn .ico-sm { width: 14px; height: 14px; }
.showcase-section[hidden] { display: none; }
.profile-pane { flex: 1; overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.profile-pane[hidden] { display: none; }
.profile-intro {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 1rem;
}
.profile-intro-title {
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  color: var(--accent);
}
.profile-intro-title .ico-md {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}
.profile-new-btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.audits-list {
  display: flex; flex-direction: column;
  gap: 0.6rem;
}
.audit-card {
  display: flex; flex-direction: column; gap: 0.4rem;
  width: 100%;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  position: relative;
  transition: border-color 0.15s;
}
.audit-card:hover { border-color: var(--accent); }
.audit-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.audit-date { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.audit-platform { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
.audit-summary {
  font-size: 0.85rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.audit-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  background: var(--accent-soft, rgba(214, 51, 108, 0.12));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.audit-score strong { font-weight: 700; }
.audit-score-suffix { font-size: 0.7em; opacity: 0.7; font-weight: 500; }
.audit-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  background: var(--bg-input);
}
.audit-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.audit-badge.processing {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.audit-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Detalle de audit */
.audit-detail { display: flex; flex-direction: column; gap: 1rem; }
.audit-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.audit-section h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--accent);
}
.audit-score-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.audit-score-big .asb-num {
  font-size: 2.4rem;
  font-weight: 700;
}
.audit-score-big .asb-suffix {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.6;
}
.audit-verdict {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.4rem 0;
}
.audit-attracts {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0.4rem 0;
}
.audit-change {
  display: flex; gap: 0.6rem;
  background: rgba(244, 143, 177, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}
.audit-change.p0 { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.05); }
.audit-change.p1 { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.audit-change.p2 { border-left-color: #10b981; background: rgba(16, 185, 129, 0.05); }
.audit-priority {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  background: var(--bg);
  border-radius: 4px;
  flex-shrink: 0;
  height: fit-content;
}
.audit-change-body { flex: 1; }
.audit-change-what {
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}
.audit-change-why { font-size: 0.78rem; line-height: 1.3; }
.audit-bio {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
}
.audit-bio-tone {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.audit-bio-text {
  font-size: 0.92rem;
  line-height: 1.45;
  font-style: italic;
  padding: 0.4rem 0;
}
.audit-bio-why { font-size: 0.78rem; }
.audit-next-step {
  background: linear-gradient(135deg, rgba(244, 143, 177, 0.15), rgba(244, 143, 177, 0.05));
  border-color: var(--accent);
}
.audit-files-preview {
  display: flex; gap: 0.4rem; overflow-x: auto;
  padding: 0.7rem 0;
  justify-content: center;
}
.audit-files-preview img {
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  opacity: 0.6;
}
.audit-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.audit-file-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.audit-file-card img {
  width: 100%; height: 180px;
  object-fit: cover;
  display: block;
}
.audit-file-verdict {
  font-size: 0.78rem;
  padding: 0.5rem 0.6rem;
  margin: 0;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .audit-files-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-file-card img { height: 140px; }
}
