/* ═══════════════════════════════════════════════════════
   VAULT — Design System
   Tokens → Reset → Layout → Components → Animations
   ═══════════════════════════════════════════════════════ */

/* ── 1. TOKENS ─────────────────────────────────────── */
:root {
  /* Light palette */
  --canvas:      #FAF8F3;
  --surface:     #FFFFFF;
  --surface-2:   #F4F1EA;
  --surface-3:   #EEE9DF;
  --text:        #1A1726;
  --muted:       #6B6577;
  --faint:       #B0AAC0;

  /* Brand */
  --primary:        #7B5CFF;
  --primary-deep:   #6A47F0;
  --primary-soft:   rgba(123, 92, 255, .11);
  --primary-glow:   rgba(123, 92, 255, .22);

  /* Semantic */
  --ok:          #1FA97A;
  --ok-soft:     rgba(31, 169, 122, .13);
  --warn:        #D98A2B;
  --warn-soft:   rgba(217, 138, 43, .15);
  --danger:      #E0564B;
  --danger-soft: rgba(224, 86, 75, .13);

  /* Surfaces */
  --border:      rgba(26, 23, 38, .07);
  --hair:        rgba(26, 23, 38, .05);
  --glass:       rgba(255, 255, 255, .60);
  --glass-bd:    rgba(255, 255, 255, .80);

  /* Shadows */
  --shadow:      0 20px 44px -18px rgba(50, 35, 90, .26);
  --shadow-sm:   0 6px 20px -10px rgba(50, 35, 90, .22);
  --shadow-xs:   0 2px 8px  -4px rgba(50, 35, 90, .14);

  /* Ambient glows */
  --glow1: rgba(123, 92, 255, .20);
  --glow2: rgba(255, 180, 100, .12);
  --glow3: rgba(155, 140, 255, .16);

  /* Tint chip backgrounds */
  --t-blue-bg:  rgba(75, 135, 245, .13);
  --t-blue-tx:  #4B87F5;
  --t-pink-bg:  rgba(232, 90, 160, .13);
  --t-pink-tx:  #E85AA0;
  --t-teal-bg:  rgba(40, 180, 180, .13);
  --t-teal-tx:  #1FAFA9;

  /* Radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 26px;
  --r-pill: 100px;

  /* Safe areas */
  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}

/* Dark theme overrides */
[data-theme="dark"],
@media (prefers-color-scheme: dark) { [data-theme="auto"] {
  --canvas:      #15131F;
  --surface:     #1E1B2B;
  --surface-2:   #252232;
  --surface-3:   #2D293C;
  --text:        #ECEAF5;
  --muted:       #9A93AD;
  --faint:       #5E5873;

  --primary:        #9B8CFF;
  --primary-deep:   #8877F5;
  --primary-soft:   rgba(155, 140, 255, .14);
  --primary-glow:   rgba(123,  92, 255, .34);

  --ok:          #42C99B;
  --ok-soft:     rgba(66, 201, 155, .15);
  --warn:        #E6A24E;
  --warn-soft:   rgba(230, 162,  78, .16);
  --danger:      #F0716A;
  --danger-soft: rgba(240, 113, 106, .15);

  --border:   rgba(255, 255, 255, .08);
  --hair:     rgba(255, 255, 255, .05);
  --glass:    rgba(28, 25, 40, .62);
  --glass-bd: rgba(255, 255, 255, .09);

  --shadow:    0 22px 50px -20px rgba(0, 0, 0, .65);
  --shadow-sm: 0  8px 22px -12px rgba(0, 0, 0, .55);
  --shadow-xs: 0  2px 10px  -4px rgba(0, 0, 0, .45);

  --glow1: rgba(123, 92, 255, .32);
  --glow2: rgba(120, 90, 255, .14);
  --glow3: rgba(155, 140, 255, .24);

  --t-blue-tx: #7FA8FF;
  --t-pink-tx: #FF8FC4;
  --t-teal-tx: #4FD4CE;
}}


/* ── 2. RESET & BASE ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--text);
  height: 100%;
  overflow: hidden;           /* single-screen app */
  -webkit-tap-highlight-color: transparent;
  transition: background .4s ease, color .4s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

img, svg { display: block; }

a { text-decoration: none; color: inherit; }

/* Scrollbar hide */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }


