html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  --app-height: 100dvh;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}
#app {
  width: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
}
#bottom-nav.nav-tabbar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 200 !important;
  display: flex !important;
  justify-content: center;
  align-items: flex-end;
  padding: 8px 12px env(safe-area-inset-bottom, 0px);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
  box-sizing: border-box;
}
#bottom-nav .nav-bubble {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 68px;
  padding: 6px 8px;
  margin: 0;
  border-radius: 999px;
  background: rgba(14, 32, 52, 0.94);
  border: 1px solid rgba(51, 65, 85, 0.9);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-sizing: border-box;
}
[data-theme="light"] #bottom-nav .nav-bubble {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(203, 213, 225, 0.95);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
#bottom-nav .nav-bubble-item {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 58px;
  min-height: 56px;
  height: 56px;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #a5b3c8;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
[data-theme="light"] #bottom-nav .nav-bubble-item { color: #1e293b; }
/* Solo color del ítem activo; el highlight visual es la píldora (.nav-indicator) */
#bottom-nav .nav-bubble-item.active {
  color: var(--accent, #0284c7);
  background: transparent;
}
[data-theme="light"] #bottom-nav .nav-bubble-item.active {
  color: var(--accent, #0284c7);
  background: transparent;
}
#bottom-nav .nav-bubble-add {
  min-width: 52px;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  background: #0284c7;
  color: #fff;
}
#bottom-nav .nav-bubble-item svg { width: 26px; height: 26px; display: block; }
#bottom-nav.nav-tabbar--keyboard { opacity: 0 !important; pointer-events: none !important; }
#boot-status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: #d97706;
  color: #0f111a;
  font: 700 0.78rem/1.3 system-ui, sans-serif;
  text-align: center;
  z-index: 99999;
  display: none;
}
#app-splash {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top, 0) 24px env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
  background: var(--bg, #0f111a);
  color: var(--text, #f4f7fb);
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 260ms ease;
}
#app-splash.splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.splash-logo {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}
.splash-brand {
  margin: 18px 0 4px;
  font: 800 1.65rem/1 system-ui, sans-serif;
  letter-spacing: -0.03em;
}
.splash-copy {
  margin: 0;
  color: var(--text-sub, #a5b3c8);
  font: 500 0.82rem/1.4 system-ui, sans-serif;
}
.splash-spinner {
  width: 28px;
  height: 28px;
  margin-top: 24px;
  border: 3px solid color-mix(in srgb, var(--accent, #0284c7) 22%, transparent);
  border-top-color: var(--accent, #0284c7);
  border-radius: 50%;
  animation: splash-spin 750ms linear infinite;
}
@keyframes splash-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #app-splash { transition: none; }
  .splash-spinner { animation-duration: 1.5s; }
}
.app-fatal-error {
  padding: 24px;
  font-family: system-ui, sans-serif;
  color: #f87171;
}
.app-fatal-error button {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: #0284c7;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Gate: instalar PWA / canal Windows (sin login en navegador) */
html[data-install-gate="1"],
html[data-install-gate="1"] body {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  overscroll-behavior: auto;
  background: #0f111a;
  color: #f4f7fb;
}
.ig-screen {
  box-sizing: border-box;
  max-width: 420px;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top, 0px)) 24px max(40px, env(safe-area-inset-bottom, 0px));
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
}
.ig-logo {
  display: block;
  margin: 0 auto 20px;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.ig-screen h1 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.ig-lede {
  margin: 0 0 20px;
  color: #a5b3c8;
  font-size: 0.95rem;
  line-height: 1.45;
}
.ig-steps {
  margin: 0 0 20px;
  padding: 16px 16px 16px 36px;
  text-align: left;
  background: #161b22;
  border: 1px solid #2a3444;
  border-radius: 14px;
  color: #e8eef7;
  font-size: 0.9rem;
  line-height: 1.45;
}
.ig-steps li + li { margin-top: 10px; }
.ig-hint {
  margin: 0 0 16px;
  color: #9aa8bc;
  font-size: 0.82rem;
  line-height: 1.4;
}
.ig-links a {
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.9rem;
}
.ig-actions {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}
.ig-btn {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 14px 18px;
  border-radius: 12px;
  background: #0284c7;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.ig-btn:hover { background: #0369a1; }
.ig-btn-ghost {
  background: transparent;
  color: #e8eef7;
  border: 1px solid #2a3444;
}
.ig-btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }
