/* ==========================================================================
   KreandoPY — sistema visual. Oscuro, mobile-first, minimalista, con acento
   por perfil (--accent) y una identidad de marca en lila (el logo "K flecha").
   ========================================================================== */
:root {
  /* Neutros con un toque lila, para que la marca se sienta en toda la app */
  --bg: #0E0B15;
  --surface: #15111D;
  --surface-2: #1C1726;
  --surface-3: #251F31;
  --border: #2B2437;
  --border-strong: #3B3249;
  --text: #F5F3FA;
  --text-2: #C3BDD0;
  --muted: #8A839A;
  /* Identidad de marca: los lilas del logo. --brand es el color sólido
     (enlaces, íconos activos, insignias); --brand-grad combina ambos para
     los botones principales; --on-brand es el texto encima de ellos.
     --logo-* son los colores exactos del ícono (scripts/generar_iconos.py). */
  --brand: #A78BFA;
  --brand-2: #E9D5FF;
  --brand-grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --on-brand: #1A0E3A;
  --logo-bg: #2E1A5C;
  --logo-light: #E9D5FF;
  --logo-mid: #A78BFA;
  --accent: var(--brand);
  --gold: #FFC53D;
  --ok: #3DD68C;
  --warn: #FFB224;
  --danger: #FF5C5C;
  --info: #5EB1FF;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 64px;
  --topbar-h: 56px;
  /* Ancho de un celular grande (iPhone Pro Max): la app nunca se estira más que esto */
  --app-w: 430px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

/* Quien prefiere menos movimiento igual ve la identidad (colores, formas),
   solo que sin las animaciones decorativas — requisito de accesibilidad
   que además revisan Apple y Google antes de publicar una app. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* El tamaño de la app no cambia: sin zoom por doble toque y sin rebote al
   llegar al final (en el iPhone el rebote deja la página "corrida"). */
html, body { overscroll-behavior: none; touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
/* Formato de app de celular en cualquier pantalla. En el teléfono ocupa todo el
   ancho; en una computadora se ve como un celular centrado. */
#app { width: 100%; max-width: var(--app-w); margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; }
@media (min-width: 431px) {
  body { background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--brand) 9%, #07060B), #07060B 70%) fixed; }
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); box-shadow: 0 0 80px rgba(0, 0, 0, .55); }
}
a { color: inherit; text-decoration: none; }
p a, .muted a, .center a { color: var(--brand); font-weight: 600; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.mt { margin-top: 1.6rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prewrap { white-space: pre-wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Shell ---------- */
.topbar {
  /* La altura suma la zona del reloj/notch: antes el padding superior se comía
     los 56px y el contenido quedaba aplastado arriba en el iPhone. */
  position: sticky; top: 0; z-index: 20; height: calc(var(--topbar-h) + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  transition: transform .25s ease;
  background: rgba(14, 11, 21, .82); backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--border);
}
/* Al bajar se esconde (queda solo la franja del reloj) y al subir vuelve */
.topbar.is-hidden { transform: translateY(calc(-1 * var(--topbar-h))); }
@media (prefers-reduced-motion: reduce) { .topbar { transition: none; } }
.brand { display: flex; align-items: center; gap: 9px; font: 800 19px/1 var(--display); letter-spacing: .06em; }
/* Logo en la cabecera y la portada: la "K flecha" (ui.js → logoMark) */
.brand-mark { width: 26px; height: 26px; flex: none; display: block; border-radius: 7px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--logo-mid) 25%, transparent); }
.topnav { display: none; }
.topnav a { padding: 7px 12px; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: 14px; transition: color .15s, background .15s; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.active { color: var(--text); background: var(--surface-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.role-chip { font-size: 12px; font-weight: 700; color: var(--text-2); border: 1px solid var(--border-strong); padding: 3px 10px; border-radius: 999px; }

.view { padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }

/* Con el teclado abierto las pestañas se van: si no, quedan flotando encima
   del teclado y le roban lugar a la conversación. */
body.kb-open .tabbar { transform: translateX(-50%) translateY(140%); pointer-events: none; }
/* --kb es el alto que tapa el teclado (app.js). En el navegador y en la PWA la
   ventana no se achica, así que el contenido se levanta esa altura. */
body.kb-open .view { padding-bottom: calc(16px + var(--kb, 0px)); }
.tabbar {
  transition: transform .22s ease;
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, var(--app-w)); z-index: 20; display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(18, 14, 26, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .15s; }
.tabbar a.active { color: var(--text); }
.tab-icon { position: relative; display: inline-block; transition: transform .25s var(--ease-spring); }
.tab-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s, stroke-width .2s; }
.tabbar a.active .tab-icon { transform: translateY(-2px); }
.tabbar a.active .tab-icon svg { stroke: var(--brand); stroke-width: 2.2; }
/* Puntito de marca que aparece bajo el ícono activo */
.tabbar a .tab-icon::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand-grad); transform: translateX(-50%) scale(0); transition: transform .2s var(--ease-spring);
}
.tabbar a.active .tab-icon::after { transform: translateX(-50%) scale(1); }


/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 700; font-size: 14.5px; transition: transform .18s var(--ease-spring), background .15s, opacity .15s, box-shadow .2s;
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { background: var(--accent); filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; }
/* Barrido de brillo al pasar el mouse: un destello diagonal que cruza el
   botón, reservado para los llamados a la acción de marca. */
.btn-primary::after, .btn-accent::after, .btn-premium::after {
  content: ""; position: absolute; inset: 0; translate: -130% 0 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
  transition: translate .55s ease;
}
.btn-primary:hover::after, .btn-accent:hover::after, .btn-premium:hover::after { translate: 130% 0 0; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.icon-btn.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.icon-btn.danger:hover { color: var(--danger); }

.input, .select {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus, .select:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.input::placeholder { color: #5F5F69; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.select-sm { min-height: 36px; padding: 6px 32px 6px 12px; font-size: 13px; border-radius: 10px; width: auto; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding-left: 14px; }
.input-prefix b { color: var(--muted); }
.input-prefix .input { border: 0; background: transparent; padding-left: 4px; box-shadow: none; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { grid-template-columns: 1fr; }
.field-inline { display: grid; grid-template-columns: 96px 1fr; align-items: center; }
@media (max-width: 420px) { .field-inline { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.card-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 14px; }
.card-block legend { font: 700 15px var(--display); padding: 0 6px; margin-left: -6px; }
.card-block .input, .card-block .select, .card-block .input-prefix { background: var(--bg); }
.sticky-save { position: sticky; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 5; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .15s; flex: none; }
.toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle.small > span { width: 34px; height: 20px; }
.toggle.small > span::after { width: 14px; height: 14px; }
.toggle.small input:checked + span::after { transform: translateX(14px); }
.toggle-field { align-self: end; min-height: 46px; }

/* ---------- Chips y segmentados ---------- */
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips:empty { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip-sm { padding: 5px 11px; font-size: 12.5px; }
.chip-removable { gap: 8px; }
.chip-removable button { border: 0; background: none; color: inherit; opacity: .6; font-size: 11px; padding: 0; margin: 0 -2px 0 2px; line-height: 1; }
.chip-removable button:hover { opacity: 1; color: var(--danger); }
.profile .chip.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.segmented button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--muted); }
.segmented button.on { background: var(--surface-3); color: var(--text); }
.segmented-sm { margin: 0; }
.segmented-sm button { padding: 5px 11px; font-size: 12.5px; }

/* ---------- Avatares, estrellas, niveles ---------- */
.avatar {
  --size: 44px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #000)); color: #fff; font-weight: 800; font-size: calc(var(--size) * .38);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 22px; font-size: 9px; }
.avatar-sm { --size: 30px; }
.avatar-md { --size: 44px; }
.avatar-lg { --size: 64px; }
.avatar-xl { --size: 104px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }

.stars { --v: 0; position: relative; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 1px; color: var(--surface-3); }
.stars::before { content: "★★★★★"; }
.stars::after { content: "★★★★★"; position: absolute; left: 0; top: 0; width: calc(var(--v) / 5 * 100%); overflow: hidden; color: var(--gold); white-space: nowrap; }
.stars.sm { font-size: 12px; }
.rating { font-weight: 700; font-size: 13.5px; }
.rating .star { color: var(--gold); }
.rating-new { color: var(--info); font-size: 12px; background: color-mix(in srgb, var(--info) 14%, transparent); padding: 2px 8px; border-radius: 99px; }

.tier {
  --tier: var(--muted); display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tier); border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent); background: color-mix(in srgb, var(--tier) 12%, transparent);
  padding: 2px 7px; border-radius: 6px; vertical-align: middle; flex: none; font-family: var(--font);
}
h1 .tier { font-size: 11px; transform: translateY(-3px); }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill-pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill-accepted { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.pill-delivered { background: color-mix(in srgb, #C86BFA 18%, transparent); color: #D79BFF; }
.pill-completed { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill-rejected, .pill-cancelled { background: var(--surface-3); color: var(--muted); }

/* ---------- Estados ---------- */
.loading { display: grid; place-items: center; padding: 64px 0; }
/* Chispa de marca: reemplaza el antiguo punto rojo de "grabando" por un
   destello en degradado, coherente con el logo animado de la cabecera. */
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-grad); animation: spark 1.1s ease-in-out infinite; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-2) 20%, transparent); }
@keyframes spark { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); grid-column: 1 / -1; }
.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 16px; }
.skeleton { pointer-events: none; }
.skeleton .ccard-media, .sk-line { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.3s infinite; }
.sk-line { height: 12px; border-radius: 6px; margin: 14px 14px 0; }
.sk-line.short { width: 50%; margin-bottom: 16px; }
@keyframes sk { to { background-position: -200% 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 650; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); color: #fff; }
#toast.ok { background: var(--ok); color: #06210F; }

.notice { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.notice-muted { color: var(--muted); }
.notice-ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice-accent { border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

/* ---------- Bienvenida ---------- */
.hero { max-width: 760px; margin: 12px auto 8px; padding: 8px 12px 0; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 99px; padding: 6px 14px 6px 12px; margin-bottom: 18px;
}
.hero-badge b { color: var(--text); letter-spacing: .04em; }
.hero-badge .rec-dot { width: 8px; height: 8px; box-shadow: none; animation: none; }
.hero h1 { font-size: 2rem; line-height: 1.04; letter-spacing: -.035em; }
.grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.05rem; color: var(--text-2); max-width: 560px; margin: 0 auto 26px; }
.role-cards { display: grid; gap: 12px; margin-bottom: 18px; text-align: left; animation: rise-in .6s var(--ease-spring) both; }
.role-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface); text-align: left; transition: border-color .2s, transform .3s var(--ease-spring), box-shadow .3s; width: 100%;
  position: relative; overflow: hidden;
}
.role-card:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: var(--shadow); }
.role-card strong { font: 750 1.2rem var(--display); }
.role-card-accent {
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%), var(--surface);
}
.role-card.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.role-emoji { font-size: 28px; display: inline-block; }
.role-cta { margin-top: 8px; font-weight: 700; color: var(--brand-2); font-size: 14px; transition: gap .2s; }