/* ── 3. APP SHELL ───────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transition: opacity .3s ease;
}

.app-hidden { opacity: 0; pointer-events: none; }
.app-visible { opacity: 1; pointer-events: auto; }

/* Each view fills the screen */
.view {
  position: absolute;
  inset: 0;
  background: var(--canvas);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background .4s ease;
}

/* Ambient atmospheric background on every view */
.view-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(110% 55% at 10%  -5%, var(--glow1), transparent 60%),
    radial-gradient( 80% 45% at 95%   5%, var(--glow2), transparent 55%),
    radial-gradient( 60% 40% at 55% 100%, var(--glow3), transparent 50%);
}

/* Subtle grain overlay */
.view-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* Scrollable content area (sits above bg, below tabbar) */
.view-content {
  position: relative;
  z-index: 10;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 18px calc(96px + var(--sab));
  -webkit-overflow-scrolling: touch;
}

/* Scroll fade at bottom of content */
.scroll-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  pointer-events: none;
  z-index: 12;
  background: linear-gradient(transparent, var(--canvas) 70%);
  transition: background .4s ease;
}


/* ── 4. LOADING SCREEN ──────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: loaderPop .5s cubic-bezier(.2,.8,.2,1) both;
}

.loader-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, #B8A0FF 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 16px 36px -10px rgba(123, 92, 255, .55);
  animation: loaderPulse 1.8s ease-in-out infinite;
}

.loader-mark svg { width: 34px; height: 34px; }

.loader-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -.02em;
}

@keyframes loaderPop  { from { opacity: 0; transform: scale(.88) translateY(8px); } }
@keyframes loaderPulse {
  0%, 100% { box-shadow: 0 16px 36px -10px rgba(123,92,255,.55); }
  50%       { box-shadow: 0 16px 48px  -8px rgba(123,92,255,.80); }
}


/* ── 5. GLASS TOPBAR ────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: calc(6px + var(--sat)) 18px 4px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.topbar-title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.topbar-sub   { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 1px; }


/* ── 6. BOTTOM TAB BAR ──────────────────────────────── */
.tabbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(14px, var(--sab));
  z-index: 35;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--glass);
  border: 1px solid var(--glass-bd);
  border-radius: var(--r-xl);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  width: 48px;
  transition: color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--primary); }

.fab {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #A78BFF);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(123, 92, 255, .70);
  transform: translateY(-12px);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.fab:active {
  transform: translateY(-10px) scale(.96);
  box-shadow: 0 6px 16px -6px rgba(123, 92, 255, .60);
}

.fab svg { width: 26px; height: 26px; }


/* ── 7. CARDS ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-sm {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-xs);
}


/* ── 8. ATOMS ───────────────────────────────────────── */

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  letter-spacing: .01em;
  white-space: nowrap;
}

.pill svg { width: 12px; height: 12px; }
.pill.ok      { background: var(--ok-soft);     color: var(--ok);     }
.pill.warn    { background: var(--warn-soft);   color: var(--warn);   }
.pill.danger  { background: var(--danger-soft); color: var(--danger); }
.pill.soft    { background: var(--primary-soft); color: var(--primary); }
.pill.muted   { background: var(--surface-2);   color: var(--muted);  }

