/* CUPRA GANG — App shell: bottom tab bar + account sheet (member pages, <=1024px). Load LAST. */
.appnav, .appsheet { display: none; }

@media (max-width: 1024px) {
  /* the bottom bar replaces the hamburger menu on member pages */
  body.has-appnav .nav-hamburger { display: none !important; }
  body.has-appnav .nav-mobile { display: none !important; }
  body.has-appnav .nav .nav-actions { margin-inline-end: 0 !important; }
  body.has-appnav .member-content { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important; }
  body.has-appnav #cg-toast-container { bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }

  .appnav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; inset-inline: 0; bottom: 0; z-index: 950;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 12, 14, .88);
    -webkit-backdrop-filter: saturate(160%) blur(22px); backdrop-filter: saturate(160%) blur(22px);
    border-top: 1px solid rgba(255, 210, 160, .14);
    box-shadow: 0 -10px 36px rgba(0, 0, 0, .55);
    transition: transform .28s cubic-bezier(.19, 1, .22, 1);
  }
  body.appnav-kb .appnav { transform: translateY(110%); }

  .appnav-i {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 56px; padding: 6px 2px 4px; border: 0; background: none; border-radius: 14px;
    color: rgba(240, 236, 228, .5); text-decoration: none; cursor: pointer; font: inherit;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: color .2s, transform .15s;
  }
  .appnav-i:active { transform: scale(.93); }
  .appnav-ic { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background .25s; }
  .appnav-ic svg { width: 24px; height: 24px; display: block; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
  .appnav-lb { font: 700 .68rem/1.1 var(--font-heading, sans-serif); letter-spacing: .04em; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  [dir=rtl] .appnav-lb { letter-spacing: 0; font-size: .72rem; }

  .appnav-i.on { color: var(--bronze-light, #d4924a); }
  .appnav-i.on .appnav-ic { background: linear-gradient(145deg, rgba(255, 190, 120, .26), rgba(184, 115, 51, .08)); box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .28); }
  .appnav-i.on .appnav-ic svg { transform: translateY(-1px) scale(1.06); }
  .appnav-i.on .appnav-ic svg * { fill: rgba(224, 160, 99, .22); }
  .appnav-i:focus-visible { outline: 2px solid var(--bronze-light, #d4924a); outline-offset: -2px; }

  /* account sheet */
  body.as-lock { overflow: hidden; }
  .appsheet { display: block; position: fixed; inset: 0; z-index: 2000; }
  .appsheet[hidden] { display: none; }
  .as-back { position: absolute; inset: 0; background: rgba(5, 5, 6, .66); opacity: 0; transition: opacity .26s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .appsheet.open .as-back { opacity: 1; }
  .as-panel {
    position: absolute; inset-inline: 0; bottom: 0; max-height: 88svh; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px));
    background: #141417; border: 1px solid rgba(255, 210, 160, .16); border-bottom: 0; border-radius: 22px 22px 0 0;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, .7); outline: 0;
    transform: translateY(100%); transition: transform .3s cubic-bezier(.19, 1, .22, 1);
    max-width: 560px; margin-inline: auto;
  }
  .appsheet.open .as-panel { transform: translateY(0); }
  .as-grab { display: grid; place-items: center; height: 26px; margin: 0 -16px; cursor: grab; touch-action: none; }
  .as-grab i { width: 38px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); }

  .as-me { display: flex; align-items: center; gap: 12px; padding: 4px 2px 16px; }
  .as-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 400 1.5rem var(--font-display, sans-serif); color: #0a0a0b; background: linear-gradient(145deg, var(--bronze-light, #d4924a), var(--bronze-dark, #8a5520)); }
  .as-me > div { flex: 1; min-width: 0; }
  .as-me b { display: block; font: 700 1.05rem var(--font-heading, sans-serif); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-me small { color: rgba(240, 236, 228, .5); font-size: .78rem; }
  .as-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--charcoal-4, #2e2e36); background: none; color: rgba(240, 236, 228, .7); display: grid; place-items: center; cursor: pointer; }
  .as-x svg { width: 16px; height: 16px; }

  .as-grp { border: 1px solid var(--charcoal-4, #2e2e36); border-radius: 16px; background: #17171a; margin-bottom: 12px; overflow: hidden; }
  .as-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 14px; background: none; border: 0; text-align: start; color: var(--white, #f0ece4); text-decoration: none; cursor: pointer; font: 600 .98rem var(--font-heading, sans-serif); letter-spacing: .03em; -webkit-tap-highlight-color: transparent; }
  .as-row[hidden] { display: none; }
  .as-row + .as-row { border-top: 1px solid rgba(255, 255, 255, .06); }
  .as-row:active, .as-row.on { background: rgba(184, 115, 51, .1); }
  .as-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--bronze-light, #d4924a); border: 1px solid rgba(255, 210, 160, .3); background: linear-gradient(145deg, rgba(255, 190, 120, .22), rgba(184, 115, 51, .05)); }
  .as-ic svg { width: 20px; height: 20px; }
  .as-tx { flex: 1; min-width: 0; }
  .as-ch { color: rgba(240, 236, 228, .3); display: grid; }
  .as-ch svg { width: 14px; height: 14px; }
  [dir=rtl] .as-ch svg { transform: scaleX(-1); }
  .as-out { border: 1px solid rgba(224, 82, 82, .35); border-radius: 16px; color: #ff8a8a; background: rgba(224, 82, 82, .06); margin-bottom: 0; }
  .as-out .as-ic { color: #ff8a8a; border-color: rgba(224, 82, 82, .35); background: rgba(224, 82, 82, .08); }
  .as-row:focus-visible, .as-x:focus-visible { outline: 2px solid var(--bronze-light, #d4924a); outline-offset: -2px; }
}

@media (min-width: 1025px) { .appnav, .appsheet { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .appnav, .appnav-i, .appnav-ic svg, .as-panel, .as-back { transition: none !important; }
}
