/* Project Wonder Guest Portal UI (Customer shell)
   Mobile-first, conflict-free stylesheet.
*/

:root{
  --bg:#0b0f18;
  --panel:#101827;
  --card:#f6f7fb;
  --card2:#ffffff;
  --text:#0b1220;
  --muted:#64748b;
  --muted2:#94a3b8;
  --line:rgba(255,255,255,.10);
  --shadow:0 18px 45px rgba(0,0,0,.45);

  --red:#ff2a2a;
  --black:#0a0a0a;

  --radius:18px;
  --radius2:24px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:#e5e7eb}
a{color:inherit}

/* ---------------- Auth pages ---------------- */
body.auth{
  /* Wonder red gradient with subtle sparkles (no external assets) */
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 58%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 34%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 76%, rgba(255,255,255,.06) 0 1px, transparent 2px),
    linear-gradient(135deg, #ff2a2a 0%, #b81414 45%, #0b0f18 100%);
}

.auth-main{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px 18px;
}

.auth-shell{
  width:min(760px, 100%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
}

.auth-shell .big-logo{
  width:140px;
  height:140px;
  border-radius:32px;
  box-shadow:0 20px 55px rgba(0,0,0,.55);
  background:rgba(0,0,0,.22);
  padding:14px;
}

.auth-shell .big-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.auth-card{
  width:min(560px, 100%);
  background:rgba(255,255,255,.98);
  border:1px solid rgba(15,23,42,.10);
  border-radius:28px;
  box-shadow:0 24px 70px rgba(0,0,0,.45);
  padding:26px;
  color:#0b1220;
}

.auth-brand{display:flex;flex-direction:column;align-items:center;gap:12px;margin-bottom:14px}
.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="date"],
.auth-card select{
  border-radius:14px !important;
  padding:14px 14px !important;
  border:1px solid rgba(15,23,42,.18) !important;
}

.auth-card .btn-primary{
  border-radius:999px;
  padding:14px 18px;
}

.auth-card h1{margin:0 0 10px 0;font-size:34px;letter-spacing:.2px}
.auth-card p{margin:0 0 18px 0;color:rgba(15,23,42,.75)}

/* Flash messages */
.flash-wrap{display:flex;flex-direction:column;gap:10px}
.flash{border-radius:16px;padding:12px 14px;border:1px solid rgba(0,0,0,.10);background:rgba(255,255,255,.96);color:#111;box-shadow:0 12px 30px rgba(0,0,0,.18)}
.flash-success{border-color:rgba(34,197,94,.35)}
.flash-error{border-color:rgba(239,68,68,.35)}
.flash-info{border-color:rgba(245,158,11,.45);background:rgba(255,248,214,.96)}

/* On auth screens, keep flashes visible and not behind the card */
body.auth .flash-wrap{position:fixed;top:74px;left:50%;transform:translateX(-50%);z-index:1000;max-width:min(640px,92vw)}


/* ---------------- App shell ---------------- */
.app-shell{min-height:100vh;display:grid;grid-template-columns: 260px 1fr;}

.app-sidebar{
  background:var(--red);
  color:#111;
  padding:22px 18px;
  border-right:1px solid rgba(0,0,0,.12);
  display:flex;
  flex-direction:column;
  min-height:100vh;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}


/* Sidebar content wrapper (used inside the mobile drawer) */
.sidebar-inner{
  display:flex;
  flex-direction:column;
  min-height:100%;
}

.side-brand{display:flex;gap:12px;align-items:center;margin-bottom:18px;text-decoration:none;color:inherit}
.brand-logo{width:42px;height:42px;border-radius:12px;object-fit:cover;box-shadow:0 10px 22px rgba(0,0,0,.25)}
.brand-title{font-weight:800;line-height:1}
.brand-sub{font-size:12px;color:rgba(0,0,0,.65);margin-top:2px}

.side-user{display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;margin:14px 0 18px 0}
.avatar{width:74px;height:74px;border-radius:999px;background:rgba(0,0,0,.12);display:grid;place-items:center;font-weight:900}
.avatar img{width:100%;height:100%;border-radius:999px;object-fit:cover}

/* Small link indicator for members that have one or more keys linked */
.avatar.has-link{position:relative}
.avatar .link-badge{
  position:absolute;
  right:-6px;
  bottom:-6px;
  width:22px;
  height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-size:12px;
  line-height:1;
  background:rgba(255,255,255,.88);
  color:#111;
  border:2px solid rgba(17,17,17,.28);
  box-shadow:0 6px 14px rgba(0,0,0,.18);
}
.side-user .name{font-weight:800}
.side-user .email{font-size:12px;color:rgba(0,0,0,.65)}
.side-user .avatar{width:84px;height:84px;border-radius:999px;overflow:hidden;border:3px solid rgba(255,255,255,.85);box-shadow:0 6px 18px rgba(0,0,0,.25)}
.side-user .avatar img{width:100%;height:100%;object-fit:cover;display:block}
.change-character{display:inline-block;margin-top:6px;font-size:12px;color:rgba(0,0,0,.75);text-decoration:underline}

.side-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
  flex:1;
}
.side-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border-radius:999px;
  text-decoration:none;
  color:#111;
  font-weight:700;
  transition:transform .08s ease, background .12s ease;
}
.side-link:hover{background:rgba(255,255,255,.22)}
.side-link.active{
  background:rgba(255,255,255,.92);
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}

.side-footer{
  margin-top:auto;
  padding-top:14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.logout{display:inline-block;margin-top:8px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.92);text-decoration:none;font-weight:800;color:#111}

.app-content{padding:26px 26px 40px 26px}
/* app_base.html uses .app-main; keep .app-content as a compatible alias */
.app-main{padding:26px 26px 40px 26px}

.page-head{
  margin-bottom:16px;
  background:radial-gradient(circle at 20% 10%, rgba(255,42,42,.55), rgba(0,0,0,.35) 55%),
             linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius2);
  padding:16px 18px;
  box-shadow:var(--shadow);
}
.page-head h1{margin:0;font-size:28px}
.page-head .muted{color:rgba(255,255,255,.88)}
.page-head .tiny{color:rgba(255,255,255,.78)}

/* Global muted text (cards, tables, etc.) */
.muted{color:var(--muted2)}
.req{color:rgba(255,255,255,.9);font-weight:900}

