/* App shell — organizer dashboard pages */

.sg-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.sg-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--sg-border-soft);
}
.sg-nav-brand {
  font-family: var(--sg-font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--sg-text);
  letter-spacing: 0.01em;
}
.sg-nav-brand span { color: var(--sg-accent); }
.sg-nav-links { display: flex; gap: 26px; margin-left: auto; }
.sg-nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--sg-text-dim);
  transition: color 0.15s ease;
}
@media (hover: hover) { .sg-nav-links a:hover { color: var(--sg-text); } }
.sg-nav-links a.active { color: var(--sg-accent); }
.sg-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 22px; }
.sg-admin-operator {
  max-width: min(34vw, 360px);
  overflow: hidden;
  color: var(--sg-text-dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sg-admin-signout { min-height: 40px; padding: 8px 14px; font-size: 11px; }
.sg-account-menu { position: relative; }

/* The desktop account popover follows the phone menu's hierarchy without
   turning into a second full-screen navigation surface. */
@media (min-width: 880px) {
  .sg-account-trigger {
    min-height: 46px;
    max-width: 230px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: center;
    padding: 3px 8px 3px 3px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--sg-text);
    font: 700 13px var(--sg-font-body);
    cursor: pointer;
  }
  .sg-account-trigger:focus-visible {
    outline: 2px solid rgba(28,197,190,.68);
    outline-offset: 2px;
  }
  .sg-account-trigger-name {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sg-account-trigger-chevron {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--sg-text-dim);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .16s ease;
  }
  .sg-account-trigger[aria-expanded="true"] .sg-account-trigger-chevron { transform: rotate(180deg); }
  .sg-account-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--sg-border);
    border-radius: 50%;
    background: rgba(255,255,255,.035);
    color: var(--sg-text);
    font: 700 12px var(--sg-font-body);
  }
  .sg-account-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .sg-account-avatar-image[hidden],
  .sg-account-avatar-fallback[hidden] { display: none; }

  .sg-account-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    width: min(390px, calc(100vw - 32px));
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 24px;
    background: rgba(14,14,16,.985);
    box-shadow: 0 24px 64px rgba(0,0,0,.55);
    backdrop-filter: blur(20px) saturate(1.08);
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
    scrollbar-gutter: stable;
  }
  .sg-account-popover[hidden] { display: none; }
  .sg-account-popover a,.sg-account-popover button { min-height: 44px; }

  .sg-account-menu-profile {
    width: 100%;
    min-height: 72px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 20px;
    gap: 14px;
    align-items: center;
    padding: 8px 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--sg-border-soft);
    border-radius: 14px 14px 0 0;
    background: transparent;
    color: var(--sg-text);
    text-align: left;
    cursor: pointer;
  }
  .sg-account-menu-profile-avatar,
  .sg-account-menu-profile .sg-account-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(28,197,190,.58), rgba(40,40,46,.96));
    color: #fff;
    font: 800 16px/1 var(--sg-font-body);
  }
  .sg-account-menu-profile-avatar img,
  .sg-account-menu-profile .sg-account-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .sg-account-menu-profile-copy { min-width: 0; }
  .sg-account-menu-profile-copy strong,
  .sg-account-menu-profile-copy span,
  .sg-account-menu-profile-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sg-account-menu-profile-copy strong,
  .sg-account-menu-profile-copy .sg-account-menu-name {
    color: var(--sg-text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
  }
  .sg-account-menu-profile-copy span,
  .sg-account-menu-profile-copy small,
  .sg-account-menu-profile-copy .sg-account-menu-plan {
    margin-top: 3px;
    color: var(--sg-text-dim);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
  }
  .sg-account-menu-profile-chevron,
  .sg-account-menu-chevron {
    color: var(--sg-text-faint);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
  }
  svg.sg-account-menu-profile-chevron,
  svg.sg-account-menu-chevron {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .sg-account-menu-new {
    position: relative;
    width: 100%;
    min-height: 74px;
    display: flex;
    align-items: center;
    margin-top: 12px;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid rgba(28,197,190,.42);
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(28,197,190,.18), rgba(28,197,190,.045) 62%, rgba(255,255,255,.015));
    color: var(--sg-text);
    cursor: pointer;
  }
  .sg-account-menu-new-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding-right: 72px;
    font-size: 16px;
    font-weight: 800;
  }
  .sg-account-menu-new-label > span:first-child,
  .sg-account-menu-new-plus {
    color: var(--sg-accent);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
  }
  .sg-account-menu-new-art {
    position: absolute;
    top: 10px;
    right: 18px;
    width: 52px;
    height: 66px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.14);
    border-radius: 9px;
    box-shadow: 0 9px 22px rgba(0,0,0,.5);
    transform: rotate(-7deg);
  }
  .sg-account-menu-new-art[hidden] { display: none; }
  .sg-account-menu-new-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .sg-account-popover-group {
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--sg-border-soft);
    border-radius: 16px;
    background: rgba(255,255,255,.02);
  }
  .sg-account-popover-group[hidden] { display: none; }
  .sg-account-menu-row,
  .sg-account-menu-signout {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 0 16px;
    border: 0;
    border-top: 1px solid var(--sg-border-soft);
    border-radius: 0;
    background: transparent;
    color: var(--sg-text);
    text-align: left;
    font: 600 14px var(--sg-font-body);
    cursor: pointer;
  }
  .sg-account-popover-group > .sg-account-menu-row:first-child,
  .sg-account-popover-group > .sg-account-menu-signout:first-child { border-top: 0; }
  .sg-account-menu-row > span:not(.sg-account-menu-value),
  .sg-account-menu-signout > span:not(.sg-account-menu-value) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sg-account-menu-row .sg-menu-icon,
  .sg-account-menu-signout .sg-menu-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--sg-text-dim);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .sg-account-menu-value {
    color: var(--sg-text-dim);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .sg-account-popover-signout .sg-account-menu-row,
  .sg-account-menu-signout { color: var(--sg-text-dim); }

  .sg-account-menu-legal {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 6px 0 -6px;
    color: var(--sg-text-faint);
    font-size: 11px;
  }
  .sg-account-menu-legal a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: var(--sg-text-faint);
  }

  @media (hover: hover) {
    .sg-account-trigger:hover {
      border-color: var(--sg-border);
      background: rgba(255,255,255,.025);
    }
    .sg-account-menu-profile:hover,
    .sg-account-menu-row:hover,
    .sg-account-menu-signout:hover { background: rgba(255,255,255,.045); }
    .sg-account-menu-new:hover {
      border-color: rgba(28,197,190,.68);
      background: linear-gradient(120deg, rgba(28,197,190,.24), rgba(28,197,190,.07) 62%, rgba(255,255,255,.025));
    }
    .sg-account-menu-legal a:hover { color: var(--sg-text-dim); }
  }
  .sg-account-menu-profile:focus-visible,
  .sg-account-menu-new:focus-visible,
  .sg-account-menu-row:focus-visible,
  .sg-account-menu-signout:focus-visible,
  .sg-account-menu-legal a:focus-visible {
    outline: 2px solid rgba(28,197,190,.72);
    outline-offset: -2px;
  }
}
.sg-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--sg-text);
  cursor: pointer;
}

