.sm-app-shell{min-height:100dvh;height:100dvh;max-height:100dvh;display:flex;flex-direction:column;background:var(--surface);color:var(--on-surface);width:100%;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box}
.sm-app-shell__header{flex:0 0 auto;position:relative;z-index:var(--sm-z-header, 20);top:auto;display:flex;align-items:center;gap:0.5rem;padding:0.65rem max(0.75rem,env(safe-area-inset-left));padding-right:max(0.75rem,env(safe-area-inset-right));background:var(--surface-container);border-bottom:1px solid var(--outline-variant);color:var(--on-surface);transition:padding 0.2s ease,box-shadow 0.2s ease;max-width:100%;box-sizing:border-box}
.sm-app-shell__header.is-scrolled{padding-top:.45rem;padding-bottom:.45rem;box-shadow:0 4px 18px rgba(0,0,0,0.35)}
.sm-app-shell__brand,.sm-app-shell__icon,.sm-app-shell__tab{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;color:inherit;background:transparent;border:0;text-decoration:none;cursor:pointer}
.sm-app-shell__brand{font-weight:800;white-space:nowrap;color:var(--on-surface)}.sm-app-shell__brand svg,.sm-app-shell__icon svg,.sm-app-shell__tab svg{width:1.35rem;height:1.35rem;fill:currentColor}
.sm-app-shell__title{margin:0;font-size:1.15rem;font-weight:750;color:var(--on-surface);transition:font-size 0.2s ease}
.sm-app-shell__header.is-scrolled .sm-app-shell__title{font-size:1rem}
.sm-app-shell__global{display:flex;gap:.25rem;margin-left:auto;flex-shrink:0}
.sm-app-shell__icon{position:relative;width:2.35rem;height:2.35rem;border-radius:50%;color:var(--on-surface-variant);flex-shrink:0}.sm-app-shell__icon:focus-visible,.sm-app-shell__tab:focus-visible,.sm-app-shell__brand:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.sm-app-shell__badge{position:absolute;top:.1rem;right:.05rem;min-width:1rem;padding:.08rem .25rem;border-radius:1rem;background:var(--error);color:var(--on-error);font-size:.65rem;line-height:1.1;text-align:center}
.sm-app-shell__content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;min-height:0;-webkit-overflow-scrolling:touch;width:100%;max-width:min(100%,76rem);min-width:0;margin-inline:auto;padding:1rem max(0.85rem,env(safe-area-inset-left)) calc(6.5rem + env(safe-area-inset-bottom));padding-right:max(0.85rem,env(safe-area-inset-right));box-sizing:border-box;animation:sm-page-enter 0.18s ease-out}
.sm-app-shell.has-no-fab .sm-app-shell__content{padding-bottom:calc(2.5rem + env(safe-area-inset-bottom))}