/* Chips (icon containers) */
.chip {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chip svg { width: 20px; height: 20px; }
.chip.sm  { width: 36px; height: 36px; border-radius: var(--r-xs); }
.chip.sm svg { width: 17px; height: 17px; }

.t-violet { background: var(--primary-soft);  color: var(--primary); }
.t-blue   { background: var(--t-blue-bg);     color: var(--t-blue-tx); }
.t-green  { background: var(--ok-soft);       color: var(--ok); }
.t-amber  { background: var(--warn-soft);     color: var(--warn); }
.t-pink   { background: var(--t-pink-bg);     color: var(--t-pink-tx); }
.t-teal   { background: var(--t-teal-bg);     color: var(--t-teal-tx); }

/* Avatar */
.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.avatar-lg { width: 52px; height: 52px; font-size: 19px; }
.avatar-md { width: 42px; height: 42px; font-size: 16px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }

/* Icon button */
.iconbtn {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.round { border-radius: 50%; border: none; background: transparent; box-shadow: none; }

/* Layout helpers */
.row     { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.col     { display: flex; flex-direction: column; }

/* Typography atoms */
.meta-strong { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.meta-sub    { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 500; }
.label-sm    { color: var(--muted); font-size: 12px; font-weight: 600; }
.val-display { font-family: 'Fraunces', serif; font-weight: 500; letter-spacing: -.02em; }

.sec-head {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 18px 2px 8px;
}

/* Section row header */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 4px 8px;
}

.section-row strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.section-row .link  { color: var(--primary); font-weight: 700; font-size: 13px; cursor: pointer; }


/* ── 9. SEARCH BAR ──────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.search-bar svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-bar input { flex: 1; background: none; color: var(--text); font-weight: 500; }
.search-bar input::placeholder { color: var(--muted); }


/* ── 10. RANGE BAR (health markers) ────────────────── */
.rbar {
  position: relative;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  width: 100%;
}

.rnorm {
  position: absolute;
  height: 100%;
  border-radius: var(--r-pill);
  background: rgba(31, 169, 122, .35);
}

.rdot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
}

.rdot.ok     { background: var(--ok);     }
.rdot.warn   { background: var(--warn);   }
.rdot.danger { background: var(--danger); }


/* ── 11. RENEWALS TIMELINE ──────────────────────────── */
.tgroup-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 4px 8px;
}

.tgroup-head .glabel {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -.02em;
}

.tgroup-head .gsub { color: var(--muted); font-size: 12px; font-weight: 700; }

.tline {
  position: relative;
  padding-left: 28px;
}

.tline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1.5px;
  background: var(--border);
}

.titem {
  position: relative;
  margin-bottom: 9px;
}

.titem::before {
  content: "";
  position: absolute;
  left: -28px; top: 18px;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  z-index: 1;
}

.titem.cdanger::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.titem.cwarn::before   { background: var(--warn);   box-shadow: 0 0 0 3px var(--warn-soft);   }
.titem.csoft::before   { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.titem.cmuted::before  { background: var(--faint);  }

.tcard {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 12px 13px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .2s ease;
}

.tcard:active { transform: translateX(2px); }
.tcard .tc-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.tcard .tc-icon svg { width: 18px; height: 18px; }
.tcard .tc-body { flex: 1; min-width: 0; }
.tcard .tc-name { font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .tc-sub  { color: var(--muted); font-size: 11.5px; margin-top: 2px; font-weight: 500; }
.tcard .tc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.days-badge {
  font-weight: 800;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.days-badge.danger { background: var(--danger-soft); color: var(--danger); }
.days-badge.warn   { background: var(--warn-soft);   color: var(--warn);   }
.days-badge.soft   { background: var(--primary-soft); color: var(--primary); }
.days-badge.muted  { background: var(--surface-2);   color: var(--muted);  }


/* ── 12. SETTINGS ───────────────────────────────────── */
.sgroup {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 4px;
}

.srow {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair);
  cursor: pointer;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.srow:last-child { border-bottom: 0; }
.srow:active { background: var(--surface-2); }
.srow .sicon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.srow .sicon svg { width: 17px; height: 17px; }
.srow .sbody { flex: 1; }
.srow .stitle { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.srow .ssub   { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 500; }
.srow .sright { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.srow .schevron svg { width: 16px; height: 16px; color: var(--faint); }
.srow.danger-row .stitle { color: var(--danger); }
.srow.danger-row .sicon  { background: var(--danger-soft); color: var(--danger); }

/* Toggle switch */
.sw {
  width: 46px;
  height: 27px;
  border-radius: var(--r-pill);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .3s ease;
}

.sw.off { background: var(--surface-3); }
.sw.on  { background: var(--primary);   }

.sw::after {
  content: "";
  position: absolute;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform .25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.sw.on::after { transform: translateX(19px); }

/* Segmented control */
.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-xs);
  padding: 3px;
  gap: 2px;
}

.seg-item {
  flex: 1;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: background .2s ease, color .2s ease;
}

.seg-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* Storage bar */
.stor-bar { height: 5px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.stor-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--primary), #A78BFF); }


/* ── 13. LOGIN SCREEN ───────────────────────────────── */
.login-view {
  background: var(--canvas);
  overflow: hidden;
}

.login-rings {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 1;
}

.login-ring {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1.5px solid rgba(123, 92, 255, .18);
}

.login-ring:nth-child(2) { border-width: 1px; border-color: rgba(123, 92, 255, .10); }

.float-chip {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--r-pill);
  padding: 8px 14px 8px 8px;
  box-shadow: 0 8px 24px -8px rgba(50, 35, 90, .22);
  font-weight: 700;
  font-size: 12.5px;
  animation: floatBob 4s ease-in-out infinite;
}

.float-chip:nth-child(2) { animation-delay: 1.4s; }
.float-chip:nth-child(3) { animation-delay: 2.6s; }

@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%       { transform: translateY(-6px) rotate(var(--r, 0deg)); }
}

.float-chip .fc-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.float-chip .fc-icon svg { width: 14px; height: 14px; }

.login-brand {
  position: absolute;
  z-index: 5;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 280px;
}

.brand-mark {
  width: 68px; height: 68px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, #B8A0FF 100%);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 14px 32px -10px rgba(123, 92, 255, .60);
}

.brand-mark svg { width: 34px; height: 34px; color: #fff; }

.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 38px;
  letter-spacing: -.03em;
  line-height: 1;
}

.brand-tagline {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 9px;
}

.login-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  background: var(--surface);
  border-radius: 32px 32px 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px -12px rgba(50, 35, 90, .14);
  padding: 22px 24px max(32px, var(--sab));
  animation: sheetRise .5s .2s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes sheetRise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  margin: 0 auto 22px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-btn:active { transform: scale(.98); }
.auth-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

.auth-btn.google {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-btn.apple {
  background: var(--text);
  color: var(--canvas);
  margin-top: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-footer {
  text-align: center;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 16px;
  line-height: 1.5;
}

.auth-footer a { color: var(--primary); font-weight: 600; }

.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}

.auth-error.visible { display: block; }


/* ── 14. PLACEHOLDER VIEW ───────────────────────────── */
.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  padding: 40px 32px;
  text-align: center;
}

.placeholder-icon {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.placeholder-icon svg { width: 34px; height: 34px; }

.placeholder-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -.02em;
}

.placeholder-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 260px;
}

.step-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  letter-spacing: .02em;
}


