:root {
  --theme: #071525;
  --ink: #eef6ff;
  --accent: #ff6b4a;
  --glass: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.32);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --top-bar-space: 0px;
  --bottom-bar-space: calc(78px + var(--safe-bottom));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,107,74,.24), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(86,130,255,.22), transparent 46%),
    var(--theme);
  color: var(--ink);
  font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}

body.is-preview {
  --top-bar-space: 0px;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  gap: 1rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,107,74,.28), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(56,160,255,.2), transparent 45%),
    var(--theme);
  transition: opacity .35s ease;
}
.splash.hide {
  opacity: 0;
  pointer-events: none;
}
.splash img {
  width: min(70vw, 220px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.splash-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.03em;
}

.notify-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(91,140,255,.35), transparent 55%),
    radial-gradient(700px 360px at 90% 90%, rgba(255,107,74,.2), transparent 50%),
    var(--theme);
}
.notify-gate[hidden] { display: none !important; }
.notify-card {
  width: min(420px, 100%);
  text-align: center;
  border-radius: 28px;
  padding: 28px 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.notify-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 14px;
  background: rgba(255,255,255,.08);
}
.notify-card h1 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 800;
}
.notify-card p {
  margin: 0 0 18px;
  color: rgba(238,246,255,.78);
  line-height: 1.45;
  font-size: .95rem;
}
.notify-cta {
  appearance: none;
  border: 0;
  width: 100%;
  border-radius: 16px;
  min-height: 52px;
  font-weight: 800;
  font-size: 1rem;
  color: #1a0a06;
  cursor: pointer;
  background: linear-gradient(90deg, #ff8a66, #ff6b4a);
}
.notify-cta:disabled { opacity: .65; cursor: wait; }
.notify-hint {
  margin: 14px 0 0 !important;
  color: #ffb4a4 !important;
  font-size: .85rem !important;
}

.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 55;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(91,140,255,.28), transparent 55%),
    radial-gradient(700px 360px at 10% 90%, rgba(255,200,90,.12), transparent 50%),
    var(--theme);
}
.welcome-gate[hidden] { display: none !important; }
.welcome-scroll {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: calc(18px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  max-width: 440px;
  margin: 0 auto;
}
.welcome-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  background: rgba(255,255,255,.08);
}
.welcome-sys {
  width: 100%;
  border-radius: 18px;
  padding: 14px 14px 10px;
  background: rgba(8, 22, 42, .72);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.welcome-sys h2 {
  margin: 0 0 12px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: rgba(238,246,255,.72);
}
.welcome-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.welcome-id-row:first-of-type { border-top: 0; padding-top: 0; }
.welcome-id-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.welcome-id-label {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(238,246,255,.55);
}
.welcome-id-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.welcome-copy {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  flex-shrink: 0;
}
.welcome-copy:active { transform: scale(.97); }
.welcome-hero {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0,0,0,.2);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.welcome-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42vh;
  object-fit: cover;
}
.welcome-blurb {
  margin: 0;
  text-align: center;
  color: rgba(238,246,255,.78);
  font-size: .92rem;
  line-height: 1.45;
}
.welcome-cta {
  appearance: none;
  border: 0;
  width: 100%;
  border-radius: 16px;
  min-height: 54px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #1a1204;
  cursor: pointer;
  background: linear-gradient(90deg, #f0c14b, #d4a017);
  box-shadow: 0 10px 28px rgba(212,160,23,.35);
}
.welcome-auto {
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  color: rgba(238,246,255,.62);
}

.top-bar {
  position: fixed;
  top: max(10px, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  overflow: hidden;
}
body.is-preview .top-bar { display: none !important; }

.glass-chip {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: rgba(255,255,255,.12);
  cursor: pointer;
}
.glass-chip.accent {
  background: rgba(255,107,74,.9);
  color: #1a0a06;
}

/* Wrapper stretches; iframe fills it (iframes ignore top+bottom stretch) */
.frame-wrap {
  position: fixed;
  top: var(--top-bar-space);
  left: 0;
  right: 0;
  bottom: var(--bottom-bar-space);
  width: 100%;
  z-index: 1;
  background: #fff;
  overflow: hidden;
}
.frame-wrap.no-nav {
  bottom: 0;
}
.frame-wrap[hidden] {
  display: none !important;
}

.frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 30;
  width: min(94vw, 420px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 8px;
  border-radius: 28px;
  overflow: hidden;
}
.bottom-nav[hidden] {
  display: none !important;
}

/* Liquid-glass look without the React/Tailwind library */
.liquid-glass {
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.06) 40%, rgba(255,255,255,.16)),
    rgba(18, 28, 48, 0.35);
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    0 18px 50px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 15%,
    rgba(255,255,255,.28) 42%,
    transparent 68%
  );
  background-size: 220% 100%;
  animation: glass-shine 6.5s linear infinite;
  opacity: .55;
}
.liquid-glass::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 26px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

@keyframes glass-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  border-radius: 20px;
  padding: 8px 4px 6px;
  display: grid;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
  font: inherit;
  position: relative;
  z-index: 1;
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.nav-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 16px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(10, 18, 36, 0.92);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.update-toast[hidden] { display: none !important; }
.update-toast button {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #5b8cff, #7b5cff);
  cursor: pointer;
}
