/* Cosa Cena v2 — account sheet (Dinner Circle, §3.7/§3.8)
   Own classes throughout -- .account-sheet-overlay / .account-sheet -- zero
   shared state or CSS with components/sheet.js's .overlay/.sheet. Same
   visual recipe (scrim, slide-up panel, handle) intentionally mirrored from
   shared.css's Bottom sheets block, not reused directly, so a future change
   to the per-screen sheet component can't accidentally move this one too. */

.account-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46,31,18,0.45);
  z-index: 300; /* above the per-screen .overlay (200) and tab bar (100) --
                   the account door has to win over whatever screen is open */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.account-sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* §3.12: explicit 430px centering, matching nav.js's .tab-bar-wrap technique.
   This is the one new component in the feature with no existing desktop-safe
   pattern to inherit automatically -- everything else reuses card/typography
   classes that already respect this; a sheet mounted directly in index.html
   (not inside a screen's own centered column) does not, unless stated here. */
.account-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 20px));
  width: 100%;
  max-width: 430px;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  z-index: 301;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 0 20px max(env(safe-area-inset-bottom), 20px);
  visibility: hidden;
}

.account-sheet.active {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.account-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--sand-mid);
  border-radius: 2px;
  margin: 12px auto 16px;
}

/* ── Signed-in identity row ────────────────────────────────────────────── */

.account-sheet-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
}

.account-sheet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover; /* only affects the <img> (real photo) case */
}

.account-sheet-email {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--brown-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Rows ──────────────────────────────────────────────────────────────── */

.account-sheet-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
}

.account-sheet-rows-signedout {
  margin-top: 20px;
}

.account-sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 52px;
  box-shadow: 0 0 0 1px rgba(46,31,18,0.05);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
  width: 100%;
  text-align: left;
}

.account-sheet-row:active {
  background: var(--terracotta-pale);
}

.account-sheet-row:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.account-sheet-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-sheet-row-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--brown);
}

.account-sheet-row-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  /* Was single-line-truncated (nowrap + ellipsis) -- fit fine for the
     shorter rows (Settings, Manage friends) but cut off Invite friends'
     longer copy ("Their dinners show up in your feed. Yours show up in
     theirs."). Wraps to 2 lines instead; .account-sheet-row's align-items
     already handles the resulting variable row height correctly. */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.account-sheet-row-signout .account-sheet-row-label {
  color: var(--brown-mid);
}

/* ── Signed-out heading (mirrors the existing sign-in sheet's own heading
   style, signin.css, kept as an independent declaration -- see this file's
   own header comment for why nothing here is shared with another sheet) ── */

.account-sheet-heading {
  font-family: 'Lora', serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--brown);
  margin: 0 0 16px;
}

/* Was heading-only until Chat 151 (SIGNIN-ACCOUNTSHEET-NO-BODY: direct
   user report, "there's no body copy" -- confirmed via a full audit of
   every tappable sign-in surface in the app, not just this one). Same
   independent-declaration policy as .account-sheet-heading above,
   mirroring .signin-sheet-body's (signin.css) visual language rather
   than sharing the class. */
.account-sheet-body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
}

/* ── Version stamp (H7: moved out of Home's page content) ────────────────── */
.account-sheet-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--sand-dark);
  text-align: center;
  letter-spacing: 0.06em;
  padding-top: 16px;
}