/* ── 15. ANIMATIONS ─────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-rise   { animation: rise   .5s cubic-bezier(.2,.8,.2,1) both; }
.anim-fade   { animation: fadeIn .35s ease both; }
.anim-rise-2 { animation: rise   .5s .08s cubic-bezier(.2,.8,.2,1) both; }
.anim-rise-3 { animation: rise   .5s .16s cubic-bezier(.2,.8,.2,1) both; }
.anim-rise-4 { animation: rise   .5s .24s cubic-bezier(.2,.8,.2,1) both; }


/* ── 16. FORM INPUTS (shared across vault, health, renewals, onboarding) ── */

.form-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: 'Figtree', sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin-top: 8px;
  transition: border-color .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.form-input::placeholder { color: var(--faint); }

.form-btn {
  display: block;
  width: 100%;
  padding: 17px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary), #A178FF);
  color: #fff;
  font-family: 'Figtree', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  cursor: pointer;
  margin-top: 22px;
  box-shadow: 0 12px 28px -10px rgba(123, 92, 255, .60),
              0 0 0 1px rgba(255,255,255,.10) inset;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  border: none;
}

.form-btn:hover  { transform: translateY(-1px); }
.form-btn:active { transform: scale(.98); }
.form-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }


/* ── 17. ONBOARDING SCREEN ──────────────────────────── */

.ob-view { overflow-y: auto; }

.ob-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: calc(40px + var(--sat)) 28px calc(40px + var(--sab));
  text-align: center;
}

.ob-card {
  width: 100%;
  text-align: left;
  margin-top: 28px;
  margin-bottom: 4px;
}

.ob-field { margin-bottom: 4px; }

/* Settings account card overrides */
.settings-account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}


/* ── 18. INVITE LINK BOX ────────────────────────────── */

.invite-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border: 1.5px solid rgba(123,92,255,.2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-top: 4px;
}

.invite-url {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.invite-copy-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .2s ease;
  border: none;
}

.invite-copy-btn:active { opacity: .75; }
.invite-copy-btn svg { width: 16px; height: 16px; }

.copy-confirm {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ok);
  text-align: center;
  margin-top: 8px;
  opacity: 0;
  transition: opacity .3s ease;
}

.copy-confirm.visible { opacity: 1; }

/* ── 19. MEMBER REMOVE BUTTON ───────────────────────── */

.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  transition: background .2s ease;
  flex-shrink: 0;
}

.remove-btn:active { background: var(--danger); color: #fff; }

/* ── 20. PROFILE HERO ───────────────────────────────── */

.profile-hero { position: relative; overflow: hidden; }
.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 90% -10%, var(--ok-soft), transparent 60%);
  pointer-events: none;
}


