/* ── TOKENS: DARK (default) ── */
:root {
  /* Material You — Dark rojizo */
  --bg-rgb: 26, 18, 18;
  --bg:         #1a1212;
  --card:       #251a1a;
  --card2:      #2e1f1f;
  --border:     rgba(255,200,200,0.10);
  --border2:    rgba(255,200,200,0.07);
  --border3:    rgba(255,200,200,0.05);
  --text:       #f5e6e6;
  --text2:      #c4a0a0;
  --text3:      #8c6464;
  --text4:      #6b4a4a;
  --label:      #c4a0a0;
  --accent:     #ef4444;
  --accent2:    #dc2626;
  --accent-dim: rgba(239,68,68,0.18);
  --header-bg:  rgba(26,18,18,0.80);
  --chip-bg:    rgba(239,68,68,0.08);
  --stat-bg:    rgba(239,68,68,0.06);
  --section-hd: rgba(239,68,68,0.05);
  --shadow:     0 16px 48px rgba(0,0,0,0.5);
}

/* ── TOKENS: LIGHT ── */
@media (prefers-color-scheme: light) {
  :root {
    /* Material You — Light rojizo */
    --bg-rgb: 252, 240, 240;
    --bg:         #fcf0f0;
    --card:       #ffffff;
    --card2:      #fff5f5;
    --border:     rgba(180,0,0,0.10);
    --border2:    rgba(180,0,0,0.07);
    --border3:    rgba(180,0,0,0.05);
    --text:       #1c0a0a;
    --text2:      #6b3030;
    --text3:      #9e5050;
    --text4:      #bb8080;
    --label:      #9e5050;
    --accent:     #c62828;
    --accent2:    #b71c1c;
    --accent-dim: rgba(198,40,40,0.10);
    --header-bg:  rgba(252,240,240,0.80);
    --chip-bg:    rgba(198,40,40,0.07);
    --stat-bg:    rgba(198,40,40,0.05);
    --section-hd: rgba(198,40,40,0.04);
    --shadow:     0 4px 20px rgba(180,0,0,0.12);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── UNIFIED FONT ── */
:root { --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html, body { font-family: var(--font); }
input, button, select, textarea { font-family: var(--font); }

html, body {
  width: 100%; height: 100%; max-height: 100%;
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px; color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;          /* no body scroll at all — each view manages its own */
  overscroll-behavior: none; /* kill pull-to-refresh and bounce */
  margin: 0; padding: 0;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y;
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ── LOADING ── */
#loadingScreen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); z-index: 200;
}
#loadingScreen h2 { display: none; }
.loading-logo {
  width: 160px; height: 160px;
  border-radius: 0; overflow: visible;
  background: transparent;
}
.loading-logo-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
/* ══════════════════════════════════════════════════════════════
   DERBY LOADER
══════════════════════════════════════════════════════════════ */
.derby-loader {
  margin-top: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

/* Row of 4 icons always visible */
.derby-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transition: gap 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.derby-icon {
  font-size: 22px;
  line-height: 1;
  user-select: none;
  display: block;
  opacity: 0.38;
  transform: scale(0.58);
  /* Spring bounce on scale, smooth on rest */
  transition:
    transform  0.5s  cubic-bezier(0.34, 1.7, 0.64, 1),
    opacity    0.3s  ease,
    filter     0.3s  ease,
    margin     0.45s cubic-bezier(0.34, 1.7, 0.64, 1);
  filter: none;
  margin: 0;
}

/* Active icon — spring bounce up */
.derby-icon.di-active {
  opacity: 1;
  transform: scale(1.6);
  filter:
    drop-shadow(0 0 7px rgba(255,210,0,0.95))
    drop-shadow(0 0 18px rgba(255,140,0,0.55));
  margin-left: -4px;
  margin-right: -4px;
}

/* Neighbors — subtle pull inward */
.derby-icon.di-near {
  margin-left: -5px;
  margin-right: -5px;
  transform: scale(0.62);
  opacity: 0.45;
  transition:
    transform  0.45s cubic-bezier(0.34, 1.5, 0.64, 1),
    opacity    0.3s  ease,
    filter     0.3s  ease,
    margin     0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
}

/* ── Label ── */
.derby-loader-text {
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.12em !important;
  color: var(--text4) !important; -webkit-text-fill-color: var(--text4) !important;
  margin: 0 !important; text-align: center;
  transition: opacity 0.3s;
  animation: derby-text-pulse 2s ease-in-out infinite;
}
@keyframes derby-text-pulse {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1;   }
}

/* ── UNAUTHORIZED ── */
#unauthorized {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 100;
}

/* ── HEADER ── */
.pf-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.pf-header-title {
  font-size: 20px !important; font-weight: 900 !important; font-style: italic !important;
  text-transform: uppercase !important; letter-spacing: -0.5px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
#user-email {
  font-size: 12px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── SCROLL ── */
.pf-scroll {
  padding-top: 72px; padding-bottom: 48px;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; min-width: 0;
}

/* ── ERROR BOX ── */
#perfil-error {
  display: none; width: 100%; max-width: 600px;
  margin: 0 auto 12px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent-dim);
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  font-size: 13px !important; font-weight: 500 !important;
}

/* ── TARJETA ── */
.pf-card {
  width: 100%; max-width: 600px;
  background: var(--card); border-radius: 2.5rem; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 0;
}

/* ── BANNER ── */
.pf-banner {
  height: 110px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  position: relative; overflow: hidden;
}
.pf-banner::after {
  content: 'roller_skating'; font-family: 'Material Icons';
  position: absolute; right: 8px; bottom: -12px;
  font-size: 130px; color: rgba(255,255,255,0.07);
  line-height: 1; pointer-events: none; user-select: none;
}

/* ── AVATAR ── */
.pf-avatar-wrap {
  display: flex; justify-content: center;
  margin-top: -50px; margin-bottom: 6px;
  position: relative; z-index: 2;
}
#avatar-container {
  position: relative; width: 100px; height: 100px;
  border-radius: 1.8rem; border: 5px solid var(--card);
  background: var(--card2); overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); cursor: default;
}
#avatar-container:not(.disabled) { cursor: pointer; }
#img-preview-foto { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-avatar-edit {
  position: absolute; bottom: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 9999px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--card);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#avatar-container:not(.disabled) .pf-avatar-edit { opacity: 1; }
.pf-avatar-edit .material-icons {
  font-size: 12px !important; color: #fff !important; -webkit-text-fill-color: #fff !important;
}
#avatar-loader {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.6);
}
#avatar-loader.hidden { display: none; }
#avatar-overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.6);
}
#avatar-overlay.flex { display: flex; }

/* ── HERO TEXT ── */
.pf-hero-text { text-align: center; padding: 4px 20px 8px; }
.pf-hero-name {
  font-size: 26px !important; font-weight: 900 !important; font-style: italic !important;
  text-transform: uppercase !important; letter-spacing: -0.4px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.1 !important; margin-bottom: 4px !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-hero-sub {
  font-size: 11px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.2em !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  margin-bottom: 8px !important;
}
.pf-hero-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pf-badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px;
  font-size: 10px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.4px !important;
}
.pf-badge-red {
  background: var(--accent-dim); color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important; border: 1px solid rgba(239,68,68,0.3);
}
.pf-badge-ghost {
  background: var(--chip-bg); color: var(--text2) !important;
  -webkit-text-fill-color: var(--text2) !important; border: 1px solid var(--border);
}

/* ── STATS ── */
.pf-stats {
  display: flex; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  margin: 12px 0 0;
}
.pf-stat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 8px; gap: 5px; text-align: center;
  background: var(--stat-bg);
  border-radius: 16px;
  border: 1px solid var(--border2);
}
.pf-stat .material-icons {
  font-size: 18px !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  opacity: 0.7;
}
.pf-stat-lbl {
  display: block !important; font-size: 8px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.3px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  line-height: 1.4 !important;
}
.pf-stat-val {
  display: block !important; font-size: 13px !important; font-weight: 800 !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  line-height: 1.3 !important; word-break: break-word !important;
}

/* ── BOTONES ── */
.pf-btn-wrap { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.pf-card-spacer { height: 28px; }
#btnEditar, #btnGuardar, #btnCancelar {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 18px; border-radius: 9999px;
  font-size: 14px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.1em !important;
  font-style: italic !important; cursor: pointer; border: none; line-height: 1 !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
#btnEditar, #btnGuardar {
  background: linear-gradient(145deg, #ff4d4d, #d61f1f) !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  box-shadow: 0 6px 18px rgba(239,68,68,0.38);
}
#btnCancelar {
  background: var(--chip-bg) !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
  border: 1px solid var(--border) !important; font-style: normal !important;
}
#btnEditar:active, #btnGuardar:active, #btnCancelar:active { transform: scale(0.98); }

/* ── SECCIONES ── */
.pf-section { padding: 0; }
.pf-divider { height: 1px; background: var(--border2); }

