/* Account menu — v2 bottom sheet opened from the header avatar when the user
 * belongs to 2+ gardens. Rides the shared .modal-overlay/.modal-sheet system
 * (app.js openModal → scrim + swipe-dismiss + body-lock for free); this layer
 * paints the v2 appearance and the garden-switcher + Settings rows.
 * Single-garden users never see this — the avatar opens Settings as before. */

.account-menu-sheet {
  background: var(--v2-bg-panel);
  border-radius: var(--v2-radius-xl) var(--v2-radius-xl) 0 0;
  max-height: 80vh;
  max-height: 80dvh;
}

.account-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 20px 6px;
  flex-shrink: 0;
}
.account-menu-title {
  font-family: var(--v2-font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--v2-text-primary);
}
.account-menu-done {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  font-family: var(--v2-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v2-text-stone);
  cursor: pointer;
  padding: 8px 4px;
  min-height: 44px;
}

.account-menu-body {
  padding: 4px 16px 28px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* identity */
.account-id-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 14px;
}
.account-id-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--v2-pop-sage-bg);
  color: var(--v2-accent-botanical);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: 19px;
  border: 1.5px solid var(--v2-accent-botanical);
  flex-shrink: 0;
}
.account-id-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.account-id-name {
  font-family: var(--v2-font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--v2-text-primary);
}
.account-id-email {
  font-family: var(--v2-font-body);
  font-size: 12px;
  color: var(--v2-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-label {
  font-family: var(--v2-font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--v2-text-stone);
  font-weight: 600;
  margin: 6px 4px 8px;
}

/* grouped rows */
.account-garden-group,
.account-util-group {
  background: var(--v2-bg-card);
  border: 1px solid var(--v2-border-soft);
  border-radius: var(--v2-radius-md);
  overflow: hidden;
}
.account-util-group {
  margin-top: 14px;
}

.account-garden-row,
.account-util-row {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--v2-border-soft);
  cursor: pointer;
  position: relative;
}
.account-garden-row:last-child,
.account-util-row:last-child {
  border-bottom: none;
}
.account-garden-row.is-active {
  background: var(--v2-pop-sage-bg);
  cursor: default;
}
.account-garden-row.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--v2-accent-botanical);
}

.account-g-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--v2-bg-secondary);
  color: var(--v2-text-secondary);
}
.account-garden-row.is-active .account-g-mark {
  background: var(--v2-accent-botanical);
  color: var(--v2-text-on-dark);
}
.account-g-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-g-name {
  font-family: var(--v2-font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--v2-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-g-role {
  font-family: var(--v2-font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--v2-text-tertiary);
}
.account-g-active-pill {
  font-family: var(--v2-font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v2-accent-botanical);
  background: var(--v2-bg-card);
  border: 1px solid var(--v2-accent-botanical);
  border-radius: var(--v2-radius-pill);
  padding: 4px 9px;
  flex-shrink: 0;
}
.account-row-chevron {
  color: var(--v2-text-muted);
  flex-shrink: 0;
}

/* Settings row */
.account-util-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--v2-text-secondary);
  flex-shrink: 0;
}
.account-util-label {
  font-family: var(--v2-font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--v2-text-primary);
  flex: 1;
}

.account-menu-note {
  font-family: var(--v2-font-body);
  font-size: 12.5px;
  color: var(--v2-text-secondary);
  line-height: 1.45;
  margin: 14px 4px 0;
}

@media (hover: hover) {
  .account-garden-row:not(.is-active):hover,
  .account-util-row:hover {
    background: var(--v2-bg-secondary);
  }
}