@media (max-width: 1023px) {
  .sg-nav-actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .sg-admin-page .sg-nav { align-items: flex-start; gap: 12px; }
  .sg-admin-page .sg-nav-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .sg-admin-operator { max-width: 48vw; }
  .sg-admin-signout { min-height: 44px; }
}
.sg-nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.sg-page-title { font-size: 34px; margin-bottom: 6px; }
.sg-page-sub { color: var(--sg-text-dim); font-size: 15px; margin-bottom: 32px; }

/* Shared loading placeholders for authenticated app views. */
.sg-skeleton {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.045) 20%, rgba(255,255,255,.105) 45%, rgba(255,255,255,.045) 70%);
  background-size: 240% 100%;
  animation: sg-skeleton-shimmer 1.35s ease-in-out infinite;
}
@keyframes sg-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-skeleton { animation: none; background: rgba(255,255,255,.07); }
}

/* Event cards on the Events list */
.sg-event-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--sg-card);
  border: 1px solid var(--sg-border-soft);
  border-radius: var(--sg-radius-card);
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color 0.15s ease;
  color: var(--sg-text);
}
@media (hover: hover) { .sg-event-card:hover { border-color: rgba(28, 197, 190, 0.4); } }
.sg-event-thumb {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--sg-surface);
  flex-shrink: 0;
}
.sg-event-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-text-faint);
  font-family: var(--sg-font-display);
  font-size: 26px;
}
.sg-event-meta { min-width: 0; flex: 1; }
.sg-event-meta h3 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-event-meta p { color: var(--sg-text-dim); font-size: 13px; margin-top: 2px; }
.sg-event-count { text-align: right; flex-shrink: 0; }
.sg-event-count strong { font-size: 22px; font-family: var(--sg-font-display); display: block; }
.sg-event-count span { font-size: 11px; color: var(--sg-text-faint); text-transform: uppercase; letter-spacing: 0.1em; }