.pf-section-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 12px;
  background: var(--section-hd);
  border-bottom: 1px solid var(--border2);
}
.pf-section-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pf-section-ico .material-icons { font-size: 18px !important; }
.ico-blue   { background: rgba(59,130,246,0.14);  } .ico-blue   .material-icons { color: #60a5fa !important; -webkit-text-fill-color: #60a5fa !important; }
.ico-purple { background: rgba(168,85,247,0.14);  } .ico-purple .material-icons { color: #c084fc !important; -webkit-text-fill-color: #c084fc !important; }
.ico-teal   { background: rgba(20,184,166,0.14);  } .ico-teal   .material-icons { color: #2dd4bf !important; -webkit-text-fill-color: #2dd4bf !important; }
.ico-red    { background: rgba(239,68,68,0.14);   } .ico-red    .material-icons { color: #f87171 !important; -webkit-text-fill-color: #f87171 !important; }
.ico-orange { background: rgba(249,115,22,0.14);  } .ico-orange .material-icons { color: #fb923c !important; -webkit-text-fill-color: #fb923c !important; }

.pf-section-title {
  font-size: 15px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.4px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  font-style: italic !important;
}
.pf-section-title.rojo { color: #f87171 !important; -webkit-text-fill-color: #f87171 !important; }

/* ── PROFILE FIELD ── */
.profile-field {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 58px; padding: 12px 20px;
  border-bottom: 1px solid var(--border3); width: 100%;
}
.profile-field:last-child { border-bottom: none; }
.is-editing .profile-field { background: rgba(239,68,68,0.015); }

.pf-row-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border3);
}
.pf-row-2 .profile-field { border-bottom: none; }
.pf-row-2 .profile-field:first-child { border-right: 1px solid var(--border3); }

/* ── LABEL ── */
label {
  display: block !important; font-size: 9px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.8px !important;
  color: var(--label) !important; -webkit-text-fill-color: var(--label) !important;
  line-height: 1 !important; margin: 0 0 5px !important; padding: 0 !important;
  background: transparent !important; border: none !important;
  transition: color 0.2s;
}
label.accent { color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important; }

/* Labels rojos en modo edición */
.is-editing .profile-field label {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}

.field-help {
  font-size: 11px !important; color: var(--text4) !important;
  -webkit-text-fill-color: var(--text4) !important;
  line-height: 1.3 !important; margin: 0 0 4px !important;
}

/* ── EDITABLE ── */
.editable {
  display: block !important; width: 100% !important;
  background: transparent !important; border: none !important; outline: none !important;
  padding: 0 !important; margin: 0 !important;
  font-size: 15px !important; font-weight: 700 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.2px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.3 !important; border-radius: 0 !important;
  -webkit-appearance: none !important; opacity: 1 !important;
}
.editable.normal {
  font-style: normal !important; text-transform: none !important;
  font-weight: 500 !important; letter-spacing: 0 !important;
}
.editable:disabled {
  -webkit-text-fill-color: var(--text) !important;
  opacity: 1 !important; cursor: default !important;
}
.is-editing .editable:not(:disabled) {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  border-bottom: 1.5px solid rgba(239,68,68,0.5) !important; padding-bottom: 3px !important;
}
.is-editing .editable:not(:disabled):focus {
  border-bottom-color: var(--accent) !important; outline: none !important;
}
.campo-error {
  border-bottom: 1.5px solid var(--accent) !important;
  box-shadow: 0 1px 0 var(--accent) !important;
}

/* ── CUSTOM SELECT TRIGGER ── */
.custom-select-trigger {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  width: 100% !important; background: transparent !important; border: none !important;
  outline: none !important; padding: 0 !important; margin: 0 !important;
  font-size: 15px !important; font-weight: 700 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.2px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  text-align: left !important; cursor: default !important;
  -webkit-appearance: none !important; border-radius: 0 !important;
}
.custom-select-trigger::after { display: none !important; }
.custom-select-trigger:disabled { cursor: default !important; }
.is-editing .custom-select-trigger:not(:disabled) {
  border-bottom: 1.5px solid rgba(239,68,68,0.5) !important; padding-bottom: 3px !important;
  cursor: pointer !important;
}
.is-editing .custom-select-trigger:not(:disabled)::after {
  display: block !important;
  content: '›' !important; font-size: 22px !important; line-height: 1 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  flex-shrink: 0 !important; margin-left: 8px !important;
}

/* ── CHIPS ── */
.chip-wrapper {
  display: flex !important; flex-wrap: wrap !important;
  gap: 6px !important; padding-top: 4px !important;
}
.chip {
  padding: 6px 14px !important; border-radius: 9999px !important;
  font-size: 12px !important; font-weight: 700 !important;
  border: 1px solid var(--border) !important; cursor: pointer !important;
  white-space: nowrap !important; line-height: 1 !important;
  -webkit-tap-highlight-color: transparent !important; transition: all 0.15s ease !important;
}
.chip-inactive {
  background: var(--chip-bg) !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
}
.chip-active {
  background: var(--accent) !important; color: #fff !important;
  -webkit-text-fill-color: #fff !important; border-color: var(--accent) !important;
}
.chip.opacity-50 { opacity: 0.35 !important; cursor: default !important; }

/* ── FILE ROW ── */
.pf-file-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border3);
}
.pf-file-row:last-child { border-bottom: none; }
.pf-file-ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pf-file-ico .material-icons { font-size: 20px !important; }
.pf-file-lbl {
  font-size: 9px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.8px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  margin: 0 0 6px !important;
}
.file-status-vacio {
  font-size: 12px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
}
.file-status-ok { display: flex !important; align-items: center !important; gap: 8px !important; flex-wrap: wrap !important; }
.file-status-ok span { color: #4ade80 !important; -webkit-text-fill-color: #4ade80 !important; font-size: 12px !important; }

/* Pill "Ver archivo" */
.file-link {
  display: inline-flex !important; align-items: center !important;
  padding: 5px 14px !important; border-radius: 9999px !important;
  background: rgba(66,133,244,0.12) !important;
  color: #60a5fa !important; -webkit-text-fill-color: #60a5fa !important;
  font-size: 11px !important; font-weight: 800 !important;
  text-decoration: none !important; letter-spacing: 0.4px !important;
  text-transform: uppercase !important;
}
/* In edit mode, hide the "VER ARCHIVO" pill — only show upload button */
.is-editing .file-status-ok { display: none !important; }
.file-preview { margin-top: 8px !important; max-height: 90px !important; border-radius: 8px !important; border: 1px solid var(--border) !important; display: block !important; max-width: 100% !important; }
.pf-file-actions { display: none; margin-top: 6px; gap: 8px; flex-wrap: wrap; align-items: center; }
.is-editing .pf-file-actions { display: flex; }
.btn-file {
  display: inline-flex !important; align-items: center !important;
  padding: 7px 16px !important; border-radius: 9999px !important;
  font-size: 11px !important; font-weight: 800 !important; text-transform: uppercase !important;
  cursor: pointer !important; background: var(--accent-dim) !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  border: 1px solid rgba(239,68,68,0.25) !important;
  -webkit-tap-highlight-color: transparent !important;
}
.text-ok    { color: #4ade80 !important; -webkit-text-fill-color: #4ade80 !important; font-size: 11px !important; }
.text-error { color: #f87171 !important; -webkit-text-fill-color: #f87171 !important; font-size: 11px !important; }

/* ── EMAIL inline ── */
.pf-email-wrap {
  display: inline-flex; align-items: baseline; gap: 0; max-width: 100%;
}
.pf-email-suffix {
  font-size: 15px !important; font-weight: 500 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  white-space: nowrap !important; flex-shrink: 0 !important; font-style: normal !important;
}
#p-email {
  min-width: 20px !important; width: auto !important; flex: none !important;
  font-style: normal !important; text-transform: none !important; font-weight: 500 !important;
}

/* ── MODAL CROP ── */
/* ── CROP MODAL — bottom sheet style ── */
#modal-crop {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#modal-crop[style*="flex"] { display: flex; }
.crop-sheet {
  width: 100%; max-width: 520px;
  background: #111; 
  border-radius: 24px 24px 0 0;
  padding: 12px 0 0;
  display: flex; flex-direction: column;
  animation: crop-sheet-in 0.32s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes crop-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.crop-handle {
  width: 36px; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 14px;
}
.crop-title {
  font-size: 13px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.08em !important;
  color: rgba(255,255,255,0.5) !important; -webkit-text-fill-color: rgba(255,255,255,0.5) !important;
  text-align: center; margin: 0 0 14px !important;
}
.crop-area {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
  position: relative;
}
.crop-area img { display: block; max-width: 100%; }
.crop-hint {
  font-size: 11px !important; font-weight: 500 !important;
  color: rgba(255,255,255,0.35) !important; -webkit-text-fill-color: rgba(255,255,255,0.35) !important;
  text-align: center; margin: 10px 0 0 !important;
  letter-spacing: 0.02em !important;
}
.crop-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.crop-btn-cancel {
  flex: 1; padding: 16px; border-radius: 14px; border: none;
  background: rgba(255,255,255,0.1);
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-size: 13px !important; font-weight: 700 !important;
  font-family: inherit !important; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.crop-btn-rotate {
  width: 52px; height: 52px; border-radius: 14px; border: none; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.crop-btn-rotate .material-icons {
  font-size: 22px !important; color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.crop-btn-confirm {
  flex: 1.6; padding: 16px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, #ff3b3b 0%, #c41212 100%);
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-size: 13px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.08em !important;
  font-family: inherit !important; cursor: pointer;
  box-shadow: 0 4px 16px rgba(220,30,30,0.4);
  -webkit-tap-highlight-color: transparent;
}
.crop-btn-cancel:active  { opacity: 0.7; }
.crop-btn-rotate:active  { opacity: 0.7; }
.crop-btn-confirm:active { transform: scale(0.97); }

/* ── SELECTOR CENTRADO (reemplaza bottom sheet) ── */
.bs-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  display: flex; align-items: center; justify-content: center;
  -webkit-overflow-scrolling: auto;
}
.bs-overlay.active { opacity: 1; pointer-events: all; touch-action: none; }
.bs-panel {
  position: fixed; z-index: 1001;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 48px); max-width: 340px;
  background: var(--card2); border-radius: 20px;
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  max-height: 65vh; display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.bs-panel.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bs-handle { display: none; }
.bs-title {
  font-size: 11px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 1px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  padding: 16px 18px 12px; flex-shrink: 0; border-bottom: 1px solid var(--border2);
}
.bs-search-wrapper { padding: 10px 14px; border-bottom: 1px solid var(--border2); flex-shrink: 0; }
.bs-search {
  width: 100%; padding: 10px 16px;
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: 9999px; outline: none;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  font-size: 16px !important; 
  -webkit-appearance: none;
}
.bs-search::placeholder { color: var(--text3); }
.bs-search:focus { border-color: var(--accent); outline: none; }
.bs-options { overflow-y: scroll; flex: 1; -webkit-overflow-scrolling: touch; }
.bs-option {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 16px 18px; background: transparent; border: none;
  border-bottom: 1px solid var(--border3);
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  font-size: 16px !important; 
  text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bs-option:active { background: var(--chip-bg); }
.bs-option.selected { color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important; font-weight: 700 !important; }
.bs-option.selected::after { content: '✓'; }
.bs-empty {
  text-align: center; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  font-size: 14px !important; padding: 32px 0;
}

/* ── MISC ── */
input[type="file"] { display: none !important; }
.hidden-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── LOGIN ── */
#loginScreen, #unauthorized {
  position: fixed; inset: 0;
  display: flex; align-items: stretch; justify-content: center;
  background: var(--bg); z-index: 100;
  overflow: hidden;
}

/* ── Decorative bg rings (same style as wizard intro) ── */
.login-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.login-bg-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.07;
}
.login-bg-ring-1 {
  width: 500px; height: 500px; top: -200px; left: -180px;
  animation: intro-ring-pulse 5s ease-in-out infinite;
}
.login-bg-ring-2 {
  width: 300px; height: 300px; top: -80px; left: -60px;
  animation: intro-ring-pulse 5s ease-in-out 1s infinite;
}

/* ── Main layout ── */
.login-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 80px 32px 52px;
  box-sizing: border-box;
}

/* ── Hero section ── */
.login-hero {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}
.login-logo {
  width: 96px; height: 96px; object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}
.login-title {
  font-size: 22px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.3px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  margin: 0 !important; text-align: center;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.2s both;
}
.login-sub {
  font-size: 13px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  margin: 0 !important; text-align: center; letter-spacing: 0.5px;
  text-transform: uppercase; font-weight: 600;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}

/* ── CTA box ── */
.login-cta-box {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.45s both;
}
.login-instruction {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 16px; padding: 14px 18px;
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  text-align: center; line-height: 1.45 !important;
  margin: 0 !important; width: 100%; box-sizing: border-box;
}
.login-instruction-icon { font-size: 20px; flex-shrink: 0; }
.login-google-btn-wrap {
  display: flex; justify-content: center; align-items: center;
  min-height: 48px; width: 100%;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  width: 100%;
}
.login-divider span {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-divider em {
  font-style: normal;
  font-size: 12px;
  color: var(--text4);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.login-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.login-register-btn:active {
  background: var(--card);
}

/* Wizard step-0 note */
.wiz-step0-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
  text-align: left;
  margin-top: 8px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.5s both;
}
/* Wiz step-0 button animations */
#wiz-step-0 .wiz-intro-logo {
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}
#wiz-step-0 .wiz-intro-title {
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.2s both;
}
#wiz-step-0 .wiz-intro-sub {
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.35s both;
}
#wiz-step-0 #wiz-google-btn {
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.45s both;
}
#wiz-step-0 .wiz-btn-skip {
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.55s both;
}
.wiz-step0-note strong { color: var(--text); }

.login-disclaimer {
  font-size: 11px !important; color: var(--text4) !important;
  -webkit-text-fill-color: var(--text4) !important;
  text-align: center; line-height: 1.5 !important;
  margin: 0 !important;
}

/* ── Keep old .login-card for noEncontrado screen which still uses it ── */
.login-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 32px; background: var(--card); border-radius: 24px;
  max-width: 340px; width: 90%;
  text-align: center; box-shadow: var(--shadow);
}