/* Make header buttons match dashboard pills */
.page-head .btn,
.hero .btn{
  background:#fff;
  color:#0b1220;
  border:1px solid rgba(0,0,0,.08);
}
.page-head .btn:hover,
.hero .btn:hover{filter:brightness(.98)}
.page-head .btn.ghost,
.hero .btn.ghost{background:#fff}

/* ---------------- Cards / layout helpers ---------------- */
.hero{
  background:radial-gradient(circle at 20% 10%, rgba(255,42,42,.55), rgba(0,0,0,.35) 55%),
             linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius2);
  padding:18px 18px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
}

.hero-title{font-size:26px;font-weight:900;margin:0 0 6px 0}
.hero-sub{margin:0 0 14px 0;color:rgba(255,255,255,.85)}

.card{
  background:var(--card);
  color:var(--text);
  border-radius:24px;  /* Increased from 18px */
  box-shadow:0 20px 60px rgba(0,0,0,.40);  /* Softer, larger shadow */
  border:1px solid rgba(255,255,255,.08);
  padding:24px;  /* Increased from 16px */
}

.card h2{margin:0 0 14px 0;font-size:20px;font-weight:800;letter-spacing:-.3px}

.grid-4{display:grid;grid-template-columns:repeat(4, minmax(0,1fr));gap:14px}
@media (max-width:1100px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:640px){.grid-4{grid-template-columns:1fr;}}
.grid-3{display:grid;grid-template-columns:repeat(3, minmax(0,1fr));gap:14px}
.grid-2{display:grid;grid-template-columns:repeat(2, minmax(0,1fr));gap:14px}
.stack{display:flex;flex-direction:column;gap:14px}

.mt-lg{margin-top:22px}

.stat-card{cursor:pointer;transition:transform .12s ease, box-shadow .18s ease;border-radius:18px}
.stat-card:hover{transform:translateY(-3px);box-shadow:0 24px 70px rgba(0,0,0,.45)}
.stat-num{font-size:34px;font-weight:900;line-height:1}
.stat-label{font-size:13px;color:var(--muted);margin-top:6px;font-weight:600}

.row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.pill{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;background:rgba(16,24,39,.08);font-weight:800;font-size:12px}
.pill.ok{background:rgba(34,197,94,.18);color:#0b3b1b;border:1px solid rgba(34,197,94,.28)}
.pill.warn{background:rgba(245,158,11,.18);color:#4a2a00;border:1px solid rgba(245,158,11,.28)}

/* ---------------- Forms ---------------- */
.form{display:flex;flex-direction:column;gap:16px}
.field{display:flex;flex-direction:column;gap:8px}
.label{font-weight:700;font-size:13px;color:rgba(255,255,255,.92);letter-spacing:-.2px}
body:not(.auth) .label{color:var(--text);opacity:.75}

input, select, textarea, .input{
  width:100%;
  padding:14px 16px;  /* Increased padding */
  border-radius:16px;  /* Smoother corners */
  border:2px solid rgba(15,23,42,.12);  /* 2px border */
  background:var(--card2);
  color:var(--text);
  outline:none;
  font-size:15px;
  transition:border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus, textarea:focus, .input:focus{
  border-color:var(--red);
  box-shadow:0 0 0 3px rgba(255,42,42,.10);
}

input::placeholder, textarea::placeholder, .input::placeholder{
  color:var(--muted2);
  opacity:.6;
}

.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:14px 20px;  /* Increased padding */
  border-radius:16px;  /* Smoother corners */
  border:2px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.96);
  color:#111;
  font-weight:800;
  font-size:15px;
  text-decoration:none;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(0,0,0,.15);
}

.btn:active{
  transform:translateY(0);
}

.btn.primary{
  background:linear-gradient(135deg, var(--red) 0%, #d41f1f 100%);
  border-color:rgba(0,0,0,.15);
  color:#fff;
  box-shadow:0 6px 18px rgba(255,42,42,.30);
}

.btn.primary:hover{
  box-shadow:0 10px 28px rgba(255,42,42,.40);
}

.btn.ghost{
  background:transparent;
  border-color:rgba(255,255,255,.25);
  color:#fff;
}

/* Lists */
.list{display:flex;flex-direction:column;gap:12px}
.item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px;
  border-radius:16px;
  background:rgba(16,24,39,.06);
  border:1px solid rgba(0,0,0,.06);
  transition:transform .12s ease, box-shadow .15s ease;
}

.item:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(0,0,0,.10);
}

.item strong{font-size:15px;font-weight:700}
.item small{display:block;color:var(--muted);font-size:13px;margin-top:2px}

/* Avatar picker */
.avatar-row{display:flex;align-items:center;gap:14px}
.avatar-lg{width:80px;height:80px;border-radius:999px;background:rgba(255,255,255,.14);display:grid;place-items:center;font-weight:900;font-size:24px;overflow:hidden;border:3px solid rgba(255,255,255,.20);box-shadow:0 8px 20px rgba(0,0,0,.25)}
.avatar-lg img{width:100%;height:100%;object-fit:cover;display:block;border-radius:999px}
.avatar-grid{display:grid;grid-template-columns:repeat(5, minmax(0,1fr));gap:12px}
.avatar-choice{border:3px solid transparent;border-radius:18px;background:rgba(16,24,39,.06);padding:12px;cursor:pointer;transition:transform .12s ease,border-color .15s ease, box-shadow .15s ease}
.avatar-choice:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.15)}
.avatar-choice.selected{border-color:var(--red);box-shadow:0 0 0 3px rgba(255,42,42,.15)}
.avatar-choice img{width:100%;height:80px;object-fit:cover;border-radius:14px;display:block}
.avatar-choice div{margin-top:8px;font-size:13px;color:var(--text);text-align:center;font-weight:700}

/* ---------------- Modal (account avatar picker) ----------------
   NOTE: The customer account template uses:
     <div class="modal" id="avatarModal">
       <div class="modal-backdrop" ...></div>
       <div class="modal-card"> ... </div>
     </div>
   Older CSS variants expected a different structure.
*/

.modal{position:fixed;inset:0;display:none;z-index:60}
.modal.open{display:block}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65);backdrop-filter:blur(4px)}
.modal-card{
  position:relative;
  width:min(900px, calc(100% - 48px));
  max-height:88vh;
  overflow:auto;
  margin:24px auto;
  background:var(--card);
  color:var(--text);
  border-radius:28px;
  box-shadow:0 24px 80px rgba(0,0,0,.50);
  padding:28px;
  border:1px solid rgba(255,255,255,.08);
}

.modal-card h2{
  font-size:24px;
  font-weight:800;
  margin:0 0 20px 0;
  letter-spacing:-.4px;
}

