/* Littlest Dreamer — auth modal + account nav button
   Matches the scheduler design system (sage/cream palette, DM Sans,
   Playfair for headings, bottom-sheet modal pattern on mobile). */

/* Self-hosted Caveat 500 (the handwritten accent font used for the
   "Sweet naps · Happy days" eyebrow + share-link footer tags). Bundled
   in the IPA / Vercel deploy under /img/fonts/ so iOS WKWebView never
   has to round-trip to fonts.gstatic.com — Google Fonts loads
   inconsistently inside the Capacitor WebView and the system fallback
   ("Snell Roundhand") looks completely different from Caveat. */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/img/fonts/caveat-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Suppress iOS double-tap-to-zoom (and the 300ms click delay it implies)
   without disabling pinch-to-zoom — `manipulation` keeps pan + pinch but
   drops the double-tap gesture that was hijacking taps in the app shell. */
html, body { touch-action: manipulation; }

.lr-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.lr-account-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.45);
}
.lr-account-btn svg { flex-shrink: 0; }
.lr-account-btn .lr-account-email {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatar initial circle — shown when signed in */
.lr-account-avatar {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: var(--sage-dark, #4a4a8c);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  max-width: none;
  overflow: visible;
  position: relative;
}
/* Gold ring — shown when premium is active */
.lr-account-avatar.is-premium {
  border-color: #c9a84c;
}
/* Hide person icon when avatar is shown */
.lr-account-btn.is-signed-in svg { display: none; }

/* While the initial auth + premium hydration is pending, keep the pill's
   shape but hide its contents — otherwise a signed-in user briefly sees
   the signed-out "Sign in" state before the avatar (and gold premium
   ring) flips in. visibility:hidden preserves layout so the pill doesn't
   resize. lr-auth.js strips this class once LRAuth.ready resolves. */
.lr-account-btn.is-auth-pending > * { visibility: hidden; }

@media (max-width: 580px) {
  .lr-account-btn { padding: 0 12px; }
  .lr-account-btn .lr-account-email:not(.lr-account-avatar) { display: none; }
  .lr-account-btn .lr-account-label { display: none; }
}

/* Modal overlay — bottom sheet on mobile, centered card on desktop */
.lr-auth-overlay {
  position: fixed;
  inset: 0;
  /* Slightly darker rgba (was 0.55 with a 2px backdrop blur) — the blur
     was the dominant cause of the laggy modal scroll on desktop because
     the GPU had to re-render the blurred backdrop behind every scroll
     frame in the modal sitting on top. A flat darker scrim reads almost
     identical without the per-frame compositor cost. */
  background: rgba(45,36,28,0.62);
  z-index: 10000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overscroll-behavior: contain;
}
.lr-auth-overlay.is-open { display: flex; }

/* Lock the page behind the sheet so swiping the modal doesn't drag the
   document or trigger mobile pull-to-refresh. */
body.lr-auth-open {
  overflow: hidden;
  overscroll-behavior: none;
}
html:has(body.lr-auth-open) { overflow: hidden; }

@media (min-width: 640px) {
  .lr-auth-overlay { align-items: center; padding: 24px; }
}

.lr-auth-modal {
  background: var(--warm-white, #fdfbff);
  color: var(--charcoal, #1a1a18);
  width: 100%;
  max-width: 440px;
  border-radius: 22px 22px 0 0;
  padding: 26px 24px calc(28px + var(--lr-nav-clear));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
  font-family: 'DM Sans', sans-serif;
  max-height: calc(90vh - var(--lr-nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Scope paint/layout to the modal so scroll repaints don't trigger
     work on the page behind the overlay. */
  contain: paint;
}
@media (min-width: 640px) {
  .lr-auth-modal {
    border-radius: 22px;
    padding: 32px 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  }
}

.lr-auth-handle {
  width: 40px;
  height: 4px;
  background: var(--border, #e0deef);
  border-radius: 4px;
  margin: -12px auto 18px;
}
@media (min-width: 640px) { .lr-auth-handle { display: none; } }

.lr-auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  line-height: 1.15;
  margin-bottom: 6px;
  color: var(--charcoal, #1a1a18);
}
.lr-auth-title em { font-style: italic; color: var(--honey, #d4a857); font-weight: 500; }
.lr-auth-subtitle {
  font-size: 14px;
  color: var(--muted, #75726d);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* Account view hero — bunny avatar + centered title block.
   Sits above the household section in the existing #lr-view-account. */
.lr-account-hero {
  text-align: center;
  margin-bottom: 18px;
  padding-top: 4px;
}
.lr-account-hero-avatar {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 6px;
  animation: lr-account-hero-float 4s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
@media (prefers-reduced-motion: reduce) {
  .lr-account-hero-avatar { animation: none; }
}
@keyframes lr-account-hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.lr-account-hero-title { margin-bottom: 4px; }
.lr-account-hero-sub { margin-bottom: 0; font-size: 13px; }
.lr-account-hero-sub strong { font-weight: 600; color: #4a4a8c; }

/* ── Profile hero card (gradient + bunny on the side) ── */
.lr-profile-hero {
  background:
    radial-gradient(ellipse at 80% 10%, rgba(255,255,255,0.7), transparent 55%),
    linear-gradient(135deg, #f0f0fa 0%, #dbdcf2 55%, #f4e6c8 100%);
  border-radius: 24px;
  padding: 18px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(74,74,140,0.10);
  /* Promote the gradient hero to its own compositor layer so the layered
     radial + linear gradient is rasterised once into a texture and reused
     during scroll, instead of repainting whenever it crosses the viewport
     edge in the scrolled modal. */
  transform: translateZ(0);
  will-change: transform;
}
.lr-profile-hero-content {
  flex: 1;
  min-width: 0;
}
.lr-profile-greeting {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #4a4a8c;
  display: block;
  margin-bottom: 4px;
}
.lr-profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.05;
  color: #2d2945;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.lr-profile-role {
  display: inline-block;
  background: linear-gradient(135deg, var(--honey, #d4a857), #c79545);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(212,168,87,0.3);
}
.lr-profile-bio {
  font-size: 12px;
  color: #4a4a8c;
  font-style: italic;
  line-height: 1.45;
  margin: 0;
  opacity: 0.85;
}
.lr-profile-bunny {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  /* No drop-shadow filter — paint cost per frame combined with the float
     animation made the modal scroll laggy. The bunny PNG has its own soft
     shadow baked in; the gradient hero card behind it provides depth. */
  animation: lr-account-hero-float 4s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
@media (prefers-reduced-motion: reduce) {
  .lr-profile-bunny { animation: none; }
}

/* ── Profile stats overview (3-column) ── */
.lr-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: linear-gradient(180deg, #fdfbff 0%, #f0f0fa 100%);
  border: 1px solid rgba(139,143,207,0.18);
  border-radius: 18px;
  padding: 14px 8px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(74,74,140,0.06);
}
.lr-profile-stat {
  text-align: center;
  padding: 0 6px;
  border-right: 1px dashed rgba(139,143,207,0.25);
}
.lr-profile-stat:last-child { border-right: none; }
.lr-profile-stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: #4a4a8c;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.lr-profile-stat-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #75726d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.lr-profile-stat-label em {
  font-style: italic;
  color: var(--honey, #d4a857);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.2px;
}

/* Footer signed-in line + sign-out button alignment */
.lr-account-signed-in {
  font-size: 12px;
  color: #75726d;
  text-align: center;
  margin: 14px 0 8px;
}
.lr-account-signed-in strong { color: #4a4a8c; font-weight: 600; }

/* Quick actions menu (sheet body). Always-visible action rows above the
   household section so the renamed "Quick actions" sheet has substance
   even before a baby/household is set up. */
.lr-account-menu {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lr-account-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #fdfbff;
  border: 1px solid rgba(139,143,207,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.12s ease;
  color: #2d2945;
}
.lr-account-menu-row:hover {
  background: #f0f0fa;
  border-color: rgba(139,143,207,0.4);
}
.lr-account-menu-icon {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fdfbff, #dbdcf2);
  color: #4a4a8c;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(139,143,207,0.18);
}
.lr-account-menu-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lr-account-menu-label { font-size: 14px; font-weight: 600; color: #2d2945; }
.lr-account-menu-sub { font-size: 12px; color: #75726d; }
.lr-account-menu-chev {
  font-size: 20px;
  color: #a4a8de;
  margin-left: 4px;
}

.lr-auth-field { margin-bottom: 14px; }
.lr-auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #75726d);
  margin-bottom: 6px;
}
.lr-auth-field input {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e0deef);
  border-radius: 12px;
  background: white;
  color: var(--charcoal, #1a1a18);
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lr-auth-field input:focus {
  outline: none;
  border-color: var(--sage, #8b8fcf);
  box-shadow: 0 0 0 3px rgba(139,143,207,0.15);
}

/* Password show/hide toggle */
.lr-pw-wrap { position: relative; }
.lr-pw-wrap input { padding-right: 46px; }
.lr-pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted, #75726d);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
  transition: color 0.15s;
}
.lr-pw-toggle:hover { color: var(--charcoal, #1a1a18); }

/* OAuth (Google / Apple) buttons — shown above the email form on the
   sign-in and sign-up views. Match the 44px+ tap-target rule and the
   broader design system (DM Sans, soft radii, subtle borders).

   Layout: 2-column grid, each button centres an icon+label block. Icons
   live in a fixed-size box so asymmetric SVG viewBoxes (e.g. the Apple
   glyph sits slightly right of centre in its own viewBox) can't pull
   the whole block off-centre. */
.lr-oauth-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.lr-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  line-height: 1;
}
.lr-oauth-btn:active:not(:disabled) { transform: scale(0.99); }
.lr-oauth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Fixed-size icon slot. Normalises the rendered footprint of both
   brand glyphs so the icon+label block is always centred as one unit. */
.lr-oauth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.lr-oauth-icon svg { display: block; width: 100%; height: 100%; }

.lr-oauth-label {
  display: inline-block;
  line-height: 1;
}

.lr-oauth-google {
  background: white;
  color: #1f1f1f;
  border: 1.5px solid var(--border, #e0deef);
}
.lr-oauth-google:hover:not(:disabled) {
  background: #fbf9f6;
  border-color: #cfc6ba;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.lr-oauth-apple {
  background: #111;
  color: white;
  border: 1.5px solid #111;
}
.lr-oauth-apple:hover:not(:disabled) { background: #000; }

/* "or" divider between OAuth buttons and the email form. */
.lr-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #75726d);
}
.lr-auth-divider::before,
.lr-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border, #e0deef);
}

.lr-auth-submit {
  width: 100%;
  min-height: 48px;
  background: var(--sage-dark, #4a4a8c);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, transform 0.05s;
}
.lr-auth-submit:hover:not(:disabled) { background: #3a3a72; }
.lr-auth-submit:active:not(:disabled) { transform: scale(0.99); }
.lr-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Aliases for the parent-input flows (signup-essentials Continue,
   Sleep-setup Save, weekly-sheet Save). Same primary-CTA recipe as
   .lr-auth-submit, separate class so future tuning can diverge. */
.lr-auth-cta {
  width: 100%;
  min-height: 48px;
  background: var(--sage-dark, #4a4a8c);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, transform 0.05s;
}
.lr-auth-cta:hover:not(:disabled) { background: #3a3a72; }
.lr-auth-cta:active:not(:disabled) { transform: scale(0.99); }
.lr-auth-cta:disabled { opacity: 0.6; cursor: not-allowed; }
.lr-auth-cta-row { margin-top: 16px; }

/* Skip link used in the signup-essentials view (top-right of the
   modal). Text-only, low visual weight, 44px tap area. */
.lr-auth-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted, #75726d);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 14px;
  min-height: 44px;
  text-decoration: underline;
}
.lr-auth-skip:hover { color: var(--charcoal, #1a1a18); }

.lr-auth-error {
  background: #fcebe4;
  color: #8a3a1a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.4;
}
.lr-auth-error.is-visible { display: block; }

.lr-auth-success {
  background: #e4f1e9;
  color: #4a4a8c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.4;
}
.lr-auth-success.is-visible { display: block; }

.lr-auth-links {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted, #75726d);
  line-height: 1.8;
}
.lr-auth-links a {
  color: var(--sage-dark, #4a4a8c);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.lr-auth-links a:hover { text-decoration: underline; }
.lr-auth-links .lr-auth-sep {
  display: block;
  margin: 4px 0;
  color: var(--border, #e0deef);
}

.lr-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(139,143,207,0.18);
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #75726d);
  cursor: pointer;
  display: block;
  z-index: 5;
}
.lr-auth-close:hover { background: rgba(255,255,255,0.95); color: #4a4a8c; }

.lr-auth-modal { position: relative; }

/* Signed-out vs signed-in view toggling inside the modal */
.lr-auth-view { display: none; }
.lr-auth-view.is-active { display: block; }

/* Optional spinner for loading state */
.lr-auth-submit .lr-auth-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: lr-spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: -2px;
}
@keyframes lr-spin { to { transform: rotate(360deg); } }

/* ── Invite banner — appears at the top of the modal for ?invite= flows */
.lr-invite-banner {
  display: none;
  position: relative;
  background: #fbf3e1;
  color: #5a4516;
  border: 1px solid #e9d8a6;
  border-radius: 12px;
  padding: 14px 36px 14px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.5;
}
.lr-invite-banner.is-visible { display: block; }
.lr-invite-banner.is-success {
  background: #e4f1e9;
  color: #4a4a8c;
  border-color: #c5dfd0;
}
.lr-invite-banner.is-error {
  background: #fcebe4;
  color: #8a3a1a;
  border-color: #f1c7b6;
}
.lr-invite-banner-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.lr-invite-banner-meta {
  font-size: 12.5px;
  opacity: 0.85;
  margin-bottom: 8px;
}
.lr-invite-banner-cta {
  display: inline-block;
  background: var(--sage-dark, #4a4a8c);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  min-height: 44px;
}
.lr-invite-banner-cta:hover { background: #3a3a72; }
.lr-invite-banner-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}
.lr-invite-banner-dismiss:hover { opacity: 1; }

/* ── Household management block (inside the account view) */
.lr-hh-block {
  margin: 4px 0 18px;
}
.lr-hh-loading,
.lr-hh-empty {
  font-size: 13.5px;
  color: var(--muted, #75726d);
  padding: 10px 0;
}
.lr-hh-section + .lr-hh-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e0deef);
}
.lr-hh-section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #75726d);
  margin-bottom: 10px;
}
.lr-hh-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lr-hh-active-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--charcoal, #1a1a18);
  min-height: 32px;
}
.lr-hh-active-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lr-hh-rename-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #e0deef);
  border-radius: 8px;
  min-height: 44px;
  flex: 1 1 180px;
}
.lr-hh-rename-input:focus {
  outline: none;
  border-color: var(--sage, #8b8fcf);
}
.lr-hh-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lr-hh-row,
.lr-hh-member,
.lr-hh-invite {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.02);
  border-radius: 10px;
  font-size: 13.5px;
  flex-wrap: wrap;
}
.lr-hh-member-label,
.lr-hh-invite-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-hh-member-tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lr-hh-invite-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lr-hh-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(0,0,0,0.06);
  color: var(--muted, #75726d);
}
.lr-hh-badge-owner {
  background: #fbf3e1;
  color: #8a6500;
}
.lr-hh-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sage-dark, #4a4a8c);
  background: white;
  border: 1.5px solid var(--border, #e0deef);
  border-radius: 50px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lr-hh-row-btn:hover { background: #fbf9f6; border-color: #cfc6ba; }
.lr-hh-row-btn-danger {
  color: #8a3a1a;
  border-color: #f1c7b6;
  background: #fcebe4;
}
.lr-hh-row-btn-danger:hover {
  background: #f9d8c8;
}
.lr-hh-row-btn.is-armed {
  background: #b84a2a;
  border-color: #b84a2a;
  color: white;
}
/* Baby rows in the account view — name on top with optional sub-line,
   active badge, and per-row action buttons. Mirrors the member-row look. */
.lr-hh-baby-row { align-items: flex-start; }
.lr-hh-baby-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.lr-hh-baby-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--charcoal, #1a1a18);
}
.lr-hh-baby-unnamed {
  font-style: italic;
  color: var(--muted, #75726d);
  font-weight: 500;
}
.lr-hh-baby-sub {
  font-size: 12px;
  color: var(--muted, #75726d);
}
.lr-hh-baby-tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lr-hh-baby-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-basis: 100%;
}

.lr-hh-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  min-height: 42px;
  background: white;
  border: 1.5px dashed var(--border, #e0deef);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sage-dark, #4a4a8c);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lr-hh-action-btn:hover {
  background: #fbf9f6;
  border-color: var(--sage, #8b8fcf);
}

/* Sign-out variant: muted dusty rose that lives in the periwinkle/honey
   family — replaces the prior terracotta which read as a rogue color
   against the Twilight Nursery palette. Reserve true red for destructive
   account actions like Delete Account. */
.lr-auth-signout {
  background: #c98b9b !important;
  margin-top: 22px;
}
.lr-auth-signout:hover:not(:disabled) {
  background: #b07788 !important;
}

/* Optional helper text inside an input label */
.lr-field-hint {
  font-weight: 400;
  color: var(--muted, #75726d);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
}

/* Invite-result view — shows the generated URL with a copy CTA */
.lr-invite-link {
  font-family: 'DM Sans', monospace, sans-serif;
  font-size: 13px;
  background: #fbf9f6;
  border: 1.5px solid var(--border, #e0deef);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--charcoal, #1a1a18);
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

/* Tracker / insights — subtle signed-in badge */
.lr-signed-in-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted, #75726d);
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.03);
}
.lr-signed-in-badge svg { flex-shrink: 0; }

/* ── Notifications view ─────────────────────────────────────────── */
.lr-notify-permission {
  background: #f5e2e6;
  color: #7a4a52;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 16px;
}
.lr-notify-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border, #e0deef);
}
.lr-notify-row:last-of-type { border-bottom: none; }
.lr-notify-row-body { flex: 1; min-width: 0; }
.lr-notify-row-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal, #1a1a18);
  margin-bottom: 3px;
}
.lr-notify-row-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted, #75726d);
}
.lr-notify-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.lr-notify-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.lr-notify-toggle-track {
  position: absolute;
  inset: 0;
  background: #d4d2cc;
  border-radius: 999px;
  transition: background 0.18s;
}
.lr-notify-toggle-track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.18s;
}
.lr-notify-toggle input:checked + .lr-notify-toggle-track {
  background: var(--sage-dark, #4a4a8c);
}
.lr-notify-toggle input:checked + .lr-notify-toggle-track::before {
  transform: translateX(18px);
}
/* Specificity boosted with [type="time"] so this overrides scheduler.html's
   page-level `select, input[type="time"], input[type="text"] { width: 100% }`
   rule which would otherwise stretch the picker across the whole row and
   crush the "Recap time" label into a 0-width column. */
input[type="time"].lr-notify-time-input,
.lr-notify-time-input {
  background: #fbf9f6;
  border: 1.5px solid var(--border, #e0deef);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--charcoal, #1a1a18);
  cursor: text;
  /* iOS renders <input type="time"> with a sizeable native chrome
     (hour/min wheels + AM/PM). Without an explicit width the input
     pushes past the row body, overlapping the "Recap time" label. */
  flex-shrink: 0;
  width: 116px;
  min-width: 0;
  text-align: center;
  appearance: none;
}
html.lr-dark .lr-notify-time-input,
html.lr-dark input[type="time"].lr-notify-time-input {
  background: var(--moonlight);
  border-color: var(--border);
  color: var(--charcoal);
}

/* ── Account footer — destructive actions paired ──────────────────
 * Leave household + Delete account sit together at low visual weight
 * below sign-out. Confirm view for delete requires typing DELETE
 * before the button enables (GitHub / Stripe pattern). */
.lr-account-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e0deef);
  text-align: center;
}
.lr-account-footer-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}
.lr-account-footer-btn {
  background: transparent;
  border: none;
  color: var(--muted, #7a7693);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 6px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(122,118,147,0.5);
  border-radius: 8px;
  /* Equal share of row width so two or three buttons stay on one
     row at every supported viewport without wrapping. White-space:
     nowrap on the labels keeps each button's text on a single line;
     if the modal ever shrinks below ~280px the label clips
     visually rather than wrapping the row. */
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-account-footer-btn:hover { background: var(--cream, #f5f1e9); color: var(--charcoal, #1a1a18); }
.lr-account-footer-btn.lr-account-footer-btn-danger {
  color: #8a3a1a;
  text-decoration-color: rgba(138,58,26,0.5);
  font-weight: 600;
}
.lr-account-footer-btn.lr-account-footer-btn-danger:hover {
  background: #fcebe4;
  color: #8a3a1a;
}
/* Armed state matches lr-hh-row-btn.is-armed: the "tap again to
   confirm" treatment on Leave household keeps parity with the
   pattern used for in-list destructive buttons elsewhere. */
.lr-account-footer-btn.is-armed {
  background: #b84a2a;
  color: white !important;
  text-decoration: none;
}
.lr-account-footer-hint {
  margin: 8px auto 0;
  max-width: 380px;
  font-size: 12px;
  color: var(--muted, #7a7693);
  line-height: 1.45;
}
html.lr-dark .lr-account-footer-btn.lr-account-footer-btn-danger { color: #f0a890; text-decoration-color: rgba(240,168,144,0.5); }
html.lr-dark .lr-account-footer-btn.lr-account-footer-btn-danger:hover { background: rgba(184,74,42,0.18); color: #f5c8b4; }
html.lr-dark .lr-account-footer-btn:hover { background: rgba(255,255,255,0.06); color: var(--charcoal); }

/* Inline feedback states for the Restore-purchases menu sub-line. */
.lr-account-menu-sub[data-state="ok"]      { color: #2b7a4b; }
.lr-account-menu-sub[data-state="err"]     { color: #8a3a1a; }
.lr-account-menu-sub[data-state="pending"] { color: var(--sage-dark, #4a4a8c); }
html.lr-dark .lr-account-menu-sub[data-state="ok"]  { color: #6fc28c; }
html.lr-dark .lr-account-menu-sub[data-state="err"] { color: #f0a890; }
html.lr-dark .lr-account-menu-sub[data-state="pending"] { color: var(--sage-dark); }
.lr-delete-checklist {
  margin: 0 0 18px;
  padding: 14px 16px 14px 32px;
  background: #fcebe4;
  border-left: 3px solid #b84a2a;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #5b2818;
}
.lr-delete-checklist li { margin-bottom: 6px; }
.lr-delete-checklist li:last-child { margin-bottom: 0; }
.lr-auth-submit.lr-auth-delete-confirm {
  background: #b84a2a;
}
.lr-auth-submit.lr-auth-delete-confirm:hover:not(:disabled) {
  background: #9c3e22;
}
html.lr-dark .lr-account-delete-btn { color: #f0a890; }
html.lr-dark .lr-account-delete-btn:hover { background: rgba(184,74,42,0.18); }
html.lr-dark .lr-delete-checklist {
  background: rgba(184,74,42,0.18);
  color: #f5d7c8;
  border-left-color: #d77452;
}
