/* ScrantonCoin — purple campus coin aesthetic */
  :root {
    --purple-1: #5b2c6f;
    --purple-2: #7d3c98;
    --purple-3: #9b59b6;
    --purple-4: #c39bd3;
    --purple-soft: #f5eef8;
    --purple-deep: #3d1a4a;
    --success: #1e8449;
    --danger: #c0392b;
    --warn: #d68910;
    --bg: #ffffff;
    --card: #ffffff;
    --text: #2c1a33;
    --muted: #6e5a78;
    --border: #e5d6ee;
    --shadow: 0 8px 24px rgba(91, 44, 111, 0.12);
    --radius: 14px;
    --nav-h: 52px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }
  html { overflow-y: auto; }
  body { overflow-y: auto; }

  /* Gate up: single scroll on #siteGate overlay, not body + card */
  body.app-locked {
    overflow: hidden;
    height: 100%;
    max-height: 100dvh;
  }
  body.auth-checking > :not(#sessionCheck) { visibility: hidden !important; }
  #sessionCheck {
    position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center;
    padding: 24px; background: #171128; color: #fff; text-align: center;
    font: 600 18px/1.4 system-ui, sans-serif;
  }
  #sessionCheck[hidden] { display: none !important; }
  .instructor-roster-wrap { overflow-x: auto; margin: 12px 0; }
  .instructor-roster { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.82rem; }
  .instructor-roster th, .instructor-roster td {
    text-align: left; vertical-align: top; padding: 9px; border-bottom: 1px solid #ddd;
  }
  .instructor-roster td .btn { margin: 2px; white-space: nowrap; }
  #instructorStudentRecords pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

  a { color: var(--purple-2); }

  .app-shell {
    max-width: none;
    width: 100%;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-h) + 18px + var(--safe-bottom));
    position: relative;
  }

  /* Top brand bar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-2));
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(61, 26, 74, 0.35);
  }
  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--purple-4) 35%, var(--purple-1) 100%);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--purple-deep);
    border: 2px solid rgba(255,255,255,0.55);
    flex-shrink: 0;
  }
  .brand-text h1 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
  }
  .brand-text p {
    margin: 0;
    font-size: 0.72rem;
    opacity: 0.85;
  }
  .role-toggle {
    margin-left: auto;
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
  }
  .role-toggle button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
  }
  .role-toggle button.active {
    background: #fff;
    color: var(--purple-1);
    font-weight: 700;
  }

  /* Pages */
  .page { display: none; padding: 16px; animation: fadeIn 0.2s ease; }
  .page.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
  }
  .card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--purple-1);
  }
  .card h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--purple-2);
  }
  .muted { color: var(--muted); font-size: 0.9rem; }
  .tiny { font-size: 0.75rem; color: var(--muted); }

  .hero {
    text-align: center;
    padding: 18px 8px 8px;
  }
  .hero .coin {
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 28%, #fff 0%, var(--purple-4) 28%, var(--purple-2) 70%, var(--purple-deep) 100%);
    display: grid;
    place-items: center;
    font-size: 42px;
    font-weight: 900;
    color: var(--purple-deep);
    box-shadow: 0 10px 28px rgba(91, 44, 111, 0.35);
    border: 3px solid rgba(255,255,255,0.65);
  }
  .hero h2 { margin: 0 0 6px; color: var(--purple-deep); }
  .pill-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
  .pill {
    background: var(--purple-soft);
    color: var(--purple-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
  }

  label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin: 10px 0 4px;
  }
  input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1rem;
    color: var(--text);
  }
  input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--purple-3);
    border-color: var(--purple-3);
  }
  textarea { min-height: 72px; resize: vertical; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 14px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-2), var(--purple-1));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(125, 60, 152, 0.35);
  }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn.secondary {
    background: #fff;
    color: var(--purple-1);
    border: 1px solid var(--border);
    box-shadow: none;
  }
  .btn.danger { background: linear-gradient(135deg, #e74c3c, var(--danger)); }
  .btn.success { background: linear-gradient(135deg, #27ae60, var(--success)); }
  .btn.sm { width: auto; padding: 8px 12px; margin-top: 0; font-size: 0.8rem; }

  .row { display: flex; gap: 8px; align-items: center; }
  .row .btn { width: auto; flex: 1; }

  .balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .balance-tile {
    background: var(--purple-soft);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
  }
  .balance-tile .val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--purple-1);
    word-break: break-all;
  }
  .balance-tile .lbl { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

  .address-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    word-break: break-all;
    background: #faf7fc;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 10px;
  }

  .qr-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0;
  }
  .qr-wrap canvas, .qr-wrap img {
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    border: 1px solid var(--border);
  }

  .alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.88rem;
  }
  .alert.info { background: #eef5ff; color: #1a5276; border: 1px solid #d4e6f1; }
  .alert.ok { background: #eafaf1; color: var(--success); border: 1px solid #d5f5e3; }
  .alert.err { background: #fdedec; color: var(--danger); border: 1px solid #f5b7b1; }
  .alert.warn { background: #fef9e7; color: #7d6608; border: 1px solid #f9e79f; }

  .tabs-inline {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .tabs-inline button {
    flex: 1;
    min-width: 90px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }
  .tabs-inline button.active {
    background: var(--purple-2);
    color: #fff;
    border-color: var(--purple-2);
  }

  .list { list-style: none; padding: 0; margin: 0; }
  .list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
  }
  .list li:last-child { border-bottom: 0; }
  .list .meta { color: var(--muted); font-size: 0.75rem; }

  /* Bottom nav */
  .bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(520px, 100%);
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    z-index: 30;
    box-shadow: 0 -4px 18px rgba(91, 44, 111, 0.08);
  }
  .bottom-nav button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.62rem;
    padding: 8px 2px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .bottom-nav button .ico { font-size: 1.15rem; line-height: 1; }
  .bottom-nav button.active { color: var(--purple-1); font-weight: 700; }

  .auth-only, .guest-only { display: none; }
  body.is-authed .auth-only { display: block; }
  body.is-authed button.auth-only,
  body.is-authed a.auth-only,
  body.is-authed .row > .auth-only { display: inline-flex; }
  body.is-authed .bottom-nav.auth-only { display: grid; }
  body.is-authed .role-toggle.auth-only { display: flex; }
  body:not(.is-authed) .guest-only { display: block; }
  body:not(.is-authed) nav.sim-topnav.guest-only { display: flex; }
  body:not(.is-authed) .bottom-nav.guest-only { display: grid; }
  body.is-authed .auth-home.auth-only { display: block; }
  body.is-authed .header-account.auth-only { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
  body.is-authed nav.sim-topnav.auth-only { display: flex; }

  /* Mutually exclusive guest / signed-in / sample chrome */
  body.is-authed .guest-only,
  body.is-demo .guest-only { display: none !important; }
  body.is-demo:not(.is-authed) .auth-only { display: none !important; }
  body.is-enrolled .enroll-incomplete-banner,
  body.is-demo .enroll-incomplete-banner,
  body:not(.is-authed) .enroll-incomplete-banner { display: none !important; }
  body.is-authed:not(.is-enrolled):not(.is-demo) .enroll-incomplete-banner:not([hidden]) {
    display: block;
    margin: 12px 16px 0;
  }
  .enroll-recovery {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fffbeb;
  }
  .enroll-recovery .btn { margin-top: 8px; }
  body:not(.is-authed) li.guest-only { display: list-item; }
  body.is-authed li.guest-only,
  body.is-demo li.guest-only { display: none !important; }
  body:not(.is-authed) .row > button.guest-only,
  body:not(.is-authed) button.guest-only { display: inline-flex; }

  .header-account #accountIdentity { display: inline-block; max-width: min(40vw, 260px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .role-toggle.role-view-bar { width: max-content; max-width: calc(100% - 24px); margin: 12px auto; flex-wrap: wrap; justify-content: center; }

  .linkish { font: inherit; }

  .hidden, [hidden] { display: none !important; }

  .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: var(--warn);
  }
  .status-dot.ok { background: var(--success); }
  .status-dot.err { background: var(--danger); }

  @media (min-width: 600px) {
    .app-shell { padding-top: 8px; }
    .card { padding: 18px; }
  }

  .demo-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffecb5;
  }
  .cert-course {
    border: 1px solid var(--border, #e5e0ef);
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
    background: #fff;
  }
  .cert-lab {
    border-top: 1px dashed var(--border, #e5e0ef);
    padding: 8px 0;
    font-size: 0.85rem;
  }
  .cert-lab .row { margin-top: 4px; }
  .artifact-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border, #e5e0ef);
    font-size: 0.72rem;
    margin: 2px;
    background: #faf8fc;
  }
  .artifact-chip.on {
    background: var(--purple-soft, #f3e8ff);
    border-color: var(--purple-3, #a855f7);
  }


  .outcome-line { margin: 8px 0; font-size: 0.9rem; }
  .steadi-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border, #e5e0ef);
    font-size: 0.78rem;
    cursor: pointer;
    background: #fff;
  }
  .steadi-chip input { width: auto; margin: 0; accent-color: var(--purple-2, #7d3c98); }
  .steadi-chip .letter {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.4rem; height: 1.4rem; border-radius: 50%;
    background: var(--purple-soft, #f3e8ff); font-weight: 800; font-size: 0.75rem;
  }
  .steadi-chip.checked { background: var(--purple-soft, #f3e8ff); border-color: var(--purple-3, #a855f7); }
  .artifact { font-family: ui-monospace, monospace; font-size: 0.8rem; background: #f8f5fc; padding: 8px; border-radius: 8px; margin-top: 6px; word-break: break-all; }


/* —— Labs hub & dashboards (appended) —— */
  .labs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  @media (min-width: 480px) {
    .labs-grid { grid-template-columns: 1fr 1fr; }
  }
  .lab-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
    text-align: left;
    width: 100%;
    color: inherit;
    font: inherit;
  }
  .lab-card:hover, .lab-card:focus {
    transform: translateY(-2px);
    border-color: var(--purple-3);
    outline: none;
  }
  .lab-card .lab-ico {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }
  .lab-card h3 {
    margin: 0 0 4px;
    color: var(--purple-1);
    font-size: 1rem;
  }
  .lab-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
  }
  .lab-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--purple-2);
    background: var(--purple-soft);
    border-radius: 999px;
    padding: 2px 8px;
  }
  .stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
  }
  .stat-row.three { grid-template-columns: 1fr 1fr 1fr; }
  .stat {
    background: var(--purple-soft);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
  }
  .stat .n { font-weight: 800; color: var(--purple-1); font-size: 1.05rem; word-break: break-all; }
  .stat .l { font-size: 0.68rem; color: var(--muted); }
  .discrepancy { color: var(--danger); font-weight: 700; }
  .match-ok { color: var(--success); font-weight: 700; }
  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--purple-2);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 8px;
  }
  .channel-grid {
    display: grid;
    gap: 8px;
  }
  .channel-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 8px;
    align-items: end;
  }
  .leaderboard li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  .role-toggle { flex-wrap: wrap; justify-content: flex-end; max-width: 160px; }
  .role-toggle button { font-size: 0.65rem; padding: 5px 8px; }
  .bottom-nav { grid-template-columns: repeat(7, 1fr); }
  .bottom-nav button { font-size: 0.58rem; }
  .instructor-panel {
    border: 1px dashed var(--purple-3);
    background: #fbf5ff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }
  .instructor-panel h3 { margin-top: 0; }
  table.lab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
  }
  table.lab-table th, table.lab-table td {
    text-align: left;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
  }
  table.lab-table th { color: var(--muted); font-weight: 600; }

/* —— Decision Lab / Case Studies —— */
  .bottom-nav { grid-template-columns: repeat(8, 1fr); }
  .bottom-nav button { font-size: 0.55rem; padding: 6px 2px; }
  .section-label {
    margin: 14px 0 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 700;
  }
  .card-soft.cases-promo {
    background: linear-gradient(135deg, #fbf5ff, #f3e8ff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
  }
  .domain-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 14px;
  }
  .domain-filters button {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--purple-1);
    cursor: pointer;
  }
  .domain-filters button.active {
    background: var(--purple-2);
    color: #fff;
    border-color: var(--purple-2);
  }
  .case-card .lab-badge { margin-right: 4px; }
  .case-meta h2 { margin: 6px 0; }
  .stage-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 10px 0 14px;
  }
  .stage-pill {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eee;
    color: var(--muted);
  }
  .stage-pill.done { background: #d4edda; color: #1e7e34; }
  .stage-pill.current { background: var(--purple-2); color: #fff; }
  .shot-frame {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #1e1b24;
    box-shadow: var(--shadow);
  }
  .shot-chrome {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    background: #2a2433;
    color: #cbb8e0;
    font-size: 0.7rem;
  }
  .shot-chrome span {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ff5f57;
  }
  .shot-chrome span:nth-child(2) { background: #febc2e; }
  .shot-chrome span:nth-child(3) { background: #28c840; }
  .shot-chrome em { margin-left: 8px; font-style: normal; opacity: 0.9; }
  .shot-body {
    min-height: 110px;
    padding: 14px;
    background: repeating-linear-gradient(
      -45deg,
      #241f2b,
      #241f2b 8px,
      #2c2636 8px,
      #2c2636 16px
    );
    color: #f5e9ff;
  }
  .shot-hint {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.35;
    background: rgba(125, 60, 152, 0.35);
    border: 1px dashed rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 10px;
  }
  .directions {
    font-size: 0.82rem;
    color: var(--muted);
    border-left: 3px solid var(--purple-3);
    padding-left: 10px;
    margin: 0 0 10px;
  }
  .case-choices {
    display: grid;
    gap: 8px;
    margin: 10px 0;
  }
  .case-choice {
    text-align: left;
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    color: inherit;
  }
  .case-choice:hover { border-color: var(--purple-3); }
  .case-choice.selected { border-color: var(--purple-2); background: var(--purple-soft); }
  .case-choice.correct { border-color: var(--success); background: #e8f8ee; }
  .case-choice.wrong { border-color: var(--danger); background: #fdecea; }
  .case-nav-row { margin-top: 8px; justify-content: space-between; }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 30, 0.55);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
  }
  @media (min-width: 560px) {
    .modal-backdrop { align-items: center; }
  }
  .modal-backdrop.hidden { display: none; }
  .modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    width: min(480px, 100%);
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  }
  .steadi-list { display: grid; gap: 8px; margin: 12px 0; }
  .steadi-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: #faf7fc;
  }
  .steadi-item .letter {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--purple-2);
    color: #fff;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
  }
  .steadi-item label { font-size: 0.8rem; cursor: pointer; }
  .steadi-item .name { font-weight: 700; color: var(--purple-1); }

/* IAV-SRI interactive (incubator case) */
  .case-interactive { margin-top: 10px; }
  .case-interactive.hidden { display: none; }
  .iav-sri {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 10px;
    color: #f5e9ff;
    font-size: 0.75rem;
  }
  .iav-sri h4 { margin: 0 0 6px; color: #fff; font-size: 0.85rem; }
  .iav-sri .iav-meta { opacity: 0.85; margin-bottom: 8px; }
  .iav-sri table { width: 100%; border-collapse: collapse; }
  .iav-sri th, .iav-sri td {
    text-align: left; padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .iav-sri input[type="number"] {
    width: 64px; padding: 4px; border-radius: 6px; border: 1px solid #9b6fb8;
    background: #1a1520; color: #fff; font-size: 0.75rem;
  }
  .iav-totals { margin-top: 8px; font-weight: 700; }
  .iav-totals .over { color: #ffb4b4; }
  .iav-totals .ok { color: #b6f3c8; }
  .iav-note { margin-top: 6px; opacity: 0.9; font-size: 0.7rem; }

/* Hero thesis */
  .hero-tagline {
    font-size: 1.05rem;
    color: var(--purple-1);
    margin: 6px 0 4px;
    letter-spacing: 0.01em;
  }
  .hero-tagline strong { font-weight: 800; }
  #homeThesis { max-width: 36rem; margin: 0 auto 8px; }

  /* Syllabus strip */
  .syllabus-strip {
    display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px;
  }
  .syllabus-chip {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--purple-1);
    cursor: pointer;
  }
  .syllabus-chip.active, .syllabus-chip:hover {
    background: var(--purple-2); color: #fff; border-color: var(--purple-2);
  }

  /* Decision-lab / health-lab mock apps inside shot frames */
  .mock-app, .phone-app {
    background: #1a1522;
    color: #f3eaff;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.78rem;
  }
  .mock-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .mock-tab {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: #e8d5ff; border-radius: 8px; padding: 4px 8px;
    font-size: 0.68rem; font-weight: 700; cursor: pointer;
  }
  .mock-tab.active { background: var(--purple-2); border-color: var(--purple-2); color: #fff; }
  .mock-app label { display: block; margin-top: 6px; color: #cbb8e0; font-size: 0.68rem; }
  .mock-app input, .mock-app textarea, .mock-app select {
    width: 100%; box-sizing: border-box;
    background: #120e18; color: #fff; border: 1px solid #6b4a82;
    border-radius: 8px; padding: 6px 8px; font: inherit; margin-top: 2px;
  }
  .mock-app .btn, .mock-app button.btn { margin-top: 8px; }
  .shot-frame.phone { max-width: 360px; margin-left: auto; margin-right: auto; }
  .phone-chrome { justify-content: center; }
  .address-box, .hash-box {
    margin-top: 8px; padding: 8px; border-radius: 8px;
    background: rgba(125,60,152,0.25); border: 1px dashed rgba(255,255,255,0.25);
    word-break: break-all; font-family: ui-monospace, monospace; font-size: 0.68rem;
  }
  .tabs-inline { display: flex; gap: 6px; margin: 8px 0; }
  .tabs-inline button {
    flex: 1; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; padding: 6px; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  }
  .tabs-inline button.active { background: var(--purple-soft); border-color: var(--purple-3); color: var(--purple-1); }
  .feed-list li {
    display: grid; grid-template-columns: 1fr; gap: 2px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .feed-list .amt { color: #b6f3c8; font-weight: 700; }
  .lab-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
  .lab-table th, .lab-table td { text-align: left; padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .case-step-meta, #caseStepMeta, #onboardStepMeta, #haStepMeta {
    font-size: 0.72rem; font-weight: 700; color: var(--purple-2); margin-bottom: 6px;
  }
  .tiny { font-size: 0.68rem; color: var(--muted); }
  .pass-ok { color: #1e7e34; font-weight: 800; }
  .fail-bad { color: #c0392b; font-weight: 800; }
  #haAuditList li { font-size: 0.75rem; }

.learn-cta {
    border: 2px solid var(--purple-3);
    background: linear-gradient(135deg, #fbf5ff, #f0e6fa);
  }
  .learn-hero .hero-tagline { margin-bottom: 4px; }
  .learn-checklist { list-style: none; padding: 0; margin: 8px 0; }
  .learn-checklist li {
    padding: 8px 10px; margin-bottom: 6px;
    border-radius: 10px; border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.2);
  }
  .learn-checklist li.done { border-color: #2ecc71; }
  .learn-checklist .step-num {
    display: inline-block; width: 22px; height: 22px; border-radius: 50%;
    background: var(--purple-2); color: #fff; text-align: center;
    font-size: 0.7rem; font-weight: 800; line-height: 22px; margin-right: 6px;
  }

/* Flagship / Certificate / Trail polish (additive) */
  .progress-dots {
    display: flex; gap: 8px; justify-content: center; align-items: center;
    margin: 10px 0 12px; flex-wrap: wrap;
  }
  .progress-dots .dot {
    width: 11px; height: 11px; border-radius: 50%; background: var(--border);
    box-shadow: 0 0 0 1px var(--purple-4);
  }
  .progress-dots .dot.done { background: var(--success); }
  .progress-dots .dot.current {
    background: var(--purple-2); transform: scale(1.25);
    box-shadow: 0 0 0 3px rgba(125, 60, 152, 0.35);
  }
  .stage-pill {
    font-size: 0.68rem; font-weight: 800; padding: 4px 9px; border-radius: 999px;
    background: #fff; border: 1px solid var(--border); color: var(--muted);
  }
  .stage-pill.current { background: var(--purple-2); color: #fff; border-color: var(--purple-2); }
  .stage-pill.done { background: #e8f8ee; color: var(--success); border-color: #82e0aa; }
  .lab-stage-card {
    background: #fff; border-radius: 18px; border: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
  }
  .trail { list-style: none; margin: 0; padding: 0; position: relative; }
  .trail::before {
    content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 3px;
    background: linear-gradient(var(--purple-3), var(--purple-soft)); border-radius: 2px;
  }
  .trail-item {
    position: relative; padding: 10px 10px 10px 40px; margin-bottom: 8px;
    background: #faf7fc; border: 1px solid var(--border); border-radius: 12px;
  }
  .trail-item::before {
    content: ""; position: absolute; left: 9px; top: 16px; width: 13px; height: 13px;
    border-radius: 50%; background: var(--purple-2); border: 2px solid #fff;
  }
  .trail-item.match::before { background: var(--success); }
  .trail-item.fail::before { background: var(--danger); }
  .hash-result {
    margin-top: 10px; padding: 12px; border-radius: 14px; font-weight: 800; text-align: center;
  }
  .hash-result.match { background: #e8f8ee; color: var(--success); border: 2px solid #82e0aa; }
  .hash-result.fail { background: #fdecea; color: var(--danger); border: 2px solid #f5b7b1; }
  .steadi-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
  .steadi-chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1.5px solid var(--border); background: #fff; border-radius: 999px;
    padding: 6px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  }
  .steadi-chip.checked { background: var(--purple-soft); border-color: var(--purple-3); }
  .steadi-chip .letter {
    width: 20px; height: 20px; border-radius: 6px; background: var(--purple-2); color: #fff;
    display: grid; place-items: center; font-size: 0.7rem; font-weight: 900;
  }
  .outcome-banner {
    background: linear-gradient(135deg, #1e8449, #196f3d); color: #fff;
    border-radius: 16px; padding: 16px; margin: 10px 0;
  }
  .outcome-banner h2 { color: #fff; margin: 0 0 6px; }
  .btn { font-size: 0.95rem; padding: 11px 16px; }
  .btn.sm { padding: 8px 12px; font-size: 0.82rem; }

/* === Clean minimal academic guest shell === */
  body:not(.is-authed) {
    --accent: #5c1620;
    --accent-soft: #f3e8ea;
    --accent-2: #4f46e5;
    --page-bg: #f7f8fa;
    --card-border: #e6e8ee;
    background: var(--page-bg);
  }
  body:not(.is-authed) .app-shell {
    max-width: none;
    width: 100%;
  }
  body:not(.is-authed) .topbar {
    background: #5c1620;
    color: #fff;
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 16px rgba(92, 22, 32, 0.12);
  }
  body:not(.is-authed) .brand-mark {
    background: #fff;
    color: #5c1620;
  }
  body:not(.is-authed) .brand-text h1,
  body:not(.is-authed) .brand-text p { color: #fff; }
  body:not(.is-authed) .brand-text h1 {
    letter-spacing: 0.04em;
    font-size: 1.1rem;
  }
  .sim-topnav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
  }
  .sim-topnav button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 0.78rem;
    font-weight: 650;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
  }
  .sim-topnav button:hover { background: rgba(255,255,255,0.12); }

  .sim-landing { padding: 8px 0 28px; }
  .sim-band {
    background: #fff;
    color: var(--text, #1f2937);
    padding: 28px 24px 22px;
    border-radius: 14px;
    margin: 12px 0 18px;
    border: 1px solid var(--card-border, #e6e8ee);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  }
  .sim-kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5c1620;
    font-weight: 700;
    opacity: 1;
  }
  .sim-band h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.35;
    font-weight: 800;
    text-transform: none;
    letter-spacing: -0.01em;
    color: #111827;
  }
  .sim-article {
    background: #fff;
    color: #1f2937;
    padding: 22px 24px 24px;
    margin: 0 0 16px;
    border-radius: 14px;
    border: 1px solid var(--card-border, #e6e8ee);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  }
  .sim-article h2, .sim-article h3 {
    margin: 0 0 12px;
    color: #111827;
    text-transform: none;
    letter-spacing: -0.01em;
    font-size: 1.08rem;
    font-weight: 800;
  }
  .sim-article p {
    margin: 0 0 12px;
    line-height: 1.65;
    font-size: 0.95rem;
    text-align: left;
    color: #374151;
  }
  .sim-article a { color: #5c1620; font-weight: 600; }
  .sim-tagline { text-align: center !important; margin-top: 10px !important; color: #111827 !important; }
  .sim-list {
    margin: 0 0 12px;
    padding-left: 1.2rem;
    line-height: 1.55;
    font-size: 0.92rem;
    color: #374151;
  }
  .sim-list li { margin-bottom: 8px; }
  .sim-signin {
    background: #fff;
    border: 1px solid var(--card-border, #e6e8ee);
    border-radius: 14px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  }
  .sim-signin h3 { margin: 0 0 8px; color: #111827; }
  .sim-signin .btn { margin: 4px 6px; }
  .sim-signin .demo-cta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef0f4;
  }
  .sim-video { margin: 0 0 14px; }
  .sim-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
  }
  .sim-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }

  /* Documents two-column — light panel */
  .sim-docs {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px;
    align-items: start;
  }
  @media (max-width: 720px) {
    .sim-docs { grid-template-columns: 1fr; }
    .sim-topnav button { padding: 6px 10px; font-size: 0.72rem; }
  }
  .sim-docs-nav {
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    padding: 14px 12px;
    border: 1px solid var(--card-border, #e6e8ee);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  }
  .sim-docs-nav h3 {
    margin: 0 0 10px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
  }
  .sim-docs-nav ul { list-style: none; margin: 0; padding: 0; }
  .sim-docs-nav li { margin: 0 0 4px; }
  .sim-docs-nav button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #374151;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    border-left: 0;
  }
  .sim-docs-nav button.active,
  .sim-docs-nav button:hover {
    color: #5c1620;
    background: #f3e8ea;
  }
  .sim-docs-nav button.active {
    font-weight: 800;
    box-shadow: inset 3px 0 0 #5c1620;
  }
  .sim-docs-main .sim-article { margin-top: 8px; }

  body:not(.is-authed) .app-footer {
    color: #6b7280;
  }
  body:not(.is-authed) .bottom-nav {
    background: #fff;
  }

  /* Demo mode banner */
  .demo-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    background: #111827;
    color: #f9fafb;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 650;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  body.is-demo .demo-banner { display: flex; }
  .demo-banner .demo-exit {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
  }
  .demo-banner .demo-exit:hover { background: rgba(255,255,255,0.1); }
  .demo-note {
    display: none;
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #6b7280;
  }
  body.is-demo .demo-note { display: block; }
  .site-gate-demo {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef0f4;
    text-align: center;
  }
  .site-gate-demo .btn { width: 100%; }
  .site-gate-demo-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .site-gate-demo-row .btn { width: 100%; }
  .auth-demo-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e5d6ee);
    text-align: center;
  }

/* === Site access gate === */
  #siteGate.site-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(160deg, #3d1a4a 0%, #5b2c6f 45%, #1a3a57 100%);
    color: #fff;
  }
  #siteGate.site-gate[hidden] { display: none !important; }
  .site-gate-card {
    width: 100%;
    max-width: min(920px, 96vw);
    max-height: none;
    overflow: visible;
    background: #fff;
    color: var(--text, #2c1a33);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.35);
    text-align: center;
  }
  .site-gate-note {
    margin: 14px 0 0;
    padding: 12px 12px 10px;
    text-align: left;
    background: #f7f3fa;
    border: 1px solid #e8dcee;
    border-radius: 12px;
  }
  .site-gate-note-title {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: var(--purple-1, #5b2c6f);
  }
  .site-gate-steps {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text, #2c1a33);
  }
  .site-gate-steps li { margin: 0 0 5px; }
  .site-gate-steps li:last-child { margin-bottom: 0; }
  .site-gate-limits {
    margin: 8px 0 0;
    line-height: 1.35;
  }
  .site-gate-limits code {
    font-size: 0.72rem;
    background: #efe6f4;
    padding: 1px 4px;
    border-radius: 4px;
  }
  .site-gate-brand {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--purple-1, #5b2c6f);
    margin: 0 0 4px;
  }
  .site-gate-sub {
    margin: 0 0 18px;
    font-size: 0.88rem;
    color: var(--muted, #6e5a78);
  }
  .site-gate-form { display: grid; gap: 10px; text-align: left; }
  .site-gate-form label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted, #6e5a78);
  }
  .site-gate-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border, #e5d6ee);
    border-radius: 10px;
    font-size: 1rem;
  }
  .site-gate-form input[type="password"]:focus {
    outline: 2px solid var(--purple-3, #9b59b6);
    border-color: var(--purple-2, #7d3c98);
  }
  .site-gate-form .btn { width: 100%; margin-top: 4px; }
  .site-gate-error {
    margin: 8px 0 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger, #c0392b);
    min-height: 1.2em;
  }


  /* === Modern nav chrome (guest + signed-in) === */
  /* Guest top: pill tabs on maroon bar */
  .sim-topnav {
    gap: 6px;
    padding: 3px;
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
    backdrop-filter: blur(6px);
  }
  .sim-topnav button {
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.88);
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 0.78rem;
    font-weight: 650;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  }
  .sim-topnav button:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
  }
  .sim-topnav button:focus-visible {
    outline: 2px solid #ffe08a;
    outline-offset: 1px;
  }
  .sim-topnav button.active,
  .sim-topnav button[aria-current="page"] {
    background: #fff;
    color: var(--sim-maroon-deep, #5c1620);
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  }

  /* Role toggle: tighter segmented control */
  .role-toggle {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 2px;
    gap: 0;
    max-width: none;
  }
  .role-toggle button {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 6px 11px;
    letter-spacing: 0.01em;
    opacity: 0.9;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  }
  .role-toggle button:hover { opacity: 1; background: rgba(255,255,255,0.1); }
  .role-toggle button.active {
    background: #fff;
    color: var(--purple-1);
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    opacity: 1;
  }

  /* Bottom nav: icon+label with top accent / soft pill active */
  .bottom-nav {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 214, 238, 0.9);
    box-shadow: 0 -8px 28px rgba(61, 26, 74, 0.08);
    height: calc(var(--nav-h) + 4px + var(--safe-bottom));
  }
  .bottom-nav button {
    position: relative;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 6px 2px 8px;
    gap: 3px;
    color: #8a7594;
    border-radius: 0;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .bottom-nav button .ico {
    font-size: 1.2rem;
    line-height: 1;
    width: 32px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .bottom-nav button:hover { color: var(--purple-2); }
  .bottom-nav button:hover .ico { background: var(--purple-soft); }
  .bottom-nav button.active {
    color: var(--purple-1);
    font-weight: 800;
  }
  .bottom-nav button.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--purple-2);
  }
  .bottom-nav button.active .ico {
    background: var(--purple-soft);
    transform: translateY(-1px);
  }

  /* Guest bottom: maroon accent on clean white bar */
  body:not(.is-authed) .bottom-nav {
    background: #fff;
    border-top-color: #d6e4f0;
  }
  body:not(.is-authed) .bottom-nav button.active { color: var(--sim-maroon-deep, #5c1620); }
  body:not(.is-authed) .bottom-nav button.active::before {
    background: var(--sim-maroon, #7a1f2b);
  }
  body:not(.is-authed) .bottom-nav button.active .ico,
  body:not(.is-authed) .bottom-nav button:hover .ico {
    background: #f6e8eb;
  }
  body:not(.is-authed) .bottom-nav button:hover { color: var(--sim-maroon, #7a1f2b); }

  /* Documents side nav — keep light panel (clean academic) */
  .sim-docs-nav {
    background: #fff;
    border-radius: 12px;
    padding: 12px 10px;
    border: 1px solid #e6e8ee;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  }
  .sim-docs-nav h3 {
    margin: 0 8px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
    opacity: 1;
  }
  .sim-docs-nav li { margin: 0 0 4px; }
  .sim-docs-nav button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #374151;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 8px;
    border-left: 0;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sim-docs-nav button:hover {
    color: #5c1620;
    background: #f3e8ea;
  }
  .sim-docs-nav button.active {
    color: #5c1620;
    background: #f3e8ea;
    font-weight: 800;
    box-shadow: inset 3px 0 0 #5c1620;
  }

  /* Case domain chips */
  .domain-filters {
    gap: 8px;
    margin: 12px 0 16px;
  }
  .domain-filters button {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--purple-1);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(91, 44, 111, 0.06);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  }
  .domain-filters button:hover {
    border-color: var(--purple-3);
    background: var(--purple-soft);
    transform: translateY(-1px);
  }
  .domain-filters button.active {
    background: linear-gradient(135deg, var(--purple-2), var(--purple-1));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(125, 60, 152, 0.28);
  }

  @media (max-width: 420px) {
    .sim-topnav button { padding: 7px 10px; font-size: 0.72rem; }
    .role-toggle button { padding: 5px 8px; font-size: 0.62rem; }
    .bottom-nav button { font-size: 0.52rem; }
    .bottom-nav button .ico { width: 28px; height: 24px; font-size: 1.05rem; }
    .domain-filters button { padding: 6px 10px; font-size: 0.68rem; }
  }


  /* ═══════════════════════════════════════════════════════════
     Embed (Google Sites iframe) + mobile / touch
     ═══════════════════════════════════════════════════════════ */
  html {
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  html, body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
  }
  body.is-embedded {
    min-height: 100%;
    min-height: 100dvh;
  }
  body.is-embedded .app-shell {
    min-height: 100%;
    min-height: 100dvh;
  }
  .app-shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-left: clamp(12px, 2.5vw, 28px);
    padding-right: clamp(12px, 2.5vw, 28px);
  }
  body.is-embedded .app-shell {
    max-width: none !important;
    padding-bottom: calc(72px + var(--safe-bottom, 0px));
  }
  body.is-embedded .page {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  body.is-embedded .card {
    max-width: 100%;
  }
  .page {
    max-width: 100%;
    overflow-x: hidden;
  }
  .card, .row, .balance-grid, .topbar, .sim-topnav {
    max-width: 100%;
  }
  .address-box {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  /* Touch targets ≥44px; 16px inputs avoid iOS zoom */
  .btn {
    min-height: 44px;
    touch-action: manipulation;
  }
  .btn.sm { min-height: 40px; padding: 10px 14px; }
  .tabs-inline button,
  .role-toggle button,
  .domain-filters button,
  .site-gate-form .btn,
  .site-gate-demo-row .btn {
    min-height: 44px;
    touch-action: manipulation;
  }
  .bottom-nav button {
    min-height: 48px;
    touch-action: manipulation;
  }
  input, select, textarea {
    max-width: 100%;
    font-size: 16px;
  }
  .wallet-ext-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }
  .wallet-ext-actions .btn {
    width: auto;
    flex: 1 1 140px;
    margin-top: 0;
  }
  .wc-qr-wrap {
    margin-top: 12px;
    text-align: center;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #faf7fc;
  }
  .wc-qr-wrap.hidden { display: none; }
  .wc-mode-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-1);
    margin-bottom: 8px;
  }
  .wc-todo {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 10px 0 0;
    line-height: 1.4;
  }
  @media (max-width: 480px) {
    .page { padding: 12px; }
    .card { padding: 14px; }
    .topbar { padding: 10px 12px; gap: 8px; }
    .brand-text h1 { font-size: 1.02rem; }
    .wallet-ext-actions .btn { flex: 1 1 100%; }
  }


  .sc-certificate {
    margin: 14px 0 18px;
    padding: 28px 24px;
    border: 2px solid var(--purple-2, #8e44ad);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, #faf7fc 100%);
    text-align: center;
    position: relative;
  }
  .sc-certificate .sc-cert-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple-2, #8e44ad);
    font-weight: 700;
    margin-bottom: 8px;
  }
  .sc-certificate h2 {
    margin: 4px 0 8px;
    font-size: 1.45rem;
    color: #1a1a2e;
  }
  .sc-certificate .sc-cert-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 14px 0 6px;
    color: #2c3e50;
  }
  .sc-certificate .sc-cert-meta {
    font-size: 12px;
    color: #555;
    margin: 4px 0;
  }
  .sc-certificate .sc-cert-rule {
    margin: 14px auto 8px;
    max-width: 36rem;
    font-size: 13px;
    color: #333;
  }
  .sc-certificate .sc-cert-electives {
    margin: 10px auto;
    max-width: 36rem;
    font-size: 12px;
    color: #444;
  }
  .sc-certificate .sc-cert-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
    font-size: 11px;
    color: #666;
  }
  .sc-certificate .sc-cert-tagline {
    font-weight: 600;
    color: var(--purple-2, #8e44ad);
    margin-top: 8px;
  }
  .sc-cert-actions { margin: 10px 0 4px; flex-wrap: wrap; gap: 8px; }
  @media print {
    body * { visibility: hidden !important; }
    .sc-certificate, .sc-certificate * { visibility: visible !important; }
    .sc-certificate {
      position: absolute;
      left: 0; top: 0; width: 100%;
      border: 2px solid #8e44ad;
      box-shadow: none;
      background: #fff;
    }
    .sc-cert-actions, .no-print { display: none !important; }
  }


  .cert-kid-note {
    margin: 8px 0 4px;
    padding: 10px 12px;
    background: #fff9e6;
    border-left: 4px solid #f1c40f;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #333;
  }


  .case-tutor {
    margin-top: 10px;
    padding: 12px 14px;
    border-left: 3px solid var(--primary, #7d3c98);
    background: #f8f4fb;
  }
  .case-tutor-title { margin: 0 0 4px; font-size: 0.95rem; }
  .case-tutor-text { margin: 6px 0 0; font-size: 0.92rem; line-height: 1.45; }
  #instructorGradebookPanel h5 { font-size: 0.85rem; color: var(--muted); }
  #instructorClassesAdmin input[type="text"] { width: 100%; max-width: 420px; }
  #instructorClassesList .btn { margin: 2px 0; }
  #instructorGradebookClassFilter { max-width: 280px; }
  #instructorGradebookList li, #instructorModuleCompletionsList li { margin-bottom: 6px; }
</style>

<style>
/* Five clear actions fit even inside a narrow Google Sites embed. */
.bottom-nav.auth-only { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bottom-nav.guest-only { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-actions { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; margin:16px 0; }
.home-actions button { width:100%; min-height:48px; white-space:normal; }
.home-balance { font-size:1.3rem; margin:14px 0; }
.sim-start-card { border:2px solid var(--purple-1); }
#walletExternalCard[hidden], #phoneWalletSetting[hidden] { display:none !important; }
@media(max-width:560px) { .home-actions { grid-template-columns:1fr; } }

  /* ── UX-1: first-run checklist, faucet gate, cert flowchart, empty states ── */
  .auth-topnav {
    flex: 1 1 100%;
    order: 5;
    margin-top: 4px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .auth-topnav::-webkit-scrollbar { display: none; }
  body.is-authed .topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .first-run-card {
    margin: 14px 0 8px;
    padding: 14px 14px 12px;
    border: 1px solid var(--border, #e4d8ef);
    border-radius: 12px;
    background: #faf8fc;
  }
  .first-run-title {
    margin: 0 0 4px;
    font-size: 1.02rem;
  }
  .first-run-checklist {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
  }
  .first-run-checklist .fr-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text, #2a2433);
  }
  .first-run-checklist .fr-item.done {
    color: var(--muted, #6b6575);
  }
  .first-run-checklist .fr-item.done .fr-label { text-decoration: line-through; opacity: 0.85; }
  .first-run-checklist .fr-item.current {
    background: var(--purple-soft, #f0e6f8);
    font-weight: 600;
  }
  .fr-mark {
    flex: 0 0 1.4em;
    width: 1.4em;
    text-align: center;
    font-weight: 700;
    color: var(--purple-1, #6b2d8b);
  }
  .fr-item.done .fr-mark { color: var(--success, #1e7e34); }
  .home-quicklinks,
  .learn-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 6px;
  }
  .home-quicklinks .btn,
  .learn-quicklinks .btn {
    width: auto;
    flex: 1 1 auto;
    margin-top: 0;
  }
  .faucet-gate {
    margin: 12px 0;
    padding: 12px 14px;
    border-left: 3px solid var(--warn, #c9891a);
  }
  .faucet-gate-title { margin: 0 0 4px; }
  .cert-flowchart {
    margin: 12px 0 16px;
    padding: 12px 14px;
  }
  .cert-flow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
  }
  .cert-flow-node {
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border, #e4d8ef);
    background: #fff;
    min-width: 0;
  }
  .cert-flow-node.current { border-color: var(--purple-2, #8e44ad); box-shadow: 0 0 0 2px var(--purple-soft, #f0e6f8); }
  .cert-flow-node.done { border-color: #82e0aa; background: #f3fbf6; }
  .cert-flow-arrow {
    align-self: center;
    font-weight: 700;
    color: var(--muted, #6b6575);
    padding: 0 2px;
  }
  .cert-flow-electives {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }
  .cert-flow-chip {
    display: inline-block;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f4f1f7;
    color: var(--muted, #6b6575);
    border: 1px solid var(--border, #e4d8ef);
  }
  .cert-flow-chip.done {
    background: #e8f8ee;
    color: var(--success, #1e7e34);
    border-color: #82e0aa;
  }
  .pill-required { background: #efe6f7; color: var(--purple-1, #6b2d8b); }
  .pill-elective { background: #eef3fb; color: #2c5282; }
  .pill-optional { background: #f7f3e8; color: #7a5b1e; }
  .empty-state {
    margin: 10px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #faf8fc;
    border: 1px dashed var(--border, #e4d8ef);
    text-align: left;
  }
  .empty-state .btn { width: auto; margin-top: 8px; }
  .muted.helper,
  .tiny.muted {
    line-height: 1.45;
  }
  .enroll-incomplete-banner .btn {
    vertical-align: middle;
  }
  /* Phone / iframe: keep connect + QR visible, tighten header */
  @media (max-width: 480px) {
    body.is-authed .topbar {
      padding: 8px 10px;
    }
    .brand-text p { display: none; }
    .auth-topnav button {
      padding: 8px 10px;
      font-size: 0.7rem;
      min-height: 40px;
      white-space: nowrap;
    }
    .header-account { width: 100%; justify-content: space-between; }
    .first-run-checklist .fr-item { font-size: 0.86rem; padding: 10px 6px; }
    .wc-qr-wrap { padding: 14px 8px; }
    .wc-qr-wrap .qr-wrap { display: flex; justify-content: center; }
    .wallet-ext-actions .btn { min-height: 48px; }
  }
  body.is-embedded .auth-topnav {
    width: 100%;
  }
  body.is-embedded .first-run-card,
  body.is-embedded .cert-flowchart,
  body.is-embedded .faucet-gate {
    max-width: 100%;
  }


  /* ── Embed tighten (Cloudflare iframe / nested scroll reduction) — keep purple/white ── */
  html.is-embedded,
  body.is-embedded {
    height: 100%;
    max-height: 100%;
    background: var(--bg, #ffffff);
  }
  body.is-embedded {
    margin: 0;
    padding: 0;
  }
  body.is-embedded .app-shell {
    max-width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(64px + var(--safe-bottom, 0px));
    margin: 0 auto;
  }
  body.is-embedded .topbar {
    padding: 8px 12px;
    border-radius: 0;
    box-shadow: 0 1px 0 rgba(61, 26, 74, 0.12);
  }
  body.is-embedded .brand-text p { display: none; }
  body.is-embedded .page {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  body.is-embedded .card {
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(91, 44, 111, 0.08);
  }
  body.is-embedded #siteGate.site-gate {
    padding: 12px;
    background: var(--bg, #ffffff);
  }
  body.is-embedded .site-gate-card {
    max-height: min(92dvh, 720px);
    margin: 0 auto;
    box-shadow: 0 8px 28px rgba(61, 26, 74, 0.16);
  }
  @media (min-width: 720px) {
    body.is-embedded .app-shell {
      max-width: none !important;
    }
  }
  /* Brand logo in topbar / gate when img.brand-logo present */
  .brand-logo,
  .site-gate-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
    border: 2px solid rgba(255,255,255,0.55);
  }
  .site-gate-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    display: block;
    border-color: var(--purple-4);
  }
  body.is-embedded .brand-logo { width: 36px; height: 36px; }

/* CF Gateway: remove upper purple brand header (frame look).
   Logo stays on #siteGate card; bottom-nav kept for guest + authed. */
.topbar {
  display: none !important;
}
body.app-locked .topbar,
body:not(.is-authed) .topbar,
body.is-authed .topbar,
body.is-embedded .topbar {
  display: none !important;
}
/* When class-code gate is up, keep app chrome from peeking behind/above the card */
body.app-locked .app-shell,
body.app-locked .bottom-nav,
body.app-locked .demo-banner,
body.app-locked .role-view-bar {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* CF Gateway: full-bleed shell (no phone 520px / 960px gutters) + single scroll */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.app-shell,
body:not(.is-authed) .app-shell,
body.is-authed .app-shell,
body.is-embedded .app-shell {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}
@media (min-width: 720px) {
  body.is-embedded .app-shell {
    max-width: none !important;
  }
}
/* Gate card stays centered; overlay is full-bleed and owns the scroll */
#siteGate.site-gate {
  align-items: safe center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}
.site-gate-card {
  margin-top: auto;
  margin-bottom: auto;
  max-height: none;
  overflow: visible;
}
body.is-embedded .site-gate-card {
  max-height: none;
  overflow: visible;
}

/* CF Gateway: desktop chrome (≥900px) — cf-gateway-5-fullbleed */
@media (min-width: 900px) {
  /* Slim white + purple desktop header (replaces heavy purple phone topbar) */
  .topbar,
  body:not(.is-authed) .topbar,
  body.is-authed .topbar,
  body.is-embedded .topbar {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px clamp(16px, 3vw, 28px);
    min-height: 56px;
    background: #ffffff !important;
    color: var(--purple-1);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(91, 44, 111, 0.06), 0 4px 16px rgba(61, 26, 74, 0.06);
  }
  /* Gate up: keep header hidden so only the centered gate card shows */
  body.app-locked .topbar {
    display: none !important;
  }

  .topbar .brand-logo {
    width: 36px;
    height: 36px;
    border: 2px solid var(--purple-4);
    background: #000;
  }
  .topbar .brand-text h1 {
    color: var(--purple-1);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
  }
  .topbar .brand-text p {
    color: var(--muted);
    opacity: 1;
    font-size: 0.72rem;
  }
  body:not(.is-authed) .topbar .brand-text h1,
  body:not(.is-authed) .topbar .brand-text p {
    color: inherit;
  }
  body:not(.is-authed) .topbar .brand-text h1 { color: var(--purple-1); }
  body:not(.is-authed) .topbar .brand-text p { color: var(--muted); }

  .topbar .sim-topnav {
    margin-left: auto;
    background: var(--purple-soft);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    backdrop-filter: none;
    flex-wrap: wrap;
  }
  .topbar .sim-topnav button {
    border: 0;
    background: transparent;
    color: var(--purple-1);
    font-size: 0.78rem;
    font-weight: 650;
    padding: 7px 12px;
    border-radius: 999px;
  }
  .topbar .sim-topnav button:hover {
    background: rgba(125, 60, 152, 0.12);
  }
  .topbar .sim-topnav button.active,
  .topbar .sim-topnav button[aria-current="page"] {
    background: var(--purple-2);
    color: #fff;
    box-shadow: none;
  }

  body.is-authed .header-account.auth-only {
    order: 3;
    margin-left: 8px;
    color: var(--muted);
  }
  body.is-authed .topbar .sim-topnav.auth-only {
    order: 2;
  }
  .header-account #accountIdentity {
    color: var(--muted);
    max-width: min(28vw, 220px);
  }
  .header-account .btn {
    border-color: var(--border);
    color: var(--purple-1);
  }

  /* Top nav replaces sticky phone bottom nav on desktop */
  .bottom-nav,
  body.is-authed .bottom-nav.auth-only,
  body:not(.is-authed) .bottom-nav.guest-only {
    display: none !important;
  }

  .app-shell,
  body:not(.is-authed) .app-shell,
  body.is-authed .app-shell,
  body.is-embedded .app-shell {
    padding-bottom: 28px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Full-bleed content — viewport width, padding only (cf-gateway-5-fullbleed) */
  .page,
  .panel,
  .role-toggle.role-view-bar,
  .demo-banner,
  .sim-landing {
    max-width: none !important;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  .page {
    padding: 20px clamp(16px, 3vw, 40px) 36px;
  }
  .role-toggle.role-view-bar {
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
  }
  .demo-banner {
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
  }

  /* Multi-column where cards allow — full width */
  .sim-landing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
  }
  .sim-landing .sim-band,
  .sim-landing .sim-start-card {
    grid-column: 1 / -1;
  }

  .home-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .labs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Wallet / send / store: pair adjacent cards in 2 columns */
  #page-wallet.active,
  #page-send.active,
  #page-store.active,
  #page-faucet.active,
  #page-settings.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  #page-wallet .back-link,
  #page-send .back-link,
  #page-store .back-link,
  #page-faucet .back-link,
  #page-settings .back-link,
  #page-wallet > .alert,
  #page-send > .alert,
  #page-store > .alert,
  #page-faucet > .alert,
  #page-settings > .alert {
    grid-column: 1 / -1;
  }

  /* Instructor roster / tables use full content width */
  .instructor-roster-wrap,
  .lab-table,
  #page-labs .card,
  #instructorRosterPanel,
  #instructorGradebookPanel {
    max-width: 100%;
    width: 100%;
  }
  .instructor-roster-wrap {
    overflow-x: auto;
  }
  .instructor-roster {
    width: 100%;
    min-width: 720px;
  }

  /* Instructor tools: classes + roster side-by-side when space */
  #labsInstructorPanel:not(.hidden) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  #labsInstructorPanel > h3,
  #labsInstructorPanel > p,
  #labsInstructorPanel > label,
  #labsInstructorPanel > input,
  #instructorRosterPanel,
  #instructorGradebookPanel,
  #instructorCasePanel {
    grid-column: 1 / -1;
  }
  #instructorClassesAdmin {
    grid-column: 1 / -1;
  }
  #instructorRosterPanel {
    grid-column: 1 / -1;
  }

  /* Gate form: full-width on desktop (no 480px phone card) */
  #siteGate .site-gate-card,
  .site-gate-card {
    max-width: min(920px, 96vw) !important;
    width: min(920px, 96vw);
    margin-left: auto;
    margin-right: auto;
  }
  #siteGate .site-gate-form {
    max-width: none;
    width: 100%;
  }
  #siteGate .site-gate-demo-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  /* Re-assert: no shell/panel caps; bottom-nav stays hidden (above) */
  .app-shell,
  body:not(.is-authed) .app-shell,
  body.is-authed .app-shell,
  body.is-embedded .app-shell {
    max-width: none !important;
    width: 100% !important;
  }
}


/* Mobile / narrow: keep phone chrome (bottom nav, no desktop header) */
@media (max-width: 899px) {
  .topbar,
  body:not(.is-authed) .topbar,
  body.is-authed .topbar,
  body.is-embedded .topbar,
  body.app-locked .topbar {
    display: none !important;
  }
}

/* cf-gateway-5-fullbleed safety — kill any remaining shell/content caps */
.app-shell,
body:not(.is-authed) .app-shell,
body.is-authed .app-shell,
body.is-embedded .app-shell {
  max-width: none !important;
  width: 100% !important;
}
@media (min-width: 900px) {
  .page,
  .panel,
  .sim-landing,
  .role-toggle.role-view-bar {
    max-width: none !important;
  }
  .bottom-nav,
  body.is-authed .bottom-nav.auth-only,
  body:not(.is-authed) .bottom-nav.guest-only {
    display: none !important;
  }
  #siteGate .site-gate-card {
    max-width: min(920px, 96vw) !important;
    width: min(920px, 96vw);
    margin-left: auto;
    margin-right: auto;
  }
}

/* cf-gateway-6-gatefix — gate card never phone-capped */
#siteGate .site-gate-card,
.site-gate-card {
  max-width: min(920px, 96vw) !important;
  width: min(920px, 96vw);
}
@media (max-width: 640px) {
  #siteGate .site-gate-card,
  .site-gate-card {
    max-width: 100% !important;
    width: 100%;
  }
  #siteGate .site-gate-demo-row {
    grid-template-columns: 1fr;
  }
}