.section { margin-top: 40px; animation: rise-in .6s var(--ease-spring) both; }
.section-title { margin-bottom: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head a { color: var(--brand-2); font-weight: 700; font-size: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cat-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); transition: border-color .2s, transform .25s var(--ease-spring), box-shadow .25s;
}
.cat-tile:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-icon { font-size: 24px; display: inline-block; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.steps li > span { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-grad); color: var(--on-brand); font-weight: 800; }
.steps p { margin: 4px 0 0; font-size: 14px; }

/* Entrada suave de las secciones y grillas al montarse: la app se siente
   viva sin distraer de la lectura. */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Auth ---------- */
.auth { max-width: 420px; margin: 24px auto; }
.auth-wide { max-width: 640px; }
.stepper { display: flex; gap: 6px; margin-bottom: 24px; }
.stepper span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.stepper span.on { background: var(--brand); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.pick:hover { border-color: var(--border-strong); }
.pick.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.pick-icon { font-size: 22px; }
.spec-group { margin-bottom: 12px; }
.spec-group > .muted { margin-bottom: 6px; }

/* ---------- Páginas ---------- */
.page-head { margin-bottom: 16px; }
.page-head p { margin: 0; }
.narrow { max-width: 720px; margin: 0 auto; }
.back { display: inline-block; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }

.search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; min-height: 48px; min-width: 0; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; min-width: 0; height: 46px; }
.search:focus-within { border-color: var(--border-strong); }