@keyframes sm-page-enter{from{opacity:0.65;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.sm-screen{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;max-width:100%;width:100%;min-width:0;box-sizing:border-box}.sm-screen>*{min-width:0;max-width:100%;box-sizing:border-box}.sm-screen__heading{display:flex;align-items:flex-end;justify-content:space-between;gap:0.75rem;flex-wrap:wrap;max-width:100%;box-sizing:border-box}.sm-screen__heading>div{min-width:0;flex:1 1 140px}.sm-screen__heading h2{margin:.15rem 0;color:var(--on-surface)}.sm-screen__heading p{margin:.25rem 0;color:var(--on-surface-variant)}
.sm-app-shell__nav{flex:0 0 auto;position:relative;z-index:var(--sm-z-nav, 40);bottom:auto;left:auto;right:auto;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:.35rem max(.5rem,env(safe-area-inset-left)) calc(.35rem + env(safe-area-inset-bottom));background:var(--surface-container);border-top:1px solid var(--outline-variant)}
.sm-app-shell__tab{min-width:0;min-height:3.2rem;flex-direction:column;gap:.15rem;border-radius:.65rem;font-size:.7rem;color:var(--on-surface-variant)}.sm-app-shell__tab.is-active{color:var(--primary);background:var(--surface-container-high)}

/* Floating Action Button (FAB) */
.sm-fab{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:calc(4.75rem + env(safe-area-inset-bottom));z-index:var(--sm-z-fab, 60);width:56px;height:56px;border-radius:18px;background:linear-gradient(135deg,#F6C445 0%,#D8A527 100%);color:#241A00;display:grid;place-items:center;border:1px solid rgba(246,196,69,0.8);box-shadow:var(--gold-glow);cursor:pointer;transition:transform 0.18s ease,opacity 0.18s ease,bottom 0.18s ease}
.sm-fab:active{transform:scale(0.92)}
.sm-fab svg{width:28px;height:28px;fill:currentColor}
.sm-fab.sm-fab--hidden{transform:translateY(160%) scale(0.8);opacity:0;pointer-events:none}
.sm-fab.sm-fab--keyboard-hidden,body.keyboard-open .sm-fab,body.has-sheet-open .sm-fab,body:has(.sm-bottom-sheet-backdrop) .sm-fab,.sm-app-shell:has(.sm-bottom-sheet-backdrop) .sm-fab,body:has(.auth-page.modal-scrim) .sm-fab{display:none !important}

/* When snackbar is visible in the shell, FAB sits above snackbar */
.sm-app-shell:has(.notice.snackbar) .sm-fab,.sm-app-shell:has(.sm-snackbar) .sm-fab,body.has-snackbar .sm-fab{bottom:calc(9.25rem + env(safe-area-inset-bottom))}

/* Draggable Bottom Sheet */
.sm-bottom-sheet-backdrop{position:fixed;inset:0;z-index:var(--sm-z-sheet-backdrop, 90);background:rgba(0,0,0,0.65);display:flex;flex-direction:column;justify-content:flex-end;backdrop-filter:blur(3px);animation:sm-sheet-fade 0.18s ease-out}
@keyframes sm-sheet-fade{from{opacity:0}to{opacity:1}}
.sm-bottom-sheet{background:var(--surface-container-low);border-top:1px solid var(--outline-variant);border-radius:24px 24px 0 0;padding:12px 20px calc(24px + env(safe-area-inset-bottom));max-height:85dvh;overflow-y:auto;box-shadow:0 -8px 32px rgba(0,0,0,0.5);transform:translateY(0);transition:transform 0.2s cubic-bezier(0.16,1,0.3,1);z-index:var(--sm-z-sheet, 100)}
.sm-sheet-handle{width:40px;height:5px;border-radius:3px;background:var(--outline);margin:0 auto 12px;cursor:grab}
.sm-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.sm-sheet-title{margin:0;font-size:18px;font-weight:800;color:var(--on-surface)}
.sm-sheet-close{font-size:18px;padding:4px 8px;min-height:44px;min-width:44px;color:var(--on-surface-variant);display:inline-flex;align-items:center;justify-content:center}

/* Quick Actions Sheet Grid */
.sm-quick-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:8px 0}
.sm-quick-action{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px 12px;text-align:center;min-height:80px;border-radius:var(--shape-md);background:var(--surface-container);border:1px solid var(--outline-variant);font-size:13px;font-weight:700}
.sm-quick-action svg{width:24px;height:24px;fill:var(--primary)}

/* Numeric Steppers (kills, points, slots, capacity) */
.sm-stepper{display:inline-flex;align-items:center;border:1px solid var(--outline-variant);border-radius:var(--shape-md);background:var(--surface-container);overflow:hidden}
.sm-stepper-btn{width:44px;height:44px;display:grid;place-items:center;background:var(--surface-container-high);color:var(--on-surface);font-size:18px;font-weight:800;cursor:pointer;border:none;user-select:none;transition:background 0.12s}
.sm-stepper-btn:active{background:var(--primary);color: var(--on-primary)}
.sm-stepper-input{width:56px;height:44px;text-align:center;background:transparent;border:none;color:var(--on-surface);font-weight:800;font-size:15px;font-variant-numeric:tabular-nums;outline:none}

/* Wheel-style Time Drum Picker */
.sm-wheel-picker{display:flex;align-items:center;justify-content:center;gap:12px;padding:16px;background:var(--surface-container);border:1px solid var(--outline-variant);border-radius:var(--shape-md);margin:8px 0}
.sm-wheel-column{display:flex;flex-direction:column;gap:6px;max-height:140px;overflow-y:auto;padding:8px 4px;scrollbar-width:none}
.sm-wheel-column::-webkit-scrollbar{display:none}
.sm-wheel-item{min-height:44px;min-width:44px;padding:4px 16px;border-radius:999px;border:none;background:transparent;color:var(--on-surface-variant);font-size:15px;font-weight:700;font-variant-numeric:tabular-nums;cursor:pointer;transition:all 0.12s}
.sm-wheel-item.is-selected{background:var(--primary);color: var(--on-primary);font-weight:850;box-shadow:var(--gold-glow)}
.sm-wheel-colon{font-size:24px;font-weight:800;color:var(--primary)}

/* Squad Invite QR Code */
.sm-invite-qr-wrap{display:grid;place-items:center;padding:16px;background:#FFFFFF;border-radius:16px;margin:14px auto;width:fit-content;box-shadow:0 4px 20px rgba(0,0,0,0.4)}
.sm-qr-svg{display:block;max-width:100%;height:auto}

@media(min-width: 768px){.sm-app-shell__content{padding-top:2rem}.sm-app-shell__nav{width:min(34rem,calc(100% - 2rem));margin:0 auto;border:1px solid var(--outline-variant);border-bottom:0;border-radius:1rem 1rem 0 0}}

/* Result posted celebration modal (reduced-motion safe) */
.sm-celebration-backdrop {
  position: fixed; inset: 0; z-index: var(--sm-z-modal, 110);
  background: rgba(0, 0, 0, 0.75);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(4px);
  animation: sm-celebration-in 0.25s ease-out;
}
@keyframes sm-celebration-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sm-celebration-backdrop { animation: none !important; }
}
.sm-celebration-card {
  max-width: 360px; width: 100%; text-align: center;
  background: linear-gradient(145deg, var(--surface-container-high) 0%, var(--surface-container-low) 100%);
  border: 1px solid rgba(246, 196, 69, 0.6);
  border-radius: var(--sm-radius-sheet); padding: 28px 24px;
  box-shadow: 0 0 36px rgba(246, 196, 69, 0.35);
}
.sm-celebration-trophy { font-size: 48px; margin-bottom: 8px; }
.sm-celebration-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--primary); text-transform: uppercase;
}
.sm-celebration-card h3 { margin: 6px 0; font-size: 20px; color: var(--on-surface); }
.sm-celebration-card p { font-size: 13px; color: var(--on-surface-variant); margin-bottom: 18px; line-height: 1.5; }

/* Onboarding coach marks (first run) */
.sm-coach-marks {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px; pointer-events: auto;
}
.sm-coach-card {
  background: var(--surface-container);
  border: 1px solid var(--primary);
  border-radius: var(--sm-radius-card); padding: 18px 20px;
  margin-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  box-shadow: var(--gold-glow);
}
.sm-coach-card h4 { margin: 0 0 6px; font-size: 15px; color: var(--primary); }
.sm-coach-card p { margin: 0 0 12px; font-size: 13px; color: var(--on-surface-variant); line-height: 1.4; }

/* Snackbar & Toast layering: sits above nav */
.notice.snackbar, .sm-snackbar {
  position: fixed;
  bottom: calc(4.75rem + env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  max-width: min(500px, calc(100% - 32px));
  margin: 0 auto;
  z-index: var(--sm-z-snackbar, 50);
  box-sizing: border-box;
}

/* Offline / slow-network banner */
.sm-network-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 180, 171, 0.15);
  border-bottom: 1px solid rgba(255, 180, 171, 0.4);
  color: #FFB4AB;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.sm-network-banner.slow {
  background: rgba(246, 196, 69, 0.15);
  border-color: rgba(246, 196, 69, 0.4);
  color: var(--primary);
}

@media (max-width: 600px) {
  .sm-app-shell__brand span {
    display: none !important;
  }
  .sm-app-shell__header {
    padding: 0.5rem max(0.5rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.5rem, env(safe-area-inset-right)) !important;
    gap: 0.35rem !important;
  }
  .sm-app-shell__title {
    font-size: 1.05rem !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
  }
  .sm-app-shell__global {
    gap: 0.2rem !important;
  }
  .sm-app-shell__icon {
    width: 2.1rem !important;
    height: 2.1rem !important;
  }
  .sm-app-shell__icon svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
  }
}

@media (max-height: 480px) {
  .sm-fab { width: 44px; height: 44px; bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
  .sm-fab svg { width: 22px; height: 22px; }
}
@media (max-width:599px){.sm-screen__heading:not(.sm-heading-between)>div:first-child{flex:1 1 100%}.sm-screen__heading:not(.sm-heading-between)>div:not(:first-child){flex:0 1 auto}}

.sm-app-shell:not(.has-no-fab) .home-priority .li-btn{margin-right:calc(56px + 12px)}