.modal-foot{display:flex;justify-content:flex-end;gap:12px;margin-top:20px}

/* Minor button variants used in templates */
.btn.secondary{
  background:rgba(16,24,39,.08);
  border-color:rgba(16,24,39,.12);
  color:var(--text);
}

.btn.danger{
  background:linear-gradient(135deg, #ff3b30 0%, #d12f26 100%);
  color:#fff;
  border-color:rgba(0,0,0,.15);
  box-shadow:0 6px 18px rgba(255,59,48,.25);
}

/* (Removed older duplicate modal + drawer styles to prevent conflicts) */


/* ---------------- Dashboard (template alias styles) ---------------- */
/* Some templates use legacy class names (kpis/kpi/grid2/etc). Provide
   thin aliases so the UI stays consistent. */

.kpis{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
  margin:12px 0;
}
@media (max-width: 900px){
  .kpis{grid-template-columns:1fr}
}

.kpi{
  display:block;
  background:var(--card);
  color:var(--text);
  border-radius:var(--radius);
  box-shadow:0 14px 40px rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.06);
  padding:14px 16px;
  text-decoration:none;
  transition:transform .08s ease, box-shadow .12s ease;
}
.kpi:hover{transform:translateY(-2px)}
.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.kpi-number{font-size:32px;font-weight:900;line-height:1}
.kpi-sub{font-size:12px;color:var(--muted);margin-top:4px}

.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
  margin-bottom:22px;
}
@media (max-width: 900px){ .grid2{grid-template-columns:1fr} }
.grid2.single{grid-template-columns:1fr!important}


.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.card-link{font-weight:800;font-size:12px;text-decoration:none;color:var(--red)}
.card-link:hover{text-decoration:underline}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  display:inline-flex;align-items:center;gap:8px;
  border-radius:999px;padding:8px 10px;
  background:rgba(16,24,39,.06);
  color:var(--text);
  text-decoration:none;
  border:1px solid rgba(16,24,39,.08);
  font-weight:800;font-size:12px;
}
.chip:hover{transform:translateY(-1px)}
.chip:active{transform:translateY(0)}

.list-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 12px;border-top:1px solid rgba(16,24,39,.08)}
.list-row:first-child{border-top:0}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}
.muted{color:var(--muted)}
.empty{color:var(--muted);padding:12px 0}

/* Button variants used by templates */
.btn-ghost{
  background:transparent;
  border:1px solid rgba(255,255,255,.20);
  color:#fff;
}
body:not(.auth) .btn-ghost{
  border:1px solid rgba(16,24,39,.18);
  color:var(--text);
}
.btn-ghost:hover{background:rgba(255,255,255,.08)}
body:not(.auth) .btn-ghost:hover{background:rgba(16,24,39,.06)}

.btn-quiet{
  background:rgba(16,24,39,.06);
  border:1px solid rgba(16,24,39,.10);
  color:var(--text);
}
.btn-quiet:hover{background:rgba(16,24,39,.10)}

/* Small icon button used in modals */
.icon-btn{
  width:34px;height:34px;border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:transparent;color:#fff;
  display:grid;place-items:center;
  cursor:pointer;
}
body:not(.auth) .icon-btn{
  border:1px solid rgba(16,24,39,.18);
  color:var(--text);
}
.icon-btn:hover{background:rgba(255,255,255,.08)}
body:not(.auth) .icon-btn:hover{background:rgba(16,24,39,.06)}