/* Tables (guest list) */
.sg-table { width: 100%; border-collapse: collapse; }
.sg-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sg-text-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--sg-border);
}
.sg-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--sg-border-soft);
}
.sg-table td .dim { color: var(--sg-text-dim); font-size: 13px; }

/* Toast */
.sg-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  color: var(--sg-text);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: var(--sg-shadow);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 100;
  pointer-events: none;
}
.sg-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.sg-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--sg-text-dim);
}
.sg-empty h3 { font-size: 22px; color: var(--sg-text); margin-bottom: 8px; }
.sg-empty p { font-size: 14px; margin-bottom: 24px; }

/* Authenticated-app feedback bubble and compact modal */
.feedback-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(17,17,19,.9);
  color: var(--sg-text-dim);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font: 700 12px var(--sg-font-body);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
@media (hover: hover) { .feedback-bubble:hover { color: var(--sg-text); border-color: rgba(28,197,190,.55); transform: translateY(-1px); } }
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
  background: rgba(0,0,0,.52);
}
.feedback-modal.open { display: flex; }
.feedback-modal-card {
  width: min(100%, 410px);
  padding: 22px;
  border: 1px solid var(--sg-border);
  border-radius: 22px;
  background: #151517;
  box-shadow: var(--sg-shadow);
}
.feedback-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.feedback-modal-head h2 { font-size: 24px; margin-bottom: 4px; }
.feedback-modal-head p { color: var(--sg-text-dim); font-size: 12px; }
.feedback-modal-close {
  width: 34px; height: 34px; flex: 0 0 auto;
  border: 1px solid var(--sg-border); border-radius: 999px;
  background: transparent; color: var(--sg-text-dim); font-size: 20px; line-height: 1; cursor: pointer;
}
@media (hover: hover) { .feedback-modal-close:hover { color: var(--sg-text); border-color: var(--sg-accent); } }
.feedback-modal .sg-field { margin-bottom: 15px; }
.feedback-modal .sg-textarea { min-height: 118px; }
.feedback-form-error { display: none; margin: -4px 0 13px; color: var(--sg-danger); font-size: 12px; }
.admin-section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 26px; }
.admin-section-nav a {
  padding: 8px 15px; border: 1px solid var(--sg-border); border-radius: 999px;
  color: var(--sg-text-dim); font-size: 12px; font-weight: 700;
}
.admin-section-nav a.active { color: var(--sg-accent); border-color: rgba(28,197,190,.55); }@media (hover: hover) { .admin-section-nav a:hover { color: var(--sg-accent); border-color: rgba(28,197,190,.55); } }