/* ── 21. VAULT — CATEGORY GRID ──────────────────────── */

.vault-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-bottom: 4px;
}

.vault-cat {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.vault-cat:active { transform: scale(.97); }

.vault-cat-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}

.vault-cat-count {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 2px;
}

.vault-cat-arr {
  position: absolute;
  top: 14px;
  right: 13px;
  color: var(--faint);
  opacity: .5;
}

.vault-cat-arr svg { width: 16px; height: 16px; }


/* ── 22. VAULT — MEMBER FILTER ROW ─────────────────── */

.member-filter-row {
  position: relative;
  z-index: 15;
  display: flex;
  gap: 10px;
  padding: 8px 18px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}

.member-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.member-chip span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: color .2s ease;
}

.member-chip.active span { color: var(--primary); }

.member-chip.active .avatar,
.member-chip.active .chip {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}


/* ── 23. VAULT — UPLOAD SHEET ───────────────────────── */

.upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  animation: fadeIn .2s ease both;
}

.upload-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 20px 22px max(28px, var(--sab));
  box-shadow: 0 -12px 40px -12px rgba(50, 35, 90, .18);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.upload-sheet.open { transform: translateY(0); }

.upload-cat-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.upload-cat-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.upload-cat-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.upload-member-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.upload-member-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.upload-member-chip span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: color .2s ease;
}

.upload-member-chip.active span { color: var(--primary); }

.upload-member-chip.active .avatar {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}


/* ── 24. VAULT — UPLOAD PROGRESS BAR ───────────────── */

.progress-wrap {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #A78BFF);
  border-radius: var(--r-pill);
  transition: width .3s ease;
}


/* ── 25. VAULT — IMAGE PREVIEW OVERLAY ─────────────── */

.img-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease both;
}

.img-close {
  position: absolute;
  top: max(20px, var(--sat));
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  z-index: 61;
}

.img-preview {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r-md);
}


/* ── 26. HEALTH — MARKER LIST ───────────────────────── */

.marker-list {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 4px;
}

.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
  transition: background .15s ease;
}

.mrow:last-child { border-bottom: 0; }
.mrow:active     { background: var(--surface-2); }

.mname {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -.01em;
  flex: 0 0 auto;
  width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mval {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16px;
  flex: 0 0 auto;
  width: 68px;
  white-space: nowrap;
}

.munit { font-size: 11px; font-weight: 600; color: var(--muted); }

.mbar-wrap { flex: 1; min-width: 0; }


/* ── 27. HEALTH — ANALYSIS OVERLAY ─────────────────── */

.analysis-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: fadeIn .25s ease both;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.analysis-msg {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
}


/* ── 28. HEALTH — QUALITATIVE PILLS ────────────────── */

.pill.warn {
  background: rgba(232, 90, 70, .12);
  color: var(--danger);
}

.pill.ok {
  background: rgba(31, 169, 122, .12);
  color: var(--ok);
}


/* ── 29. HEALTH — ORDINAL DOTS ──────────────────────── */

.ordinal-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.odot {
  font-size: 8px;
  line-height: 1;
  transition: color .2s ease;
}

.odot.ok   { color: var(--ok); }
.odot.warn { color: var(--danger); }


/* ── 30. HEALTH — HOME VIEW ─────────────────────────── */

.health-member-row { transition: background .15s ease; }
.health-member-row:active { background: var(--surface-2); }

.flag-badge {
  min-width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 6px;
  flex-shrink: 0;
}


/* ── 31. HEALTH — TREND CHART ───────────────────────── */

#trend-canvas {
  width: 100% !important;
  height: 220px !important;
}

.obs-tap {
  cursor: pointer;
  transition: background .15s ease;
}
.obs-tap:active { background: var(--surface-2); }


/* ── 32. DASHBOARD ──────────────────────────────────── */

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin: 20px 0 8px;
  font-size: 13px;
  letter-spacing: -.01em;
}

.section-row strong {
  font-weight: 800;
  font-size: 14px;
}

.dash-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.dash-health-row { transition: background .15s ease; }
.dash-health-row:active { background: var(--surface-2); }

.dash-renewal-row { transition: background .15s ease; }
.dash-renewal-row:active { background: var(--surface-2); }