.error-box {
  margin: 12px 16px 0; padding: 12px 16px;
  background: var(--accent-dim); border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px; color: var(--accent); font-size: 13px; line-height: 1.4;
}

/* ── TOGGLE ROW (Settings style) ── */
.profile-field-toggle {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 12px 20px;
  border-bottom: 1px solid var(--border3); width: 100%;
  gap: 16px;
}
.profile-field-toggle:last-child { border-bottom: none; }
.is-editing .profile-field-toggle { background: rgba(239,68,68,0.015); }
.ptf-label {
  font-size: 15px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.3 !important; flex: 1;
}
.is-editing .profile-field-toggle .ptf-label {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; flex-shrink: 0; }
.toggle-btn {
  position: relative; width: 52px; height: 30px;
  border-radius: 9999px; border: none; cursor: default;
  transition: background 0.25s ease; padding: 0;
  -webkit-tap-highlight-color: transparent; flex-shrink: 0;
  outline: none;
}
.toggle-btn:not(:disabled) { cursor: pointer; }
.toggle-off {
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.toggle-on  { background: var(--accent); box-shadow: none; }
.toggle-thumb {
  position: absolute; width: 24px; height: 24px;
  background: #fff; border-radius: 9999px;
  top: 50%; transform: translateY(-50%);
  transition: left 0.22s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.toggle-off .toggle-thumb { left: 3px; }
.toggle-on  .toggle-thumb { left: calc(100% - 27px); }
.toggle-text { display: none; }
.toggle-btn:disabled { opacity: 0.4; }

/* ══════════════════════════════════════════════════
   NAVEGACIÓN POR VISTAS
══════════════════════════════════════════════════ */
#appContent {
  width: 100%; height: 100dvh;
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
}
.app-view {
  position: absolute; top: 0; left: 0; width: 100%;
  min-height: 100%;
  display: none; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.app-view.active {
  display: flex;
  transform: translateX(0);
}
.app-view.slide-out {
  transform: translateX(-30%);
}

/* ── APP HEADER ── */
.app-header {
  position: sticky; top: 0; z-index: 50; min-height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  /* Gloss glass — same hue as bg, no border */
  background: rgba(var(--bg-rgb), 0.78);
  backdrop-filter: blur(28px) saturate(1.8) brightness(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(1.8) brightness(1.05);
  border-bottom: none;
  box-shadow: none;
  flex-shrink: 0;
}
.app-header-section {
  padding: 0 12px 0 8px; gap: 4px;
  height: auto !important;
  min-height: 60px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 10px; padding-bottom: 10px;
}
.app-header-title {
  font-size: 20px !important; font-weight: 900 !important; font-style: italic !important;
  text-transform: uppercase !important; letter-spacing: -0.5px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  flex: 1;
}
.app-header-section .app-header-title { font-size: 18px !important; }
.app-header-email {
  font-size: 12px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-back {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: transparent; display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.header-back .material-icons {
  font-size: 24px !important; color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}
.header-back:active { background: var(--chip-bg); }
.header-edit-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: transparent; display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.header-edit-btn .material-icons {
  font-size: 20px !important; color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}
.header-edit-btn:active { background: var(--chip-bg); }
.header-edit-btn.editing .material-icons {
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
}

/* ── APP SCROLL ── */
.app-scroll {
  flex: 1 1 0;
  overflow-y: scroll; -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  overscroll-behavior-y: contain;
  /* No side overflow / extra space */
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════
   HERO CARD (home)
══════════════════════════════════════════════════ */
.hero-card {
  background: var(--card); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.hero-banner { display: none; }
.hero-avatar-wrap { display: none; }
#avatar-container {
  position: relative; width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--card2); overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); cursor: pointer;
  flex-shrink: 0;
}
#img-preview-foto { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-avatar-edit {
  position: absolute; bottom: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 9999px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--card);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#avatar-container:not(.disabled) .pf-avatar-edit { opacity: 1; }
.pf-avatar-edit .material-icons { font-size: 11px !important; color: #fff !important; -webkit-text-fill-color: #fff !important; }
#avatar-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
#avatar-loader.hidden { display: none; }
#avatar-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
#avatar-overlay.flex { display: flex; }
.hero-text { text-align: center; padding: 0 16px 20px; }
.hero-name {
  font-size: 24px !important; font-weight: 900 !important; font-style: italic !important;
  text-transform: uppercase !important; letter-spacing: -0.4px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.1 !important; margin-bottom: 3px !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-sub {
  font-size: 11px !important; font-weight: 800 !important;
  text-transform: uppercase !important; letter-spacing: 0.2em !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  margin-bottom: 8px !important;
}
.hero-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.hero-stats {
  display: none;
}

/* ══════════════════════════════════════════════════
   SETTINGS LIST (home)
══════════════════════════════════════════════════ */
.settings-list {
  display: flex; flex-direction: column; gap: 8px;
  background: transparent;
}
.settings-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border: none; border-radius: 16px;
  background: var(--card);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s; min-height: 72px; box-shadow: none;
}
.settings-row:active { background: var(--card2); }
.settings-row-ico {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.settings-row-ico .material-icons { font-size: 24px !important; }
.settings-row-body { flex: 1; min-width: 0; }
.settings-row-title {
  display: block; font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.3 !important;
}
.settings-row-sub {
  display: block; font-size: 13px !important; font-weight: 400 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px !important;
}
.settings-row-arrow {
  font-size: 24px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   SECTION VIEWS — FIELDS
══════════════════════════════════════════════════ */
.sec-group {
  background: var(--card); border-radius: 18px;
  overflow: visible;
}
/* But clip inner items to rounded corners */
.sec-group > .sec-row:first-child { border-radius: 18px 18px 0 0; }
.sec-group > .sec-row:last-child  { border-radius: 0 0 18px 18px; }
.sec-group > .sec-row:only-child  { border-radius: 18px; }
.sec-group > .sec-row-toggle:first-child { border-radius: 18px 18px 0 0; }
.sec-group > .sec-row-toggle:last-child  { border-radius: 0 0 18px 18px; }
.sec-group > .sec-row-toggle:only-child  { border-radius: 18px; }

/* Regular row */
.sec-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border3);
  min-height: 68px;
}
.sec-row:last-child { border-bottom: none; }
.sec-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sec-row-label {
  font-size: 12px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.6px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  line-height: 1 !important;
  transition: color 0.2s;
}
/* Labels: default = muted, red ONLY when that specific view is being edited */
.sec-row-label {
  color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
}
.sec-toggle-label {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}
/* Red labels only inside the view that has is-editing */
.app-view.is-editing .sec-row-label {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.app-view.is-editing .sec-toggle-label {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.sec-input {
  display: block !important; width: 100% !important;
  background: transparent !important; border: none !important; outline: none !important;
  padding: 0 !important; margin: 0 !important;
  font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.3 !important; border-radius: 0 !important;
  -webkit-appearance: none !important; opacity: 1 !important;
}
.sec-input-bold { font-weight: 800 !important; font-style: italic !important; text-transform: uppercase !important; }
.sec-input-normal { font-weight: 400 !important; font-style: italic !important; }
.sec-input:disabled { -webkit-text-fill-color: var(--text) !important; opacity: 1 !important; cursor: default !important; }
.is-editing .sec-input:not(:disabled) {
  border-bottom: 1.5px solid rgba(239,68,68,0.5) !important;
  padding-bottom: 2px !important;
}
.is-editing .sec-input:not(:disabled):focus { border-bottom-color: var(--accent) !important; }

.sec-select-arrow {
  font-size: 20px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important; flex-shrink: 0;
}

/* Toggle row */
.sec-row-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; min-height: 64px; gap: 16px;
  border-bottom: 1px solid var(--border3);
}
.sec-row-toggle:last-child { border-bottom: none; }
.sec-toggle-label {
  font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  flex: 1;
}

/* Avatar row in section */
.sec-row-avatar { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sec-row-avatar:active { background: var(--chip-bg); }
.sec-avatar-preview {
  width: 48px; height: 48px; border-radius: 12px; overflow: hidden;
  background: var(--card2); flex-shrink: 0; position: relative;
}
.sec-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sec-avatar-edit-ico {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.is-editing .sec-avatar-edit-ico { opacity: 1; }
.sec-avatar-edit-ico .material-icons { font-size: 18px !important; color: #fff !important; -webkit-text-fill-color: #fff !important; }
.sec-row-title { font-size: 16px !important; font-weight: 600 !important; color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;  }
.sec-row-sub { font-size: 12px !important; color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;  }
.sec-row-arrow { font-size: 20px !important; color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important; flex-shrink: 0; }

/* File status inside sec-row */
.sec-file-status { margin-top: 2px; }
.sec-file-actions { display: none; margin-top: 6px; gap: 8px; flex-wrap: wrap; align-items: center; }
.is-editing .sec-file-actions { display: flex; }

/* Save/Cancel row */
.sec-save-wrap {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0;
}
.btn-save {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 18px; border-radius: 9999px;
  font-size: 14px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.1em !important;
  font-style: italic !important; cursor: pointer; border: none; line-height: 1 !important;
  background: linear-gradient(145deg, #ff4d4d, #d61f1f) !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  box-shadow: 0 6px 18px rgba(239,68,68,0.38);
  -webkit-tap-highlight-color: transparent;
}
.btn-cancel {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px; border-radius: 9999px;
  font-size: 13px !important; font-weight: 700 !important;
  text-transform: uppercase !important; cursor: pointer;
  border: 1px solid var(--border) !important; line-height: 1 !important;
  background: var(--chip-bg) !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
  -webkit-tap-highlight-color: transparent;
}
.btn-save:active { transform: scale(0.98); }
.btn-cancel:active { transform: scale(0.98); }

/* Chips inside sec-row */
.sec-row .chip-wrapper { padding-top: 6px; }

/* ══════════════════════════════════════════════════
   MULTISELECT MODAL (pronombres y futuros)
══════════════════════════════════════════════════ */
.ms-panel {
  max-height: 70vh;
  display: flex; flex-direction: column;
}
.ms-options {
  flex: 1; overflow-y: scroll; padding: 4px 0;
}
.ms-option-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 20px; border: none; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid var(--border3);
  transition: background 0.15s;
}
.ms-option-row:last-child { border-bottom: none; }
.ms-option-row:active { background: var(--chip-bg); }
.ms-option-row.ms-selected { background: var(--accent-dim); }
.ms-opt-label {
  font-size: 17px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.ms-check {
  font-size: 22px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
}
.ms-option-row.ms-selected .ms-check {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.ms-footer {
  display: flex; gap: 10px; padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.ms-footer .btn-cancel { flex: 1; padding: 14px; }
.ms-footer .btn-save   { flex: 2; padding: 14px; }

/* Multiselect trigger (pronombres row) */
.multiselect-trigger {
  display: flex !important; align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important; padding: 0 !important;
  background: transparent !important; border: none !important;
  cursor: default !important;
}
.multiselect-trigger.multiselect-editable { cursor: pointer !important; }
.ms-value {
  font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  flex: 1; text-align: left;
}
.ms-arrow {
  font-size: 22px !important; color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}

/* Fix: hide the extra static arrow below selects - only show the one in the row */
.sec-select-arrow { display: none !important; }

/* Select trigger: show chevron arrow inside the row when editing */
.custom-select-trigger {
  display: flex !important; align-items: center !important;
  justify-content: space-between !important;
  text-align: left !important; width: 100% !important;
  background: transparent !important; border: none !important; outline: none !important;
  padding: 0 !important; cursor: default !important;
  font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.is-editing .custom-select-trigger { cursor: pointer !important; }
.is-editing .custom-select-trigger::after {
  content: "chevron_right"; font-family: "Material Icons";
  font-size: 22px; color: var(--accent); -webkit-text-fill-color: var(--accent);
  flex-shrink: 0; margin-left: 4px;
}

/* Extra breathing room for rows with file upload or multi-line content */
.sec-row.sec-row-tall { min-height: 80px; align-items: flex-start; padding-top: 18px; padding-bottom: 18px; }
.sec-row-body.has-file { gap: 8px; }

/* Date picker trigger */
.date-picker-trigger {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  width: 100% !important; background: transparent !important; border: none !important;
  outline: none !important; padding: 0 !important; cursor: default !important;
  font-size: 18px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  -webkit-appearance: none !important;
}
.is-editing .date-picker-trigger { cursor: pointer !important; }
.is-editing .date-picker-trigger::after {
  content: "edit_calendar"; font-family: "Material Icons";
  font-size: 20px; color: var(--accent); -webkit-text-fill-color: var(--accent);
  flex-shrink: 0;
}

/* Date picker modal */
#date-picker-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  padding: 24px;
}
#date-picker-modal.active { display: flex; }
.dp-card {
  background: var(--card); border-radius: 28px;
  width: 100%; max-width: 340px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.dp-header {
  padding: 24px 24px 8px;
}
.dp-header-label {
  font-size: 12px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.6px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  margin-bottom: 4px;
}
.dp-selected-date {
  font-size: 32px !important; font-weight: 400 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  line-height: 1.2 !important;
}
.dp-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px;
}
#dp-nav-arrows { display: none !important; } /* arrows hidden — chips handle navigation */
.dp-nav-label {
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.dp-nav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.dp-nav-btn:active { background: var(--chip-bg); }
.dp-nav-btn .material-icons {
  font-size: 20px !important; color: var(--text2) !important;
  -webkit-text-fill-color: var(--text2) !important;
}
.dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; padding: 4px 12px 8px;
}
.dp-day-label {
  text-align: center; font-size: 11px !important; font-weight: 700 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  padding: 6px 0;
}
.dp-day {
  aspect-ratio: 1; border-radius: 50%; border: none; background: transparent;
  font-size: 14px !important; font-weight: 400 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; transition: background 0.15s;
}
.dp-day:hover { background: var(--chip-bg); }
.dp-day.dp-selected {
  background: var(--accent) !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-weight: 700 !important;
}
.dp-day.dp-other-month { color: var(--text4) !important; -webkit-text-fill-color: var(--text4) !important; }
.dp-day.dp-today:not(.dp-selected) {
  border: 1.5px solid var(--accent);
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.dp-error {
  margin: 0 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,59,48,0.12);
  border: 1px solid rgba(255,59,48,0.3);
  font-size: 13px !important; font-weight: 600 !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  text-align: center;
  animation: wiz-fade-up 0.2s ease both;
}
.dp-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 8px 16px 20px;
}
.dp-btn {
  padding: 10px 20px; border-radius: 9999px; border: none;
  font-size: 14px !important; font-weight: 700 !important;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  text-transform: uppercase !important; letter-spacing: 0.05em !important;
}
.dp-btn-cancel {
  background: transparent; color: var(--text2) !important;
  -webkit-text-fill-color: var(--text2) !important;
}
.dp-btn-cancel:active { background: var(--chip-bg); }
.dp-btn-ok {
  background: var(--accent); color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.dp-btn-ok:active { filter: brightness(0.9); }

/* Year/month picker inside date picker */
.dp-year-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 12px 16px 16px; max-height: 220px; overflow-y: scroll;
}
.dp-year-btn {
  padding: 12px 4px; border-radius: 12px; border: none;
  font-size: 15px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  background: transparent; cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.dp-year-btn.dp-year-selected {
  background: var(--accent) !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-weight: 700 !important;
}
.dp-year-btn:active { background: var(--chip-bg); }

/* ── EXTRA BREATHING ROOM ── */
.sec-row { padding: 18px 18px; }

/* Longer toggle labels wrap gracefully */
.sec-toggle-label { line-height: 1.3 !important; }

/* File action row spacing */
.sec-file-actions { margin-top: 8px; }

/* sec-row with file content */
.sec-row .sec-file-status + .sec-file-actions { margin-top: 6px; }

/* Chips hidden when not editing - show only trigger */
.chip-wrapper { display: none; }


/* Sec groups and rows: height always wraps content */
.sec-group, .sec-row, .sec-row-toggle { height: auto !important; }

/* sec-file-actions: hidden by default, shown in edit mode */
.sec-file-actions { display: none !important; }
.app-view.is-editing .sec-file-actions { display: flex !important; }

/* "VER ARCHIVO" pill: visible by default, hidden in edit mode */
.file-status-ok { display: flex !important; }
.app-view.is-editing .file-status-ok { display: none !important; }

/* Fix date picker month/year button white box */
.dp-nav-chips { display: flex; gap: 2px; align-items: center; }

/* sec-input italic: handled below */

/* ── 3. Header action buttons (save/cancel) - fixed in nav */
.header-actions {
  display: flex; align-items: center; gap: 8px;
  /* sits right in flex row after title */
}
.header-save-btn {
  padding: 7px 16px; border-radius: 9999px; border: none;
  background: var(--accent); cursor: pointer;
  font-size: 12px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.05em !important;
  font-style: italic !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.header-save-btn:active { filter: brightness(0.88); }
.header-cancel-btn {
  padding: 7px 14px; border-radius: 9999px; border: none;
  background: var(--chip-bg); cursor: pointer;
  font-size: 12px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.04em !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.header-cancel-btn:active { filter: brightness(0.88); }

/* Hide old save wrap at bottom */
.sec-save-wrap { display: none !important; }

/* Hide pencil edit button when in editing mode */
.app-view.is-editing .header-edit-btn { display: none !important; }

/* Selects and date: NOT italic */
.custom-select-trigger,
.date-picker-trigger,
.multiselect-trigger { font-style: normal !important; }

/* ── EDIT MODE: inputs & triggers keep normal text color (not red) ── */
.app-view.is-editing .sec-input,
.app-view.is-editing .custom-select-trigger,
.app-view.is-editing .date-picker-trigger,
.app-view.is-editing .multiselect-trigger,
.app-view.is-editing .ms-value {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}
/* Underline accent on editable fields instead */
.app-view.is-editing .sec-input:not(:disabled),
.app-view.is-editing .custom-select-trigger,
.app-view.is-editing .date-picker-trigger.enabled,
.app-view.is-editing .multiselect-trigger.multiselect-editable {
  border-bottom: 1.5px solid var(--accent) !important;
  padding-bottom: 2px !important;
}
/* Toggle labels in editing: accent only on LABEL (small caps), NOT on sec-toggle-label */
.app-view.is-editing .sec-toggle-label {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

/* select uppercase: handled below */

/* ── 5. Section labels (NOMBRE CIVIL etc): bold, no italic, uppercase ── */
.sec-row-label {
  font-weight: 700 !important;
  font-style: normal !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  font-size: 11px !important;
  color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
}

/* ── 4. Date picker footer: more breathing room ── */
.dp-footer {
  padding: 16px 20px 28px !important;
  gap: 12px !important;
}
.dp-btn {
  padding: 13px 24px !important;
  font-size: 14px !important;
}
.dp-year-grid {
  gap: 10px !important;
  padding: 16px 20px 16px !important;
}
.dp-year-btn {
  padding: 14px 4px !important;
  font-size: 15px !important;
  border-radius: 14px !important;
}

/* ── SECTION HEADER: stacked layout ── */
.app-header-section {
  flex-direction: column !important;
  align-items: stretch !important;
  height: auto !important;
  padding: 8px 12px 8px 8px !important;
  gap: 0 !important;
}
.header-row-top {
  display: flex; align-items: center; gap: 4px;
  min-height: 44px;
}
.header-row-top .app-header-title {
  flex: 1;
}
.header-row-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 4px 4px 6px;
}
/* In editing mode, show action row */
.app-view.is-editing .header-row-actions { display: flex !important; }
/* Hide pencil in edit mode */
.app-view.is-editing .header-edit-btn { display: none !important; }

/* ── STYLIZED CHEVRONS: thin CSS arrow, no Material icon font ── */
.settings-row-arrow,
.sec-row-arrow,
.sec-select-arrow {
  /* Hide the Material icon text, use CSS border arrow instead */
  font-family: none !important;
  font-size: 0 !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  width: 20px; height: 20px;
  display: flex !important; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.settings-row-arrow::after,
.sec-row-arrow::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-right: 2px solid var(--text3);
  border-top: 2px solid var(--text3);
  transform: rotate(45deg) translateX(-2px);
  border-radius: 1px;
}

/* ── FIX date-picker-trigger::after — remove "edit_calendar" text icon ── */
.is-editing .date-picker-trigger::after {
  content: '' !important;
  display: block;
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: rotate(45deg) translateX(-2px);
  border-radius: 1px;
  font-family: none !important;
}

/* ── is-editing select trigger arrow: thin red chevron ── */
.is-editing .custom-select-trigger::after {
  content: '' !important;
  display: block;
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: rotate(45deg) translateX(-2px);
  border-radius: 1px;
  font-family: none !important;
  flex-shrink: 0; margin-left: 8px;
}

/* ── STATS in generales section ── */
.sec-stats-group { background: var(--card) !important; }
.sec-stat-row {
  display: flex; gap: 0;
  padding: 4px 0;
}
.sec-stat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 16px 8px 18px;
  gap: 6px;
  border-right: 1px solid var(--border3);
}
.sec-stat:last-child { border-right: none; }
.sec-stat-ico {
  font-size: 18px !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
  opacity: 0.7;
}
.sec-stat-lbl {
  font-size: 9px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.5px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  text-align: center; line-height: 1.2;
}
.sec-stat-val {
  font-size: 12px !important; font-weight: 700 !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
  text-align: center; line-height: 1.3;
  text-transform: uppercase !important;
}

/* Hide old hero-stats (now empty) */
.hero-stats { display: none !important; }

/* ── HERO CARD — flat Android Settings style ── */
.hero-flat-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
}
.hero-avatar-flat {
  /* override inherited styles for flat layout */
}
.hero-flat-info {
  flex: 1; min-width: 0;
}
.hero-flat-info .hero-name {
  text-align: left !important;
  font-size: 22px !important;
  margin-bottom: 2px !important;
}
.hero-flat-info .hero-sub {
  text-align: left !important;
  font-size: 12px !important;
  margin-bottom: 0 !important;
}
.hero-flat-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-left: 0;
}
/* Camera icon always visible on hero avatar (no edit mode needed) */
.hero-avatar-flat .pf-avatar-edit {
  opacity: 1 !important;
}
/* hero-text and hero-badges: hide old centered ones */
.hero-text { display: none !important; }
.hero-badges { display: none !important; }
.hero-avatar-wrap { display: none !important; }

/* ── Fix double-arrow on select rows (the ::after + the static span) ── */
/* sec-select-arrow span: hide when arrow is shown via CSS ::after */
.sec-select-arrow { display: none !important; }
/* Only the CSS ::after on .custom-select-trigger and .date-picker-trigger shows the arrow */

/* ── Date picker trigger italic ── */
.date-picker-trigger {
  font-style: italic !important;
  text-transform: uppercase !important;
}

/* ════════════════════════════════════
   CONSOLIDATED FINAL OVERRIDES
   ════════════════════════════════════ */

/* Loading */
.loading-logo .material-icons { display: none; }

/* Favicon — no CSS needed, handled in HTML */

/* Font: single consistent stack for ALL inputs and text */
.sec-input, .custom-select-trigger, .date-picker-trigger,
.multiselect-trigger, .ms-value, .sec-row-label,
.sec-row-title, .sec-row-sub, .sec-toggle-label,
.app-header-title, .hero-name, .hero-sub {
  font-family: var(--font) !important;
}

/* All sec-input values: uppercase + italic */
.sec-input {
  font-style: italic !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
}
.sec-input-bold {
  font-weight: 800 !important;
  font-style: italic !important;
  text-transform: uppercase !important;
}
.sec-input-normal {
  font-weight: 600 !important;
  font-style: italic !important;
  text-transform: uppercase !important;
}
/* Selects and date: uppercase, NOT italic */
.custom-select-trigger,
.date-picker-trigger,
.multiselect-trigger,
.ms-value {
  font-style: normal !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  font-family: var(--font) !important;
}

/* Date picker trigger: italic specifically */
.date-picker-trigger {
  font-style: italic !important;
}

/* ── STATS: proper column alignment ── */
.sec-stat {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 18px 6px 20px !important;
  gap: 5px !important;
  text-align: center !important;
}
.sec-stat-ico {
  font-size: 18px !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
  flex-shrink: 0;
  display: block !important;
}
.sec-stat-lbl {
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  display: block !important;
  text-align: center !important;
  line-height: 1.2 !important;
  min-height: 22px !important; /* align across all 3 */
}
.sec-stat-val {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
  display: block !important;
  text-align: center !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
}

/* ── Date picker month/year CSS arrow (no Material icon) ── */

/* dp-nav-label: fix transparent bg */
.dp-nav-label {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  font-family: var(--font) !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
}

/* ── Header action row: slide-down animation ── */
.header-row-actions {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1),
              opacity    0.22s ease,
              padding    0.25s ease;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-row-actions.visible {
  max-height: 60px;
  opacity: 1;
  padding-top: 4px !important;
  padding-bottom: 8px !important;
}
/* Buttons animate in with slight scale */
.header-cancel-btn, .header-save-btn {
  transform: translateY(-6px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
              opacity   0.18s ease;
}
.header-row-actions.visible .header-cancel-btn {
  transform: translateY(0); opacity: 1;
  transition-delay: 0.04s;
}
.header-row-actions.visible .header-save-btn {
  transform: translateY(0); opacity: 1;
  transition-delay: 0.08s;
}


/* ════════════════════════════════════════════════════════════════
   TYPOGRAPHY SYSTEM — single source of truth, overrides all above
   
   SCALE:
   • Hero name        — 24px, 900, uppercase, italic  (identity)
   • Hero sub/badges  — 12px, 600, uppercase, normal  (metadata)
   • Section title (header) — 18px, 900, uppercase, italic  (nav)
   • Settings row title     — 16px, 600, normal, normal    (list)
   • Settings row sub       — 12px, 400, normal, normal    (preview)
   • Field label (caps)     — 10px, 700, uppercase, normal (key)
   • Field value (input)    — 17px, 600, uppercase, italic (value)
   • Field value bold       — 17px, 900, uppercase, italic (derby name/number)
   • Toggle label           — 16px, 500, normal, normal    (question)
   • Button text            — 12px, 800, uppercase, italic (CTA)
   • Stat label             — 9px,  700, uppercase, normal
   • Stat value             — 12px, 700, uppercase, italic
   ════════════════════════════════════════════════════════════════ */

/* Hero */
.hero-name {
  font-size: 24px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.5px !important; line-height: 1.1 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.hero-sub {
  font-size: 12px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.6px !important; line-height: 1.4 !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
}

/* Header / nav title */
.app-header-title {
  font-size: 18px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.3px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* Settings list rows */
.settings-row-title {
  font-size: 16px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: none !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.settings-row-sub {
  font-size: 12px !important; font-weight: 400 !important;
  font-style: normal !important; text-transform: none !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
}

/* Field labels (NOMBRE DERBY, etc.) */
.sec-row-label {
  font-size: 10px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.7px !important; line-height: 1 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
}
.app-view.is-editing .sec-row-label {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}

/* Field values — ALL inputs/selects/date share the same scale */
.sec-input,
.custom-select-trigger,
.date-picker-trigger,
.multiselect-trigger,
.ms-value {
  font-size: 17px !important; font-weight: 600 !important;
  font-style: italic !important; text-transform: uppercase !important;
  font-family: var(--font) !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
/* Bold variant — derby name/number/rol */
.sec-input-bold {
  font-weight: 900 !important;
}
/* Selects are NOT italic (it's a choice, not typed text) */
.custom-select-trigger,
.multiselect-trigger,
.ms-value {
  font-style: normal !important;
}

/* Toggle question label */
.sec-toggle-label {
  font-size: 16px !important; font-weight: 500 !important;
  font-style: normal !important; text-transform: none !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.app-view.is-editing .sec-toggle-label {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* Buttons */
.header-save-btn {
  font-size: 12px !important; font-weight: 800 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.header-cancel-btn {
  font-size: 12px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: uppercase !important;
}

/* Stats */
.sec-stat-lbl {
  font-size: 9px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.sec-stat-val {
  font-size: 12px !important; font-weight: 700 !important;
  font-style: italic !important; text-transform: uppercase !important;
}

/* Photo row sub-label */
.sec-row-title {
  font-size: 16px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: none !important;
  font-family: var(--font) !important;
}
.sec-row-sub {
  font-size: 12px !important; font-weight: 400 !important;
  font-style: normal !important; text-transform: none !important;
  font-family: var(--font) !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
}

/* Badges */
.pf-badge {
  font-size: 11px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}


/* ═══════════════════════════════════════════════════════
   DEFINITIVE OVERRIDES — these win over everything above
   ═══════════════════════════════════════════════════════ */

/* Font: Be Vietnam Pro everywhere */
* { font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif; }
input, button, select, textarea {
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ── 9. ALL inputs: NOT italic, lowercase (capitalize for readability) ── */
.sec-input,
.sec-input-bold,
.sec-input-normal,
.custom-select-trigger,
.date-picker-trigger,
.multiselect-trigger,
.ms-value {
  font-style: normal !important;
  text-transform: none !important;  /* keep natural case */
  font-family: "Be Vietnam Pro", sans-serif !important;
}
/* Still bold for derby name/number */
.sec-input-bold { font-weight: 800 !important; }
.sec-input { font-weight: 500 !important; font-size: 17px !important; }
.custom-select-trigger,
.date-picker-trigger,
.multiselect-trigger { font-weight: 500 !important; font-size: 17px !important; }

/* Field labels: small caps, bold, accent in editing */
.sec-row-label {
  font-size: 10px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
}
.app-view.is-editing .sec-row-label {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}

/* Toggle labels: natural, readable */
.sec-toggle-label {
  font-size: 16px !important; font-weight: 500 !important;
  font-style: normal !important; text-transform: none !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.app-view.is-editing .sec-toggle-label {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* Hero name */
.hero-name {
  font-size: 22px !important; font-weight: 800 !important;
  font-style: normal !important; text-transform: none !important;
  letter-spacing: -0.3px !important;
}
.hero-sub {
  font-size: 12px !important; font-weight: 500 !important;
  font-style: normal !important; text-transform: none !important;
}

/* Nav title */
.app-header-title {
  font-size: 17px !important; font-weight: 800 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
}

/* Settings list */
.settings-row-title {
  font-size: 16px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: none !important;
}
.settings-row-sub {
  font-size: 12px !important; font-weight: 400 !important;
  font-style: normal !important; text-transform: none !important;
}

/* Buttons */
.header-save-btn {
  font-size: 12px !important; font-weight: 800 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.header-cancel-btn {
  font-size: 12px !important; font-weight: 600 !important;
  font-style: normal !important; text-transform: uppercase !important;
}
.btn-file {
  font-size: 12px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
}

/* ── 8. SINGLE CLEAN ARROW on selects — kill all Material Icon ::before/::after ── */
/* Suppress ALL existing ::after/::before on triggers */
.custom-select-trigger::before,
.custom-select-trigger::after,
.date-picker-trigger::before,
.date-picker-trigger::after,
.sec-select-arrow { display: none !important; }

/* Only show arrow when editing, using CSS border (not Material icon) */
.app-view.is-editing .custom-select-trigger::after,
.app-view.is-editing .date-picker-trigger.enabled::after {
  content: "" !important;
  display: inline-block !important;
  width: 7px !important; height: 7px !important;
  border-right: 2px solid var(--accent) !important;
  border-top: 2px solid var(--accent) !important;
  transform: rotate(45deg) translateY(-1px) !important;
  border-radius: 1px !important;
  margin-left: 8px !important;
  flex-shrink: 0 !important;
  font-family: none !important;
  vertical-align: middle !important;
}

/* ── Photo upload blocker overlay ── */
#foto-upload-blocker {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}
.foto-blocker-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 32px 40px; border-radius: 20px;
  background: var(--card);
}
.foto-blocker-inner span {
  font-size: 15px !important; font-weight: 600 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.foto-blocker-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading: pure logo pulse, no bg color on logo box ── */
.loading-logo {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

/* ── Date picker: ensure month button is always clickable ── */

/* date-picker-trigger: always shows pointer */
.date-picker-trigger {
  cursor: pointer !important;
}
/* When NOT editing, show default cursor and muted appearance */
.date-picker-trigger:disabled,
.date-picker-trigger[disabled] {
  cursor: default !important;
  opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   HOME: GROUPED SETTINGS (Android-style single card)
═══════════════════════════════════════════════════════════ */
.settings-group {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.settings-row-grouped {
  border-radius: 0 !important;
  border-bottom: 1px solid var(--border3);
  background: transparent !important;
}
.settings-row-grouped:first-child { border-radius: 20px 20px 0 0 !important; }
.settings-row-last,
.settings-row-grouped:last-child  { border-radius: 0 0 20px 20px !important; border-bottom: none !important; }
.settings-row-grouped:active { background: var(--card2) !important; }

/* CSS chevron on grouped rows */
.settings-row-grouped .settings-row-arrow,
.settings-row-grouped .settings-row-arrow::after {
  display: block !important;
}
.settings-row-grouped .settings-row-arrow {
  width: 16px; height: 16px;
  display: flex !important; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-row-grouped .settings-row-arrow::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 2px solid var(--text3);
  border-top: 2px solid var(--text3);
  transform: rotate(45deg) translateX(-2px);
  border-radius: 1px;
}

/* ── Hero card: show chevron top-right ── */
.hero-card-clickable {
  position: relative;
  cursor: pointer;
}
.hero-card-clickable::after {
  content: '';
  position: absolute;
  top: 18px; right: 18px;
  width: 8px; height: 8px;
  border-right: 2.5px solid var(--text3);
  border-top: 2.5px solid var(--text3);
  transform: rotate(45deg);
  border-radius: 1px;
  pointer-events: none;
}

/* ── Date field: underline + calendar-edit icon in edit mode ── */
.date-picker-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1.5px solid transparent !important;
  padding: 0 0 2px !important;
  text-align: left !important;
  width: 100% !important;
  transition: border-color 0.2s !important;
}
.app-view.is-editing .date-picker-trigger {
  border-bottom-color: rgba(239,68,68,0.5) !important;
  cursor: pointer !important;
}
.date-picker-trigger .dp-trig-ico {
  display: none;
  font-size: 16px !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
  flex-shrink: 0;
}
.app-view.is-editing .date-picker-trigger .dp-trig-ico {
  display: block !important;
}

/* ── Date picker: smooth transitions when changing month/year ── */
#dp-days, #dp-year-grid {
  animation: dpFadeIn 0.18s ease;
}
@keyframes dpFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#dp-grid-wrap, #dp-year-grid {
  transition: opacity 0.15s ease;
}
/* Month label animates too */
#dp-month-label, #dp-year-label {
  display: inline-block;
  transition: opacity 0.12s ease;
}


/* ── Date picker: month/year as pill buttons ── */
.dp-nav-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 8px 14px !important;
  border-radius: 99px !important;
  border: 1.5px solid var(--border) !important;
  background: var(--card) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  cursor: pointer !important;
  pointer-events: all !important;
  transition: background 0.15s, border-color 0.15s !important;
  -webkit-tap-highlight-color: transparent !important;
}
.dp-nav-chip:active {
  background: var(--chip-bg) !important;
  border-color: var(--accent) !important;
}
/* No pseudo-content arrow — chip shape is enough affordance */
.dp-nav-chip::after { content: none; }

/* ── Month grid: 3 columns, same style as year grid ── */
.dp-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 16px 16px;
}
.dp-month-btn {
  padding: 14px 6px !important;
  border: none !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-align: center !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: background 0.15s !important;
  font-family: var(--font) !important;
}
.dp-month-btn:active {
  background: var(--chip-bg) !important;
}
.dp-month-selected {
  background: var(--accent) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 700 !important;
}

/* ══════════════════════════════════════════════════════════════
   NO ENCONTRADO — pantalla intermedia
══════════════════════════════════════════════════════════════ */
#noEncontradoScreen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); z-index: 100;
  overflow: hidden;
}

/* Animated rings background — same as login screen */
#noEncontradoScreen .login-bg {
  display: block;
}

/* Content container — same structure as login */
.no-enc-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 28px; width: 100%; max-width: 400px;
  gap: 0;
}
.no-enc-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 28px; text-align: center;
}
.no-enc-emoji {
  font-size: 52px; line-height: 1; margin-bottom: 4px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}
.no-enc-title {
  font-size: 26px; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; line-height: 1.15;
  text-align: center; margin: 0;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.2s both;
}
.no-enc-email-badge {
  font-size: 13px; color: var(--text3); font-weight: 500;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px; word-break: break-all;
  text-align: center; margin-top: 4px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}
.no-enc-cta-box {
  width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  animation: wiz-fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.45s both;
}
.no-enc-instruction {
  font-size: 14px; color: var(--text2); text-align: center;
  line-height: 1.5; margin: 0 0 4px;
}
/* Pre-size Google button slot to avoid layout jump when iframe loads */
#google-resignin-btn {
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.no-enc-or { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0; }
.no-enc-or span { flex: 1; height: 1px; background: var(--border); }
.no-enc-or em {
  font-size: 12px; font-style: normal;
  color: var(--text4); font-weight: 600; letter-spacing: 0.08em;
}
.no-enc-register-btn {
  display: flex; align-items: center;
  justify-content: center; gap: 6px;
  width: 100%; padding: 13px 20px;
  border-radius: 14px; border: 1.5px solid var(--border);
  background: transparent; color: var(--text);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background 0.18s;
}
.no-enc-register-btn:active { background: var(--card); }

/* ══════════════════════════════════════════════════════════════
   WIZARD DE REGISTRO — paso a paso
══════════════════════════════════════════════════════════════ */

#registroScreen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;      /* only allow vertical touch, kills lateral drift */
  width: 100%; height: 100%;
}

/* ── Header fijo ── */
.wiz-header {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 20px 6px 4px; min-height: 56px; flex-shrink: 0;
  background: var(--bg); border-bottom: 1px solid var(--border2);
  position: relative; z-index: 2;
}
.wiz-back-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.wiz-back-btn:active { background: var(--chip-bg); }
.wiz-back-btn .material-icons {
  font-size: 24px !important;
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.wiz-progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.wiz-progress-bar {
  height: 5px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.wiz-progress-fill {
  height: 100%; background: var(--accent); border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.wiz-step-label {
  font-size: 10px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.7px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
}

/* ── Viewport ── */
.wiz-viewport {
  flex: 1; position: relative;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ── Individual step ── */
.wiz-step {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg);
  box-sizing: border-box;
  width: 100%;
}
/* Inner scroll wrapper — has the padding and handles scroll */
.wiz-step-inner {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 24px 20px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.wiz-step.wiz-active {
  visibility: visible;
  pointer-events: auto;
}

/* ── Background emoji watermark ── */
.wiz-bg-emoji {
  position: absolute; bottom: -10px; right: -10px;
  font-size: 160px; line-height: 1;
  opacity: 0.06; pointer-events: none; user-select: none;
  transform: rotate(-12deg);
  z-index: 0;
}

/* ── Step content sits above bg emoji ── */
.wiz-emoji, .wiz-title, .wiz-desc, .wiz-content, .wiz-actions {
  position: relative; z-index: 1;
}

/* ── Emoji ── */
.wiz-emoji {
  font-size: 54px; line-height: 1; margin-bottom: 18px;
  user-select: none;
}

/* ── Entry animations ── */
@keyframes wiz-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Content: invisible until step becomes active, then fades in once after slide completes */
.wiz-step .wiz-step-inner {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}
.wiz-step.wiz-active .wiz-step-inner {
  animation: wiz-content-in 0.28s cubic-bezier(0.4,0,0.2,1) 0.30s both;
}
@keyframes wiz-content-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ── */
.wiz-title {
  font-size: 28px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.5px !important; line-height: 1.1 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  margin: 0 0 10px !important;
}
.wiz-desc {
  font-size: 15px !important; font-weight: 400 !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
  line-height: 1.65 !important; margin: 0 0 28px !important;
}

/* ── Content area ── */
.wiz-content { display: flex; flex-direction: column; gap: 12px; }

/* ── Actions area ── */
.wiz-actions {
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}

/* ── Buttons ── */
.wiz-btn-next, .wiz-btn-finish {
  display: flex !important; align-items: center !important;
  justify-content: center !important; gap: 8px !important;
  width: 100% !important; padding: 18px 24px !important;
  border-radius: 9999px !important; border: none !important;
  background: linear-gradient(135deg, #ff3b3b 0%, #c41212 100%) !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-size: 13px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.1em !important;
  cursor: pointer !important; -webkit-tap-highlight-color: transparent !important;
  box-shadow: 0 8px 24px rgba(220,30,30,0.35) !important;
  transition: transform 0.12s, box-shadow 0.12s !important;
}
.wiz-btn-next:active, .wiz-btn-finish:active {
  transform: scale(0.97) !important;
  box-shadow: 0 4px 12px rgba(220,30,30,0.25) !important;
}
.wiz-btn-next .material-icons,
.wiz-btn-finish .material-icons {
  font-size: 18px !important;
  color: rgba(255,255,255,0.9) !important; -webkit-text-fill-color: rgba(255,255,255,0.9) !important;
}
.wiz-btn-skip {
  background: transparent !important; border: none !important;
  font-size: 12px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.06em !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  padding: 10px !important; cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Spinning icon for loading state */
@keyframes wiz-spin { to { transform: rotate(360deg); } }
.wiz-spin { display: inline-block !important; animation: wiz-spin 0.9s linear infinite !important; }

/* ── Error toast at bottom ── */
.wiz-error-toast {
  position: absolute !important;
  bottom: 20px; left: 16px; right: 16px;
  background: var(--card) !important;
  border: 1.5px solid var(--accent) !important;
  border-radius: 14px !important; padding: 14px 16px !important;
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  z-index: 20 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.18) !important;
  animation: wiz-fade-up 0.2s ease both;
}

/* ── Avatar / foto ── */
.reg-foto-center {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding-top: 16px;
}
.reg-avatar {
  width: 160px; height: 160px; border-radius: 36px; flex-shrink: 0;
  background: var(--card2); border: 3px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
  -webkit-tap-highlight-color: transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.reg-avatar:active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(220,30,30,0.12);
}
.reg-avatar:active { border-color: var(--accent); }
.reg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-avatar-placeholder {
  font-size: 52px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
}
.reg-avatar-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
}
.reg-avatar-overlay .material-icons {
  font-size: 32px !important; color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.reg-foto-hint {
  font-size: 13px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important;
  text-align: center; margin: 0 !important;
  transition: color 0.3s;
}
.reg-foto-hint-compliment {
  font-size: 15px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  animation: compliment-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes compliment-pop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Shared field labels ── */
.reg-label {
  font-size: 10px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.8px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  margin: 0 !important;
}
.reg-required { color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important; }

/* ── Text inputs ── */
.reg-input {
  width: 100% !important; padding: 14px 16px !important;
  background: var(--card) !important; border: 1.5px solid var(--border) !important;
  border-radius: 14px !important; outline: none !important;
  font-size: 16px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  -webkit-appearance: none !important; box-sizing: border-box !important;
  font-family: inherit !important;
  /* force correct colors even when browser autofills or overrides */
  caret-color: var(--accent) !important;
}
.reg-input:-webkit-autofill,
.reg-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent) !important;
}
.reg-input:focus { border-color: var(--accent) !important; }
.reg-input::placeholder {
  color: var(--text4) !important; -webkit-text-fill-color: var(--text4) !important;
}
.wiz-big-input { font-size: 18px !important; padding: 16px 18px !important; }

/* ── Selector buttons ── */
.reg-selector-btn {
  display: flex !important; align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important; padding: 14px 16px !important;
  border-radius: 14px !important; border: 1.5px solid var(--border) !important;
  background: var(--card) !important;
  font-size: 15px !important; font-weight: 500 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  text-align: left !important; cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important; box-sizing: border-box !important;
  font-family: inherit !important;
}
.wiz-selector-btn { padding: 16px 18px !important; font-size: 16px !important; }
.reg-selector-btn.has-value .reg-selector-val {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}
.reg-selector-btn:active { background: var(--card2) !important; }
.reg-selector-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg-selector-ico {
  font-size: 18px !important; color: var(--text3) !important;
  -webkit-text-fill-color: var(--text3) !important; flex-shrink: 0; margin-left: 8px;
}

/* ── Phone row ── */
.reg-phone-row { display: flex; gap: 10px; align-items: stretch; width: 100%; }
.reg-codigo-btn { flex-shrink: 0 !important; width: 120px !important; min-width: 0 !important; }
.reg-tel-input  { flex: 1 !important; width: 0 !important; min-width: 0 !important; }

/* ── Wizard chips ── */
.wiz-chips { display: flex !important; flex-wrap: wrap !important; gap: 10px !important; }
.wiz-chips .chip { font-size: 15px !important; padding: 11px 22px !important; }
.wiz-chips-inline { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
.wiz-chips-inline .chip { font-size: 13px !important; padding: 8px 16px !important; }

/* ── Privacy box (paso 6) ── */
.wiz-privacy-box {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; margin-top: 4px;
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--border2);
}
.wiz-privacy-title {
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.6px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  margin: 0 !important;
}
.wiz-privacy-row { display: flex; flex-direction: column; gap: 8px; }
.wiz-privacy-q {
  font-size: 14px !important; font-weight: 500 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* ── Fine print ── */
.reg-note {
  text-align: center; font-size: 12px !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  line-height: 1.5 !important; margin: 0 !important;
}
.reg-note strong { color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important; }

/* ══════════════════════════════════════════════════════════════
   WIZARD — LOADING OVERLAY (full-screen)
══════════════════════════════════════════════════════════════ */
#wiz-loading-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  animation: wiz-overlay-in 0.35s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes wiz-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wiz-loading-content {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 0 32px;
}

/* ── Rink rings ── */
.wiz-loading-rink {
  position: relative;
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
}

.wiz-rink-ring {
  position: absolute; border-radius: 50%;
  border-style: solid; border-color: transparent;
}
.wiz-rink-ring-1 {
  width: 160px; height: 160px;
  border-width: 3px;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: wiz-spin-cw 1.1s linear infinite;
  opacity: 0.9;
}
.wiz-rink-ring-2 {
  width: 120px; height: 120px;
  border-width: 3px;
  border-bottom-color: var(--accent);
  border-left-color: var(--accent);
  animation: wiz-spin-ccw 1.4s linear infinite;
  opacity: 0.55;
}
.wiz-rink-ring-3 {
  width: 80px; height: 80px;
  border-width: 2px;
  border-top-color: var(--accent);
  animation: wiz-spin-cw 0.9s linear infinite;
  opacity: 0.3;
}

@keyframes wiz-spin-cw  { to { transform: rotate(360deg);  } }
@keyframes wiz-spin-ccw { to { transform: rotate(-360deg); } }

/* ── Skate emoji in the center ── */
.wiz-skater {
  position: relative; z-index: 2;
  font-size: 44px; line-height: 1;
  animation: wiz-skater-wobble 1.8s ease-in-out infinite;
  user-select: none;
}
@keyframes wiz-skater-wobble {
  0%,100% { transform: rotate(-8deg) scale(1);   }
  25%      { transform: rotate( 0deg) scale(1.08); }
  50%      { transform: rotate( 8deg) scale(1);   }
  75%      { transform: rotate( 0deg) scale(0.95); }
}

/* ── Text ── */
.wiz-loading-title {
  font-size: 22px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -0.3px !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  margin: 0 !important; text-align: center;
  animation: wiz-loading-pulse 2s ease-in-out infinite;
}
.wiz-loading-sub {
  font-size: 14px !important; font-weight: 500 !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  margin: 0 !important; text-align: center;
  min-height: 20px;
  transition: opacity 0.4s;
}
@keyframes wiz-loading-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── Optional badge on step title ── */
.wiz-optional-badge {
  display: inline-block;
  font-size: 11px !important; font-weight: 700 !important;
  font-style: normal !important; text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--text3) !important; -webkit-text-fill-color: var(--text3) !important;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 99px; padding: 2px 10px;
  vertical-align: middle; margin-left: 8px;
  position: relative; top: -3px;
}

/* ══════════════════════════════════════════════════════════════
   WIZARD INTRO SCREEN
══════════════════════════════════════════════════════════════ */
.wiz-intro-screen {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: stretch; justify-content: center;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  width: 100%; height: 100%;
}

/* ── Decorative rings in background ── */
.wiz-intro-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.wiz-intro-bg-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.07;
}
.wiz-intro-bg-ring-1 {
  width: 480px; height: 480px;
  top: -160px; right: -180px;
  animation: intro-ring-pulse 4s ease-in-out infinite;
}
.wiz-intro-bg-ring-2 {
  width: 320px; height: 320px;
  top: -80px; right: -100px;
  animation: intro-ring-pulse 4s ease-in-out 0.6s infinite;
}
.wiz-intro-bg-ring-3 {
  width: 160px; height: 160px;
  top: 0px; right: -20px;
  animation: intro-ring-pulse 4s ease-in-out 1.2s infinite;
}
@keyframes intro-ring-pulse {
  0%,100% { transform: scale(1);   opacity: 0.07; }
  50%      { transform: scale(1.05); opacity: 0.13; }
}

/* ── Content ── */
.wiz-intro-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: 52px 28px 40px;
  width: 100%; max-width: 420px;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* ── Logo / hero ── */
.wiz-intro-logo {
  font-size: 64px; line-height: 1; margin-bottom: 24px;
  animation: intro-logo-in 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes intro-logo-in {
  from { opacity:0; transform: scale(0.4) rotate(-20deg); }
  to   { opacity:1; transform: scale(1)   rotate(0deg);   }
}

/* ── Title ── */
.wiz-intro-title {
  font-size: 36px !important; font-weight: 900 !important;
  font-style: italic !important; text-transform: uppercase !important;
  letter-spacing: -1px !important; line-height: 1.05 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
  margin: 0 0 16px !important;
  animation: wiz-fade-up 0.4s cubic-bezier(0.4,0,0.2,1) 0.15s both;
}
.wiz-intro-title br { display: block; }

/* ── Sub ── */
.wiz-intro-sub {
  font-size: 15px !important; font-weight: 400 !important;
  line-height: 1.65 !important;
  color: var(--text2) !important; -webkit-text-fill-color: var(--text2) !important;
  margin: 0 0 32px !important;
  animation: wiz-fade-up 0.4s cubic-bezier(0.4,0,0.2,1) 0.25s both;
}

/* ── Step previews ── */
.wiz-intro-steps {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 36px;
  animation: wiz-fade-up 0.4s cubic-bezier(0.4,0,0.2,1) 0.35s both;
}
.wiz-intro-step {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border2);
  opacity: 0;
  animation: wiz-fade-up 0.35s cubic-bezier(0.4,0,0.2,1) both;
}
.wiz-intro-step-1 { animation-delay: 0.38s; }
.wiz-intro-step-2 { animation-delay: 0.46s; }
.wiz-intro-step-3 { animation-delay: 0.54s; }
.wiz-intro-step-4 { animation-delay: 0.62s; }
/* fill forward so they stay visible */
.wiz-intro-step { animation-fill-mode: both; }

.wiz-intro-step-ico { font-size: 24px; line-height: 1; flex-shrink: 0; }
.wiz-intro-step-txt {
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important;
}

/* ── CTA button ── */
.wiz-intro-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 20px 24px;
  border-radius: 9999px; border: none;
  background: linear-gradient(135deg, #ff3b3b 0%, #c41212 100%);
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  font-size: 15px !important; font-weight: 900 !important;
  text-transform: uppercase !important; letter-spacing: 0.1em !important;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 10px 28px rgba(220,30,30,0.38);
  transition: transform 0.12s, box-shadow 0.12s;
  animation: wiz-fade-up 0.4s cubic-bezier(0.4,0,0.2,1) 0.7s both;
  margin-bottom: 12px;
}
.wiz-intro-btn:active {
  transform: scale(0.97);
  box-shadow: 0 5px 14px rgba(220,30,30,0.28);
}
.wiz-intro-btn .material-icons {
  font-size: 20px !important;
  color: rgba(255,255,255,0.9) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.9) !important;
}