/* Data-loading states for the private admin workspace. */
.admin-loading[hidden] { display: none; }
.admin-skeleton-stack { display: grid; gap: 10px; }
.admin-skeleton-card {
  min-width: 0;
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--sg-border-soft);
  border-radius: 18px;
  background: rgba(17,17,17,.72);
}
.admin-skeleton-row { display: flex; align-items: center; gap: 16px; }
.admin-skeleton-copy { min-width: 0; flex: 1; display: grid; gap: 10px; }
.admin-skeleton-title { width: min(280px, 68%); height: 18px; }
.admin-skeleton-meta { width: min(390px, 86%); height: 11px; }
.admin-skeleton-action { width: 92px; height: 36px; flex: 0 0 auto; border-radius: 999px; }
.admin-count-skeleton { display: inline-block; width: 72px; height: 11px; }
.admin-summary-skeleton { display: inline-block; width: 38px; height: 31px; }
.admin-load-error {
  padding: 52px 20px;
  border: 1px solid var(--sg-border-soft);
  border-radius: 18px;
  background: rgba(17,17,17,.48);
  color: var(--sg-text-dim);
  text-align: center;
}
.admin-load-error strong { display: block; margin-bottom: 7px; color: var(--sg-text); font-size: 17px; }
.admin-load-error p { margin-bottom: 18px; font-size: 13px; }