/* ── 33. TAB BAR — 5 equal tabs, no FAB ─────────────── */

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 2px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { width: 22px; height: 22px; }
.tab span { font-size: 10px; }

.tab.active {
  color: var(--primary);
}

.tab.active svg {
  stroke-width: 2.5;
}

/* ── 34. TOP-RIGHT ADD BUTTON ───────────────────────── */

.add-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(123,92,255,.6);
  flex-shrink: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}

.add-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px -3px rgba(123,92,255,.5);
}

.add-btn svg { width: 18px; height: 18px; stroke-width: 2.8; }

.add-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform .15s ease;
}

.add-btn-inline:active { transform: scale(0.94); }
.add-btn-inline svg { width: 14px; height: 14px; stroke-width: 2.8; }


/* ── 35. FAMILY TAB — member cards ──────────────────── */

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.family-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.family-card:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px -4px rgba(0,0,0,.15);
}

.family-card-avatar {
  position: relative;
  width: 64px;
  height: 64px;
}

.comp-ring-sm {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 76px;
  height: 76px;
  pointer-events: none;
}

.comp-pct-sm {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  font-family: 'Fraunces', serif;
  white-space: nowrap;
}

.family-card-name {
  margin-top: 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  text-align: center;
}

.family-card-sub {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}


/* ── 36. PROFILE SCREEN ─────────────────────────────── */

.profile-hero-card { margin-bottom: 0; }

.profile-hero-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}

.profile-photo-wrap:hover .photo-overlay,
.profile-photo-wrap:active .photo-overlay { opacity: 1; }

.photo-overlay svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.profile-hero-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.profile-sub {
  color: var(--muted);
  font-size: 13px;
}

.comp-ring-lg-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.comp-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 15px;
}


/* ── 37. CHECKLIST ──────────────────────────────────── */

.checklist-row { align-items: center; }

.checklist-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.checklist-icon.ok   { background: rgba(31,169,122,.15); color: var(--ok); }
.checklist-icon.miss { background: rgba(232,90,100,.1);  color: var(--danger); }
.checklist-icon.nr   { background: var(--surface-2);     color: var(--muted); font-size: 15px; }

.checklist-btn {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .15s ease;
}

.checklist-btn:active { opacity: .7; }

.upload-btn {
  background: var(--primary);
  color: #fff;
}

.nr-btn {
  background: var(--surface-2);
  border: 1px solid var(--border) !important;
  color: var(--muted);
}


/* ── 38. MEDICINES ──────────────────────────────────── */

.med-row { transition: background .15s ease; }
.med-row:active { background: var(--surface-2); }
.med-inactive { opacity: 0.55; }


/* ── 39. PDF PREVIEW & SHARE ─────────────────────────── */

.doc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: opacity .15s;
  flex-shrink: 0;
}

.doc-action-btn:active { opacity: .7; }
.doc-action-btn svg { width: 16px; height: 16px; }

.doc-action-btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(123,92,255,.5);
}

/* Image overlay actions row */
.img-overlay-actions {
  position: absolute;
  top: max(env(safe-area-inset-top), 16px);
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 2;
}

.img-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.img-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* Toast notification */
.vault-toast {
  position: absolute;
  bottom: calc(var(--tabbar-h, 72px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--canvas);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 200;
}

.vault-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ── 40. POLISH PASS ────────────────────────────────── */

/* Fix 3: Copy-confirm toast in invite sheet */
.copy-confirm {
  font-size: 13px;
  font-weight: 700;
  color: var(--ok);
  text-align: center;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .25s ease, opacity .25s ease, margin .25s ease;
}
.copy-confirm.visible {
  max-height: 28px;
  opacity: 1;
  margin-top: 8px;
}

/* Fix 5: Single-member full-width card */
.family-grid-solo {
  grid-template-columns: 1fr;
}
.family-grid-solo .family-card {
  flex-direction: row;
  text-align: left;
  padding: 20px;
  gap: 20px;
}
.family-grid-solo .family-card-name,
.family-grid-solo .family-card-sub {
  text-align: left;
}
.family-grid-solo .family-card-avatar {
  flex-shrink: 0;
}

/* Fix 6: Photo upload loading overlay */
.photo-loading { position: relative; }
.photo-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  animation: spin .8s linear infinite;
}

/* Fix 10: Tab label no-wrap for Renewals */
.tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Fix 11: Section header consistency */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-row strong,
.sec-head strong {
  font-weight: 800;
  font-size: 14px;
}
