  /* ========== SPLASH SCREEN (logo principal al abrir la app) ========== */
  #splashScreen{
    position:fixed; inset:0; z-index:9999;
    background:#000;
    display:flex; align-items:center; justify-content:center;
    overflow:hidden;
    transition:opacity .6s ease, visibility .6s ease;
  }
  #splashScreen.splash-hide{ opacity:0; visibility:hidden; pointer-events:none; }

  /* 1. Humo tenue detrás del logo */
  .splash-smoke{
    position:absolute; inset:-20%;
    background:
      radial-gradient(circle at 50% 55%, rgba(120,0,0,0.35) 0%, rgba(60,0,0,0.18) 30%, transparent 60%),
      radial-gradient(circle at 40% 40%, rgba(80,0,0,0.25) 0%, transparent 55%);
    filter:blur(30px);
    animation:smoke-breathe 6s ease-in-out infinite;
  }
  @keyframes smoke-breathe{
    0%,100%{ transform:scale(1) rotate(0deg); opacity:.7; }
    50%{ transform:scale(1.15) rotate(4deg); opacity:1; }
  }

  /* 2. Chispas rojas ascendiendo (pocas, sutiles, cerca del logo) */
  .splash-particles{
    position:absolute;
    left:50%; bottom:50%;
    width:min(60vw, 260px); height:min(60vw, 260px);
    transform:translate(-50%, 40%);
    overflow:visible;
    pointer-events:none;
  }
  .splash-particle{
    position:absolute; bottom:0;
    width:2.5px; height:2.5px; border-radius:50%;
    background:#ff5540;
    box-shadow:0 0 5px 1.5px rgba(255,80,50,0.85);
    animation-name:particle-rise, particle-flicker;
    animation-timing-function:ease-in, ease-in-out;
    animation-iteration-count:infinite, infinite;
    opacity:0;
  }
  @keyframes particle-rise{
    0%{ transform:translateY(0) translateX(0); opacity:0; }
    12%{ opacity:.9; }
    88%{ opacity:.3; }
    100%{ transform:translateY(-180px) translateX(var(--drift,0px)); opacity:0; }
  }
  @keyframes particle-flicker{
    0%,100%{ filter:brightness(1); }
    50%{ filter:brightness(1.6); }
  }

  /* 3. Cortinas de escenario (izq/der) que se abren al cargar */
  .splash-curtain-left, .splash-curtain-right{
    position:absolute; top:0; bottom:0; width:54%; z-index:5;
    background:
      repeating-linear-gradient(90deg, rgba(0,0,0,0.28) 0px, rgba(0,0,0,0.28) 2px, transparent 2px, transparent 15px),
      linear-gradient(90deg, #430c0c 0%, #7a1414 45%, #430c0c 100%);
    box-shadow: inset 0 0 60px 12px rgba(0,0,0,0.65);
  }
  .splash-curtain-left{
    left:0; transform-origin:left center;
    animation:curtain-open-left 1.1s cubic-bezier(.65,0,.35,1) .15s forwards;
  }
  .splash-curtain-right{
    right:0; transform-origin:right center;
    animation:curtain-open-right 1.1s cubic-bezier(.65,0,.35,1) .15s forwards;
  }
  .splash-curtain-left::after, .splash-curtain-right::after{
    content:''; position:absolute; top:0; bottom:0; width:8px;
    background:linear-gradient(180deg,#f5c542,#a9781f,#f5c542);
    box-shadow:0 0 14px 2px rgba(245,197,66,.65);
  }
  .splash-curtain-left::after{ right:0; }
  .splash-curtain-right::after{ left:0; }
  @keyframes curtain-open-left{ 0%{ transform:translateX(0); } 100%{ transform:translateX(-100%); } }
  @keyframes curtain-open-right{ 0%{ transform:translateX(0); } 100%{ transform:translateX(100%); } }

  /* 4. Reflector cálido de tarima, se enciende cuando la cortina termina de abrir */
  .splash-spotlight{
    position:absolute; left:50%; top:-15%;
    width:140%; height:120%;
    transform:translateX(-50%);
    background:radial-gradient(ellipse 42% 50% at 50% 0%, rgba(255,205,120,0.35) 0%, rgba(255,205,120,0.12) 35%, transparent 65%);
    opacity:0; z-index:2; pointer-events:none;
    animation:spotlight-on 1s ease-out 1.05s forwards;
  }
  @keyframes spotlight-on{ 0%{ opacity:0; } 100%{ opacity:1; } }

  .splash-logo-wrap{
    position:relative; z-index:3;
    width:min(86vw, 460px);
    display:flex; align-items:center; justify-content:center;
    opacity:0;
    animation:logo-reveal .8s ease-out 1s forwards;
  }
  @keyframes logo-reveal{
    0%{ opacity:0; transform:scale(.92); }
    100%{ opacity:1; transform:scale(1); }
  }

  /* 5. El logo — sin tocar su diseño */
  .splash-logo{
    position:relative; z-index:2;
    width:100%; height:auto;
    object-fit:contain;
    filter:drop-shadow(0 0 22px rgba(245,197,66,.55));
    animation:logo-breathe 3.4s ease-in-out 1.8s infinite;
  }
  @keyframes logo-breathe{
    0%,100%{ transform:scale(1); }
    50%{ transform:scale(1.025); }
  }

  /* 6. Destello rápido justo cuando termina de abrirse la cortina */
  .splash-flash{
    position:absolute; inset:0;
    background:radial-gradient(circle at 50% 50%, #fff 0%, rgba(255,255,255,0.6) 25%, transparent 65%);
    animation:splash-flash 700ms ease-out 1.1s 1;
    pointer-events:none;
    opacity:0;
  }
  @keyframes splash-flash{
    0%{ opacity:1; }
    100%{ opacity:0; }
  }

  @media (prefers-reduced-motion: reduce){
    .splash-smoke,.splash-particle,.splash-flash{ animation:none !important; opacity:0 !important; }
    .splash-curtain-left{ animation:none !important; transform:translateX(-100%) !important; }
    .splash-curtain-right{ animation:none !important; transform:translateX(100%) !important; }
    .splash-spotlight{ animation:none !important; opacity:1 !important; }
    .splash-logo-wrap{ animation:none !important; opacity:1 !important; transform:none !important; }
    .splash-logo{ animation:none !important; }
  }

  /* ========== HEADER PRINCIPAL (logo Festoría con vida propia) ==========
     Ya no es parte de la imagen de fondo: es un bloque real que se
     superpone tapando esa franja de la imagen (fondo negro sólido). */
  #appHeader{
    position:fixed; top:0; left:0; right:0; z-index:150;
    height:var(--header-h);
    background:#000;
    overflow:hidden;
    padding-top:env(safe-area-inset-top, 0);
  }

  /* Humo + chispas muy sutiles detrás del logo, contenidas al header */
  .header-smoke{
    position:absolute; inset:-60% -10%;
    background:radial-gradient(circle at 18% 50%, rgba(140,0,0,0.35) 0%, transparent 55%);
    filter:blur(18px);
    animation:smoke-breathe 7s ease-in-out infinite;
    pointer-events:none;
  }
  .header-particles{ position:absolute; inset:0; overflow:hidden; pointer-events:none; }
  .header-particle{
    position:absolute; bottom:6px; left:14%;
    width:2px; height:2px; border-radius:50%;
    background:#ff5540;
    box-shadow:0 0 4px 1px rgba(255,80,50,0.75);
    opacity:0;
    animation:header-particle-rise 5s ease-in infinite;
  }
  .header-particle:nth-child(2){ left:24%; animation-delay:1.6s; animation-duration:6s; }
  .header-particle:nth-child(3){ left:9%;  animation-delay:3.1s; animation-duration:4.4s; }
  @keyframes header-particle-rise{
    0%{ transform:translateY(0); opacity:0; }
    15%{ opacity:.55; }
    85%{ opacity:.15; }
    100%{ transform:translateY(-46px); opacity:0; }
  }

  /* Esquinas oscuras / humo en los extremos del header (look "desgastado") */
  .header-corner{
    position:absolute; z-index:1; width:34%; max-width:170px; height:100%;
    pointer-events:none;
  }
  .header-corner-left{
    left:0; top:0;
    background:
      radial-gradient(ellipse at 0% 0%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 35%, transparent 68%),
      radial-gradient(circle at 6% 85%, rgba(255,60,40,0.5) 0%, transparent 45%);
  }
  .header-corner-right{
    right:0; top:0;
    background:
      radial-gradient(ellipse at 100% 100%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 35%, transparent 68%),
      radial-gradient(circle at 94% 15%, rgba(255,60,40,0.4) 0%, transparent 45%);
  }
  .header-ember{
    position:absolute; width:2px; height:2px; border-radius:50%;
    background:#ff5540; box-shadow:0 0 5px 1.5px rgba(255,80,50,0.85);
    animation:header-particle-rise 5.5s ease-in infinite;
  }

  .header-row{
    position:relative; z-index:2; height:100%;
    display:grid; grid-template-columns:auto 1fr auto; align-items:center;
    padding:0 clamp(12px, 4vw, 18px);
    gap:8px;
  }

  /* Mascota decorativa, esquina superior izquierda — antes era el farol */
  .header-lantern{
    height:calc(var(--header-h) - 46px); width:auto;
    display:block; flex-shrink:0;
    filter:drop-shadow(0 0 6px rgba(255,170,60,.35));
    transform-origin:50% 100%;
    animation:header-mascot-toast 3.2s ease-in-out infinite;
  }

  /* Balanceo tipo "brindis": se mece de lado a lado, como alzando cada
     vaso por turnos, con un pequeño rebote vertical. */
  @keyframes header-mascot-toast{
    0%   { transform:rotate(-6deg) translateY(0); }
    25%  { transform:rotate(0deg)  translateY(-4px); }
    50%  { transform:rotate(6deg)  translateY(0); }
    75%  { transform:rotate(0deg)  translateY(-4px); }
    100% { transform:rotate(-6deg) translateY(0); }
  }

  /* Logo de Festoría en el header — centrado, sin anillo circular */
  .header-brand{ display:flex; align-items:center; justify-content:center; gap:10px; min-width:0; }
  .header-emblem{ position:relative; height:calc(var(--header-h) - 34px); max-width:min(60vw, 240px); flex-shrink:0; display:flex; align-items:center; }
  .header-emblem-img{
    position:relative; z-index:2; height:100%; width:auto; max-width:100%;
    object-fit:contain; display:block;
    filter:drop-shadow(0 0 8px rgba(245,197,66,.6)) drop-shadow(0 0 16px rgba(245,197,66,.3));
  }

  /* Wordmark: logo metálico + tagline */
  .header-wordmark{ min-width:0; display:flex; flex-direction:column; justify-content:center; }
  .header-title{
    font-weight:800; font-size:clamp(19px, 6.6vw, 30px);
    letter-spacing:.01em; line-height:1.0;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    background:linear-gradient(180deg,#ffffff 0%, #d7dbe0 42%, #9aa1ab 55%, #ffffff 100%);
    -webkit-background-clip:text; background-clip:text; color:transparent;
    text-shadow:0 1px 1px rgba(0,0,0,.5);
  }
  .header-subtitle{
    margin-top:2px;
    font-weight:700; font-size:clamp(13px, 4.4vw, 18px);
    letter-spacing:.18em; line-height:1.1;
    color:#ff4636;
    text-shadow:0 0 10px rgba(255,60,48,.85), 0 0 20px rgba(255,60,48,.4);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .header-tagline{
    margin-top:4px;
    font-size:clamp(8px, 2.4vw, 10px); font-weight:600; letter-spacing:.1em;
    color:rgba(255,255,255,.55);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  /* Íconos de acción (campana + avatar) con el mismo tratamiento neón rojo */
  .header-actions{ display:flex; flex-direction:column; align-items:center; gap:6px; flex-shrink:0; }
  .header-icon-btn{
    position:relative; width:clamp(32px,8.2vw,40px); height:clamp(32px,8.2vw,40px);
    border-radius:50%; border:1.5px solid rgba(255,60,48,.55);
    background:rgba(25,0,0,.45);
    box-shadow:0 0 9px rgba(255,50,40,.45), inset 0 0 7px rgba(255,50,40,.15);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; padding:0; overflow:hidden;
  }
  .header-icon-btn svg{ width:56%; height:56%; stroke:#ffece9; }
  .header-icon-btn img{ width:100%; height:100%; object-fit:cover; display:block; }
  .header-notif-dot{
    display:none;
    position:absolute; top:5px; right:6px; width:6px; height:6px; border-radius:50%;
    background:#ff3b30; box-shadow:0 0 5px 1.5px rgba(255,59,48,.9);
    animation:splash-pulse 2.6s ease-out infinite;
  }

  /* Estado persistente de la campana mientras hay algo sin leer: fondo
     y borde rojos s\u00f3lidos (no solo sombra) + \u00edcono en blanco sobre
     rojo, para que se note de un vistazo, no solo de cerca. */
  .header-icon-btn.notif-unread{
    background:linear-gradient(155deg, #ff3b30, #b3170f);
    border-color:#ffb3ac;
    box-shadow:0 0 16px rgba(255,50,40,.95), inset 0 0 9px rgba(255,255,255,.2);
    animation:notif-bell-latido 1.8s ease-in-out infinite;
  }
  .header-icon-btn.notif-unread svg{ stroke:#fff; }
  @keyframes notif-bell-latido{
    0%,100%{ transform:scale(1); }
    50%{ transform:scale(1.08); }
  }
  /* Golpe único cuando llega algo nuevo (se suma al latido de fondo).
     Mucho más grande y con un breve "hold" arriba para que se note de
     verdad, no solo un tic sutil. */
  .header-icon-btn.notif-bump{ animation:notif-bell-bump 1.1s cubic-bezier(.34,1.56,.64,1); position:relative; z-index:5; }
  @keyframes notif-bell-bump{
    0%{ transform:scale(1); }
    30%{ transform:scale(1.85) rotate(-14deg); }
    45%{ transform:scale(1.55) rotate(10deg); }
    60%{ transform:scale(1.7) rotate(-6deg); }
    75%{ transform:scale(1.55) rotate(3deg); }
    100%{ transform:scale(1.08) rotate(0); }
  }

  /* Banner de notificación in-app: franja arriba de la pantalla */
  #notifBanner{
    position:fixed; left:0; right:0; top:0; z-index:400;
    display:flex; align-items:center; gap:10px;
    padding:calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
    background:linear-gradient(180deg, rgba(20,2,2,.97), rgba(35,4,4,.95));
    border-bottom:1.5px solid rgba(255,60,48,.6);
    box-shadow:0 4px 18px rgba(0,0,0,.5), 0 0 14px rgba(255,50,40,.35);
    transform:translateY(-100%);
    transition:transform .35s cubic-bezier(.34,1.2,.64,1);
    cursor:pointer;
  }
  #notifBanner.show{ transform:translateY(0); }
  .notif-banner-icon{
    flex-shrink:0; width:34px; height:34px; border-radius:50%;
    background:rgba(255,60,48,.18); border:1.5px solid rgba(255,60,48,.55);
    display:flex; align-items:center; justify-content:center; font-size:17px;
  }
  .notif-banner-text{ flex:1; min-width:0; }
  .notif-banner-title{ font-size:13.5px; font-weight:800; color:#fff; line-height:1.25; }
  .notif-banner-body{ font-size:12px; color:#e8b9b3; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .notif-banner-close{
    flex-shrink:0; background:none; border:none; color:#d1a8a3; font-size:16px;
    padding:4px; cursor:pointer; line-height:1;
  }

  /* Línea de neón rojo al pie del header */
  .header-neon-line{
    position:absolute; left:0; right:0; bottom:0; height:2px; z-index:2;
    background:linear-gradient(90deg, transparent, #ff3b30 20%, #ffcbb8 50%, #ff3b30 80%, transparent);
    background-size:200% 100%;
    box-shadow:0 0 8px 1px rgba(255,59,48,.85), 0 0 16px 2px rgba(255,59,48,.4);
    animation:header-line-shimmer 4.5s linear infinite;
  }
  @keyframes header-line-shimmer{
    0%{ background-position:0% 0; }
    100%{ background-position:200% 0; }
  }

  /* Panel de notificaciones */
  #notifPanel{
    display:none; position:fixed; z-index:200;
    top:calc(var(--header-h) + 8px); right:clamp(12px, 4vw, 18px);
    width:min(310px, calc(100vw - 24px)); max-height:min(430px, 70vh);
    overflow-y:auto; background:rgba(10,0,0,.97);
    border:1px solid rgba(255,60,48,.4); border-radius:14px;
    box-shadow:0 8px 24px rgba(0,0,0,.5);
    font-size:12.5px; color:#d1d5db;
  }
  .notif-panel-head{
    position:sticky; top:0; display:flex; align-items:center; justify-content:space-between;
    padding:12px 14px; background:rgba(10,0,0,.97);
    border-bottom:1px solid rgba(255,60,48,.25);
  }
  .notif-panel-head h4{ font-size:13.5px; font-weight:800; color:#f3f4f6; margin:0; }
  .notif-panel-close{
    background:none; border:none; color:#9ca3af; font-size:15px; cursor:pointer; padding:2px 4px; line-height:1;
  }
  .notif-empty{ text-align:center; color:#9ca3af; padding:22px 16px; }
  .notif-section-title{
    padding:10px 14px 4px; font-size:10.5px; font-weight:700; letter-spacing:.04em;
    text-transform:uppercase; color:#f87171;
  }
  .notif-item{
    display:flex; align-items:center; gap:10px; padding:9px 14px;
    cursor:pointer; text-align:left; transition:background .15s;
  }
  .notif-item:hover{ background:rgba(255,60,48,.08); }
  .notif-item-icon{
    flex:0 0 auto; width:32px; height:32px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,60,48,.15); font-size:14px; font-weight:800; color:#fca5a5;
  }
  .notif-item-info{ flex:1; min-width:0; }
  .notif-item-title{
    font-size:12.5px; font-weight:700; color:#f3f4f6;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .notif-item-sub{
    font-size:11px; color:#9ca3af; margin-top:1px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .notif-item-badge{
    flex:0 0 auto; min-width:16px; height:16px; padding:0 4px; border-radius:8px;
    background:#ff3b30; color:#fff; font-size:10px; font-weight:800;
    display:flex; align-items:center; justify-content:center;
  }

  @media (prefers-reduced-motion: reduce){
    .header-smoke,.header-particle,.header-notif-dot,.header-neon-line,.header-icon-btn.notif-unread,.header-icon-btn.notif-bump{ animation:none !important; }
  }