@media (max-width: 520px) {
  .sg-nav {
    position: relative;
    gap: 14px;
    margin-bottom: 30px;
  }
  .sg-nav-brand {
    font-size: clamp(17px, 6vw, 19px);
  }
  .sg-nav-toggle { display: flex; }
  .sg-nav-links {
    position: absolute;
    top: calc(100% - 10px);
    right: 0;
    display: grid;
    gap: 4px;
    min-width: 170px;
    padding: 10px;
    border: 1px solid var(--sg-border);
    border-radius: 16px;
    background: rgba(17,17,17,.96);
    box-shadow: var(--sg-shadow);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
    z-index: 30;
  }
  .sg-nav.open .sg-nav-links {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .sg-nav-links a {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
  }
  .sg-nav-links a.active {
    background: rgba(28,197,190,.1);
  }
  .sg-nav.open .sg-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .sg-nav.open .sg-nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  .sg-nav.open .sg-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .sg-page-title { font-size: 28px; }
  .feedback-bubble { right: 14px; bottom: 14px; }
  .feedback-modal { padding: 10px; }
  .feedback-modal-card { border-radius: 20px; padding: 20px; }
  .admin-skeleton-card { min-height: 104px; padding: 17px; }
  .admin-skeleton-action { width: 62px; }
}

/* Phone-only V2 foundation. Keep every override below the 880px desktop split. */
@media (max-width: 879px) {
  .sg-account-menu { display: none; }

  :root {
    --sg-mobile-page-gutter: 22px;
    --sg-mobile-title-size: var(--sg-mobile-page-title-size);
    --sg-mobile-body-size: 16px;
    --sg-mobile-helper-size: 15px;
    --sg-mobile-label-size: 14px;
    --sg-mobile-control-height: 60px;
    --sg-mobile-control-radius: 18px;
    --sg-mobile-card-radius: 22px;
    --sg-mobile-section-gap: 24px;
  }

  html {
    scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  body {
    font-size: var(--sg-mobile-body-size);
  }

  .sg-shell {
    width: 100%;
    max-width: 680px;
    padding-right: max(var(--sg-mobile-page-gutter), env(safe-area-inset-right));
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    padding-left: max(var(--sg-mobile-page-gutter), env(safe-area-inset-left));
  }

  .sg-nav {
    z-index: 50;
    min-height: 76px;
    gap: 14px;
    margin-bottom: 30px;
    padding: 16px 0;
  }

  .sg-nav-brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: clamp(17px, 5vw, 19px);
  }

  .sg-nav-toggle {
    width: 44px;
    height: 44px;
    display: flex;
  }

  .sg-nav-links {
    position: absolute;
    top: calc(100% - 8px);
    right: 0;
    width: min(240px, calc(100vw - var(--sg-mobile-page-gutter) - var(--sg-mobile-page-gutter)));
    display: grid;
    gap: 4px;
    margin-left: 0;
    padding: 10px;
    border: 1px solid var(--sg-border);
    border-radius: 18px;
    background: rgba(17,17,17,.98);
    box-shadow: var(--sg-shadow);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }

  .sg-nav.open .sg-nav-links {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .sg-nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: var(--sg-mobile-label-size);
  }

  .sg-nav-links a.active {
    background: rgba(28,197,190,.1);
  }

  .sg-nav.open .sg-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .sg-nav.open .sg-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .sg-nav.open .sg-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .sg-page-title {
    margin-bottom: 8px;
    font-size: var(--sg-mobile-title-size);
    line-height: 1.04;
  }

  .sg-page-sub {
    margin-bottom: var(--sg-mobile-section-gap);
    font-size: var(--sg-mobile-body-size);
    line-height: 1.55;
  }

  .sg-label,
  .sg-field label {
    font-size: var(--sg-mobile-label-size);
    letter-spacing: .1em;
  }

  .sg-btn {
    min-height: var(--sg-mobile-control-height);
    padding: 15px 22px;
    font-size: var(--sg-mobile-body-size);
  }

  @media (hover: hover) { .sg-btn-primary:hover {
    transform: none;
  } }

  .sg-btn:focus-visible,
  .sg-event-card:focus-visible,
  .sg-nav-toggle:focus-visible,
  .sg-nav-links a:focus-visible {
    outline: 2px solid rgba(28,197,190,.68);
    outline-offset: 3px;
  }

  .sg-input,
  .sg-select {
    min-height: var(--sg-mobile-control-height);
    padding: 15px 16px;
  }

  .sg-textarea {
    min-height: 120px;
    padding: 15px 16px;
    line-height: 1.55;
  }

  .sg-card {
    padding: 22px;
    border-radius: var(--sg-mobile-card-radius);
  }

  .sg-event-card {
    min-height: 116px;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: var(--sg-mobile-card-radius);
  }

  .sg-event-thumb {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .sg-event-meta h3 {
    font-size: 19px;
    line-height: 1.2;
  }

  .sg-event-meta p {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
  }

  .sg-event-count {
    min-width: 46px;
  }

  .sg-event-count strong {
    font-size: 24px;
  }

  .sg-event-count span {
    font-size: 11px;
    line-height: 1.3;
  }

  .sg-empty {
    padding: 52px 20px;
  }

  .sg-empty h3 {
    font-size: 24px;
  }

  .sg-empty p {
    font-size: 15px;
    line-height: 1.6;
  }

  .sg-toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: min(calc(100% - var(--sg-mobile-page-gutter) - var(--sg-mobile-page-gutter)), 520px);
    min-height: 48px;
    padding: 12px 18px;
    font-size: 14px;
    text-align: center;
  }

  .feedback-bubble {
    right: max(var(--sg-mobile-page-gutter), env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .feedback-modal {
    padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .feedback-modal-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 22px;
    border-radius: 24px;
  }

  .feedback-modal-head h2 {
    font-size: var(--sg-mobile-section-title-size);
  }

  .feedback-modal-head p,
  .feedback-form-error {
    font-size: 13px;
  }

  .feedback-modal-close {
    width: 44px;
    height: 44px;
  }

  .admin-section-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    font-size: 13px;
  }

  body.has-mobile-sticky-action .sg-shell {
    padding-bottom: calc(156px + env(safe-area-inset-bottom));
  }

  body.has-mobile-sticky-action .feedback-bubble {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.has-mobile-sticky-action .sg-toast {
    bottom: calc(146px + env(safe-area-inset-bottom));
  }

  .sg-mobile-sticky-action {
    position: fixed;
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 60;
    width: calc(100% - var(--sg-mobile-page-gutter) - var(--sg-mobile-page-gutter));
    max-width: 636px;
    min-height: 60px;
    box-shadow: 0 14px 34px rgba(0,0,0,.48);
    transform: translateX(-50%);
  }

  .sg-mobile-sticky-action:focus-visible {
    transform: translateX(-50%);
  }@media (hover: hover) { .sg-mobile-sticky-action:hover {
    transform: translateX(-50%);
  } }

  .sg-mobile-sticky-action:active {
    transform: translateX(-50%) translateY(1px);
  }
}

/* Menu-only extras: Feedback and legal links live in the phone menu on signed-in pages. */
.sg-nav-feedback,
.sg-nav-legal { display: none; }

.sg-legal-feedback,
.sg-legal-feedback-separator { display: none; }

@media (max-width: 879px) {
  body.sg-app-page .feedback-bubble { display: none; }
  body.sg-app-page:not(.quick-create-mobile-flow):not(.event-mobile-flow-enabled):not(.manage-mobile-custom-nav) .sg-global-footer { display: none; }

  body.sg-app-page.quick-create-mobile-flow .sg-legal-feedback,
  body.sg-app-page.quick-create-mobile-flow .sg-legal-feedback-separator,
  body.sg-app-page.event-mobile-flow-enabled .sg-legal-feedback,
  body.sg-app-page.event-mobile-flow-enabled .sg-legal-feedback-separator,
  body.sg-app-page.manage-mobile-custom-nav .sg-legal-feedback,
  body.sg-app-page.manage-mobile-custom-nav .sg-legal-feedback-separator { display: inline-flex; }

  .sg-legal-feedback {
    min-height: 44px;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }

  .sg-nav-feedback {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    padding: 10px 12px;
    border: 0;
    border-top: 1px solid var(--sg-border-soft);
    border-radius: 0;
    background: none;
    color: var(--sg-text-dim);
    font: inherit;
    font-size: var(--sg-mobile-label-size, 14px);
    text-align: left;
    cursor: pointer;
  }

  .sg-nav-legal {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 12px 2px;
    color: var(--sg-text-faint);
    font-size: 12px;
  }

  .sg-nav-links .sg-nav-legal a {
    min-height: 44px;
    display: inline-flex;
    padding: 0 4px;
    color: var(--sg-text-faint);
    font-size: 12px;
  }
}

/* Bottom tab bar (phones, signed-in top-level pages). */
.sg-tab-bar,
.sg-menu-sheet { display: none; }

@media (max-width: 879px) {
  body.has-tab-bar { --sg-tab-bar-height: 62px; }
  /* The ☰ opens the full-screen menu panel instead of the dropdown. */
  body.has-tab-bar .sg-nav-links { display: none; }

  .sg-tab-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(10,10,11,.88);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
  }
  .sg-tab {
    min-width: 0;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
    color: var(--sg-text-faint);
    font: 700 11px/1.1 var(--sg-font-body);
    -webkit-tap-highlight-color: transparent;
  }
  .sg-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sg-tab[aria-current="page"] { color: var(--sg-accent); }
  .sg-tab:active { background: rgba(255,255,255,.04); }
  .sg-tab:focus-visible { outline: 2px solid rgba(28,197,190,.68); outline-offset: -2px; }
  /* Create is always teal: visible without being a giant button. */
  .sg-tab-create { color: var(--sg-accent); }
  .sg-tab-create svg { stroke-width: 2; }
  .sg-tab-avatar {
    position: relative;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(28,197,190,.55), rgba(40,40,46,.95));
    color: #fff;
    font: 800 10px/1 var(--sg-font-body);
    letter-spacing: .02em;
  }
  .sg-tab-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .sg-tab[aria-current="page"] .sg-tab-avatar { box-shadow: 0 0 0 2px var(--sg-bg), 0 0 0 3.5px var(--sg-accent); }

  /* The phone Create button now lives in the tab bar. */
  body.has-tab-bar .sg-mobile-sticky-action { display: none !important; }
  body.has-tab-bar .events-shell #empty-action:not([hidden]) { display: inline-flex !important; margin-top: 22px; }

  /* Everything that sat on the bottom edge moves up by the bar's height. */
  body.has-tab-bar .sg-shell,
  body.has-tab-bar.has-mobile-sticky-action .sg-shell { padding-bottom: calc(104px + var(--sg-tab-bar-height) + env(safe-area-inset-bottom)); }
  body.has-tab-bar .sg-toast,
  body.has-tab-bar.has-mobile-sticky-action .sg-toast { bottom: calc(72px + var(--sg-tab-bar-height) + env(safe-area-inset-bottom)); }
  body.has-tab-bar .settings-shell { padding-bottom: calc(112px + var(--sg-tab-bar-height) + env(safe-area-inset-bottom)); }

  /* ☰ menu: a full-screen panel that slides in from the right. */
  html.sg-menu-sheet-open,
  html.sg-menu-sheet-open body { overflow: hidden; }
  .sg-menu-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--sg-bg);
    transform: translateX(100%);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
  }
  .sg-menu-sheet.open { transform: translateX(0); }
  .sg-menu-sheet-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: max(10px, env(safe-area-inset-top)) max(var(--sg-mobile-page-gutter), env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(var(--sg-mobile-page-gutter), env(safe-area-inset-left));
  }
  .sg-menu-close {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 4px 0 6px -10px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--sg-text);
    cursor: pointer;
  }
  .sg-menu-close svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sg-menu-profile {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 84px;
    padding: 6px 0 20px;
    border-bottom: 1px solid var(--sg-border-soft);
    color: var(--sg-text);
  }
  .sg-menu-avatar {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(28,197,190,.6), rgba(40,40,46,.95));
    color: #fff;
    font: 800 20px/1 var(--sg-font-body);
  }
  .sg-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .sg-menu-profile-copy { min-width: 0; }
  .sg-menu-profile-copy strong,
  .sg-menu-profile-copy small { display: block; }
  .sg-menu-profile-copy strong { overflow: hidden; font-size: 20px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .sg-menu-profile-copy small { margin-top: 3px; color: var(--sg-text-dim); font-size: 15px; }
  .sg-menu-chevron { color: var(--sg-text-faint); font-size: 28px; }
  .sg-menu-new {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 76px;
    margin-top: 22px;
    padding: 0 20px;
    overflow: hidden;
    border: 1px solid rgba(28,197,190,.42);
    border-radius: 20px;
    background: linear-gradient(120deg, rgba(28,197,190,.2), rgba(28,197,190,.05) 60%, rgba(255,255,255,.02));
    color: var(--sg-text);
  }
  .sg-menu-new-label { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; }
  .sg-menu-new-label span { color: var(--sg-accent); font-size: 26px; font-weight: 400; line-height: 1; }
  .sg-menu-new-art {
    position: absolute;
    top: 12px;
    right: 22px;
    width: 64px;
    height: 80px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.14);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,.45);
    transform: rotate(-7deg);
  }
  .sg-menu-new-art[hidden] { display: none; }
  .sg-menu-new-art img { width: 100%; height: 100%; object-fit: cover; }
  .sg-menu-group {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--sg-border-soft);
    border-radius: 18px;
    background: rgba(255,255,255,.025);
  }
  .sg-menu-group[hidden] { display: none; }
  .sg-menu-row {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 0 18px;
    border: 0;
    border-top: 1px solid var(--sg-border-soft);
    background: none;
    color: var(--sg-text);
    font: 600 16px var(--sg-font-body);
    text-align: left;
    cursor: pointer;
  }
  .sg-menu-group > .sg-menu-row:first-child { border-top: 0; }
  .sg-menu-row:active { background: rgba(255,255,255,.04); }
  .sg-menu-row:focus-visible,
  .sg-menu-profile:focus-visible,
  .sg-menu-new:focus-visible,
  .sg-menu-close:focus-visible { outline: 2px solid rgba(28,197,190,.72); outline-offset: -2px; }
  .sg-menu-icon { width: 22px; height: 22px; fill: none; stroke: var(--sg-text-dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sg-menu-value { color: var(--sg-text-dim); font-size: 14px; font-weight: 700; }
  .sg-menu-legal { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; color: var(--sg-text-faint); font-size: 12px; }
  .sg-menu-legal a { min-height: 44px; display: inline-flex; align-items: center; color: var(--sg-text-faint); }
}

@media (max-width: 879px) and (prefers-reduced-motion: reduce) {
  .sg-menu-sheet:not([hidden]) { transition: none; }
}