/* Botón que abre el panel de filtros (ciudad, presupuesto, horario…) fuera
   de la pantalla principal, para que Explorar muestre solo lo esencial. */
.filters-btn { flex: none; min-height: 48px; padding: 0 16px; gap: 7px; }
.filters-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.filters-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--brand-grad); color: var(--on-brand); font-size: 11px; font-weight: 800;
}
/* La hoja del panel (.modal-sheet) usa overflow:visible para el selector de
   fecha/hora, así que este contenido más largo necesita su propio scroll
   interno — si no, el final del panel queda inalcanzable. */
.filters-body {
  padding: 4px 16px 22px; display: flex; flex-direction: column;
  max-height: calc(86vh - 64px); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.filters-body .filter-group:first-child { margin-top: 0; }
.when-hint { margin: -4px 0 10px; }
#specs { margin-top: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

/* ---------- Tarjetas de creador ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; animation: rise-in .5s var(--ease-spring) both; }
.ccard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .25s var(--ease-spring), border-color .2s, box-shadow .25s; position: relative;
}
.ccard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); }
.ccard-media { display: grid; gap: 2px; height: 170px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, #111), #111); position: relative; }
.ccard-media img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.ccard-media.m2 { grid-template-columns: 2fr 1fr; }
.ccard-media.m3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.ccard-media.m3 img:first-child { grid-row: span 2; }
.ccard-flag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.65); padding: 3px 8px; border-radius: 6px; }
.ccard-body { display: flex; gap: 10px; align-items: center; padding: 0 14px; margin-top: -20px; position: relative; }
.ccard-body .avatar { box-shadow: 0 0 0 3px var(--surface); }
.ccard-info { min-width: 0; padding-top: 22px; flex: 1; }
.ccard-name { display: flex; align-items: center; gap: 6px; font-weight: 750; font-size: 15.5px; }
.ccard-meta { font-size: 12.5px; color: var(--muted); }
.ccard-headline { margin: 10px 14px 0; font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 14px; margin-top: auto; }
.price { font-size: 13px; color: var(--muted); }
.price b { color: var(--text); }


/* ---------- Perfil ---------- */
.profile { max-width: 980px; margin: -16px auto 0; }
.cover { height: 180px; margin: 0 -16px; background: radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 70%, #000), var(--bg) 70%); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.profile-head { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin-top: -52px; padding: 0 4px; position: relative; }
.profile-id { flex: 1; min-width: 240px; }
.profile-id h1 { margin: 10px 0 2px; }
.headline { font-size: 15.5px; color: var(--text-2); margin: 8px 0 10px; max-width: 620px; }
.profile-cta { display: flex; gap: 8px; flex-wrap: wrap; }
/* flex-basis auto: cada botón toma el ancho de su texto y pasa a la línea siguiente si no entra.
   Con flex:1 (base 0) y overflow:hidden los botones se achicaban y cortaban el texto. */
.profile-cta { width: 100%; } .profile-cta .btn { flex: 1 1 auto; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ok); padding: 0 6px; }
.avail i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.avail.off { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 20px 0 14px; }
.stat { background: var(--surface); padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.stat b { font: 800 18px var(--display); letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat span:last-child { font-size: 11.5px; color: var(--muted); }
.stat b { font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.links a { font-size: 13px; font-weight: 650; color: var(--text-2); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); }
.links a:hover { color: var(--text); border-color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.masonry { columns: 2 160px; column-gap: 10px; }
.tile { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; position: relative; break-inside: avoid; background: var(--surface-2); }
.tile img, .tile video { width: 100%; height: auto; display: block; transition: transform .3s; }
.tile:hover img { transform: scale(1.03); }
.tile-ph { aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #111), #111); color: var(--text-2); }
.tile-star { position: absolute; top: 8px; left: 8px; color: var(--gold); background: rgba(0,0,0,.55); border-radius: 8px; padding: 2px 7px; font-size: 13px; }
.tile-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); font-size: 18px; padding-left: 4px; }
.tile-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 8px; font-size: 12.5px; font-weight: 650; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .2s; }
.tile:hover .tile-title { opacity: 1; }
@media (hover: none) { .tile-title { opacity: 1; } }

.services { display: grid; gap: 10px; }
.service { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.service p { margin: 4px 0 6px; font-size: 14px; }
.service .btn { align-self: flex-start; margin-top: auto; }
.service-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.service-price { font: 800 17px var(--display); white-space: nowrap; }
.service.is-off { opacity: .55; }
.service-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.criteria { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.crit { display: grid; grid-template-columns: 1fr 90px 30px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.reviews { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.review p { margin: 8px 0 0; color: var(--text-2); font-size: 14.5px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.review-author { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.review-score { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.about section { margin-bottom: 22px; }
.about p { color: var(--text-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- Modal / lightbox ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.8); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: calc(var(--app-w) - 32px); max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.modal-wide { max-width: var(--app-w); background: #000; }
/* Ventanas con texto o formulario: margen interno y lugar para la ✕ */
.modal:not(.modal-wide):not(.modal-sheet) { padding: 22px 20px 20px; }
.modal:not(.modal-wide):not(.modal-sheet) > h2:first-of-type { padding-right: 40px; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; }

/* ---------- Selector de fecha/hora (estilo iOS) ---------- */
.modal-backdrop.backdrop-bottom { align-items: end; justify-items: center; padding: 0; }
.modal-backdrop.backdrop-bottom .modal { max-width: var(--app-w); }
.modal.modal-sheet {
  border-radius: 20px 20px 0 0; max-height: 86vh; overflow: visible;
  padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .28s cubic-bezier(.32, .72, 0, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.picker-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--border); }
.picker-title { font-weight: 700; font-size: 15px; }
.picker-cancel, .picker-done { background: none; border: 0; font-size: 15px; padding: 8px 10px; border-radius: 8px; }
.picker-cancel { color: var(--muted); }
.picker-cancel:hover { color: var(--text); }
.picker-done { color: var(--brand); font-weight: 800; }
.picker-body { padding: 14px 10px 22px; }

.wheel-columns { display: flex; align-items: stretch; position: relative; }
.wheel-columns::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%);
  height: 40px; background: var(--surface-3); border-radius: 10px; pointer-events: none; z-index: 0;
}
.wheel-columns-3 .wheel:nth-child(1) { flex: 0.8; }
.wheel-columns-3 .wheel:nth-child(2) { flex: 1.3; }
.wheel-columns-3 .wheel:nth-child(3) { flex: 1; }
.wheel-columns-2 .wheel { flex: 1; }
.wheel-colon { align-self: center; font-size: 19px; font-weight: 700; color: var(--muted); position: relative; z-index: 1; }

.wheel {
  height: 200px; overflow-y: scroll; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 75%, transparent 100%);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-pad { height: 40px; flex: none; }
.wheel-item {
  height: 40px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center;
  font-size: 18px; color: var(--muted); user-select: none; cursor: pointer; transition: color .15s;
}
.wheel-item.is-selected { color: var(--text); font-weight: 700; }

.picker-field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 46px;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.picker-field:hover { border-color: var(--border-strong); }
.picker-field.is-empty { color: #5F5F69; }
.picker-field .picker-field-icon { flex: none; opacity: .7; font-size: 15px; }
.picker-field-clear {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--surface-3);
  color: var(--muted); font-size: 11px; line-height: 1; display: grid; place-items: center;
}
.picker-field-clear:hover { color: var(--text); }
.lightbox img, .lightbox video { width: 100%; max-height: 78vh; object-fit: contain; background: #000; }
.embed { position: relative; aspect-ratio: 16 / 9; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-info { padding: 14px 18px; background: var(--surface); }
.lightbox-info p { margin: 6px 0 0; }

/* ---------- Contratar ---------- */
.book-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.book-head h1 { margin: 0; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.option span { flex: 1; display: flex; flex-direction: column; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.option input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- Contrataciones ---------- */
.booking-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.booking-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.booking-row:hover { border-color: var(--border-strong); }
.booking-row.is-new { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.booking-info { flex: 1; min-width: 0; }
.booking-title { font-weight: 700; }
.booking-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.bd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bd-head h1 { margin-bottom: 4px; }
.progress { list-style: none; display: flex; padding: 0; margin: 20px 0; }
.progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); position: relative; text-align: center; }
.progress li i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--bg); position: relative; z-index: 1; }
.progress li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--surface-3); }
.progress li:first-child::before { display: none; }
.progress li.done { color: var(--text); }
.progress li.done i, .progress li.done::before { background: var(--ok); }
.progress li.current i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent); }
.party { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.party-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.facts-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.bd-desc { margin-top: 12px; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions .btn { flex: 1; }
.hint { margin-top: 8px; }
.review-form { background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border)); border-radius: var(--radius); padding: 16px; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.crit-input { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.star-input { display: flex; }
.star-input button { border: 0; background: none; font-size: 26px; line-height: 1; padding: 2px; color: var(--surface-3); transition: transform .1s, color .1s; }
.star-input button:hover { transform: scale(1.15); }
.star-input button.on { color: var(--gold); }
.review-avg { text-align: right; font-size: 13px; color: var(--muted); }
.review-avg b { font: 800 20px var(--display); color: var(--text); margin-left: 6px; }
.chat { margin-top: 24px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.msg { max-width: 80%; align-self: flex-start; }
.msg p { margin: 0; background: var(--surface-3); padding: 9px 13px; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; word-break: break-word; }
.msg span { font-size: 11px; color: var(--muted); padding: 0 6px; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg.mine p { background: var(--text); color: var(--bg); border-radius: 16px 16px 4px 16px; text-align: left; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Editar perfil ---------- */
.edit-hero { position: relative; margin-bottom: 64px; }
.edit-cover { display: block; height: 150px; border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; background: radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 70%, #000), var(--bg) 70%); }
.edit-cover img { width: 100%; height: 100%; object-fit: cover; }
.edit-avatar { position: absolute; left: 18px; bottom: -52px; cursor: pointer; }
.edit-badge { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.edit-avatar .edit-badge { right: -2px; bottom: 4px; padding: 4px 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); position: relative; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.swatch-custom { background: conic-gradient(#A78BFA, #10B981, #FFC53D, #FF9A3D, #FF3B7F, #7C4DFF, #10B981); overflow: hidden; }
.swatch-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dropzone { display: grid; place-items: center; text-align: center; min-height: 110px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); cursor: pointer; font-weight: 600; }
.dropzone:hover { border-color: var(--text-2); }
.dropzone input { display: none; }
.dropzone small { display: block; font-weight: 500; margin-top: 4px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pitem { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pitem-media { aspect-ratio: 1; background: var(--surface-2); }
.pitem-media img { width: 100%; height: 100%; object-fit: cover; }
.pitem-media .tile-ph { aspect-ratio: 1; }
.pitem-body { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px; }
.pitem-actions { display: flex; gap: 4px; flex: none; }

/* ---------- Horario de disponibilidad ---------- */
.schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.schedule-day { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; flex-wrap: wrap; }
.schedule-day-label { flex: 0 0 92px; font-weight: 700; font-size: 13.5px; }
.schedule { display: flex; flex-direction: column; gap: 10px; }
.schedule-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.schedule-row .muted { flex: 0 0 92px; }
.schedule-compact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.schedule-compact .schedule-row { font-size: 13px; }

/* ---------- Selector de ciudad ---------- */
.city-field { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Filtros de búsqueda (ciudad / cuándo) ---------- */
.filter-group { margin: 14px 0; }
.filter-label { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.when-add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.when-add-row .picker-field { flex: 1 1 150px; min-height: 44px; }

/* ---------- Insignia de mensajes sin leer ---------- */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 10px; font-weight: 800;
  line-height: 1; vertical-align: top;
}
.topnav a .tab-badge { margin-left: 5px; }
.tab-icon .tab-badge { position: absolute; top: -4px; right: -8px; box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Mensajes ---------- */
.chat-conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.conv-row:hover { border-color: var(--border-strong); }
.conv-row.is-unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-row.is-unread .conv-name { font-weight: 800; }
.conv-last { margin-top: 2px; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.conv-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
/* Conversación a pantalla completa: sin la cabecera de la app ni las pestañas,
   solo la persona con la que hablás, los mensajes y el cuadro de texto. La
   pantalla no se desplaza: lo que se desplaza es la lista de mensajes. */
body.chat-full .topbar, body.chat-full .tabbar, body.chat-full #banner { display: none; }
body.chat-full .view { padding: 0; }
.chat-screen { display: flex; flex-direction: column; height: 100dvh; }
.chat-head {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: calc(6px + env(safe-area-inset-top)) 12px 8px;
  background: rgba(14, 11, 21, .9); backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--border);
}
.chat-back { font-size: 30px; line-height: 1; color: var(--text); padding: 0 6px 4px 0; flex: none; }
.chat-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.chat-who b { display: block; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who small { color: var(--muted); font-size: 12px; }
.chat-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 8px;
}
.chat-start { margin: auto 0; }
.chat-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  transition: padding-bottom .25s cubic-bezier(.32, .72, 0, 1);
  background: var(--surface); border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; min-width: 0; height: 42px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 21px; padding: 0 16px; font: 15px var(--font);
}
.chat-input:focus { outline: none; border-color: color-mix(in srgb, var(--brand) 60%, var(--border-strong)); }
.chat-send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: var(--on-brand); font-size: 17px; line-height: 1;
  display: grid; place-items: center; padding-left: 2px;
}
.chat-send:active { transform: scale(.94); }
.chat-blocked { justify-content: space-between; color: var(--muted); font-size: 13.5px; }
/* Con el teclado abierto la barra se pega al teclado: sin la franja de abajo
   del iPhone (con el teclado no hay barra de inicio) y, en el navegador y la
   PWA —donde la ventana no se achica—, levantada lo que ocupa el teclado. */
body.kb-open .chat-bar { padding-bottom: calc(6px + var(--kb, 0px)); }
body.kb-open .chat-bar .chat-input, body.kb-open .chat-bar .chat-send,
body.kb-open .chat-bar .attach-btn { transition: none; }

/* ---------- Premium ---------- */
:root { --gold-2: #FFD86B; }
.premium-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800;
  color: #3A2A00; background: linear-gradient(135deg, var(--gold), var(--gold-2));
  padding: 2px 8px; border-radius: 6px; vertical-align: middle; flex: none;
}
.ccard.is-premium { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent); }
.ccard-featured {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; color: #3A2A00;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); padding: 3px 9px; border-radius: 6px;
}
.btn-premium {
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3A2A00; border-color: transparent;
  font-weight: 800; box-shadow: 0 6px 20px rgba(255, 197, 61, .25);
}
.btn-premium:hover { filter: brightness(1.05); }

.page-head.center { text-align: center; }
.plan-grid { display: grid; gap: 14px; margin: 22px 0; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 20px; display: flex; flex-direction: column; }
.plan-card h2 { margin-bottom: 2px; }
.plan-card-premium { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%), var(--surface); }
.plan-card.is-current { box-shadow: 0 0 0 2px var(--text); }
.plan-ribbon { position: absolute; top: -11px; right: 18px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3A2A00; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.plan-benefits { list-style: none; margin: 16px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-2); flex: 1; }
.plan-benefits li { display: flex; gap: 8px; }
.plan-current-tag { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 700; cursor: default; }

.plan-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; margin-top: 14px; }
.plan-mini.is-premium { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.plan-mini p { margin: 2px 0 0; }

/* ==========================================================================
   Avisos, favoritos, moderación, cuenta y contrapropuestas
   ========================================================================== */

/* --- Botones y piezas de formulario que faltaban --- */
.btn-danger { background: var(--danger); color: #1A0B0B; border-color: var(--danger); font-weight: 700; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
.btn-quiet { color: var(--muted); padding: 0 10px; }
.btn-quiet:hover { color: var(--danger); }
.btn.is-on { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
/* min-width en 0 para que el texto largo no desborde el botón en pantallas
   angostas; el flex-basis reparte el ancho disponible. */
.row-buttons .btn { flex: 1 1 130px; min-width: 0; }
.mt-sm { margin-top: 8px; }
.input-sm { min-height: 38px; padding: 0 10px; font-size: 14px; }
.ok-line { color: var(--ok); margin: 0; }
.warn-line { color: var(--warn); margin: 4px 0 0; }
.link { color: var(--brand); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font: 700 16px var(--display); margin: 0; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* --- Cabecera: campanita, guardados, moderación --- */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--brand); color: var(--on-brand); font: 700 10px/16px var(--font);
  text-align: center; box-shadow: 0 0 0 2px var(--bg); }

/* --- Banda de aviso bajo la cabecera --- */
.app-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border));
  padding: 9px 16px; font-size: 13.5px; }
.app-banner .banner-close { margin-left: auto; border: 0; background: none; color: var(--muted);
  font-size: 14px; padding: 4px 6px; }

/* --- Corazón de "guardar creador" ---
   Abajo a la derecha: arriba ya están la cinta "Destacado" (derecha) y el
   cartel "No disponible" (izquierda). */
.fav-btn { position: absolute; bottom: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(14, 11, 21, .62); backdrop-filter: blur(6px); color: #fff;
  font-size: 17px; line-height: 1; display: grid; place-items: center; z-index: 2; }
.fav-btn:hover { background: rgba(14, 11, 21, .85); }
.fav-btn.is-on { color: var(--brand); }
.ccard-media { position: relative; }

/* --- Filtros nuevos de Explorar --- */
.nearby-toggle { margin-top: 8px; }
.range-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.field-inline { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 110px; }
.range-row .select { flex: 1; min-width: 150px; }

/* --- Lista de avisos --- */
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; }
.note.is-unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.note-icon { font-size: 19px; line-height: 1.2; flex: none; }
.note-body { min-width: 0; flex: 1; }
.note-title { font-weight: 700; }
.note-text { margin: 3px 0 0; color: var(--text-2); font-size: 13.5px; }
.note-foot { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* --- Panel de moderación --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px;
  margin: 0 0 16px; }
.stat-grid .stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; gap: 2px; }
.stat-grid .stat.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.stat-num { font: 800 22px var(--display); letter-spacing: -.02em; }
.stat-label { font-size: 11.5px; color: var(--muted); text-align: center; }

.mod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mod-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px; }
.mod-main { min-width: 0; flex: 1 1 260px; }
.mod-user { display: flex; gap: 10px; align-items: flex-start; }
.mod-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.mod-target { margin: 6px 0 0; font-size: 14px; }
.mod-target a { color: var(--brand); font-weight: 600; }
.mod-detail { margin: 6px 0 0; color: var(--text-2); font-style: italic; }
.mod-item { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 13.5px; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-sm { min-height: 38px; padding: 0 12px; flex: 1; }
.search-sm input { height: 36px; }

/* --- Contrapropuesta de precio --- */
.proposal { display: flex; flex-direction: column; gap: 10px; }
.proposal p { margin: 4px 0 0; }

/* --- Respuesta a una reseña --- */
.review-reply { margin-top: 10px; padding: 9px 12px; border-left: 2px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.review-reply p { margin: 3px 0 0; color: var(--text-2); font-size: 14px; }
.review-reply-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* --- Adjunto en el chat --- */
.attach-btn { display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  font-size: 17px; cursor: pointer; }
.attach-btn:hover { border-color: var(--border-strong); }
.msg-img { display: block; margin: 0 0 6px; }
.msg-img img { display: block; max-width: 220px; max-height: 260px; width: auto; border-radius: 10px; }

/* Paginación de Explorar */
.load-more { display: flex; justify-content: center; padding: 22px 0 6px; }

/* Consentimiento en el registro y pie legal */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); line-height: 1.45; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--brand); }
.consent a { color: var(--brand); font-weight: 600; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 48px 0 8px;
  padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Cuenta: ajustes, ganancias, bloqueados */
.toggle.setting { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; font-weight: 400; }
.toggle.setting > span { margin-top: 2px; }
.toggle.setting div { display: flex; flex-direction: column; gap: 2px; }
.toggle.setting small { font-size: 12.5px; }
.block-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.block-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.block-list li .btn { margin-left: auto; }
.legal-links { display: flex; gap: 18px; justify-content: center; font-size: 13px; margin: 8px 0 0; }
.legal-links a { color: var(--muted); }

/* Perfil: completitud y menú de opciones */
.completeness { background: var(--surface); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-radius: var(--radius); padding: 14px 16px; margin: 18px 0 0; }
.completeness-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.progress-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 8px; }
.progress-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; }
.completeness ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.completeness a { color: var(--brand); font-weight: 600; }
.action-sheet { display: flex; flex-direction: column; padding: 8px; }
.action-sheet-title { text-align: center; padding: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.action-sheet button { border: 0; background: none; padding: 15px; font-size: 16px; font-weight: 600; border-top: 1px solid var(--border); }
.action-sheet button:hover { background: var(--surface-2); }
.action-sheet button.danger { color: var(--danger); }

/* Pagos */
.demo-banner { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-radius: 10px; padding: 8px 12px; text-align: center; font-weight: 700; font-size: 13px; margin-bottom: 14px; }
.checkout { text-align: center; padding: 26px 20px; }
.checkout h1 { font-size: 2.2rem; margin: 4px 0 6px; }

/* Espacio de almacenamiento */
.storage { margin: 18px 0 0; }
.progress-bar.is-full i { background: var(--warn); }

/* Admin: métricas y errores */
.funnel { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.funnel li { display: grid; grid-template-columns: 110px 1fr 48px 36px; align-items: center; gap: 10px; font-size: 13.5px; }
.funnel b { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-track { height: 10px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.funnel-track i { display: block; height: 100%; background: var(--brand); border-radius: 4px; min-width: 2px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.bars { position: relative; height: 110px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); }
.bar { flex: 1; min-width: 2px; height: max(var(--h), 1px); background: var(--brand); border-radius: 4px 4px 0 0; position: relative; }
.bar:hover { background: var(--brand-2); }
.bar::before { content: ""; position: absolute; inset: -110px -1px 0; }  /* área de hover más grande que la barra */
.bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 3; pointer-events: none; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.error-msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.error-detail { background: var(--bg); border-radius: 8px; padding: 10px; font-size: 11.5px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
details.mod-main summary { cursor: pointer; list-style: none; }

/* ---------- Apertura de la app (splash con motion) ----------
   Vive en index.html para verse desde el primer cuadro, antes de que cargue el
   JavaScript. app.js lo retira cuando la app está lista. No bloquea toques. */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: none;
  /* El nombre y la frase van debajo de la ficha sin ocupar lugar, así que el
     conjunto se sube: si no, todo queda pesado hacia abajo. */
  padding-bottom: 130px;
  background: var(--bg); transition: opacity .6s ease, visibility .6s;
}
/* El resplandor aparece de a poco: el primer cuadro es igual a la pantalla de
   carga nativa de iOS (fondo liso + ficha lila vacía, del mismo tamaño y en el
   centro), así el paso de una a otra no se nota. */
#splash::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 40% at 50% 50%, color-mix(in srgb, var(--logo-mid) 18%, transparent), transparent 70%);
  animation: splash-fade 1.2s ease .9s both;
}
#splash.splash-out { opacity: 0; visibility: hidden; }
#splash.splash-out .splash-stage { transform: scale(1.08); }
.splash-stage { position: relative; transition: transform .7s cubic-bezier(.4, 0, .2, 1); }
.splash-mark { width: 102px; height: 102px; position: relative; animation: splash-beat .6s var(--ease-spring) 1.25s both; }
.splash-logo { position: relative; display: block; width: 100%; height: 100%; }
.splash-logo * { transform-box: fill-box; }
/* 1) la barra de la K crece desde abajo  2) llegan las dos mitades de la
   flecha y se encastran  3) la ficha late, sale una onda y pasa un brillo */
.sp-stem { transform-origin: 50% 100%; animation: splash-stem .6s cubic-bezier(.2, .8, .2, 1) .15s both; }
.sp-top { animation: splash-top .65s var(--ease-spring) .6s both; }
.sp-bottom { animation: splash-bottom .65s var(--ease-spring) .72s both; }
.sp-shine { opacity: .22; animation: splash-shine .9s ease-in-out 1.35s both; }
.splash-wave {
  position: absolute; inset: 0; border-radius: 22%; border: 2px solid var(--logo-mid); opacity: 0;
  animation: splash-wave 1.4s cubic-bezier(.2, .7, .3, 1) 1.25s both;
}
.splash-wave:nth-of-type(2) { animation-delay: 1.5s; border-color: var(--logo-light); }
.splash-word, .splash-tag { position: absolute; left: 50%; white-space: nowrap; }
.splash-word { top: calc(100% + 24px); display: flex; font: 800 34px/1 var(--display); letter-spacing: .01em; overflow: hidden; padding: 4px 2px; transform: translateX(-50%); }
.splash-word span { display: inline-block; animation: splash-letter .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(1.3s + var(--i) * 60ms); }
.splash-word .splash-py { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 1px; }
.splash-tag { top: calc(100% + 76px); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); animation: splash-tag .8s ease 2s both; }
@keyframes splash-stem { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes splash-top { from { transform: translate(90px, -90px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-bottom { from { transform: translate(90px, 90px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-shine { from { transform: translateX(0); } to { transform: translateX(900px); } }
@keyframes splash-beat { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.07); } }
@keyframes splash-wave { from { transform: scale(.95); opacity: .8; } to { transform: scale(2.1); opacity: 0; } }
@keyframes splash-letter { from { transform: translateY(110%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-tag { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Portada y entrada (pantalla completa, sin cabecera ni pestañas) ---------- */
body.bare .topbar, body.bare .tabbar, body.bare #banner { display: none; }
body.bare .view { padding: 0 24px; }
.btn-lg { min-height: 54px; border-radius: 16px; font-size: 16px; }
.input-lg { min-height: 54px; border-radius: 14px; font-size: 16px; padding: 0 16px; }

.welcome {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative;
  padding: calc(20px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
}
/* Luces de marca que se mueven despacio detrás de todo */
.w-aurora { position: absolute; inset: 0 -24px; overflow: hidden; pointer-events: none; z-index: 0; }
.w-aurora span { position: absolute; width: 320px; height: 320px; border-radius: 50%; filter: blur(70px); opacity: .45; }
.w-aurora span:nth-child(1) { background: var(--brand); top: 6%; left: -30%; animation: drift-a 14s ease-in-out infinite alternate; }
.w-aurora span:nth-child(2) { background: var(--brand-2); top: 22%; right: -35%; opacity: .3; animation: drift-b 17s ease-in-out infinite alternate; }
.w-aurora span:nth-child(3) { background: #0EA5E9; bottom: 18%; left: 10%; width: 220px; height: 220px; opacity: .14; animation: drift-a 20s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(90px, 60px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-80px, 90px) scale(.9); } }
.welcome > :not(.w-aurora) { position: relative; z-index: 1; }

.w-brand { display: flex; align-items: center; gap: 9px; font: 800 18px/1 var(--display); letter-spacing: .04em; animation: rise-in .6s var(--ease-spring) both; }
.w-main { margin-top: auto; padding-top: 48px; }
.w-title { font-size: 2.6rem; line-height: 1.02; letter-spacing: -.04em; margin: 0 0 14px; animation: rise-in .7s var(--ease-spring) .08s both; }
.w-sub { font-size: 16px; color: var(--text-2); margin: 0; animation: rise-in .7s var(--ease-spring) .16s both; }

/* Categorías pasando solas: dan idea de qué hay sin agregar texto para leer */
.w-marquee {
  margin: 34px -24px 0; overflow: hidden; animation: rise-in .7s var(--ease-spring) .24s both;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.w-track { display: flex; gap: 8px; width: max-content; animation: marquee 28s linear infinite; }
.w-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
@keyframes marquee { to { transform: translateX(calc(-50% - 4px)); } }

.w-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 40px; animation: rise-in .7s var(--ease-spring) .32s both; }
.w-actions .btn-primary { background: var(--brand-grad); color: var(--on-brand); }
.w-actions .btn-ghost { border-color: var(--border-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.w-legal { display: flex; justify-content: center; gap: 8px; margin-top: 18px; font-size: 12px; color: var(--muted); }
.w-legal a:hover { color: var(--text); }

.auth-screen { margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 0 32px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-back { width: 44px; height: 44px; margin-left: -10px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.auth-back:hover { background: var(--surface-2); color: var(--text); }
.auth-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-screen h1 { font-size: 2rem; letter-spacing: -.035em; margin: 32px 0 6px; }
.auth-screen > .muted { margin-bottom: 28px; }
.auth-screen .form { gap: 12px; }
.auth-forgot { align-self: flex-end; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin: -2px 2px 8px; }
.auth-forgot:hover { color: var(--text); }
.auth-screen .btn-primary { background: var(--brand-grad); color: var(--on-brand); }
.auth-alt { margin-top: auto; padding-top: 32px; text-align: center; color: var(--muted); font-size: 14px; }

/* Denunciar contenido: un mensaje ajeno se toca para ver opciones */
.msg[data-msg]:not([data-msg=""]) { cursor: pointer; }
.review-flag { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 2px 6px; margin-left: 4px; border-radius: 6px; }
.review-flag:hover { color: var(--danger); background: var(--surface-2); }
.mod-excerpt { margin: 4px 0 8px; padding: 8px 10px; border-left: 3px solid var(--danger); background: var(--surface-2); border-radius: 6px; font-size: 14px; white-space: pre-wrap; }
.offline { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.plan-price { margin: 2px 0 6px; font-size: 15px; color: var(--text-2); }
.plan-price b { font: 800 1.5rem var(--display); color: var(--text); }
.apple-terms { font-size: 12.5px; color: var(--muted); line-height: 1.55; text-align: center; margin-top: 8px; }
.apple-terms p { margin: 0 0 10px; }
.apple-terms .row-buttons { justify-content: center; }
.w-look { align-self: center; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 6px 10px; }
.w-look:hover { color: var(--text); }

/* ---------- Tablero de cumplimiento y casos de moderación ---------- */
.chk-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; background: var(--surface); }
.chk-head b { font: 800 17px/1.2 var(--display); }
.chk-head p { margin: 4px 0 0; }
.chk-head.chk-ok { border-left-color: var(--ok); }
.chk-head.chk-warn { border-left-color: var(--warn); }
.chk-head.chk-fail { border-left-color: var(--danger); }
.chk-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.chk-count { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); }
.chk-count.ok { color: var(--ok); } .chk-count.warn { color: var(--warn); } .chk-count.fail { color: var(--danger); }
.chk-group h2 { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-fail { background: var(--danger); }
.chk-list { list-style: none; margin: 8px 0 0; padding: 0; }
.chk { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.chk:first-child { border-top: 0; }
.chk b { font-size: 14.5px; }
.chk p { margin: 2px 0 0; }
.chk-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; }
.chk-ok .chk-mark { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.chk-warn .chk-mark { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.chk-fail .chk-mark { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.chk-action { font-size: 13px; font-weight: 600; color: var(--text-2); }
.chk-rule { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.case-block { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.case-block h3 { font: 800 15px/1.2 var(--display); margin: 0 0 4px; }
.case-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Pedidos (los publican los clientes, los ven los creadores) ---------- */
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pill-open { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.project-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.project-row { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.project-row:hover { border-color: var(--border-strong); }
.project-row.is-closed { opacity: .65; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-cat { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.project-title { font-size: 16px; line-height: 1.3; }
.project-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.project-foot > * { white-space: nowrap; }
.project-foot > :last-child { margin-left: auto; }
.project-client { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; }
.project-client > .avatar { flex: none; }
a.project-client > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
.project-client small { font-weight: 500; }
.project-detail { gap: 10px; }
.project-h1 { font-size: 22px; margin: 0; }
.project-desc { margin: 4px 0; white-space: pre-line; line-height: 1.5; }
.project-pitch { position: relative; background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); border-radius: var(--radius-lg); padding: 22px 20px; margin-bottom: 18px; }
.project-pitch h2 { margin: 0 0 12px; }
.pitch-steps { margin: 0 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.pitch-steps li span { display: block; color: var(--muted); font-size: 13.5px; }
.offer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.offer.is-mine { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.offer p { margin: 0; white-space: pre-line; line-height: 1.5; }
.offer-who { display: flex; align-items: center; gap: 10px; }
.offer-who > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offer-price { font-weight: 800; font-size: 17px; }
.offer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-actions .tiny { margin-left: auto; white-space: nowrap; }
.offer-actions .review-flag { font-size: 18px; padding: 8px 10px; margin-left: 0; }


.offer-who .premium-badge, .project-client .premium-badge,
.offer-who .founder-badge, .project-client .founder-badge { align-self: flex-start; margin-left: 0; }

/* Entrar con Apple: botón según las pautas de Apple (blanco sobre fondo oscuro) */
.btn-apple { background: #fff; color: #000; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.btn-apple:hover { background: #f2f2f2; }
.btn-apple svg { width: 17px; height: 20px; fill: currentColor; margin-top: -2px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Estadísticas (creadores Premium) ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi-main { grid-column: 1 / -1; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-main .kpi-value { font-size: 40px; }
.kpi-delta { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--warn); }
.stat-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 10px; margin-bottom: 14px; }
.stat-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--border); }
.stat-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: none; min-width: 0; cursor: pointer; }
.stat-bar span { display: block; width: 100%; height: max(var(--h), 2px); background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; }
.stat-bar:hover span, .stat-bar.on span { opacity: 1; background: var(--brand-2); }
.stat-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.stat-tip { margin: 8px 0 0; text-align: center; min-height: 1.2em; }

/* ---------- Tarjeta para Instagram ---------- */
.story-modal { display: flex; flex-direction: column; gap: 12px; }
.story-modal h2, .story-modal p { margin: 0; }
.story-preview { display: grid; place-items: center; min-height: 240px; }
.story-preview img { width: min(62vw, 240px); aspect-ratio: 9 / 16; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.busy-days { margin: 10px 0 0; font-size: 13.5px; }

/* Pedido de un cliente Premium: destacado para los creadores */
.project-row.is-featured { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%), var(--surface); }
.project-star { font-size: 11px; font-weight: 800; color: #3A2A00; background: linear-gradient(135deg, var(--gold), var(--gold-2)); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }

/* ---------- Miembro fundador ---------- */
.founder-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #7C3AED, var(--brand));
  padding: 2px 8px; border-radius: 6px; vertical-align: middle; flex: none; margin-left: 4px;
}
.founder-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: var(--radius);
  padding: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px;
}
.founder-card p { margin: 0; }
.founder-head { display: flex; align-items: center; gap: 10px; }
.founder-head > div { display: flex; flex-direction: column; }
.founder-head small { color: var(--muted); }
.founder-medal { font-size: 32px; }
.founder-code { font: inherit; font-weight: 800; letter-spacing: .5px; background: var(--surface-2, var(--surface)); border: 1px dashed var(--brand); border-radius: 6px; padding: 2px 8px; color: inherit; }
.founder-welcome { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.founder-welcome h2, .founder-welcome p { margin: 0; }
.founder-big { font-size: 56px; }