/* Mobile header */
.app-mobile-header{display:none;position:sticky;top:0;z-index:40;height:56px;padding:10px 14px;align-items:center;justify-content:space-between;gap:12px;background:rgba(11,15,24,.82);backdrop-filter:blur(10px);border-bottom:1px solid rgba(255,255,255,.10)}
.app-mobile-brand{display:flex;align-items:center;gap:10px;min-width:0}
.app-mobile-logo{width:34px;height:34px;border-radius:12px;object-fit:cover;box-shadow:0 10px 22px rgba(0,0,0,.25)}
.app-mobile-title{font-weight:900;letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* In app mode, icon-btn defaults to dark text; the mobile header needs white icons */
.app-mobile-header .icon-btn{color:#ff2d2d;border:1px solid rgba(255,255,255,.18)}
.app-mobile-header .icon-btn:hover{background:rgba(255,255,255,.12)}

/* Force the hamburger glyph itself to stay white on mobile */
.app-mobile-header #menuBtn{color:#ff2d2d !important;font-size:20px;line-height:1}

/* Keep body from scrolling when drawer is open */
body.drawer-open{overflow:hidden}
@media (min-width:981px){body.drawer-open{overflow:auto}}


/* Desktop shell fix */
.app-main{min-width:0}

/* Mobile layout: hide desktop sidebar, show header + drawer */
@media (max-width:980px){
  .app-shell{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .app-mobile-header{display:flex}
  .app-sidebar{display:none}
  .app-main{padding:16px}
}

/* Drawer */
.app-drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:44}
.app-drawer{position:fixed;inset:0 auto 0 0;width:min(320px,86vw);background:var(--red);color:#111;z-index:45;box-shadow:var(--shadow);overflow:hidden}
.app-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:14px;border-bottom:1px solid rgba(0,0,0,.12)}
.app-drawer-title{font-weight:900}
.app-drawer-body{padding:14px;overflow:auto;height:calc(100vh - 56px);padding-bottom:calc(14px + env(safe-area-inset-bottom));-webkit-overflow-scrolling:touch}
@media (min-width:981px){.app-drawer,.app-drawer-overlay{display:none!important}}
@media (min-width:981px){.app-sidebar .side-user .avatar img{object-fit:contain;padding:6px;background:rgba(255,255,255,.35)}}

.card.quick{ margin-top:14px; }
.pill.ok{ background:rgba(34,197,94,.18); color:rgba(12,74,110,1); border:1px solid rgba(34,197,94,.45); }
.btn.btn-ghost{ background:rgba(255,255,255,.92); color:#111; border:1px solid rgba(0,0,0,.12); box-shadow:0 10px 22px rgba(0,0,0,.12); }
.btn.btn-ghost:hover{ transform:translateY(-1px); }

/* Header buttons readable on gradient */
.page-head .btn.secondary{color:#fff;border-color:rgba(255,255,255,.5);background:rgba(0,0,0,.18)}
.page-head .btn.secondary:hover{background:rgba(0,0,0,.28)}


.auth-logo{width: 168px;height: 168px;object-fit:contain;filter:drop-shadow(0 10px 18px rgba(0,0,0,.20));}

.auth-title{font-weight:900;letter-spacing:.3px;color:#0b1220;font-size:18px}


/* ===== Public landing (/) ===== */
.public{min-height:100vh;background:linear-gradient(135deg,#2a0b0b 0%, #7b0f0f 40%, #b31414 100%);color:#fff;}
.public-top{position:sticky;top:0;z-index:40;background:rgba(0,0,0,.20);backdrop-filter:blur(10px);border-bottom:1px solid rgba(255,255,255,.12);}
.public-top-inner{max-width:1100px;margin:0 auto;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.public-brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;}
.public-logo{width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 10px 18px rgba(0,0,0,.25));}
.public-brand-text{font-weight:800;letter-spacing:.2px}
.public-links{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.public-link{color:#fff;text-decoration:none;opacity:.9}
.public-link:hover{opacity:1;text-decoration:underline}
.public-main{max-width:1100px;margin:0 auto;padding:22px 18px 40px;}
.public-footer{border-top:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.18);}
.public-footer-inner{max-width:1100px;margin:0 auto;padding:16px 18px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;}

.landing-hero{padding:16px 0 6px;}
.landing-hero-inner{position:relative;display:grid;grid-template-columns:1.2fr .8fr;gap:18px;align-items:start;}
.landing-title{font-size:40px;line-height:1.05;margin:0 0 10px;font-weight:900;}
.landing-subtitle{font-size:16px;opacity:.92;margin:0 0 14px;max-width:60ch;}
.landing-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px;}
.landing-pills{display:flex;gap:8px;flex-wrap:wrap}
.poster-card{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);border-radius:18px;padding:16px;box-shadow:0 18px 40px rgba(0,0,0,.28);}
.landing-hero-art{display:flex;flex-direction:column;align-items:center;gap:12px;}
.poster-logo{width:54px;height:54px;object-fit:contain;margin-bottom:8px;filter:drop-shadow(0 12px 18px rgba(0,0,0,.25));}
.poster-title{font-weight:900;margin:2px 0 8px}
.poster-steps{margin:0;padding-left:18px;display:grid;gap:8px}
.landing-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.landing-card{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:14px}
.landing-card-title{font-weight:900;margin-bottom:6px}
.landing-card-text{opacity:.9}
@media(max-width:900px){
  .landing-hero-inner{grid-template-columns:1fr}
  .landing-title{font-size:32px}
  .landing-grid{grid-template-columns:1fr}
}

/* ===== Admin namespace safety ===== */
.admin .topbar{background:linear-gradient(135deg,#2a0b0b 0%, #7b0f0f 40%, #b31414 100%);color:#fff;border-bottom:1px solid rgba(255,255,255,.14);}
.admin .brand-title,.admin .brand-subtitle{color:#fff}
.admin .tab{color:#fff}
.admin .navdrop summary{color:#fff}
.admin .nav-toggle{color:#fff;border-color:rgba(255,255,255,.35)}
.admin .container{max-width:1200px}

.btn-sm{padding:8px 10px;font-size:13px;}


.landing-kicker{display:inline-block;font-weight:800;letter-spacing:.08em;text-transform:uppercase;font-size:12px;opacity:.9;margin-bottom:8px}
.landing-section{padding:20px 0}
.landing-section-inner{max-width:980px;margin:0 auto;padding:0 14px}
.prose{max-width:80ch}
.hero-card{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);border-radius:22px;padding:16px;box-shadow:0 18px 40px rgba(0,0,0,.28)}
.hero-card-top{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.hero-logo{width:56px;height:56px;object-fit:contain;filter:drop-shadow(0 12px 18px rgba(0,0,0,.25))}
.hero-card-title{font-weight:900;font-size:18px}
.hero-svg{width:100%;height:auto;border-radius:18px;display:block}
@media (max-width: 860px){
  .landing-hero-inner{grid-template-columns:1fr}
}



.stack-lg{display:flex;flex-direction:column;gap:18px}
.form-row{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}
.form-row .field{min-width:180px}
.form-row .field.grow{flex:1 1 280px;min-width:240px}
.form-row .field.actions{min-width:140px}
.avatar-badge{width:34px;height:34px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;
  font-weight:900;font-size:12px;letter-spacing:.02em;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18)}
.list-left{display:flex;align-items:center;gap:10px}
.name{font-weight:800}
@media (max-width: 680px){
  .form-row .field{min-width:100%}
  .form-row .field.actions{min-width:100%}
}



/* Landing media */
.landing-section{padding:28px 0;}
.landing-section-inner{max-width:1100px;margin:0 auto;padding:0 18px;}
.landing-media-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px;}
.landing-media{border-radius:16px;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.03);box-shadow:0 10px 30px rgba(0,0,0,.25);}
.landing-media img{display:block;width:100%;height:auto;}
@media(max-width:860px){.landing-media-grid{grid-template-columns:1fr;}}


/* Avatar images */
.avatar-img{width:38px;height:38px;border-radius:999px;object-fit:cover;display:block;border:1px solid rgba(255,255,255,0.10);background:rgba(255,255,255,0.06);}


/* Landing hero corner image */
.hero-corner{position:static;display:flex;justify-content:center;margin:0 0 10px;max-width:240px;width:100%;opacity:0.98;}
.hero-corner img{width:100%;max-width:240px;height:auto;border-radius:14px;box-shadow:0 12px 30px rgba(0,0,0,.25);display:block;}
@media (max-width:720px){.hero-corner{max-width:220px;}}


/* Members grid on customer dashboard */
.members-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
@media (max-width: 900px){.members-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 520px){.members-grid{grid-template-columns:1fr;}}

.member-card{
  display:flex;
  gap:14px;
  align-items:center;
  padding:18px;
  border:2px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:var(--card);
  text-decoration:none;
  color:inherit;
  transition:transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}

.member-card:hover{
  border-color:var(--red);
  transform:translateY(-3px);
  box-shadow:0 12px 32px rgba(0,0,0,.25);
}

.member-card .avatar{
  width:64px;
  height:64px;
  border-radius:16px;
  overflow:hidden;
  flex-shrink:0;
  box-shadow:0 4px 12px rgba(0,0,0,.20);
}

.member-card .avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.member-meta{min-width:0;flex:1}
.member-name{font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.2px}

.pill{
  display:inline-block;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:4px 10px;
  margin-right:6px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
}

.pill.child{background:rgba(122,162,255,.18);border-color:rgba(122,162,255,.30);color:#3b5998}
.mt16{margin-top:16px}
.gap12{gap:12px}

/* Make login/signup logo 20% bigger */
.auth-logo img{width:calc(var(--logo-size, 140px) * 1.2);max-width:220px}

.hero-art-img{width:100%;max-width:420px;height:auto;display:block;filter:drop-shadow(0 20px 40px rgba(0,0,0,.35));}

.auth-logo{width:168px;max-width:220px;height:auto;}


/* Landing hero images */
.hero-card { display:flex; align-items:center; justify-content:center; padding: 24px; }
.hero-images { display:flex; gap:16px; align-items:center; justify-content:center; flex-wrap:wrap; width:100%; }
.hero-img { display:block; border-radius:16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width:100%; height:auto; }
.hero-img--novakey { width: 220px; }
.hero-img--dragon { width: 360px; }

@media (max-width: 900px){
  .hero-img--novakey { width: 200px; }
  .hero-img--dragon { width: 100%; max-width: 520px; }
}

.span-2 { grid-column: 1 / -1; }


/* Landing definition card */
.definition-card{margin-top:18px;padding:16px 16px 10px;border-radius:16px;background:rgba(0,0,0,.22);border:1px solid rgba(255,255,255,.14)}
.definition-card h2{margin:0 0 10px;font-size:18px;color:#fff}
.definition-card p{margin:0 0 10px;color:rgba(255,255,255,.88)}
.poster-img{width:100%;height:auto;display:block;border-radius:18px}


/* --- Overrides to stabilize layout (v23) --- */

/* Sidebar: keep branding compact */
.app-sidebar img { max-width: 48px; height: auto; }
.side-brand img.brand-logo { width: 36px !important; height: 36px !important; }
.side-user .side-avatar .avatar{width:84px;height:84px;border-radius:999px;overflow:hidden;border:3px solid rgba(255,255,255,.85);box-shadow:0 6px 18px rgba(0,0,0,.25);}
.side-user .side-avatar .avatar img{width:100%;height:100%;object-fit:cover;display:block}

/* Dashboard members: allow full-width + responsive wrapping */
.card.members-card { width: 100%; }
.members-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.members-grid .member-card { flex: 1 1 240px; min-width: 220px; max-width: 360px; }
.members-grid .member-card a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }

/* Public landing hero images */
.hero-right { position: relative; }
.hero-corner { position: static !important; margin: 0 auto 12px !important; width: 100% !important; text-align: center; display:flex; justify-content:center; }
.hero-corner img { width: 220px !important; max-width: 260px !important; height: auto !important; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.hero-right img.hero-img--dragon { width: 420px; max-width: 100%; height: auto; border-radius: 18px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-corner { position: static !important; margin-top: 14px; }
  .hero-corner img { width: 200px !important; max-width: 80vw !important; }
  .hero-right { display: flex; flex-direction: column; align-items: center; }
}

.landing-hero-art .poster-card{width:100%;max-width:520px}



/* --- Customer UI tweaks (2026-01-01) --- */
.side-user{align-items:center}
.side-user-meta{display:flex;flex-direction:column;gap:2px;min-width:0;align-items:center;text-align:center}
.side-user .name{font-size:16px;line-height:1.15;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user .email{max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.change-character{margin-top:8px}

.members-card .card-head{margin-bottom:12px}
.members-grid{margin-top:10px}
.grid2.mt24{margin-top:24px}

/* Make member tiles feel clickable */
.member, .member-card{cursor:pointer}
.member:hover, .member-card:hover{transform:translateY(-1px)}

.child-edit-pill{margin-left:auto;align-self:center}


/* Household page - keep member rows horizontal (no grid columns) */
.stack { display: flex; flex-direction: column; }
.avatar-link { display: inline-flex; align-items: center; text-decoration: none; }
.avatar-link:hover { opacity: 0.95; }
/* Ensure list rows stay full width */
.list .row.between { width: 100%; }


/* Mobile hamburger menu */
.icon-btn--menu{
  display:none;
  color:#fff;
  font-size:20px;
  line-height:1;
}
@media (max-width: 900px){
  .icon-btn--menu{ display:inline-flex; }
  .app-sidebar{ display:none; }
  body.drawer-open{ overflow:hidden; }
  .app-drawer{ width: 86vw; max-width: 360px; }
}

/* ===== Fix huge logo in mobile drawer/sidebar ===== */
.side-brand .logo{width:42px;height:42px;border-radius:12px;object-fit:cover;box-shadow:0 10px 22px rgba(0,0,0,.25)}
@media (max-width: 900px){
  .side-brand .logo{width:38px;height:38px}
}

/* ===== Bands & Cards (Devices) ===== */
.device-legend{display:flex;gap:14px;margin-top:10px;flex-wrap:wrap}
.device-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:rgba(255,255,255,.65)}
.device-item img{width:56px;height:36px;object-fit:contain}
.device-title{font-weight:900}

.uid-list{display:flex;flex-direction:column;gap:10px}
.uid-row{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid rgba(0,0,0,.10);border-radius:16px;background:rgba(255,255,255,.92)}
.uid-media img{width:64px;height:40px;object-fit:contain}
.uid-main{flex:1;min-width:0}
.uid-title{font-weight:900;letter-spacing:.2px}
.uid-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
@media (max-width: 900px){
  .uid-row{flex-direction:row}
  .uid-actions{justify-content:flex-start}
}


/* Dashboard compact Nova Key list */
.uid-list.compact .uid-row{padding:10px 12px;}
.uid-list.compact .uid-media img{width:48px;height:48px;}
.uid-list.compact .uid-actions{gap:8px;}
@media (max-width: 720px){.uid-list.compact .uid-actions{align-items:flex-end;}}

/* Sidebar avatar should never squash into an oval */
.side-user .avatar{flex:0 0 auto;min-width:84px;min-height:84px;aspect-ratio:1/1}
.side-avatar{display:flex;justify-content:center}


/* Linked adult indicator */
.pill.linked{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:900;background:rgba(34,197,94,.16);border:1px solid rgba(34,197,94,.45);color:rgba(20,83,45,1)}
.pill.linked .dot{width:8px;height:8px;border-radius:999px;background:rgba(34,197,94,.9)}
.pill.link-green{background:rgba(34,197,94,.16);border:1px solid rgba(34,197,94,.45);color:rgba(20,83,45,1)}


/* Sidebar avatar hard-lock (prevents oval squish on wide screens) */
.side-user .side-avatar{width:84px!important;height:84px!important;flex:0 0 84px;display:flex;justify-content:center;align-items:center}
.side-user .avatar{width:84px!important;height:84px!important;min-width:84px!important;min-height:84px!important;aspect-ratio:1/1;border-radius:50%!important;overflow:hidden}
.side-user .avatar img{width:100%!important;height:100%!important;object-fit:cover;display:block}


/* Roomier header on Household page */
.page-head--roomy{
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}
.page-head--roomy .page-sub{
  margin-top:8px;
  max-width:none;
}
.page-head--roomy .page-actions{
  margin-top:6px;
  margin-left:auto;
}

/* Household member cards */
.member-card{
  padding:12px 12px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:14px;
  margin-bottom:10px;
}

/* Link badge is only for linked accounts now */
.avatar{ position:relative; }
.link-badge{
  position:absolute;
  right:-6px;
  bottom:-6px;
  width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(0,0,0,0.75);
  color:#fff;
  font-size:11px;
  line-height:1;
  border:2px solid #fff;
}

.mt-8{margin-top:8px;}

.mb-12{margin-bottom:12px;}

/* Household invite verification box */
.invite-card{
  background: #fff7cc;
  border: 1px solid rgba(0,0,0,.08);
}
.invite-card .muted{opacity:.9}


/* --- Profile polish (Apple-ish) --- */
.kv{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.kv-row{display:grid;grid-template-columns:160px 1fr;gap:14px;align-items:start;padding:10px 0;border-bottom:1px solid rgba(15,23,42,.08)}
.kv-row:last-child{border-bottom:none}
.k{font-weight:700;color:rgba(11,18,32,.70);font-size:13px;letter-spacing:-.2px}
.v{font-weight:600;color:rgba(11,18,32,.92);font-size:14px;line-height:1.35}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-weight:600}

.divider{height:1px;background:rgba(15,23,42,.10);margin:18px 0}
.subhead{margin:0 0 10px 0;font-size:15px;letter-spacing:-.2px}

.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
@media (max-width:720px){
  .kv-row{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr}
}

/* Make form fields feel consistent everywhere */
input, select, textarea{
  font-family:inherit;
}

/* =========================================
   Avatar hard override: undo sidebar img shrink
   ========================================= */

/* DO NOT let the generic sidebar img rule touch the avatar */
.app-sidebar .side-user .avatar img,
.app-sidebar .side-user .side-avatar .avatar img {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  padding: 0 !important;
  background: transparent !important;
  display: block !important;
  border-radius: 50% !important;
}

/* Keep the container truly circular */
.app-sidebar .side-user .avatar,
.app-sidebar .side-user .side-avatar .avatar {
  width: 84px !important;
  height: 84px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
}

/* =========================================================
   Sidebar UX: sticky user block + scrollable nav + always-visible logout
   Works for desktop sidebar and mobile drawer
   ========================================================= */

/* Desktop sidebar: make it a fixed-height column and allow internal scrolling */
@media (min-width: 981px){
  .app-sidebar{
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden; /* prevents the whole page from fighting the sidebar */
  }

  /* Ensure the sidebar content can layout as: [brand+user] [scrolling nav] [footer/logout] */
  .app-sidebar .sidebar-inner{
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* critical for scroll containers */
  }

  /* Keep the user block visible when nav scrolls */
  .app-sidebar .side-user{
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: 8px;
    padding-bottom: 10px;
    background: var(--red); /* prevents “see-through” when it sticks */
    border-bottom: 1px solid rgba(0,0,0,.10);
  }

  /* Nav becomes the scroll area */
  .app-sidebar .side-nav{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  /* Footer/logout always stays visible at bottom */
  .app-sidebar .side-footer{
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--red);
    border-top: 1px solid rgba(0,0,0,.10);
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* Mobile drawer: same idea, but inside the drawer body */
@media (max-width: 980px){
  /* Make drawer body a column so we can pin user/footer and scroll nav */
  .app-drawer-body{
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    min-height: 0;
    overflow: hidden; /* nav will scroll, not the whole body */
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  /* Keep user block visible inside drawer */
  .app-drawer-body .side-user{
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--red);
    padding-top: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,.10);
  }

  /* Nav scrolls inside drawer */
  .app-drawer-body .side-nav{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  /* Footer/logout stays at bottom inside drawer */
  .app-drawer-body .side-footer{
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--red);
    border-top: 1px solid rgba(0,0,0,.10);
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* =========================================================
   Dashboard – Household section title prominence
   Make household name match "Your Nova Keys" visual weight
   ========================================================= */

/* Household card title / name */
.card.members-card .card-head h2,
.card.members-card .card-head .name,
.card.members-card .card-head strong {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.1;
  margin: 0;
}

/* Optional: tighten spacing so it feels intentional */
.card.members-card .card-head {
  margin-bottom: 14px;
  align-items: center;
}



/* =============================================================
   HOME DASHBOARD V3  — Mission Control
   Uses prefix "hm-" to avoid any legacy conflicts
   ============================================================= */

/* ── Invite banner ── */
.hm-invite{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
  gap:12px;padding:12px 18px;border-radius:16px;margin-bottom:14px;
  background:#fff9db;border:1px solid rgba(234,179,8,.30);
}
.hm-invite-left{display:flex;align-items:center;gap:12px}
.hm-invite-ico{font-size:22px}
.hm-invite-title{font-size:14px;font-weight:800;color:#111}
.hm-invite-sub{font-size:12px;color:#64748b;margin-top:1px}
.hm-invite-btns{display:flex;gap:8px}

/* ── Buttons ── */
.hm-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:9px 16px;border-radius:999px;border:none;
  font-size:13px;font-weight:800;cursor:pointer;
  transition:filter .1s ease, transform .08s ease;
  font-family:inherit;text-decoration:none;
}
.hm-btn:hover{filter:brightness(.94);transform:translateY(-1px)}
.hm-btn--accept{background:var(--red);color:#fff}
.hm-btn--ghost{background:rgba(0,0,0,.09);color:#111}
.hm-btn--glow{
  background:linear-gradient(135deg,#8b5cf6,#6d28d9);
  color:#fff;box-shadow:0 8px 24px rgba(109,40,217,.35);
  margin-top:14px;
}
.hm-btn-sm{padding:7px 13px;font-size:12px}

/* ── Hero banner ── */
.hm-hero{
  display:flex;align-items:center;justify-content:space-between;
  background:linear-gradient(135deg, var(--red) 0%, #9b1010 55%, #6b0a0a 100%);
  border-radius:22px;
  padding:22px 24px;
  margin-bottom:16px;
  box-shadow:0 14px 40px rgba(255,42,42,.22), 0 4px 12px rgba(0,0,0,.3);
  position:relative;
  overflow:hidden;
}
/* subtle star-field dots */
.hm-hero::before{
  content:'';position:absolute;inset:0;
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 52% 70%, rgba(255,255,255,.07) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 85%, rgba(255,255,255,.06) 0 1px, transparent 2px),
    radial-gradient(circle at 35% 55%, rgba(255,255,255,.05) 0 1px, transparent 2px);
  pointer-events:none;
}
.hm-hero-left{display:flex;flex-direction:column;gap:4px;position:relative}
.hm-hero-eyebrow{
  font-size:12px;font-weight:700;color:rgba(255,255,255,.65);
  text-transform:uppercase;letter-spacing:.5px;
}
.hm-hero-name{
  font-size:30px;font-weight:900;color:#fff;
  letter-spacing:-.5px;line-height:1.05;
}
.hm-hero-sub{
  font-size:13px;color:rgba(255,255,255,.6);font-weight:600;margin-top:2px;
}
.hm-hero-avatar-wrap{text-decoration:none;flex:0 0 auto;position:relative}
.hm-av-hero{
  width:62px!important;height:62px!important;
  min-width:62px!important;min-height:62px!important;
  border-radius:50%!important;overflow:hidden!important;display:block!important;
  border:3px solid rgba(255,255,255,.45);
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.hm-av-hero img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;border-radius:50%!important}
@media(max-width:400px){
  .hm-hero{padding:18px}
  .hm-hero-name{font-size:24px}
  .hm-av-hero{width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important}
}
.hm-av-member{
  width:52px!important;height:52px!important;
  min-width:52px!important;min-height:52px!important;
  border-radius:50%!important;overflow:hidden!important;display:block!important;
  flex:0 0 auto;
}
.hm-av-member img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;border-radius:50%!important}

/* ═══════════════════════════════════════════════
   STORY HERO CARD
   ═══════════════════════════════════════════════ */
.hm-story-hero{
  background:linear-gradient(145deg, #0e1421 0%, #121929 60%, rgba(15,20,30,0.92) 100%);
  border:1px solid rgba(255,255,255,.09);
  border-top:2px solid var(--story-color);
  border-radius:24px;
  padding:22px 22px 18px;
  margin-bottom:18px;
  box-shadow:0 12px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.2);
  position:relative;
  overflow:hidden;
}
/* Subtle glow orb in corner */
.hm-story-hero::before{
  content:'';position:absolute;top:-40px;right:-40px;
  width:180px;height:180px;border-radius:50%;
  background:radial-gradient(circle, rgba(139,92,246,.12) 0%, transparent 70%);
  pointer-events:none;
}

.hm-story-hero-top{
  display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;
}
.hm-story-type-badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 12px;border-radius:999px;
  background:rgba(139,92,246,.12);
  border:1px solid rgba(139,92,246,.30);
  color:var(--story-color);font-size:12px;font-weight:800;
  text-transform:uppercase;letter-spacing:.5px;
}
.hm-story-switch-toggle{
  padding:6px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.07);color:rgba(255,255,255,.75);
  font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;
  transition:background .1s,color .1s;
}
.hm-story-switch-toggle:hover{background:rgba(255,255,255,.14);color:#fff}

.hm-story-name{
  font-size:28px;font-weight:900;color:#fff;letter-spacing:-.4px;
  line-height:1.05;margin-bottom:18px;
}
@media(max-width:480px){.hm-story-name{font-size:22px}}

/* ── Progress block ── */
.hm-progress-block{
  background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.07);
  border-radius:16px;padding:16px;margin-bottom:16px;
}
.hm-progress-row{
  display:flex;align-items:center;gap:14px;margin-bottom:10px;
}
.hm-progress-stat{text-align:center;flex:0 0 auto}
.hm-progress-stat--right{text-align:center}
.hm-progress-num{font-size:26px;font-weight:900;color:#fff;line-height:1}
.hm-progress-lbl{font-size:10px;font-weight:700;color:rgba(255,255,255,.45);text-transform:uppercase;letter-spacing:.4px;margin-top:2px}
.hm-progress-bar-wrap{flex:1;min-width:0}
.hm-progress-bar{
  height:8px;background:rgba(255,255,255,.12);border-radius:999px;overflow:hidden;
  margin-bottom:6px;
}
.hm-progress-fill{
  height:100%;background:var(--story-color);border-radius:999px;
  transition:width .6s cubic-bezier(.4,0,.2,1);
  box-shadow:0 0 8px rgba(139,92,246,.50);
}
.hm-progress-pct{font-size:11px;font-weight:700;color:rgba(255,255,255,.5);text-align:center}
.hm-chapter-pill{
  display:inline-flex;align-items:center;
  padding:4px 12px;border-radius:999px;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);
  font-size:12px;font-weight:700;color:rgba(255,255,255,.8);
  letter-spacing:.2px;
}

/* ── Story switcher (panel that drops in) ── */
.hm-story-switcher{
  background:rgba(0,0,0,.3);border:1px solid rgba(255,255,255,.1);
  border-radius:16px;padding:14px;margin-bottom:14px;
}
.hm-story-switcher--visible{display:block}
.hm-switcher-label{
  font-size:11px;font-weight:800;color:rgba(255,255,255,.45);
  text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px;
}
.hm-switcher-list{display:flex;flex-direction:column;gap:6px}
.hm-switcher-option{
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;border-radius:12px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  cursor:pointer;text-align:left;font-family:inherit;
  transition:background .1s,border-color .1s,transform .08s;
  width:100%;
}
.hm-switcher-option:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2);transform:translateX(2px)}
.hm-switcher-option:disabled{opacity:.5;cursor:default;transform:none}
.hm-switcher-ico{font-size:20px;flex:0 0 auto}
.hm-switcher-info{flex:1;min-width:0}
.hm-switcher-name{font-size:14px;font-weight:800;color:#fff;line-height:1.2}
.hm-switcher-type{font-size:11px;font-weight:600;color:rgba(255,255,255,.45);text-transform:uppercase;letter-spacing:.3px;margin-top:2px}
.hm-switcher-arrow{font-size:16px;color:rgba(255,255,255,.35);flex:0 0 auto}

/* ── No story state ── */
.hm-no-story{text-align:center;padding:18px 0 12px}
.hm-no-story-icon{font-size:40px;color:rgba(255,255,255,.18);margin-bottom:10px}
.hm-no-story-title{font-size:20px;font-weight:900;color:rgba(255,255,255,.7)}
.hm-no-story-sub{font-size:13px;color:rgba(255,255,255,.4);margin-top:6px}

/* ── My Keys row ── */
.hm-keys-row{
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:14px;
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
}
.hm-keys-label{
  font-size:11px;font-weight:800;color:rgba(255,255,255,.4);
  text-transform:uppercase;letter-spacing:.5px;flex:0 0 auto;
}
.hm-keys-list{display:flex;flex-wrap:wrap;gap:6px;flex:1}
.hm-key-chip{
  display:inline-flex;align-items:center;gap:5px;
  padding:5px 10px;border-radius:999px;
  background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.12);
  font-size:12px;font-weight:700;color:rgba(255,255,255,.55);
  font-family:ui-monospace,monospace;
}
.hm-key-chip--active{
  background:rgba(34,197,94,.12);border-color:rgba(34,197,94,.35);color:rgba(134,239,172,1);
}
.hm-key-chip span{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hm-keys-empty{flex:1}
.hm-keys-add{font-size:12px;font-weight:700;color:rgba(255,255,255,.35);text-decoration:none}
.hm-keys-add:hover{color:rgba(255,255,255,.65)}
.hm-keys-empty-lbl{font-size:12px;color:rgba(255,255,255,.3)}

/* ═══════════════════════════════════════════════
   HOUSEHOLD MEMBER SCROLL
   ═══════════════════════════════════════════════ */
.hm-family-section{margin-bottom:24px}
.hm-family-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:12px;
}
.hm-family-title{font-size:15px;font-weight:900;color:#e5e7eb}
.hm-family-manage{font-size:13px;font-weight:700;color:var(--red);text-decoration:none}
.hm-family-manage:hover{text-decoration:underline}

.hm-family-scroll{
  display:flex;gap:10px;overflow-x:auto;padding-bottom:10px;
  -webkit-overflow-scrolling:touch;scrollbar-width:none;
}
.hm-family-scroll::-webkit-scrollbar{display:none}

/* Member bubbles */
.hm-member-bubble{
  flex:0 0 auto;width:106px;
  display:flex;flex-direction:column;align-items:center;gap:7px;
  padding:14px 10px 12px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.09);
  border-radius:20px;cursor:pointer;
  transition:background .12s,border-color .12s,transform .08s;
  font-family:inherit;text-align:center;
}
.hm-member-bubble:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.16);transform:translateY(-2px)}
.hm-bubble--active{
  background:rgba(139,92,246,.12)!important;
  border-color:rgba(139,92,246,.45)!important;
  box-shadow:0 0 0 2px rgba(139,92,246,.25);
}

.hm-bubble-name{
  font-size:12px;font-weight:800;color:#e5e7eb;line-height:1.2;
  width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.hm-child-tag{
  display:inline-block;font-size:9px;font-weight:800;
  padding:1px 5px;border-radius:999px;
  background:rgba(59,130,246,.2);border:1px solid rgba(59,130,246,.35);
  color:#93c5fd;text-transform:uppercase;letter-spacing:.3px;margin-right:3px;
}
.hm-bubble-story{
  font-size:10px;font-weight:700;color:rgba(139,92,246,.9);
  background:rgba(139,92,246,.12);border:1px solid rgba(139,92,246,.25);
  border-radius:999px;padding:3px 8px;
  width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  line-height:1.3;
}
.hm-bubble-story--none{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.08);color:rgba(255,255,255,.3)}
.hm-bubble-bar{
  width:100%;height:4px;background:rgba(255,255,255,.1);border-radius:999px;overflow:hidden;
}
.hm-bubble-fill{height:100%;background:#8b5cf6;border-radius:999px;transition:width .5s ease}

/* Add member button */
.hm-member-add{
  flex:0 0 auto;width:80px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  padding:14px 10px;
  border:2px dashed rgba(255,255,255,.12);border-radius:20px;
  text-decoration:none;color:rgba(255,255,255,.25);
  transition:border-color .1s,color .1s;
}
.hm-member-add:hover{border-color:var(--red);color:var(--red)}
.hm-member-add-ico{font-size:22px;line-height:1}
.hm-member-add-lbl{font-size:11px;font-weight:800}

/* ── Inline Member Panel ── */
.hm-member-panel{
  background:linear-gradient(145deg,#0e1421,#141d2e);
  border:1px solid rgba(255,255,255,.1);border-radius:22px;
  overflow:hidden;margin-top:12px;
  animation:hmPanelIn .18s ease;
}
@keyframes hmPanelIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

.hm-panel-header{
  display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:18px 20px;
  border-bottom:1px solid rgba(255,255,255,.07);
  border-top:3px solid var(--panel-color,#8b5cf6);
}
.hm-panel-avatar{
  width:56px;height:56px;border-radius:50%;object-fit:cover;flex:0 0 auto;
  border:2px solid rgba(255,255,255,.2);
}
.hm-panel-id{flex:1;min-width:0}
.hm-panel-name{font-size:18px;font-weight:900;color:#fff;line-height:1.1}
.hm-panel-meta{font-size:12px;color:rgba(255,255,255,.4);margin-top:2px}
.hm-panel-edit-link{display:block;font-size:12px;font-weight:700;color:var(--red);text-decoration:none;margin-top:4px}
.hm-panel-edit-link:hover{text-decoration:underline}
.hm-panel-story-badge{
  padding:5px 13px;border-radius:999px;font-size:12px;font-weight:800;
  border:1px solid transparent;white-space:nowrap;
}
.hm-panel-badge--none{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.12);color:rgba(255,255,255,.35)}

.hm-panel-body{padding:18px 20px;display:flex;flex-direction:column;gap:18px}
.hm-panel-progress{}
.hm-panel-prog-row{
  display:flex;align-items:center;gap:14px;margin-bottom:10px;
}
.hm-panel-keys{}
.hm-section-label{
  font-size:11px;font-weight:800;color:rgba(255,255,255,.35);
  text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px;
}
.hm-panel-switcher{margin-top:0}

/* Ensure app-main is dark so the hero card looks correct */
.app-main{
  background:var(--bg);
}

/* Welcome strip lives on the dark background */
.hm-welcome{
  color:#e5e7eb;
}

