/* ScrantonCoin mobile wallet shell — overrides Decision Lab desktop chrome */
:root {
  --purple-deep: #3D1A4A;
  --purple-1: #5b2c6f;
  --purple-2: #7d3c98;
  --gold: #B8860B;
  --gold-soft: #C9A227;
  --gold-bg: #FBF3E0;
  --canvas: #F8FAFC;
  --bg: #F8FAFC;
  --nav-h: 64px;
}

html, body.sc-app-shell {
  background: var(--canvas) !important;
  overflow-x: hidden !important;
  max-width: 100% !important;
  -webkit-text-size-adjust: 100%;
}

body.sc-app-shell .app-shell {
  max-width: 520px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-bottom: calc(16px + var(--safe-bottom, 0px)) !important;
  min-height: 100dvh;
  background: var(--canvas);
}

/* Slim header always visible (except when class gate locks the app) */
body.sc-app-shell .topbar.sc-app-header,
body.sc-app-shell:not(.app-locked) .topbar.sc-app-header,
body.sc-app-shell.is-authed .topbar.sc-app-header,
body.sc-app-shell:not(.is-authed) .topbar.sc-app-header {
  display: flex !important;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 52px;
  background: #ffffff !important;
  color: var(--purple-deep);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 10px rgba(61, 26, 74, 0.08);
  flex-wrap: nowrap;
}

body.sc-app-shell.app-locked .topbar {
  display: none !important;
}

body.sc-app-shell .topbar .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--purple-deep);
  background: #000;
  object-fit: cover;
  flex-shrink: 0;
}

body.sc-app-shell .topbar .brand-text {
  flex: 1;
  min-width: 0;
}

body.sc-app-shell .topbar .brand-text h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--purple-deep) !important;
}

body.sc-app-shell .topbar .brand-text p {
  display: block !important;
  margin: 0;
  font-size: 0.72rem;
  color: var(--gold) !important;
  opacity: 1 !important;
}

body.sc-app-shell .header-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 46%;
}

body.sc-app-shell .header-account #accountIdentity {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

body.sc-app-shell .role-view-bar,
body.sc-app-shell #roleToggle {
  display: none !important;
}

/* Bottom bars removed — tiles + shell-top-nav only (no WebView CSS injection needed) */
body.sc-app-shell .bottom-nav,
body.sc-app-shell.is-authed .bottom-nav.auth-only,
body.sc-app-shell:not(.is-authed) .bottom-nav.guest-only,
body.sc-app-shell .bottom-nav.guest-only,
body.sc-app-shell .bottom-nav.auth-only {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  position: static !important;
}

body.sc-app-shell .shell-top-nav {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 12px 10px;
  background: #ffffff;
  border-bottom: 1px solid #e5d6ee;
  position: sticky;
  top: 52px;
  z-index: 35;
}

body.sc-app-shell.app-locked .shell-top-nav {
  display: none !important;
}

body.sc-app-shell .shell-top-nav button {
  min-height: 40px;
  border: 1px solid #e5d6ee;
  border-radius: 12px;
  background: var(--canvas, #F8FAFC);
  color: var(--purple-deep, #3D1A4A);
  font-size: 0.78rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.sc-app-shell .shell-top-nav button.active {
  background: var(--gold-bg, #FBF3E0);
  border-color: var(--gold, #B8860B);
  color: var(--purple-deep, #3D1A4A);
}


/* Pages / cards */
body.sc-app-shell .page {
  max-width: 100% !important;
  padding: 14px 14px 24px !important;
}

body.sc-app-shell .card,
body.sc-app-shell .sim-start-card,
body.sc-app-shell .card-soft {
  border-radius: 16px;
  border-color: #e5d6ee;
}

body.sc-app-shell .btn {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  touch-action: manipulation;
}

body.sc-app-shell .btn.sm {
  min-height: 40px;
}

body.sc-app-shell input,
body.sc-app-shell select,
body.sc-app-shell textarea {
  min-height: 48px;
  font-size: 16px !important; /* avoid iOS zoom */
  border-radius: 12px;
}

body.sc-app-shell .sim-kicker {
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

body.sc-app-shell .sim-band h2,
body.sc-app-shell .hero h2,
body.sc-app-shell .card h2 {
  color: var(--purple-deep);
}

body.sc-app-shell .app-footer {
  text-align: center;
  padding: 8px 16px 12px;
  color: var(--muted, #6e5a78);
}

body.sc-app-shell .home-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

body.sc-app-shell .home-actions .btn {
  width: 100%;
}

/* Gate card phone-friendly */
body.sc-app-shell #siteGate .site-gate-card,
body.sc-app-shell .site-gate-card {
  max-width: min(420px, 96vw) !important;
  width: min(420px, 96vw) !important;
  border-top: 3px solid var(--gold);
}

body.sc-app-shell .site-gate-brand {
  color: var(--purple-deep);
  letter-spacing: 0.08em;
}

body.sc-app-shell .site-gate-sub {
  color: var(--gold);
}

/* Desktop: still phone-column shell (WebView preview) */
@media (min-width: 900px) {
  body.sc-app-shell .bottom-nav,
  body.sc-app-shell.is-authed .bottom-nav.auth-only,
  body.sc-app-shell:not(.is-authed) .bottom-nav.guest-only {
    display: none !important;
  }
  body.sc-app-shell .topbar.sc-app-header,
  body.sc-app-shell.is-authed .topbar.sc-app-header,
  body.sc-app-shell:not(.is-authed) .topbar.sc-app-header {
    display: flex !important;
  }
  body.sc-app-shell .app-shell {
    max-width: 520px !important;
    box-shadow: 0 0 0 1px #e5d6ee, 0 12px 40px rgba(61, 26, 74, 0.12);
  }
}

/* Safe area for notches / home indicator */
@supports (padding: max(0px)) {
  body.sc-app-shell .bottom-nav {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
}

/* (bottom-nav leftover styles inert — bars removed from DOM) */
/* Hide unused Decision Lab chrome remnants if any JS injects */
body.sc-app-shell .sim-topnav,
body.sc-app-shell .auth-topnav {
  display: none !important;
}

/* Student shell: hide Sample Store demo entry points (IDs kept for app.js) */
body.sc-app-shell #siteGateDemoBusiness,
body.sc-app-shell #authDemoBusinessBtn {
  display: none !important;
}

/* student shell: hide Sample Store */
body.sc-app-shell #siteGateDemoBusiness,
body.sc-app-shell #authDemoBusinessBtn {
  display: none !important;
}

/* Hide Decision Lab cert/CORE chrome if app.js injects it into the wallet shell */
body.sc-app-shell [data-nav="certificate"],
body.sc-app-shell [data-nav="learn"],
body.sc-app-shell [data-nav="labs"],
body.sc-app-shell button[data-nav="certificate"] {
  display: none !important;
}
