/* ==========================================================
   NEL H5 — mobile shell (390px design, 375px compat)
   ========================================================== */

body.h5 {
  background: var(--nel-canvas);
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}

/* Device frame (only shown when viewing in a wider viewport) */
.h5-frame {
  max-width: 390px;
  margin: 0 auto;
  background: var(--nel-canvas);
  min-height: 100vh;
  position: relative;
  padding-bottom: 120px; /* space for fixed tab bar (~91px) + comfortable clearance */
  box-shadow: 0 30px 80px rgba(15,23,42,.08);
}

/* Status bar (fake iOS) */
.h5-status {
  height: 44px;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  color: var(--nel-brand-ink);
  background: var(--nel-canvas);
  position: sticky; top: 0; z-index: 10;
}
.h5-status-icons { display: flex; gap: 5px; align-items: center; }

/* App bar */
.h5-appbar {
  padding: 8px 16px 12px;
  display: flex; align-items: center; gap: 12px;
  min-height: 48px;
}
.h5-appbar .back-btn {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--nel-surface); border: 1px solid var(--nel-line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--nel-brand-ink);
  flex-shrink: 0;
}
.h5-appbar .title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--nel-brand-ink); letter-spacing: -0.01em; }
.h5-appbar .actions { display: flex; gap: 8px; }

/* Section container */
.h5-section { padding: 8px 16px; }
.h5-section > h3 { font-size: 15px; margin-bottom: 12px; }

/* Card in mobile context */
.h5-card {
  background: var(--nel-surface);
  border: 1px solid var(--nel-line);
  border-radius: 14px;
  padding: 16px;
}

/* Bottom tab bar */
.h5-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 390px;
  margin: 0 auto;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--nel-line);
  padding: 8px 8px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 40;
}
.h5-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px;
  color: var(--nel-fg-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: color var(--nel-t-fast);
}
.h5-tab svg { width: 22px; height: 22px; }
.h5-tab.is-active { color: var(--nel-brand); font-weight: 700; }
/* Teli ya no es una pestaña: ver .teli-fab en nel-teli-chat.css */
.h5-tab { font-size: 11px; min-height: 44px; }

/* H5 Hero */
.h5-hero {
  padding: 8px 16px 20px;
  background: linear-gradient(180deg, var(--nel-brand-50) 0%, var(--nel-bg-surface) 100%);
}
.h5-hero-brand { display: flex; align-items: center; gap: 10px; padding: 8px 0; margin-bottom: 16px; }
/* .h5-hero-brand now hosts a <span data-nel-logo="mark"> — no images. */
.h5-hero-brand { color: var(--nel-brand-800); --nel-logo-accent: var(--nel-brand-600); }

/* Single-language indicator badge for H5 hero */
.h5-hero-brand .lang-badge {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--nel-text-muted);
  border: 1px solid var(--nel-border-default);
  border-radius: 6px; background: var(--nel-bg-surface);
}
.h5-hero-brand .h-name { font-size: 13px; font-weight: 700; color: var(--nel-brand-ink); line-height: 1.1; }
.h5-hero-brand .h-sub  { font-size: 10px; color: var(--nel-fg-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.h5-hero-lang { margin-left: auto; }

.h5-hero-title { font-size: 24px; line-height: 1.2; font-weight: 700; color: var(--nel-brand-ink); letter-spacing: -0.02em; margin-bottom: 16px; }

.h5-search {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--nel-surface);
  border: 1px solid var(--nel-line);
  border-radius: 12px;
  box-shadow: var(--nel-shadow-1);
  margin-bottom: 12px;
}
.h5-search input { border: none; background: transparent; outline: none; flex: 1; font-size: 14px; color: var(--nel-fg); }

.h5-chip-row {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 0 0 4px;
  margin: 0 -16px 0;
  padding-left: 16px; padding-right: 16px;
  scrollbar-width: none;
}
.h5-chip-row::-webkit-scrollbar { display: none; }
.h5-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--nel-line);
  background: var(--nel-surface);
  color: var(--nel-fg-secondary);
  font-size: 12px;
  border-radius: 999px;
  text-decoration: none;
}

/* Service grid for mobile */
.h5-svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.h5-svc-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: var(--nel-surface);
  border: 1px solid var(--nel-line);
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  color: var(--nel-brand-ink);
  transition: all var(--nel-t-fast);
}
.h5-svc-tile img { width: 44px; height: 44px; object-fit: contain; }
.h5-svc-tile .label { font-size: 11px; line-height: 1.2; font-weight: 600; }
.h5-svc-tile.is-preparing img { filter: grayscale(0.25); opacity: 0.75; }
.h5-svc-tile.is-preparing .label { color: var(--nel-fg-muted); font-weight: 500; }

/* Featured service (large) */
.h5-featured {
  padding: 14px;
  background: var(--nel-surface);
  border: 1px solid var(--nel-line);
  border-radius: 14px;
  display: flex; gap: 12px; align-items: center;
}
.h5-featured-illus {
  width: 64px; height: 64px; flex-shrink: 0;
  background: transparent;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.h5-featured-illus img { width: 100%; height: 100%; object-fit: contain; }
.h5-featured .title { font-size: 14px; font-weight: 600; color: var(--nel-brand-ink); line-height: 1.3; margin-bottom: 4px; }
.h5-featured .meta  { font-size: 11px; color: var(--nel-fg-muted); }

/* Bottom action bar (for Wizard etc) */
.h5-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 390px; margin: 0 auto;
  padding: 12px 16px 20px;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--nel-line);
  display: flex; gap: 10px;
  z-index: 40;
}
.h5-action-bar .btn { flex: 1; height: 48px; }

/* Container wrapping the frame with a device-like backdrop */
.h5-outer {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(37,53,113,0.05), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(11,105,199,0.04), transparent 60%),
    var(--nel-canvas);
  padding: 24px 12px;
  display: flex;
  justify-content: center;
}

@media (max-width: 420px) {
  .h5-outer { padding: 0; }
  .h5-frame { box-shadow: none; }
}
