body.app-shell-ready main > .nav-link,
body.app-shell-ready main > .players-link,
body.app-shell-ready main > .back-link {
  display: none !important;
}

html.app-shell-document {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.app-shell-ready {
  padding-top: env(safe-area-inset-top);
  overscroll-behavior-y: none;
}

body.app-shell-ready *,
body.app-shell-ready *::before,
body.app-shell-ready *::after {
  box-sizing: border-box;
}

body.app-shell-ready img {
  max-width: 100%;
}

.app-menu-button {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border: 1px solid #293552;
  border-radius: 8px;
  background: #111a2e;
  color: #f8fafc;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  touch-action: manipulation;
}

.app-menu-button:hover {
  background: #17233c;
}

.app-public-status {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 997;
  min-height: 34px;
  max-width: min(240px, calc(100vw - 96px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #14532d;
  border-radius: 999px;
  background: #102516;
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.app-public-status[hidden] {
  display: none;
}

.app-public-status[data-status="syncing"] {
  border-color: #854d0e;
  background: #27200f;
  color: #fde68a;
}

.app-public-status[data-status="busy"] {
  border-color: #7f1d1d;
  background: #3f1d2b;
  color: #fecaca;
}

.info-dot,
.app-help-dot {
  display: inline-grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  place-items: center;
  margin-left: 5px;
  border: 1px solid #3c4b6d;
  border-radius: 999px;
  background: #0e1527;
  color: #bfdbfe;
  font: 800 13px/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  vertical-align: middle;
}

.app-help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.app-help-popover {
  display: none;
  position: absolute;
  z-index: 1002;
  top: 30px;
  left: 0;
  width: min(300px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid #3c4b6d;
  border-radius: 10px;
  background: #0e1527;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.app-help-wrap.open .app-help-popover {
  display: block;
}

.app-launch-mode-banner {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 996;
  display: grid;
  gap: 2px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid #35507f;
  border-radius: 10px;
  background: #10203c;
  color: #dbeafe;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  line-height: 1.3;
}

.app-launch-mode-banner strong {
  color: #f8fafc;
  font-size: 13px;
}

.app-launch-mode-banner span {
  font-size: 12px;
}

.app-launch-mode-banner.payment_required {
  border-color: #14532d;
  background: #102516;
  color: #bbf7d0;
}

.app-launch-mode-banner.manual_approval {
  border-color: #854d0e;
  background: #27200f;
  color: #fde68a;
}

.app-menu-icon,
.app-menu-icon::before,
.app-menu-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.app-menu-icon {
  position: relative;
}

.app-menu-icon::before,
.app-menu-icon::after {
  position: absolute;
  left: 0;
}

.app-menu-icon::before {
  top: -7px;
}

.app-menu-icon::after {
  top: 7px;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: min(320px, calc(100vw - 44px));
  padding: 78px 18px 22px;
  background: #0e1527;
  border-right: 1px solid #293552;
  box-shadow: 18px 0 55px rgba(0, 0, 0, 0.36);
  transform: translateX(-100%);
  transition: transform 180ms ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.app-sidebar-open .app-sidebar {
  transform: translateX(0);
}

body.app-sidebar-open .app-sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 18px;
}

.app-sidebar-brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #293552;
  border-radius: 10px;
  object-fit: cover;
}

.app-sidebar-title {
  color: #f8fafc;
  font-size: 20px;
  font-weight: bold;
}

.app-sidebar-subtitle {
  margin-top: 4px;
  color: #9caac4;
  font-size: 13px;
}

.app-continue-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0 0 18px;
  padding: 0 12px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #17233c;
  color: #f8fafc;
  text-decoration: none;
  font-weight: bold;
}

.app-continue-link span {
  max-width: 130px;
  overflow: hidden;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-nav {
  display: grid;
  gap: 18px;
}

.app-sidebar-group {
  display: grid;
  gap: 8px;
}

.app-sidebar-heading {
  margin: 0 2px 2px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #293552;
  border-radius: 8px;
  background: #111a2e;
  color: #dbeafe;
  text-decoration: none;
  font-weight: bold;
  touch-action: manipulation;
}

.app-sidebar-link:hover,
.app-sidebar-link.active {
  border-color: #3b82f6;
  background: #17233c;
  color: #f8fafc;
}

.app-sidebar-link span {
  color: #9caac4;
  font-size: 12px;
  font-weight: normal;
}

.app-bottom-nav {
  display: none;
}

.app-install-button {
  width: 100%;
  min-height: 44px;
  margin: 20px 0 12px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-weight: bold;
}

.app-owner-toggle,
.app-user-logout {
  width: 100%;
  min-height: 44px;
  margin: 20px 0 0;
  border: 1px solid #293552;
  border-radius: 8px;
  background: transparent;
  color: #dbeafe;
  font: inherit;
  font-weight: bold;
}

.app-owner-toggle:hover,
.app-user-logout:hover {
  border-color: #3b82f6;
  background: #17233c;
}

.app-sidebar-status {
  margin-top: 14px;
  color: #8fa2c0;
  font-size: 12px;
}

.app-owner-health {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #293552;
  border-radius: 8px;
  background: #0e172a;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
}

.app-owner-health strong {
  color: #f8fafc;
  font-size: 13px;
}

.app-owner-health[data-status="ready"] {
  border-color: #166534;
}

.app-owner-health[data-status="busy"] {
  border-color: #2563eb;
}

.app-owner-health[data-status="watch"] {
  border-color: #f59e0b;
}

body.app-offline .app-sidebar-status {
  color: #facc15;
}

.app-status-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1002;
  max-width: min(420px, calc(100vw - 28px));
  padding: 11px 14px;
  border: 1px solid #293552;
  border-radius: 8px;
  background: #111a2e;
  color: #f8fafc;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  transform: translateX(-50%);
}

.app-status-toast[data-tone="warn"] {
  border-color: #facc15;
  color: #fef3c7;
}

.app-status-toast[data-tone="info"] {
  border-color: #3b82f6;
  color: #dbeafe;
}

.app-legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin: 34px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid #293552;
  color: #8fa2c0;
  font-size: 13px;
  line-height: 1.45;
}

.app-legal-footer a {
  color: #93c5fd;
  font-weight: 800;
  text-decoration: none;
}

.app-onboarding {
  position: fixed;
  inset: 0;
  z-index: 1004;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.app-onboarding-panel {
  width: min(520px, 100%);
  border: 1px solid #293552;
  border-radius: 12px;
  background: #10192d;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.44);
  padding: 22px;
}

.app-onboarding-kicker {
  margin-bottom: 8px;
  color: #a3e635;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-onboarding-panel h2 {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 28px;
}

.app-onboarding-panel p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.55;
}

.app-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.app-onboarding-grid span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #293552;
  border-radius: 8px;
  background: #0b1020;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.app-onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.app-onboarding-primary {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #a3e635;
  color: #14210a;
  font: inherit;
  font-weight: 900;
}

.app-onboarding-actions a {
  color: #93c5fd;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  body.app-shell-ready main {
    width: min(100% - 20px, 1240px) !important;
    padding-top: max(72px, calc(54px + env(safe-area-inset-top))) !important;
    padding-bottom: max(96px, calc(82px + env(safe-area-inset-bottom))) !important;
  }

  .app-menu-button {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    width: 48px;
    height: 48px;
  }

  .app-public-status {
    top: max(18px, calc(6px + env(safe-area-inset-top)));
    right: max(12px, env(safe-area-inset-right));
    min-height: 32px;
    max-width: calc(100vw - 84px);
  }

  .app-sidebar {
    width: min(340px, calc(100vw - 32px));
    padding-top: max(78px, calc(68px + env(safe-area-inset-top)));
    padding-bottom: max(22px, calc(22px + env(safe-area-inset-bottom)));
  }

  .app-sidebar-link {
    min-height: 48px;
  }

  body.app-shell-ready select,
  body.app-shell-ready input,
  body.app-shell-ready button {
    font-size: 16px !important;
    min-width: 0;
  }

  .app-sidebar-brand {
    align-items: flex-start;
  }

  .app-sidebar-brand img {
    width: 38px;
    height: 38px;
  }

  body.app-shell-ready .table-wrap {
    margin-left: -2px;
    margin-right: -2px;
    -webkit-overflow-scrolling: touch;
  }

  body.app-shell-ready table {
    min-width: 680px;
  }

  .app-bottom-nav {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 998;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    padding: 8px;
    border: 1px solid #293552;
    border-radius: 12px;
    background: rgba(14, 21, 39, 0.97);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  }

  .app-status-toast {
    bottom: max(82px, calc(72px + env(safe-area-inset-bottom)));
  }

  .app-legal-footer {
    margin-top: 24px;
    padding-bottom: 6px;
    font-size: 12px;
  }

  .app-onboarding-panel {
    padding: 18px;
  }

  .app-onboarding-grid {
    grid-template-columns: 1fr;
  }

  .app-bottom-nav a {
    display: grid;
    grid-template-rows: 20px 16px;
    gap: 3px;
    place-items: center;
    min-height: 48px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    touch-action: manipulation;
  }

  .app-bottom-nav a.active {
    background: #17233c;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px #3b82f6;
  }

  .app-bottom-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #24324f;
    color: #bfdbfe;
    font-size: 11px;
    line-height: 1;
  }

  .app-bottom-nav a.active .app-bottom-icon {
    background: #3b82f6;
    color: #ffffff;
  }
}
