html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  position: relative;
}

/* =========================================================
   Arogya Workspace — Phase F-1
   Direction B: left rail + canvas + attention rail
   Mobile: drawer + bottom nav
   ========================================================= */

/* Explicit body background — prevents dark-mode black-on-load */
body {
  background: #FAFAF7;
  margin: 0;
}

/* ── Shell ───────────────────────────────────────────────────────────────── */

.ws-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  background: var(--color-background-tertiary);
  padding-top: env(safe-area-inset-top);
}
/* On iOS, fill the safe-area notch with teal to match the topbar */
@supports (padding-top: env(safe-area-inset-top)) {
  .ws-shell::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top);
    background: #083D36;
    z-index: 100;
  }
}

/* ── Left rail ───────────────────────────────────────────────────────────── */

.ws-rail {
  width: 220px;
  flex-shrink: 0;
  background: #083D36;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}
.ws-rail-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ws-rail-top { padding: 18px 14px 12px; }
.ws-rail-brand {
  font-size: 20px; font-weight: 700; color: #fff;
  letter-spacing: -.01em; margin-bottom: 12px;
  padding: 0 2px;
  display: flex; align-items: center; gap: 8px;
}
/* Family switcher */
.ws-rail-fam {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 8px 10px;
  cursor: pointer; transition: background .12s;
}
.ws-rail-fam:hover { background: rgba(255,255,255,0.14); }
.ws-rail-fam-mono {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(0,0,0,0.3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.75);
}
.ws-rail-fam-name { font-size: 13px; font-weight: 500; color: #fff; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-rail-fam-chev { font-size: 13px; color: rgba(255,255,255,0.4); flex-shrink: 0; }
.ws-rail-fam-multi { cursor: pointer; }
.ws-rail-fam-multi:hover { background: rgba(255,255,255,0.16); }
.ws-rail-fam-menu {
  margin: 2px 8px 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  overflow: hidden;
}
.ws-rail-fam-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.7); text-decoration: none;
  transition: background .1s;
}
.ws-rail-fam-opt:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ws-rail-fam-opt.active { color: #9FE1CB; }
/* Nav */
.ws-rail-nav { flex: 1; }
.ws-rail-sec {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: rgba(255,255,255,0.35);
  padding: 12px 16px 5px;
}
.ws-rail-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.7);
  padding: 10px 16px; text-decoration: none; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  margin: 1px 8px; border-radius: 10px; width: calc(100% - 16px);
  transition: background .12s, color .12s;
}
.ws-rail-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ws-rail-item.active {
  background: rgba(255,255,255,0.13);
  color: #fff; font-weight: 600;
}
.ws-rail-item i { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
/* Member items */
.ws-rail-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 16px; text-decoration: none; cursor: pointer;
  margin: 1px 8px; border-radius: 10px; width: calc(100% - 16px);
  transition: background .12s;
}
.ws-rail-member:hover { background: rgba(255,255,255,0.08); }
.ws-rail-member.active { background: rgba(255,255,255,0.13); }
.ws-rail-m-av {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}
.ws-rail-m-name { font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.85); flex: 1; }
.ws-rail-member.active .ws-rail-m-name { color: #fff; font-weight: 600; }
.ws-rail-flag {
  font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.1); border-radius: 999px;
  padding: 1px 6px; min-width: 18px; text-align: center; flex-shrink: 0;
  margin-right: 2px;
}
/* Add member */
.ws-rail-add {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.38);
  padding: 8px 16px; text-decoration: none; cursor: pointer;
  margin: 1px 8px; border-radius: 10px; width: calc(100% - 16px);
  transition: color .12s, background .12s;
}
.ws-rail-add:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.06); }
.ws-rail-add i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
/* Bottom */
.ws-rail-bottom { padding: 10px 12px 16px; margin-top: auto; }
.ws-rail-disclaimer {
  background: rgba(0,0,0,0.2); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  font-size: 10px; color: rgba(255,255,255,0.32); line-height: 1.6;
}
.ws-rail-foot-link {
  display: block; padding: 6px 4px;
  font-size: 14px; color: rgba(255,255,255,0.72);
  text-decoration: none; cursor: pointer;
}
.ws-rail-foot-link:hover { color: rgba(255,255,255,0.95); }
.ws-rail-foot-signout {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 4px; margin-top: 4px;
  font-size: 14px; color: rgba(255,255,255,0.72);
  text-decoration: none; cursor: pointer;
}
.ws-rail-foot-signout:hover { color: rgba(255,255,255,0.95); }
/* Legacy — kept for any templates still using ws-rail-item-muted */
.ws-rail-item-muted { color: rgba(255,255,255,0.45); font-weight: 400; }

/* ── Main area (top bar + content) ───────────────────────────────────────── */

.ws-main { flex: 1; display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow: hidden; background: var(--color-background-tertiary); }

/* Top bar */
.ws-top {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 44px; flex-shrink: 0;
  background: var(--color-background-primary);
  border-bottom: 0.5px solid var(--color-border-tertiary);
  position: sticky; top: 0; z-index: 10;
}
.ws-menu-btn {
  display: none; /* hidden on desktop */ background: none; border: none;
  font-size: 18px; color: var(--color-text-secondary); cursor: pointer;
  padding: 4px; border-radius: 6px; flex-shrink: 0;
}
.ws-top-brand {
  display: none; /* hidden on desktop — branding is in the rail */
  align-items: center; gap: 6px; text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--color-text-primary);
}
.ws-top-brand i { font-size: 16px; color: #1D9E75; }
.ws-top-family {
  font-size: 12px; color: var(--color-text-secondary);
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
}
.ws-top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ws-top-btn {
  width: 30px; height: 30px; border-radius: 8px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary); text-decoration: none;
  border: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-secondary);
}
.ws-top-btn:hover { background: var(--color-background-primary); color: var(--color-text-primary); }

/* Content row: canvas + right attention rail */
.ws-content { display: flex; flex: 1; min-height: 0; overflow: hidden; max-width: 100%; }

/* Main canvas */
.ws-canvas { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; min-width: 0; max-width: 100%; }

/* Right attention rail */
.ws-attention {
  width: 260px; flex-shrink: 0;
  background: var(--color-background-secondary);
  border-left: 0.5px solid var(--color-border-tertiary);
  overflow-y: auto; padding: 12px 0;
}
.ws-attn-hdr {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--color-text-tertiary);
  padding: 0 12px 8px; display: flex; align-items: center; gap: 5px;
}
.ws-attn-card {
  margin: 0 10px 7px; padding: 9px 10px;
  border-radius: var(--border-radius-md);
  font-size: 13px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 6px;
  border: 0.5px solid;
}
.ws-attn-card i { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.ws-attn-info   { background: #E6F1FB; border-color: #85B7EB; color: #0C447C; }
.ws-attn-amber  { background: #FAEEDA; border-color: #FAC775; color: #633806; }
.ws-attn-red    { background: #FCEBEB; border-color: #F09595; color: #791F1F; }
.ws-attn-empty  { font-size: 11px; color: var(--color-text-tertiary); padding: 0 12px; font-style: italic; }

/* Mobile attention strip (hidden on desktop) */
.ws-attn-strip { display: none; }

/* Mobile scrim */
.ws-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 49; }

/* Mobile bottom nav */
.ws-bottom-nav { display: none; }

/* ── Login page ──────────────────────────────────────────────────────────── */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #062A1C 0%, #0A3D2B 35%, #0D5C40 65%, #1D9E75 100%);
}

/* Decorative floating circles */
.login-shell::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(29, 158, 117, 0.18);
  pointer-events: none;
}
.login-shell::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(29, 158, 117, 0.12);
  pointer-events: none;
}
.login-deco-mid {
  position: absolute;
  top: 50%; left: -40px;
  transform: translateY(-60%);
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.login-deco-top {
  position: absolute;
  top: 30px; left: 40%;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
.login-deco-br {
  position: absolute;
  bottom: 80px; right: 60px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 390px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 4px 16px rgba(0,0,0,0.12);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  color: #0A3D2B;
  margin-bottom: 6px;
}
.login-logo-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0D5C40, #1D9E75);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(13,92,64,0.3);
}
.login-logo-icon i { font-size: 22px; color: #ffffff; }

.login-tagline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1D9E75;
  margin-bottom: 20px;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #111827;
  line-height: 1.3;
}
.login-sub {
  font-size: 13px;
  color: #6B7280;
  margin: 0 0 28px;
  line-height: 1.6;
}
.login-error {
  font-size: 12px; color: #791F1F;
  background: #FCEBEB; border: 0.5px solid #F09595;
  border-radius: 8px; padding: 10px 12px;
  margin-bottom: 16px; text-align: left;
}
.login-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 14px; font-weight: 500; text-decoration: none;
  border: none; cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.login-google-btn:hover {
  background: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.login-google-btn:active { transform: translateY(0); }

.login-legal {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 14px;
  line-height: 1.6;
}
.login-legal a { color: #1D9E75; text-decoration: none; }
.login-legal a:hover { text-decoration: underline; }

.login-divider {
  height: 0.5px;
  background: #E5E7EB;
  margin: 20px 0;
}

.login-note {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 0;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
}
.login-note i { font-size: 12px; color: #1D9E75; flex-shrink: 0; margin-top: 1px; }


/* ── Home canvas ─────────────────────────────────────────────────────────── */

.home-canvas { padding: 20px; }
.home-fam-lbl { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--color-text-tertiary); margin-bottom: 10px; }

/* ── Hero section ── */
.home-hero {
  background: linear-gradient(135deg, #2D4538 0%, #4D7561 100%);
  border-radius: 14px;
  padding: 18px 22px 20px;
  margin-bottom: 20px;
  box-shadow: rgba(0,0,0,0.1) 0px -8px 16px 0px inset;
}
.home-hero-meta {
  font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.home-hero-badge {
  background: rgba(255,255,255,0.12); padding: 1px 7px; border-radius: 10px;
  color: rgba(255,255,255,0.55);
}
.home-hero-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-hero-left { flex: 1; min-width: 0; }
.home-hero-greeting { font-size: 22px; font-weight: 500; color: #fff; margin: 0 0 4px; line-height: 1.25; }
.home-hero-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin: 0; }
.home-hero-stats { display: flex; gap: 20px; flex-shrink: 0; text-align: center; padding-top: 2px; }
.home-hero-stat-num { font-size: 28px; font-weight: 500; color: #fff; line-height: 1; }
.home-hero-stat-lbl { font-size: 9px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* ── Member cards v2 ── */
.home-member-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px) { .home-member-grid-v2 { grid-template-columns: 1fr; } }

.home-mc-v2 {
  background: #fff;
  border: 0.5px solid #E4E1D8;
  border-radius: 14px;
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
  box-shadow: rgba(0,0,0,0.06) 0px 4px 10px 0px;
}
.home-mc-v2:hover { box-shadow: rgba(0,0,0,0.1) 0px 6px 16px 0px; }
.home-mc-av {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.home-mc-av-add {
  background: #F2EFE7 !important; border: 1px dashed #C8C4B8 !important;
  box-shadow: none !important;
}
.home-mc-av-add i { color: #8a93a0; font-size: 20px; }
.home-mc-info { flex: 1; min-width: 0; }
.home-mc-name { font-size: 15px; font-weight: 500; color: #1f2a36; margin-bottom: 2px; }
.home-mc-rel  { font-size: 12px; color: #8a93a0; margin-bottom: 7px; }
.home-mc-docs { font-size: 12px; color: #8a93a0; display: flex; align-items: center; gap: 4px; }
.home-mc-docs i { font-size: 12px; }
.home-mc-arr  { font-size: 16px; color: #c8c4ba; flex-shrink: 0; }
.home-mc-add  { background: #FAFAF7 !important; border: 1px dashed #C8C4B8 !important; box-shadow: none !important; }
.home-members-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; }
.home-member-card {
  display: flex; align-items: flex-start; gap: 13px;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-top: 2px solid #9FE1CB;
  border-radius: var(--border-radius-lg); padding: 16px 16px 14px;
  text-decoration: none; transition: border-color .12s, box-shadow .12s;
}
.home-member-card:hover {
  border-color: #5DCAA5;
  box-shadow: 0 2px 10px rgba(8,80,65,.08);
}
.home-member-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: #083D36; color: #9FE1CB;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; margin-top: 1px;
}
.home-member-avatar.avatar-pet { background: #FAEEDA; color: #633806; }
.home-member-avatar i { font-size: 20px; }
.home-member-info { flex: 1; min-width: 0; }
.home-member-name { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 3px; }
.home-member-meta { font-size: 12px; color: var(--color-text-tertiary); }
.home-member-arrow { font-size: 14px; color: var(--color-text-tertiary); flex-shrink: 0; }
.home-empty { font-size: 13px; color: var(--color-text-secondary); font-style: italic; }

/* ── Member canvas ───────────────────────────────────────────────────────── */

.member-canvas { padding: 0; }
.ws-tab-nav {
  display: flex; border-bottom: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-primary);
  padding: 0 16px; gap: 0; position: sticky; top: 44px; z-index: 5;
}
.ws-tab {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; padding: 11px 16px; text-decoration: none;
  color: var(--color-text-secondary); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.ws-tab:hover { color: var(--color-text-primary); }
.ws-tab.active { color: var(--color-text-primary); font-weight: 500; border-bottom-color: #1D9E75; }
.ws-tab i { font-size: 14px; }
.ws-tab-content { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* Hide desktop rail */
  .ws-rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    z-index: 50;  /* must beat member-ai-topbar z-index:30 */
  }
  .ws-shell.drawer-open .ws-rail { transform: translateX(0); }
  .ws-shell.drawer-open .ws-scrim { display: block; }

  /* Show mobile controls */
  .ws-menu-btn { display: flex; }
  .ws-top-brand { display: flex; }
  .ws-top-family { display: none; }

  /* Hide desktop right rail */
  .ws-attention { display: none; }

  /* Show mobile attention strip */
  .ws-attn-strip {
    display: block;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    background: var(--color-background-secondary);
  }
  .ws-attn-strip-toggle {
    display: flex; align-items: center; gap: 7px;
    width: 100%; padding: 9px 14px; font-size: 12px;
    color: var(--color-text-secondary); background: none; border: none;
    cursor: pointer; font-weight: 500; text-align: left;
  }
  .ws-attn-strip-toggle i:first-child { color: #EF9F27; }
  .ws-attn-chev { margin-left: auto; font-size: 12px; transition: transform .15s; }
  .ws-attn-strip-body { padding: 0 10px 8px; }

  /* Bottom nav — teal background */
  .ws-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #083D36;
    border-top: none;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 30;
  }
  .ws-bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 8px 4px 5px; font-size: 10px; font-weight: 500;
    color: rgba(255,255,255,0.55); text-decoration: none;
    background: none; border: none; cursor: pointer;
  }
  .ws-bnav-item i { font-size: 21px; }
  .ws-bnav-item.active, .ws-bnav-item:focus { color: #fff; }
  .ws-bnav-add {
    background: #1D9E75; color: #fff; border-radius: 50%;
    width: 46px; height: 46px; flex: none; margin: -6px 8px 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: row; padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .ws-bnav-add i { font-size: 24px; }
  .ws-bnav-add span { display: none; }

  /* Push canvas up from bottom nav */
  .ws-canvas { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

  /* Home canvas single column */
  .home-canvas { padding: 16px; }
  .home-members-grid { grid-template-columns: 1fr; }

  /* Member tab content tighter */
  .ws-tab-content { padding: 10px; }
  .ws-tab-nav { top: 44px; overflow-x: auto; }
}

/* ── F-2: Upload panel ──────────────────────────────────────────────────── */

.up-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
}
/* Prevent display:flex from fighting display:none set via JS */
.up-overlay[style*="display: none"],
.up-overlay[style*="display:none"] { display: none !important; }
@media (min-width: 600px) {
  .up-overlay { align-items: center; }
}
.up-panel {
  background: var(--color-background-primary);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  padding: 0 0 16px;
}
@media (min-width: 600px) {
  .up-panel { border-radius: var(--border-radius-lg); }
}
.up-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 0.5px solid var(--color-border-tertiary);
  position: sticky; top: 0; background: var(--color-background-primary); z-index: 1;
}
.up-panel-tabs { display: flex; gap: 4px; }
.up-tab {
  font-size: 12px; padding: 6px 12px; border-radius: 6px;
  border: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-secondary);
  color: var(--color-text-secondary); cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.up-tab.active {
  background: var(--color-background-primary);
  color: var(--color-text-primary); font-weight: 500;
  border-color: var(--color-border-secondary);
}
.up-close {
  background: none; border: none; font-size: 18px;
  color: var(--color-text-tertiary); cursor: pointer;
  padding: 4px; border-radius: 6px;
}
.up-close:hover { background: var(--color-background-secondary); }
.up-for-whom { padding: 14px 16px 0; }
.up-field-label { display: block; font-size: 11px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 5px; }
.up-select, .up-input {
  width: 100%; font-size: 13px; padding: 8px 10px;
  border-radius: var(--border-radius-md);
  border: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
}
.up-field-row { display: flex; gap: 10px; padding: 10px 16px 0; }
.up-field { display: flex; flex-direction: column; }
.up-input { padding: 7px 10px; }
.up-drop-zone {
  margin: 12px 16px 0; border: 1.5px dashed var(--color-border-secondary);
  border-radius: var(--border-radius-lg); padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color .12s, background .12s;
}
.up-drop-zone:hover, .up-drop-zone.drag-over {
  border-color: #1D9E75; background: #E1F5EE;
}
.up-drop-zone i { font-size: 28px; color: var(--color-text-tertiary); display: block; margin-bottom: 8px; }
.up-drop-text { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 4px; }
.up-drop-hint { font-size: 11px; color: var(--color-text-tertiary); margin: 0; }
.up-link { color: #185FA5; cursor: pointer; }
.up-file-list { margin: 8px 16px 0; }
.up-file-row {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-md); margin-bottom: 5px; font-size: 12px;
}
.up-file-row i { font-size: 14px; color: var(--color-text-secondary); }
.up-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-file-size { color: var(--color-text-tertiary); flex-shrink: 0; }
.up-file-row button { background: none; border: none; color: var(--color-text-tertiary); cursor: pointer; font-size: 14px; padding: 2px; }
.up-status { margin: 10px 16px 0; padding: 9px 12px; border-radius: var(--border-radius-md); font-size: 12px; line-height: 1.45; }
.up-status-ok  { background: #E1F5EE; color: #083D36; border: 0.5px solid #9FE1CB; }
.up-status-err { background: #FCEBEB; color: #791F1F; border: 0.5px solid #F09595; }
.up-submit-btn {
  margin: 12px 16px 0; width: calc(100% - 32px); padding: 11px 16px;
  border-radius: var(--border-radius-md); background: var(--color-text-primary);
  color: var(--color-background-primary); font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.up-submit-btn:disabled { opacity: .4; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── F-2: Queue / upload history ────────────────────────────────────────── */

.queue-canvas { padding: 20px; max-width: 800px; }
.queue-header { margin-bottom: 18px; }
.queue-title { font-size: 20px; font-weight: 500; margin: 0 0 3px; }
.queue-sub { font-size: 12px; color: var(--color-text-tertiary); margin: 0; }
.queue-empty { text-align: center; padding: 40px 0; }
.queue-empty i { font-size: 32px; color: var(--color-text-tertiary); display: block; margin-bottom: 10px; }
.queue-empty p { font-size: 13px; color: var(--color-text-secondary); margin: 4px 0; }
.queue-list { display: flex; flex-direction: column; gap: 0; border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-lg); overflow: hidden; background: var(--color-background-primary); }
.queue-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 0.5px solid var(--color-border-tertiary); }
.queue-row:last-child { border-bottom: none; }
.queue-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.queue-info { flex: 1; min-width: 0; }
.queue-filename { font-size: 13px; font-weight: 500; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.queue-meta { font-size: 11px; color: var(--color-text-tertiary); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.queue-channel-web { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: #E6F1FB; color: #0C447C; border: 0.5px solid #85B7EB; }
.queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.queue-status-badge { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.qsb-done       { background: #E1F5EE; color: #083D36; }
.qsb-failed     { background: #FCEBEB; color: #791F1F; }
.qsb-processing { background: #FAEEDA; color: #633806; }
.qsb-pending    { background: var(--color-background-secondary); color: var(--color-text-tertiary); border: 0.5px solid var(--color-border-tertiary); }
.queue-link { font-size: 15px; color: #185FA5; text-decoration: none; }
.queue-reassign-btn { background: none; border: none; font-size: 15px; color: var(--color-text-tertiary); cursor: pointer; padding: 2px; border-radius: 4px; }
.queue-reassign-btn:hover { background: var(--color-background-secondary); }
.queue-reassign-panel { margin-top: 6px; display: flex; align-items: center; }
.ws-upload-btn {
  background: #1D9E75; border-color: #1D9E75; color: #fff;
  width: auto; padding: 0 12px; gap: 5px;
  font-size: 12px; font-weight: 500;
  box-shadow: rgba(29,158,117,0.4) 0px 4px 12px 0px, rgba(0,0,0,0.15) 0px -2px 5px 0px inset;
}
.ws-upload-btn:hover { background: #0F6E56; border-color: #0F6E56; transform: translateY(-1px); }

/* ── Upload progress stages ─────────────────────────────────────────────── */
.up-attribution-note {
  font-size: 11px; color: var(--color-text-tertiary);
  padding: 8px 16px 0; display: flex; align-items: flex-start; gap: 5px;
  line-height: 1.5;
}
.up-attribution-note a { color: #185FA5; }
.up-action-row { padding: 12px 16px 0; }
.up-done-btn {
  width: 100%; padding: 11px 16px; border-radius: var(--border-radius-md);
  background: #1D9E75; color: #fff;
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.up-prog-row {
  padding: 10px 16px 8px; border-bottom: 0.5px solid var(--color-border-tertiary);
}
.up-prog-row:last-child { border-bottom: none; }
.up-prog-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--color-text-primary);
  margin-bottom: 6px; overflow: hidden;
}
.up-prog-name i { font-size: 14px; color: var(--color-text-tertiary); flex-shrink: 0; }
.up-prog-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-prog-stages { display: flex; flex-wrap: wrap; gap: 5px; }
.up-stage {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
}
.up-stage i { font-size: 11px; }
.up-stage-ok   { background: #E1F5EE; color: #083D36; }
.up-stage-err  { background: #FCEBEB; color: #791F1F; }
.up-stage-spin { background: #FAEEDA; color: #633806; }

/* ── Home member cards — richer ─────────────────────────────────────────── */
.home-member-docs {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--color-text-tertiary); margin-top: 4px;
}
.home-member-docs i { font-size: 12px; }

/* ── Records two-column layout (desktop only) ───────────────────────────── */
.web-records-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.web-records-col-left,
.web-records-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 900px) {
  .web-records-cols {
    grid-template-columns: 1fr;
  }
}

/* ── Home member card actions ───────────────────────────────────────────── */
.home-member-card-wrap { position:relative; }
.home-member-actions {
  position:absolute; top:50%; right:40px; transform:translateY(-50%);
  display:none; gap:4px;
}
.home-member-card-wrap:hover .home-member-actions { display:flex; }
.home-member-action-btn {
  width:28px; height:28px; border-radius:8px; font-size:14px;
  display:flex; align-items:center; justify-content:center;
  border:0.5px solid var(--color-border-tertiary);
  background:var(--color-background-primary);
  color:var(--color-text-secondary); cursor:pointer; text-decoration:none;
}
.home-member-action-btn:hover { background:var(--color-background-secondary); color:var(--color-text-primary); }
.home-add-card { border-style:dashed; }
.home-add-card:hover { background:var(--color-background-secondary); }

/* ── Global search bar in top bar ───────────────────────────────────────── */
.ws-search-wrap {
  flex: 1; max-width: 380px; margin: 0 8px; display: flex;
}
.ws-search-form { display:flex; align-items:center; width:100%; position:relative; }
.ws-search-input {
  width: 100%; padding: 6px 32px 6px 30px;
  border-radius: 20px; border: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-secondary); font-size: 12px;
  color: var(--color-text-primary); font-family: inherit;
}
.ws-search-input:focus { outline:none; border-color:#1D9E75; background:var(--color-background-primary); }
.ws-search-icon { position:absolute; left:9px; font-size:13px; color:var(--color-text-tertiary); pointer-events:none; }
.ws-search-submit { position:absolute; right:6px; background:none; border:none; cursor:pointer; font-size:13px; color:var(--color-text-tertiary); padding:0; }
.ws-search-submit:hover { color:#1D9E75; }
@media (max-width:768px) { .ws-search-wrap { display:none; } }

/* ── Records two-column (JS-driven grid, replaces CSS columns) ──────────── */
.web-sys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.web-sys-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}
@media (max-width: 900px) {
  .web-sys-grid { grid-template-columns: 1fr; }
}

/* ── Web records accordion — new 3-level design ─────────────────────────── */
.web-rec-wrap { margin-top:12px; }
.web-rec-header { display:flex; align-items:center; justify-content:space-between; padding:0 2px 10px; }
.web-rec-title { font-size:13px; font-weight:500; color:var(--color-text-primary); display:flex; align-items:center; gap:6px; }
.web-rec-title i { font-size:14px; color:#1D9E75; }
.web-rec-sub { font-size:11px; color:var(--color-text-tertiary); }

/* Level 1 — System */
.web-sys { border:0.5px solid var(--color-border-tertiary); border-radius:var(--border-radius-md); overflow:hidden; margin-bottom:8px; }
.web-sys-summary { list-style:none; background:var(--color-background-secondary); padding:12px 14px; display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.web-sys-summary::-webkit-details-marker { display:none; }
.web-sys-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.web-sys-name { font-size:13px; font-weight:700; color:var(--color-text-primary); flex:1; text-transform:uppercase; letter-spacing:.04em; }
.web-sys-counts { display:flex; align-items:center; gap:6px; }
.web-sys-total { font-size:11px; color:var(--color-text-tertiary); }
.web-sys-flagged { font-size:11px; background:#FCEBEB; color:#791F1F; padding:1px 8px; border-radius:20px; }
.web-sys-chev { font-size:13px; color:var(--color-text-tertiary); transition:transform .2s; }
.web-sys[open] .web-sys-chev { transform:rotate(180deg); }
.web-sys-body { background:var(--color-background-primary); }

/* Level 2 — Panel */
.web-panel { border-top:0.5px solid var(--color-border-tertiary); }
.web-panel-summary { list-style:none; padding:8px 14px 8px 28px; display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; background:var(--color-background-primary); }
.web-panel-summary::-webkit-details-marker { display:none; }
.web-panel-chev { font-size:12px; color:var(--color-text-tertiary); flex-shrink:0; transition:transform .15s; }
.web-panel[open] .web-panel-chev { transform:rotate(90deg); }
.web-panel-name { font-size:12px; font-weight:500; color:var(--color-text-primary); flex:1; }
.web-panel-meta { display:flex; align-items:center; gap:6px; }
.web-panel-count { font-size:11px; color:var(--color-text-tertiary); }
.web-panel-flagged { font-size:11px; background:#FCEBEB; color:#791F1F; padding:1px 7px; border-radius:20px; }

/* Level 3 — Metric rows */
.web-metric-table { padding:0 14px 0 46px; background:var(--color-background-primary); }
.web-metric-cols-hdr {
  display:grid; grid-template-columns:1fr 80px 90px 68px 52px; gap:8px; align-items:center;
  padding:5px 0; border-bottom:0.5px solid var(--color-border-secondary);
  background:var(--color-background-secondary); margin:0 -14px 0 -46px; padding-left:46px; padding-right:14px;
}
.web-metric-cols-hdr span { font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.06em; color:var(--color-text-tertiary); }
.web-metric-row {
  display:grid; grid-template-columns:1fr 80px 90px 68px 52px; gap:8px; align-items:center;
  padding:6px 0; border-bottom:0.5px solid var(--color-border-tertiary); font-size:12px;
}
.web-metric-row:last-child { border-bottom:none; }
.web-m-name { color:var(--color-text-secondary); display:flex; align-items:center; gap:5px; }
.web-m-trend { font-size:10px; color:var(--color-text-tertiary); display:inline-flex; align-items:center; gap:2px; }
.web-m-trend i { font-size:10px; }
.web-m-val { color:var(--color-text-primary); font-variant-numeric:tabular-nums; }
.web-m-val a { text-decoration:none; }
.web-m-val a:hover { text-decoration:underline; }
.web-m-unit { font-size:10px; color:var(--color-text-tertiary); }
.web-m-range { font-size:11px; color:var(--color-text-tertiary); font-variant-numeric:tabular-nums; }
.web-m-status { font-size:11px;display:flex;align-items:center;gap:3px; }
.web-m-date { font-size:11px; color:var(--color-text-tertiary); font-variant-numeric:tabular-nums; }

/* Status dot — red for any out-of-range value */
.status-dot { display:inline-block;width:7px;height:7px;border-radius:50%;background:#E24B4A;flex-shrink:0;margin-right:2px; }

/* Status colour classes — compound selectors (both classes on same element) */
.status-normal, .in-range { color:var(--color-text-secondary) !important; }
/* Flagged row — bold entire row + subtle background tint */
.web-metric-row.web-metric-flagged {
  background: rgba(250, 238, 218, 0.45);
}
.web-metric-row.web-metric-flagged .web-m-name,
.web-metric-row.web-metric-flagged .web-m-date { font-weight:600; color:var(--color-text-primary); }
/* Value cell colouring — already bold from status classes below */
.web-m-val.status-high, .web-m-val.status-critical { color:#791F1F !important; font-weight:600; }
.web-m-val.status-low  { color:#854F0B !important; font-weight:600; }
/* Status badge pill */
.web-m-status.status-high,
.web-m-status.status-critical { background:#FCEBEB; color:#791F1F !important; padding:2px 8px; border-radius:20px; font-weight:600; }
.web-m-status.status-low   { background:#FAEEDA; color:#854F0B !important; padding:2px 8px; border-radius:20px; font-weight:600; }
.web-m-status.status-normal { background:#E1F5EE; color:#083D36 !important; padding:2px 8px; border-radius:20px; }
/* Responsive — single column on narrow screens */
@media (max-width:640px) {
  /* Auto-width columns — let status pill and date take as much as they need */
  .web-metric-cols-hdr, .web-metric-row {
    grid-template-columns: 1fr auto auto auto;
    gap: 6px;
    padding: 7px 0;
  }
  /* Hide Range column entirely on mobile (was already hidden) */
  .web-metric-cols-hdr span:nth-child(3), .web-m-range { display: none; }
  /* Tighter font and no-wrap to prevent visual collision */
  .web-m-name { font-size: 12px; line-height: 1.3; }
  .web-m-val  { font-size: 12px; white-space: nowrap; }
  .web-m-status {
    font-size: 10px !important;
    padding: 2px 6px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .web-m-date { font-size: 10px; white-space: nowrap; flex-shrink: 0; }
  .web-m-unit { font-size: 9px; }
  /* Reduce left indent so name column has more room */
  .web-metric-table { padding: 0 12px 0 30px; }
  .web-metric-cols-hdr { padding-left: 30px; margin-left: -30px; }
}

/* ── Inline trend chart (web Records accordion) ─────────────────────────── */
.web-trend-wrap {
  display: none;
  grid-column: 1 / -1;   /* span all 5 metric columns */
  padding: 10px 0 6px;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}
.web-trend-wrap.open { display: block; }
.web-trend-canvas { width: 100%; height: 180px; display: block; }

/* Colored left border on Level 1 — override border-radius on left side */
.web-sys { border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0; }

/* ── Modals (trend chart + add reminder) ────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:200;
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.modal-overlay.hidden { display:none; }
.modal-box {
  background:var(--color-background-primary); border-radius:var(--border-radius-lg);
  border:0.5px solid var(--color-border-tertiary); width:100%; max-width:560px;
  max-height:90vh; overflow-y:auto; padding:20px;
}
.modal-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.modal-title { font-size:15px; font-weight:500; color:var(--color-text-primary); }
.modal-close { background:none; border:none; cursor:pointer; font-size:18px; color:var(--color-text-tertiary); padding:0; }
.modal-close:hover { color:var(--color-text-primary); }
.modal-field { margin-bottom:14px; }
.modal-label { display:block; font-size:11px; font-weight:500; color:var(--color-text-secondary); margin-bottom:5px; }
.modal-input, .modal-select { width:100%; box-sizing:border-box; font-size:13px; padding:8px 10px; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-tertiary); background:var(--color-background-primary); color:var(--color-text-primary); }
.modal-input:focus, .modal-select:focus { outline:none; border-color:#1D9E75; }
.modal-type-row { display:flex; gap:8px; }
.modal-type-btn { flex:1; padding:7px; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-tertiary); background:var(--color-background-secondary); font-size:12px; cursor:pointer; color:var(--color-text-secondary); }
.modal-type-btn.active { background:#E1F5EE; border-color:#1D9E75; color:#083D36; font-weight:500; }
.modal-save-btn { width:100%; padding:10px; border-radius:var(--border-radius-md); background:#1D9E75; color:#fff; font-size:14px; font-weight:500; border:none; cursor:pointer; margin-top:4px; }
.modal-save-btn:disabled { opacity:.4; }
.modal-save-btn:not(:disabled):hover { background:#0F6E56; }
/* Trend table */
.trend-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:14px; }
.trend-table th { font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.06em; color:var(--color-text-tertiary); padding:5px 8px; border-bottom:0.5px solid var(--color-border-secondary); text-align:left; }
.trend-table td { padding:6px 8px; border-bottom:0.5px solid var(--color-border-tertiary); }
.trend-table tr:last-child td { border-bottom:none; }
.trend-val-flag { color:#A32D2D; font-weight:500; }

/* ── Search bar: slimmer idle, dramatically prominent when active ────────── */
/* Idle: compact and unobtrusive */
.search-bar {
  padding: 6px 12px !important;
  transition: padding 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, background 0.18s ease;
}
.search-bar input {
  font-size: 12px;
  transition: font-size 0.18s ease;
}
/* Active: visibly larger — user knows they are in search mode */
.search-bar:focus-within {
  width: 60%;                   /* narrows to bring Clear button within reach */
  padding: 11px 16px !important;
  border-color: #1D9E75 !important;
  border-width: 1.5px !important;
  box-shadow: 0 0 0 4px rgba(29,158,117,0.15), 0 2px 8px rgba(0,0,0,0.06) !important;
  background: #fff !important;
}
@media (max-width: 768px) {
  .search-bar:focus-within { width: 100%; }
  /* Hide "Add Health Data" label on mobile — bottom nav + is sufficient */
  .ws-upload-btn span { display: none; }
  .ws-upload-btn { padding: 0 10px; min-width: 36px; }
}
.search-bar:focus-within input {
  font-size: 15px !important;
  color: var(--color-text-primary);
}
.search-bar:focus-within .ti-search {
  color: #1D9E75 !important;
  font-size: 16px !important;
}

/* ── Member header edit pencil (web-only, overlaid top-right of card) ───── */
.member-header-edit-btn {
  position: absolute;
  top: 18px; right: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.member-header-edit-btn:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

/* ── Search bar X clear button ──────────────────────────────────────────── */
#search-clear-btn {
  display: none;        /* shown via JS (inline-flex) when input has content */
  align-items: center; justify-content: center;
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 20px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  gap: 3px;
}
#search-clear-btn:hover { background: var(--color-background-primary); color: var(--color-text-primary); border-color: var(--color-border-secondary); }

/* ── Search bar: stronger active state ──────────────────────────────────── */
.search-bar {
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within {
  border-color: #1D9E75;
  box-shadow: 0 0 0 3px rgba(29,158,117,0.14);
}
.search-bar:focus-within input {
  font-size: 14px;
  color: var(--color-text-primary);
}
.search-bar:focus-within .ti-search { color: #1D9E75 !important; }

/* ── Ask Arogya button in top bar (replaces search form) ────────────────── */
.ws-ask-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 20px;
  background: #083D36; color: #E1F5EE;
  border: none;
  font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  box-shadow: rgba(8,80,65,0.4) 0px 4px 14px 0px, rgba(0,0,0,0.2) 0px -3px 6px 0px inset;
}
.ws-ask-btn:hover { background: #0A6652; color: #E1F5EE; border-color: transparent; transform: translateY(-1px); box-shadow: rgba(8,80,65,0.5) 0px 6px 18px 0px, rgba(0,0,0,0.2) 0px -3px 6px 0px inset; }
.ws-ask-btn i { font-size: 13px; }

/* ── Rail upload job cards ───────────────────────────────────────────────── */
.rail-job-card {
  margin: 0 10px 9px;
  padding: 9px 10px;
  background: var(--color-background-primary);
  border-radius: var(--border-radius-md);
  border: 0.5px solid var(--color-border-tertiary);
}
.rjc-name {
  font-size: 11px; color: var(--color-text-secondary);
  margin-bottom: 8px; word-break: break-all; line-height: 1.3;
}
/* 4-stage progress track */
.rjc-track {
  display: flex; align-items: center; margin-bottom: 4px;
}
.rjt {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rjt.rjt-pending  { background: var(--color-background-secondary); border: 1.5px solid var(--color-border-secondary); }
.rjt.rjt-active   { background: #E1F5EE; border: 1.5px solid #1D9E75; animation: rjtPulse 1.2s ease-in-out infinite; }
.rjt.rjt-done     { background: #1D9E75; border: 1.5px solid #1D9E75; color: #fff; }
.rjt.rjt-failed   { background: #FCEBEB; border: 1.5px solid #E24B4A; color: #E24B4A; }
@keyframes rjtPulse { 0%,100%{opacity:1} 50%{opacity:.45} }
.rjl              { flex: 1; height: 1.5px; background: var(--color-border-secondary); }
.rjl.rjl-done     { background: #1D9E75; }
.rjc-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--color-text-tertiary);
  margin-bottom: 6px; padding: 0 1px; letter-spacing: 0;
}
/* Attribution section */
.rjc-attr { margin-top: 2px; }
.rja-saved { font-size: 11px; color: var(--color-text-secondary); line-height: 1.4; }
.rja-toggle {
  font-size: 10px; color: var(--color-text-tertiary); background: none;
  border: none; cursor: pointer; padding: 0 2px; text-decoration: underline;
}
.rja-change {
  display: none; flex-direction: column; gap: 5px; margin-top: 6px;
}
.rja-sel {
  font-size: 11px; padding: 4px 6px; border-radius: 6px;
  border: 0.5px solid var(--color-border-secondary); width: 100%;
  background: var(--color-background-secondary); font-family: inherit;
}
.rja-btn {
  font-size: 11px; padding: 4px 10px; border-radius: 6px;
  border: none; background: #1D9E75; color: #fff; cursor: pointer; align-self: flex-start;
}
.rja-btn:hover { background: #178a63; }

/* ── Global window drag-drop overlay ────────────────────────────────────── */
#global-drop-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(29,158,117,0.07);
  border: 3px dashed #1D9E75;
  display: none;        /* shown as flex by JS */
  align-items: center; justify-content: center;
}
.gdrop-inner {
  background: #fff; border-radius: 16px;
  padding: 28px 36px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  pointer-events: none;
}

/* Rail card failure message */
.rjc-fail-msg {
  font-size: 10px;
  color: #A32D2D;
  line-height: 1.4;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 0.5px solid #FCEBEB;
}

/* ── Rail card top row (name + dismiss button) ─────────── */
.rjc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
}
.rjc-name { flex: 1; font-size: 11px; font-weight: 600; color: var(--color-text-primary); word-break: break-all; }
.rjc-dismiss {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--color-text-tertiary);
  padding: 0 2px; margin-top: -1px;
}
.rjc-dismiss:hover { color: var(--color-text-secondary); }

/* ── Collapsed success card ─────────────────────────────── */
.rjc-collapsed .rjc-track,
.rjc-collapsed .rjc-labels,
.rjc-collapsed .rjc-attr { display: none; }
.rjc-collapsed .rjc-name::before {
  content: '\2713\00a0';
  color: #1D9E75;
  font-weight: 700;
}

/* ── Attribution: Tier 2 proposed ───────────────────────── */
.rja-proposed { margin-top: 6px; }
.rja-proposed-lbl { font-size: 11px; color: var(--color-text-secondary); line-height: 1.4; display: block; margin-bottom: 5px; }
.rja-conf { color: var(--color-text-tertiary); font-size: 10px; }
.rja-btn-row { display: flex; gap: 5px; margin-bottom: 3px; }
.rja-btn-confirm {
  background: #1D9E75; color: #fff; border: none;
  border-radius: 4px; font-size: 10px; font-weight: 600;
  padding: 4px 10px; cursor: pointer;
}
.rja-btn-confirm:hover { background: #178a64; }
.rja-btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Attribution: Tier 3 unidentified ───────────────────── */
.rja-tier3 { margin-top: 6px; }
.rja-tier3 span { font-size: 11px; color: #9A5800; line-height: 1.4; display: block; margin-bottom: 5px; }

/* ── Attribution: Tier 1 saved ──────────────────────────── */
.rja-saved { margin-top: 6px; font-size: 11px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ── Change row (shared across tiers) ───────────────────── */
.rja-change { display: none; flex-direction: row; gap: 4px; margin-top: 4px; align-items: center; }
.rja-sel { font-size: 10px; border: 1px solid var(--color-border-secondary); border-radius: 4px; padding: 3px 4px; background: var(--color-bg-primary); flex: 1; }
.rja-btn { background: var(--color-bg-secondary); border: 1px solid var(--color-border-secondary); border-radius: 4px; font-size: 10px; padding: 4px 8px; cursor: pointer; }
.rja-btn:hover { background: var(--color-bg-tertiary); }
.rja-toggle { background: none; border: none; font-size: 10px; color: #1D9E75; cursor: pointer; padding: 0; text-decoration: underline; }

/* ── Failure message ─────────────────────────────────────── */
.rjc-fail-msg { font-size: 10px; color: #A32D2D; line-height: 1.4; margin-top: 5px; padding-top: 5px; border-top: 0.5px solid #FCEBEB; }

/* ── Upload rail accordion header ─────────────────────────── */
.rail-uploads-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 5px;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 2px;
  user-select: none;
}
.rail-uploads-header:hover { background: var(--color-background-secondary, #f5f5f2); }
.rail-uploads-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.rail-uploads-summary {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-left: 2px;
}

/* ── Rail card: name + dismiss row ────────────────────────── */
.rjc-top { display:flex; align-items:flex-start; justify-content:space-between; gap:4px; margin-bottom:6px; }
.rjc-name { flex:1; font-size:11px; font-weight:600; color:var(--color-text-primary); word-break:break-all; }
.rjc-dismiss { flex-shrink:0; background:none; border:none; cursor:pointer; font-size:14px; line-height:1; color:var(--color-text-tertiary); padding:0 2px; margin-top:-1px; }
.rjc-dismiss:hover { color:var(--color-text-secondary); }

/* ── Rail card: attribution row ────────────────────────────── */
.rja-saved { margin-top:6px; font-size:11px; color:var(--color-text-secondary); display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.rja-change { display:none; flex-direction:row; gap:4px; margin-top:4px; align-items:center; }
.rja-sel { font-size:10px; border:1px solid var(--color-border-secondary); border-radius:4px; padding:3px 4px; background:#fff; color:#333; flex:1; }
.rja-btn { background:#f0f0ed; border:1px solid #ccc; border-radius:4px; font-size:10px; color:#333; padding:4px 10px; cursor:pointer; white-space:nowrap; }
.rja-btn:hover { background:#e5e5e0; }
.rja-btn:disabled { opacity:0.5; cursor:not-allowed; }
.rja-toggle { background:none; border:none; font-size:10px; color:#1D9E75; cursor:pointer; padding:0; text-decoration:underline; white-space:nowrap; }

/* ── Failure message ───────────────────────────────────────── */
.rjc-fail-msg { font-size:10px; color:#A32D2D; line-height:1.4; margin-top:5px; padding-top:5px; border-top:0.5px solid #FCEBEB; }

/* ── Tab canvas: smooth transition on load ─────────────────── */
#ws-tab-canvas { transition: opacity 0.15s ease; }

/* ── Accordion sections (details/summary) ─────────────────────────────────── */
.arog-accordion { border-radius: var(--border-radius-lg); overflow: hidden; margin-bottom: 12px; }
.arog-accordion > summary { list-style: none; cursor: pointer; user-select: none; }
.arog-accordion > summary::-webkit-details-marker { display: none; }
.arog-accordion > summary::marker { display: none; }
.arog-accordion-chev { transition: transform .2s; margin-left: auto; flex-shrink: 0; }
.arog-accordion[open] .arog-accordion-chev { transform: rotate(180deg); }
details[open] .arog-accordion-chev { transform: rotate(180deg); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { display: none; }


/* ═══════════════════════════════════════════════════════════════════════════
   Member AI topbar — shared across member.html and home.html
   ═══════════════════════════════════════════════════════════════════════════ */

/* Topbar height varies by breakpoint — child elements (tab-nav-row) use this */
:root { --member-topbar-h: 58px; }
@media (max-width: 768px) { :root { --member-topbar-h: 50px; } }

.member-ai-topbar {
  background: #083D36;
  padding: 8px 16px 8px 14px;
  display: flex; align-items: center; gap: 0;
  flex-shrink: 0; position: sticky; top: 0; z-index: 30;
}

.member-menu-btn {
  width: 36px; height: 36px; border-radius: 7px;
  background: rgba(255,255,255,0.1); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-right: 10px;
  -webkit-tap-highlight-color: transparent;
}
.member-menu-btn i { font-size: 18px; color: rgba(255,255,255,0.85); }

/* Scope dropdown */
.member-scope-wrap { position: relative; flex-shrink: 0; }
.member-scope-btn {
  background: rgba(255,255,255,0.12); border: none; cursor: pointer;
  color: #fff; font-size: 14px; font-weight: 700;
  padding: 5px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); letter-spacing: -0.01em;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.member-scope-btn:hover { background: rgba(255,255,255,0.18); }
.member-scope-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 10px; padding: 4px 0;
  min-width: 200px; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.scope-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--color-text-primary); text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.scope-opt:hover { background: var(--color-background-secondary); }
.scope-opt-active { color: #083D36; background: #E1F5EE; }
.scope-opt-active:hover { background: #D0F0E6; }

.member-scope-divider {
  width: 1.5px; height: 28px; background: rgba(255,255,255,0.25);
  flex-shrink: 0; margin: 0 12px;
}

/* Desktop search bar */
.member-ai-bar-inner {
  flex: 0 0 400px; background: #fff;
  border-radius: 10px; display: flex; align-items: center;
  gap: 8px; padding: 8px 8px 8px 13px; cursor: text;
  min-height: 42px;
}
.member-search-input {
  flex: 1; border: none; outline: none;
  font-size: 13px; font-family: var(--font-sans);
  background: transparent; color: var(--color-text-primary);
}
.member-search-input::placeholder { color: #B0ADA8; font-size: 13px; }
.member-mic-btn {
  background: none; border: none; cursor: pointer;
  color: #B0ADA8; display: flex; align-items: center;
  padding: 2px; flex-shrink: 0;
}
.member-mic-btn i { font-size: 16px; }
.member-search-send {
  background: #083D36; color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; flex-shrink: 0; font-family: var(--font-sans);
  white-space: nowrap;
}
.member-search-send i { font-size: 15px; color: #9FE1CB; }
.member-topbar-spacer { flex: 1; min-width: 18%; }
/* ── Topbar "Add health data" button — shown on all pages ── */
.topbar-add-btn {
  margin-left: auto;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  color: #083D36; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  font-family: var(--font-sans);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.10);
  letter-spacing: 0.01em;
}
.topbar-add-btn:hover  { background: #f0faf6; box-shadow: 0 3px 8px rgba(0,0,0,0.22); }
.topbar-add-btn:active { background: #e0f5ed; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.topbar-add-btn i { font-size: 14px; color: #083D36; }
@media (max-width: 768px) {
  .topbar-add-btn {
    padding: 8px 12px;
    border-radius: 8px;
    /* Build fu1 (AUDIT-008): removed margin-right:110px reservation —
       the deprecated .member-mobile-ask pill no longer occupies that space. */
  }
  .topbar-add-btn-label { display: none; }
}




/* Tablet (769–900px): compress topbar to prevent overflow */
@media (min-width: 769px) and (max-width: 900px) {
  .member-ai-bar-inner { flex: 0 0 240px; }
  .member-scope-btn    { max-width: 120px; font-size: 13px; }
  .topbar-add-btn      { padding: 6px 12px; font-size: 11px; }
  .topbar-add-btn-label { display: none; }
}
/* Build fu1 (AUDIT-008): removed all .member-mobile-ask CSS — the pill button
   was deprecated in favor of the floating AI button (ws-fab). Element no longer
   appears in any template. ~20 lines of dead CSS removed. */
@media (max-width: 768px) {
  .member-ai-topbar { padding: 10px 12px !important; }
  /* DO NOT add position: relative — it breaks the sticky behaviour and
     content scrolls over the topbar. position:sticky already creates a
     positioning context for the absolutely-positioned mobile ask pill. */
  .member-scope-divider { display: none; }
  .member-ai-bar-inner { display: none !important; }
  .member-topbar-spacer { display: none !important; }
  .member-scope-btn { font-size: 13px; padding: 4px 8px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Horizontal scroll defenders — catch any wide child that escapes its parent
   ═══════════════════════════════════════════════════════════════════════════ */
.ws-shell, .ws-main, .ws-content, .ws-canvas, .home-canvas, #home-canvas {
  overflow-x: hidden;
  max-width: 100%;
}
/* Condition cards & metric chip rows — flex children need min-width:0 so
   the parent doesn't get forced wider by intrinsic child sizes. */
.cond-metrics-row { max-width: 100%; }
.chp-cards-list, .chp-card { min-width: 0; max-width: 100%; }
/* Family chip strip on home — same pattern */
.home-fam-strip { max-width: 100%; }


/* ═══════════════════════════════════════════════════════════════════════════
   Mobile-only tweaks for summary sections (cd: tighter mobile UI)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Active Health Conditions: full-width cards on mobile */
  .chp-cond-grid { grid-template-columns: 1fr !important; }

  /* Hide "X on treatment" badge in section header on mobile (clutter) */
  /* Hide "X flagged" badge in Watching section header on mobile */
  .sec-count { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Records tab — filter bar (cd: prevent iOS zoom, fix mobile usability)
   ═══════════════════════════════════════════════════════════════════════════ */
.rec-filter-input {
  flex: 1; border: 0.5px solid var(--color-border-secondary);
  border-radius: 7px; padding: 6px 10px;
  font-size: 13px; font-family: var(--font-sans);
  outline: none;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
}
.rec-filter-btn {
  font-size: 12px; font-weight: 500;
  padding: 6px 10px; border-radius: 6px;
  border: 0.5px solid var(--color-border-secondary);
  background: var(--color-background-primary);
  color: var(--color-text-secondary);
  cursor: pointer; white-space: nowrap;
  font-family: var(--font-sans);
}
.rec-filter-select { padding: 6px 8px; }

/* Mobile: bump to 16px to disable iOS auto-zoom on focus */
@media (max-width: 768px) {
  .rec-filter-input,
  .rec-filter-btn,
  .rec-filter-select {
    font-size: 16px !important;
  }
  .rec-filter-input { padding: 8px 12px; }
  .rec-filter-btn { padding: 8px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   History Timeline v2 — unified component for Upload History + Member History
   ═══════════════════════════════════════════════════════════════════════════ */

/* Filter bar (only on Upload History) */
.htl-filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.htl-filter-lbl {
  font-size: 11px; color: var(--color-text-tertiary);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 500;
}
.htl-fchip {
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 14px; padding: 5px 12px;
  font-size: 12px; color: var(--color-text-secondary);
  text-decoration: none; transition: background .12s, color .12s;
}
.htl-fchip:hover { background: var(--color-background-secondary); }
.htl-fchip.on {
  background: #083D36; color: #fff; border-color: #083D36;
}
.htl-counter {
  margin-left: auto; font-size: 12px;
  color: var(--color-text-tertiary);
}

/* Timeline wrap — provides padding for the left spine column */
.htl-wrap { padding-left: 80px; position: relative; }
.htl-timeline { position: relative; }
.htl-timeline::before {
  content: ''; position: absolute;
  left: -18px; top: 14px; bottom: 8px;
  width: 1.5px;
  background: var(--color-border-secondary);
}

.htl-month {
  font-size: 11px; color: var(--color-text-tertiary);
  font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  margin: 18px 0 8px;
}

.htl-row { position: relative; margin-bottom: 7px; }
.htl-date {
  position: absolute; left: -80px; top: 8px;
  width: 56px; text-align: right;
}
.htl-d {
  font-size: 22px; font-weight: 500;
  color: var(--color-text-primary); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.htl-mo {
  font-size: 12px; font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: .06em;
  margin-top: 4px;
}
.htl-yr {
  font-size: 10px; color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums; margin-top: 2px;
}

.htl-dot {
  position: absolute; left: -22px; top: 15px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-background-primary);
  border: 1.5px solid var(--color-border-secondary);
  z-index: 1;
}
.htl-dot.dot-lab   { border-color: #0F6E56; }
.htl-dot.dot-rx    { border-color: #854F0B; }
.htl-dot.dot-scan  { border-color: #534AB7; }
.htl-dot.dot-visit { border-color: #185FA5; }
.htl-dot.dot-sym   { border-color: #A32D2D; }
.htl-dot.dot-vac   { border-color: #5F5E5A; }

/* The card itself */
.htl-card {
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s;
}
.htl-card:hover { border-color: var(--color-border-secondary); }
.htl-card-head {
  padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Type tag */
.htl-tag {
  font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0; margin-top: 2px;
  font-family: var(--font-sans);
}
.htl-tag.tag-lab   { background: #E1F5EE; color: #083D36; }
.htl-tag.tag-rx    { background: #FAEEDA; color: #854F0B; }
.htl-tag.tag-scan  { background: #EEEDFE; color: #3C3489; }
.htl-tag.tag-visit { background: #EAF0FB; color: #185FA5; }
.htl-tag.tag-sym   { background: #FCEBEB; color: #791F1F; }
.htl-tag.tag-vac   { background: #F1EFE8; color: #444441; }

/* Info column */
.htl-info { flex: 1; min-width: 0; }
.htl-l1 {
  font-size: 13px; font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.35;
}
.htl-l2 {
  font-size: 12px; color: var(--color-text-tertiary);
  margin-top: 3px; line-height: 1.4;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.htl-l3 {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px;
}
.htl-panel-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 3px;
  background: var(--color-background-secondary);
  color: var(--color-text-secondary);
  font-weight: 500; text-transform: uppercase; letter-spacing: .04em;
}
.htl-panel-chip.pn-cbc     { background: #FCEBEB; color: #791F1F; }
.htl-panel-chip.pn-lft     { background: #FAEEDA; color: #854F0B; }
.htl-panel-chip.pn-kft     { background: #EEEDFE; color: #3C3489; }
.htl-panel-chip.pn-lipid   { background: #FAEEDA; color: #854F0B; }
.htl-panel-chip.pn-thyroid { background: #EEEDFE; color: #3C3489; }
.htl-panel-chip.pn-hba1c   { background: #FCEBEB; color: #791F1F; }

/* Right side — person pill + kebab */
.htl-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-top: 1px;
}
.htl-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 3px 10px 3px 4px; border-radius: 12px;
  white-space: nowrap;
}
.htl-pill-avt {
  width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 9px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.htl-pill.p-coral  { background: #FAECE7; color: #993C1D; }
.htl-pill.p-purple { background: #EEEDFE; color: #3C3489; }
.htl-pill.p-amber  { background: #FAEEDA; color: #854F0B; }
.htl-pill.p-red    { background: #FCEBEB; color: #A32D2D; }
.htl-pill.p-slate  { background: #EAF0FB; color: #185FA5; }
.htl-pill.p-sage   { background: #EAF3DE; color: #3B6D11; }
.htl-pill.p-custom { background: var(--color-background-secondary); color: var(--color-text-secondary); }

.htl-menu {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--color-text-tertiary);
  font-size: 14px; cursor: pointer;
  border-radius: 5px;
  font-family: var(--font-sans);
}
.htl-menu:hover { background: var(--color-background-secondary); }

/* Expansion body */
.htl-exp {
  display: none;
  padding: 0 12px 12px;
  border-top: 0.5px solid var(--color-border-tertiary);
  font-size: 12px;
  flex-direction: column; gap: 10px;
}
.htl-card.open .htl-exp { display: flex; padding-top: 12px; }
.htl-card.open { border-color: var(--color-border-secondary); }
.htl-exp-row {
  display: flex; gap: 14px; align-items: flex-start;
}
.htl-exp-lbl {
  font-size: 10px; color: var(--color-text-tertiary);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 500;
  min-width: 80px; padding-top: 2px; flex-shrink: 0;
}
.htl-exp-val {
  flex: 1; color: var(--color-text-primary); line-height: 1.55;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.htl-exp-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Medications */
.htl-med {
  font-size: 12px;
  color: var(--color-text-primary);
  line-height: 1.55;
  padding: 2px 0;
}
.htl-med + .htl-med { margin-top: 4px; }
.htl-med-low {
  color: #888780;
  font-style: italic;
}
.htl-conf-tag {
  font-size: 9px; font-weight: 500;
  background: #FAEEDA; color: #854F0B;
  padding: 1px 6px; border-radius: 3px;
  margin-left: 6px; font-style: normal;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Value chips inside expansion */
.htl-exp-chips {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.htl-val-chip {
  font-size: 11px; padding: 2px 7px; border-radius: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.htl-val-chip.vc-bad     { background: #FCEBEB; color: #791F1F; }
.htl-val-chip.vc-warn    { background: #FAEEDA; color: #854F0B; }
.htl-val-chip.vc-good    { background: #E1F5EE; color: #083D36; }
.htl-val-chip.vc-neutral { background: var(--color-background-secondary); color: var(--color-text-secondary); }

/* Action buttons */
.htl-exp-actions {
  display: flex; gap: 6px; padding-top: 4px;
  flex-wrap: wrap;
}
.htl-act-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 6px;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  font-size: 12px; color: var(--color-text-primary);
  cursor: pointer; font-family: var(--font-sans);
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.htl-act-btn i { font-size: 13px; }
.htl-act-btn:hover { background: var(--color-background-secondary); border-color: var(--color-border-secondary); }
.htl-act-btn.htl-primary {
  background: #083D36; color: #fff; border-color: #083D36;
}
.htl-act-btn.htl-primary:hover { background: #04342C; border-color: #04342C; }
.htl-act-btn.htl-danger { color: #791F1F; }
.htl-act-btn.htl-danger:hover { background: #FCEBEB; border-color: #F09595; }

/* Empty state */
.htl-empty {
  text-align: center; padding: 40px 20px;
  color: var(--color-text-tertiary);
}
.htl-empty i { font-size: 32px; margin-bottom: 10px; display: block; }
.htl-empty-title { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); margin: 0 0 4px; }
.htl-empty-sub { font-size: 12px; margin: 0; }

/* Failed jobs section — collapsed by default */
.htl-failed {
  margin-top: 24px;
  background: #FCEBEB;
  border: 0.5px solid #F09595;
  border-radius: 8px;
}
.htl-failed-hdr {
  padding: 10px 14px;
  font-size: 12px; font-weight: 500;
  color: #791F1F;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.htl-failed-hdr::-webkit-details-marker { display: none; }
.htl-failed-body { padding: 0 12px 12px; }
.htl-failed-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-top: 0.5px solid #F09595;
  font-size: 12px;
}
.htl-failed-meta { flex: 1; min-width: 0; }
.htl-failed-name { font-weight: 500; color: var(--color-text-primary); }
.htl-failed-sub { font-size: 11px; color: var(--color-text-tertiary); margin-top: 2px; }

/* ─── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .htl-wrap { padding-left: 0; }
  .htl-timeline::before { display: none; }
  .htl-date { display: none; }
  .htl-dot { display: none; }

  .htl-card-head {
    padding: 9px 11px;
    gap: 7px;
    flex-wrap: wrap;
  }
  .htl-tag { font-size: 9px; padding: 2px 7px; }
  .htl-l1 {
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .htl-l2 {
    font-size: 10px;
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Hide panel chips on mobile — keep mobile compact */
  .htl-l3 { display: none; }
  .htl-info { flex: 1 1 100%; order: 2; min-width: 0; }
  .htl-tag { order: 1; }
  .htl-right { order: 1; margin-left: auto; }
  .htl-pill {
    font-size: 10px; padding: 2px 7px 2px 3px;
    border-radius: 11px;
  }
  .htl-pill-avt { width: 15px; height: 15px; font-size: 8px; }
  .htl-pill-name { display: none; }  /* avatar dot only on mobile */

  .htl-exp-row {
    flex-direction: column; gap: 4px;
  }
  .htl-exp-lbl { padding-top: 0; }
  .htl-act-btn { font-size: 12px; padding: 8px 12px; }

  .htl-filterbar {
    gap: 5px; margin-bottom: 12px;
  }
  .htl-filter-lbl { display: none; }
  .htl-fchip { font-size: 11px; padding: 4px 10px; }
  .htl-counter { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ch+: Flagged-only slider switch (next to search bar, Records tab only)
   ═══════════════════════════════════════════════════════════════════════════ */
.flagged-switch-wrap {
  display: none;  /* hidden by default; .show added by JS when Records tab active */
  align-items: center; gap: 7px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.flagged-switch-wrap.show { display: inline-flex; }
.flagged-switch-lbl {
  font-size: 12px; font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.flagged-switch {
  position: relative;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: #C8C4B8;
  border: none; padding: 0;
  cursor: pointer;
  transition: background .18s;
  flex-shrink: 0;
}
.flagged-switch:hover { background: #B5B0A2; }
.flagged-switch.on { background: #083D36; }
.flagged-switch.on:hover { background: #04342C; }
.flagged-switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .18s;
}
.flagged-switch.on .flagged-switch-knob {
  transform: translateX(16px);
}

@media (max-width: 768px) {
  .flagged-switch-lbl { display: none; }  /* switch-only on mobile */
}

/* Generic search-hidden marker — works for any card/row */
.search-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   ch+: Desktop sidebar collapse to icons-only
   When .ws-shell has .sidebar-collapsed:
     - Sidebar shrinks 220px → 56px showing just member avatar dots
     - Right "Needs attention" rail expands 260px → 320px
     - Member names, section labels, brand text hide; icons stay
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  /* Sidebar collapse */
  .ws-shell.sidebar-collapsed .ws-rail {
    width: 56px;
    transition: width .22s ease;
  }
  .ws-shell:not(.sidebar-collapsed) .ws-rail {
    transition: width .22s ease;
  }

  /* Right rail expansion — fills the freed-up space */
  .ws-shell.sidebar-collapsed .ws-attention {
    width: 320px;
    transition: width .22s ease;
  }
  .ws-shell:not(.sidebar-collapsed) .ws-attention {
    transition: width .22s ease;
  }

  /* Hide the things that don't fit in 56px */
  .ws-shell.sidebar-collapsed .ws-rail-brand span,
  .ws-shell.sidebar-collapsed .ws-rail-fam,
  .ws-shell.sidebar-collapsed .ws-rail-sec,
  .ws-shell.sidebar-collapsed .ws-rail-m-name,
  .ws-shell.sidebar-collapsed .ws-rail-flag,
  .ws-shell.sidebar-collapsed .ws-rail-bottom {
    display: none;
  }

  /* ch+: kill the text-node leak in workspace nav links
     ("Family home", "Medical activities", "Ask Arogya AI", "Upload history" are
     raw text nodes next to the icon — display:none on the parent would hide
     the whole item, so we zero the font-size and restore it on the icon). */
  .ws-shell.sidebar-collapsed .ws-rail-item {
    font-size: 0;
    padding: 9px 0;
    margin: 1px 6px;
    width: calc(100% - 12px);
    justify-content: center;
    gap: 0;
  }
  .ws-shell.sidebar-collapsed .ws-rail-item i {
    font-size: 18px;
    width: auto;
  }

  /* Tighten padding so avatars sit cleanly centered */
  .ws-shell.sidebar-collapsed .ws-rail-top {
    padding: 18px 6px 8px;
  }
  .ws-shell.sidebar-collapsed .ws-rail-brand {
    justify-content: center;
    margin-bottom: 10px;
    font-size: 22px;
  }
  .ws-shell.sidebar-collapsed .ws-rail-nav {
    padding-top: 4px;
  }
  .ws-shell.sidebar-collapsed .ws-rail-member {
    justify-content: center;
    padding: 6px 4px;
    margin: 2px 4px;
    border-radius: 8px;
    gap: 0;
  }
  /* Active member highlight extends across the narrow rail */
  .ws-shell.sidebar-collapsed .ws-rail-member.active {
    background: rgba(255, 255, 255, 0.10);
  }
  /* Slightly larger avatar in collapsed mode — it's the only thing shown */
  .ws-shell.sidebar-collapsed .ws-rail-m-av {
    width: 32px; height: 32px;
    font-size: 13px;
  }
}

/* On mobile, .sidebar-collapsed is a no-op — drawer behaviour overrides it */
@media (max-width: 768px) {
  .ws-shell.sidebar-collapsed .ws-rail {
    width: 280px;  /* normal drawer width */
  }
}

/* ───────────────────────────────────────────────────────────────────
   v4.3 IA additions (build er)
   - Noto Sans per-script font @import
   - :lang() selectors for correct line-height per script
   - Global .form-label rule
   - Responsive sidebar hide on mobile
   ─────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600&family=Noto+Sans+Tamil:wght@400;500;600&family=Noto+Sans+Telugu:wght@400;500;600&family=Noto+Sans+Bengali:wght@400;500;600&family=Noto+Sans+Gujarati:wght@400;500;600&family=Noto+Sans+Kannada:wght@400;500;600&family=Noto+Sans+Malayalam:wght@400;500;600&display=swap');

:lang(hi), :lang(mr) { font-family: 'Noto Sans Devanagari', var(--font-sans); line-height: 1.85; }
:lang(ta)            { font-family: 'Noto Sans Tamil',      var(--font-sans); line-height: 1.90; }
:lang(te)            { font-family: 'Noto Sans Telugu',     var(--font-sans); line-height: 1.85; }
:lang(bn)            { font-family: 'Noto Sans Bengali',    var(--font-sans); line-height: 1.80; }
:lang(gu)            { font-family: 'Noto Sans Gujarati',   var(--font-sans); line-height: 1.85; }
:lang(kn)            { font-family: 'Noto Sans Kannada',    var(--font-sans); line-height: 1.85; }
:lang(ml)            { font-family: 'Noto Sans Malayalam',  var(--font-sans); line-height: 1.90; }

/* Global form label — v4.3 hierarchy (13px / 600 / brand colour) */
.form-label,
form label,
.field-label {
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
  color: var(--form-label-color);
  letter-spacing: 0.1px;
  margin-bottom: 8px;
  display: block;
}
.form-label .req,
.form-label .required,
form label .req,
form label .required { color: #DC2626; }

.form-label .opt,
form label .opt {
  color: #9CA3AF;
  font-weight: 400;
  font-size: 11px;
}

/* Responsive sidebar — mobile hide of the workspace rail is already
   handled by the existing @media (max-width: 768px) block above
   (`.ws-rail { position: fixed; transform: translateX(-100%); ... }`
   plus `.ws-shell.drawer-open .ws-rail { transform: translateX(0) }`).
   No additional rule needed here. */

/* ───────────────────────────────────────────────────────────────────
   v4.3 IA — topbar partial, FAB (build er)
   Note: desktop sidebar collapse is already handled by the existing
   `.ws-shell.sidebar-collapsed .ws-rail` CSS block (workspace.css ~L1894+)
   and `wsToggleDrawer()` JS in workspace.html. wsToggleSidebar() in
   nav.js is a thin alias to that existing function.
   ─────────────────────────────────────────────────────────────────── */

/* Collapsible sidebar — handled by existing .ws-shell.sidebar-collapsed rules. */

/* New topbar partial (.ws-topbar) — fresh shell, brand-green chrome.
   Currently only used by templates that opt in via {% include "partials/topbar.html" %}.
   Existing pages keep using .member-ai-topbar. */
.ws-topbar {
  height: var(--topbar-height);
  background: var(--color-brand);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 30;
}
.ws-topbar-hamburger,
.ws-topbar-back {
  width: 34px; height: 34px;
  border: none; background: transparent;
  border-radius: 7px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-topbar-hamburger:hover,
.ws-topbar-back:hover { background: rgba(255,255,255,0.1); }
.ws-topbar-hamburger i,
.ws-topbar-back i { font-size: 18px; }
.ws-topbar-titleblock { line-height: 1.15; }
.ws-topbar-title {
  font-size: 14px; font-weight: 500; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-topbar-subtitle {
  font-size: 11px; color: rgba(255,255,255,0.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-topbar-context-pill {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.ws-topbar-context-pill:hover { background: rgba(255,255,255,0.18); }
.ws-topbar-context-av {
  width: 22px; height: 22px; border-radius: 50%;
  background: #D97706;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ws-topbar-context-name {
  font-size: 13px; font-weight: 500; color: #fff;
  white-space: nowrap;
}
.ws-topbar-context-caret { font-size: 13px; color: rgba(255,255,255,0.6); }
.ws-topbar-ai-search {
  flex: 1; max-width: 540px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 6px 10px;
}
.ws-topbar-ai-search i { font-size: 15px; color: rgba(255,255,255,0.55); flex-shrink: 0; }
.ws-topbar-ai-search input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: inherit; font-size: 13px; color: #fff;
  min-width: 0;
}
.ws-topbar-ai-search input::placeholder { color: rgba(255,255,255,0.5); }
.ws-topbar-spacer { flex: 1; }
.ws-topbar-doctor-cta {
  background: var(--color-amber-action);
  color: #1B1C1A;
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.ws-topbar-doctor-cta i { font-size: 14px; }
.ws-topbar-acct-chip {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.ws-topbar-acct-chip:hover { background: rgba(255,255,255,0.22); }
.ws-topbar-acct-initial {
  font-size: 11px; font-weight: 700; color: #fff;
}
@media (max-width: 768px) {
  .ws-topbar { padding: 0 10px; gap: 6px; }
  .ws-topbar-ai-search { display: none; }  /* mobile uses FAB instead */
  .ws-topbar-title { font-size: 13px; }
}

/* Floating Ask Arogya AI button (.ws-fab) — corner button on every
   authenticated page except /ask. */
.ws-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(8, 61, 54, 0.28);
  z-index: 60;            /* above bottom nav (z:30), below modals */
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ws-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(8, 61, 54, 0.35); }
.ws-fab:active { transform: translateY(0); }
.ws-fab i { font-size: 24px; color: #fff; }
/* Mobile: sit above the bottom nav */
@media (max-width: 768px) {
  .ws-fab {
    bottom: var(--fab-offset-bottom);
    right: 16px;
    width: 52px;
    height: 52px;
  }
  .ws-fab i { font-size: 22px; }
}

/* ───────────────────────────────────────────────────────────────────
   v4.3 Watching strip — slim tiles (build er)
   Lives at the top of the Records tab. Horizontal-scroll list of
   flagged metrics. Tap a tile to open the trend chart.
   ─────────────────────────────────────────────────────────────────── */
.wt-strip {
  margin: 4px 0 14px;
}
.wt-strip-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px 8px;
  font-family: var(--font-sans);
}
.wt-strip-hdr i { font-size: 14px; color: var(--color-brand); }
.wt-strip-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.wt-strip-count {
  font-size: 10px;
  color: var(--color-text-tertiary);
}
.wt-strip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.wt-strip-scroll::-webkit-scrollbar { height: 4px; }
.wt-strip-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border-secondary);
  border-radius: 4px;
}
.wt-tile {
  flex: 0 0 78px;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-left: 3px solid var(--color-text-tertiary);  /* overridden inline */
  border-radius: 8px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.wt-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.wt-tile:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}
.wt-tile-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wt-tile-vrow {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 1px;
}
.wt-tile-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1;
}
.wt-tile-unit {
  font-size: 9px;
  color: var(--color-text-secondary);
}
.wt-tile-range {
  font-size: 9px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* ───────────────────────────────────────────────────────────────────
   v4.3 Add Sheet bottom sheet (build er)
   Opens from ⊕ centre button. 3 cards: Upload / Activity / Quick note.
   ─────────────────────────────────────────────────────────────────── */
.add-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s ease, transform 0.06s ease;
}
.add-card:hover {
  border-color: var(--color-border-secondary);
  transform: translateY(-1px);
}
.add-card:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}
.add-card-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: rgba(8, 61, 54, 0.08);
  color: var(--color-brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.add-card-icon i { font-size: 18px; }
.add-card-text { flex: 1; min-width: 0; }
.add-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.2;
}
.add-card-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}
.add-card-chev {
  font-size: 14px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}


/* ═════════════════════════════════════════════════════════════════════════
 * Build `es` — Records Hub + Doctor Directory styles
 * ═════════════════════════════════════════════════════════════════════════ */

/* Records Hub landing — 6 lens cards */
.records-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .records-hub-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .records-hub-grid { grid-template-columns: repeat(6, 1fr); }
}

.lens-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lens-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.lens-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E6F1FB;
  color: #185FA5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}
.lens-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.lens-card-count {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}
.lens-card-count-muted { opacity: 0.6; }

/* Series cards in Conditions lens */
.series-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Status pills (used by series, episodes) */
.status-pill {
  font-size: 10px;
  font-weight: 500;
  border-radius: 8px;
  padding: 2px 8px;
  white-space: nowrap;
}
.status-active   { background: #E6F1FB; color: #0C447C; }
.status-closed   { background: #F3F4F6; color: #4B5563; }
.status-merged   { background: #F0E7FF; color: #5B21B6; }
.status-deleted  { background: #FEE2E2; color: #991B1B; }
.status-orphaned { background: #FEF3C7; color: #92400E; display: inline-flex; align-items: center; gap: 3px; }

/* Series ⋮ kebab menu */
.series-kebab { position: relative; }
.series-kebab-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.series-kebab-btn:hover { background: #F3F4F6; color: var(--color-text-primary); }
.series-kebab-btn .ti { font-size: 18px; }
.series-kebab-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 180px;
  z-index: 20;
  overflow: hidden;
}
.series-kebab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  color: var(--color-text-primary);
}
.series-kebab-item:hover { background: #F9FAFB; }
.series-kebab-item .ti { font-size: 14px; color: var(--color-text-tertiary); }
.series-kebab-item-danger { color: #B91C1C; }
.series-kebab-item-danger .ti { color: #B91C1C; }

/* Body system tiles */
.body-system-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .body-system-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .body-system-grid { grid-template-columns: repeat(4, 1fr); } }
.body-system-tile {
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.12s ease;
}
.body-system-tile:hover { transform: translateY(-1px); }
.body-system-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E6F1FB;
  color: #185FA5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin: 0 auto 8px;
}
.body-system-tile-empty .body-system-tile-icon { background: #F3F4F6; color: #9CA3AF; }
.body-system-tile-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}
.body-system-tile-stats {
  font-size: 9px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}
.body-system-tile-flag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #C2410C;
  color: #fff;
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 500;
}

/* Episode card (Episodes lens) */
.episode-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
}

/* Incident row (Episode Detail) */
.incident-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  margin-bottom: 6px;
}
.incident-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
}
.incident-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-quaternary);
  border-radius: 4px;
}
.incident-delete-btn:hover { color: #B91C1C; background: #FEE2E2; }

/* Timeline */
.timeline-event {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}
.timeline-event-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: 0 0 auto;
}

/* Filter chips (Doctors list, etc.) */
.filter-chip {
  font-size: 12px;
  padding: 6px 12px;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 16px;
  background: #fff;
  color: var(--color-text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.filter-chip.active {
  background: #085041;
  color: #fff;
  border-color: #085041;
}

/* Doctor card */
.doctor-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.doctor-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E6F1FB;
  color: #185FA5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}

/* Medication row */
.medication-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  margin-bottom: 6px;
}
.medication-row-history { background: #FAFAFA; opacity: 0.92; }
.medication-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #92400E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
}

/* Buttons used across new pages */
.es-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 0.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.es-btn-primary { background: #085041; color: #fff; }
.es-btn-primary:hover { background: #06402F; }
.es-btn-secondary { background: #fff; color: var(--color-text-primary); border-color: var(--color-border-tertiary); }
.es-btn-secondary:hover { background: #F9FAFB; }
.es-btn-danger-outline { background: #fff; color: #B91C1C; border-color: #FCA5A5; }
.es-btn-danger-outline:hover { background: #FEE2E2; }

/* Confirmation modal */
.es-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.es-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 420px;
  margin: 0 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Build ex — Insurance + Post-ingestion sheet + Comparison sheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Insurance Home ─────────────────────────────────────────────────────── */
.add-policy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 16px;
  background: rgba(255,255,255,0.18); color: #fff;
  font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.add-policy-btn:hover { background: rgba(255,255,255,0.28); }

.ins-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: #DBE2DE;
  padding: 0; margin: 0 0 0 0;
  border-bottom: 1px solid #DBE2DE;
}
.ins-sum-stat {
  background: #fff; padding: 20px;
}
.ins-sum-lbl {
  font-size: 11px; color: #707975;
  text-transform: uppercase; letter-spacing: .04em;
  font-weight: 500; margin-bottom: 6px;
}
.ins-sum-val {
  font-size: 22px; color: #1B2520; font-weight: 700;
  letter-spacing: -.01em; line-height: 1.1;
}
.ins-sum-sub {
  font-size: 11px; color: #707975; margin-top: 4px;
}

.ins-renewal-strip {
  display: flex; align-items: center; gap: 10px;
  background: #FFF6E6; border: 1px solid #FAE0AC;
  border-radius: 10px; padding: 12px 14px;
  margin: 16px 0 12px;
  text-decoration: none; color: #5A3D0A;
  font-size: 12.5px;
}
.ins-renewal-strip .ti { font-size: 16px; flex: 0 0 auto; }
.ins-renewal-strip .text { flex: 1; min-width: 0; }
.ins-renewal-strip .text strong { font-weight: 600; }
.ins-renewal-strip .act {
  font-size: 12px; color: #083D36; font-weight: 600; flex: 0 0 auto;
}

.ins-coverage-cta {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 14px; margin: 12px 0;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ins-coverage-cta:hover {
  border-color: #083D36; box-shadow: 0 2px 8px rgba(8,61,54,.06);
}
.ins-coverage-cta-ic {
  width: 40px; height: 40px; border-radius: 50%;
  background: #E8F0EE; color: #083D36;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 auto;
}
.ins-coverage-cta-text { flex: 1; min-width: 0; }
.ins-coverage-cta-text h3 {
  font-size: 13.5px; color: #1B2520; font-weight: 600;
  margin: 0 0 2px;
}
.ins-coverage-cta-text p {
  font-size: 11.5px; color: #707975; margin: 0;
}
.ins-coverage-cta .ins-arrow {
  color: #707975; font-size: 14px;
}

.ins-section-header {
  font-size: 12px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 16px 0 8px;
}

.ins-policy-card {
  display: block; background: #fff;
  border: 1px solid #DBE2DE; border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.ins-policy-card:hover {
  border-color: #083D36; box-shadow: 0 2px 8px rgba(8,61,54,.08);
}
.ins-policy-card:active { transform: translateY(1px); }

.ins-policy-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.ins-insurer-mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: #083D36; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}
.ins-policy-meta { flex: 1; min-width: 0; }
.ins-policy-name {
  font-size: 14px; color: #1B2520; font-weight: 600;
  margin: 0 0 1px; line-height: 1.25;
}
.ins-policy-insurer {
  font-size: 11.5px; color: #707975; margin: 0 0 2px;
}
.ins-policy-id {
  font-size: 11px; color: #94A0A8; margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.ins-health-badge {
  font-size: 10.5px; padding: 3px 8px; border-radius: 10px;
  font-weight: 600; flex: 0 0 auto;
  text-transform: uppercase; letter-spacing: .02em;
}
.ins-badge-good   { background: #E0EEDE; color: #2E6B26; }
.ins-badge-gaps   { background: #FFF6E6; color: #854F0B; }
.ins-badge-lapsed { background: #F0EEEA; color: #707975; }

.ins-policy-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 12px;
  padding-top: 10px; border-top: 1px solid #F0EEEA;
}
.ins-pstat { font-size: 11px; }
.ins-pstat-lbl {
  color: #707975; margin-bottom: 2px;
}
.ins-pstat-val {
  color: #1B2520; font-weight: 600; font-size: 13px;
}
.ins-pstat-val.ins-regular { font-weight: 500; font-size: 12px; }

.ins-lapsed-help {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11.5px; color: #707975; margin-bottom: 8px;
  padding: 8px 10px; background: #F8F6F1; border-radius: 6px;
}
.ins-lapsed-help .ti { font-size: 14px; color: #94A0A8; flex: 0 0 auto; margin-top: 1px; }

.ins-lapsed-card {
  background: #F8F6F1; border: 1px solid #E5E1D8;
  border-radius: 10px; padding: 12px;
  margin-bottom: 8px; opacity: .88;
}
.ins-lapsed-head { display: flex; align-items: flex-start; gap: 10px; }
.ins-lapsed-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: #94A0A8; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.ins-lapsed-meta { flex: 1; min-width: 0; }
.ins-lapsed-name { font-size: 13px; color: #1B2520; font-weight: 600; margin: 0; }
.ins-lapsed-insurer { font-size: 11px; color: #707975; margin: 2px 0 0; }
.ins-lapsed-status {
  font-size: 10px; padding: 2px 7px; border-radius: 10px;
  background: #707975; color: #fff; font-weight: 600;
  text-transform: uppercase; flex: 0 0 auto;
}
.ins-lapsed-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 10px 0 8px;
}
.ins-lapsed-actions { display: flex; gap: 6px; }
.ins-lapsed-btn {
  flex: 1; padding: 6px 10px; border-radius: 6px;
  background: #fff; border: 1px solid #DBE2DE;
  font-size: 11.5px; color: #1B2520; font-weight: 500;
  text-align: center; text-decoration: none;
  transition: background .15s;
}
.ins-lapsed-btn:hover { background: #F0EEEA; }

.ins-empty {
  text-align: center; padding: 48px 24px;
  background: #fff; border: 1px dashed #DBE2DE; border-radius: 12px;
  margin: 24px 0;
}
.ins-empty-ic {
  width: 56px; height: 56px; border-radius: 50%;
  background: #E8F0EE; color: #083D36;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 12px;
}
.ins-empty h2 {
  font-size: 16px; color: #1B2520; margin: 0 0 6px;
}
.ins-empty p {
  font-size: 12.5px; color: #707975;
  margin: 0 0 16px; line-height: 1.5;
}

.ins-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: #083D36; color: #fff;
  font-size: 13px; font-weight: 500;
  text-decoration: none; border: none; cursor: pointer;
  font-family: inherit;
}
.ins-btn-primary:hover { background: #0A4D43; }

.ins-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: #fff; color: #1B2520;
  font-size: 13px; font-weight: 500;
  text-decoration: none; border: 1px solid #DBE2DE; cursor: pointer;
  font-family: inherit;
}
.ins-btn-ghost:hover { background: #F0EEEA; }

/* ── Policy Detail ──────────────────────────────────────────────────────── */
.ins-detail-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background .15s;
}
.ins-detail-back:hover { background: rgba(255,255,255,0.15); }

.ins-detail-menu {
  background: transparent; border: none; color: rgba(255,255,255,0.9);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ins-detail-menu:hover { background: rgba(255,255,255,0.15); }

.ins-actions-menu {
  position: absolute; top: 38px; right: 0;
  background: #fff; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  min-width: 200px; padding: 4px 0;
  display: none; z-index: 50;
}
.ins-actions-menu.open { display: block; }
.ins-actions-menu a,
.ins-actions-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; width: 100%;
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; color: #1B2520;
  text-decoration: none; font-family: inherit;
  text-align: left;
}
.ins-actions-menu a:hover,
.ins-actions-menu button:hover { background: #F0EEEA; }
.ins-actions-menu .ins-danger { color: #A32D2D; }
.ins-actions-menu form { margin: 0; }

.ins-hero-card {
  background: #fff; padding: 20px;
  border-bottom: 1px solid #DBE2DE;
}
.ins-hero-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.ins-hero-meta { flex: 1; min-width: 0; }
.ins-hero-name {
  font-size: 17px; color: #1B2520; font-weight: 700;
  margin: 0 0 2px; line-height: 1.2;
}
.ins-hero-insurer {
  font-size: 12.5px; color: #4a5664; margin: 0;
}
.ins-hero-id {
  font-size: 11.5px; color: #94A0A8;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin: 4px 0 0;
}
.ins-hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.ins-hs { font-size: 11px; }
.ins-hs-val {
  font-size: 17px; color: #083D36; font-weight: 700;
  margin: 2px 0; letter-spacing: -.01em;
}
.ins-hs-sub { font-size: 10.5px; color: #707975; }

.ins-doc-bar {
  margin-top: 16px;
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 12px;
}
.ins-doc-row { display: flex; align-items: center; gap: 10px; }
.ins-doc-thumb {
  width: 36px; height: 36px; border-radius: 6px;
  background: linear-gradient(135deg, #094D43 0%, #0A6655 100%);
  flex: 0 0 auto;
}
.ins-doc-info { flex: 1; min-width: 0; }
.ins-doc-info p { margin: 0; font-size: 12.5px; color: #1B2520; }
.ins-doc-info p:first-child { font-weight: 600; }
.ins-doc-info p + p { font-size: 11px; color: #707975; margin-top: 2px; }

.ins-sh {
  font-size: 11px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 18px 0 8px;
}

.ins-section-card {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 4px 14px;
}
.ins-section-card.ins-muted { color: #707975; padding: 14px; }

.ins-member-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ins-member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #DBE2DE;
  border-radius: 18px; padding: 5px 12px 5px 5px;
  font-size: 12px; color: #1B2520;
}
.ins-av {
  width: 22px; height: 22px; border-radius: 50%;
  background: #083D36; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
}

.ins-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #F0EEEA;
  gap: 12px;
}
.ins-row:last-child { border-bottom: none; }
.ins-row-lbl { font-size: 12px; color: #707975; flex: 0 0 auto; }
.ins-row-val {
  font-size: 12.5px; color: #1B2520; font-weight: 500;
  text-align: right;
}

.ins-waiting-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #F0EEEA;
}
.ins-waiting-row:last-child { border-bottom: none; }
.ins-wait-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 auto;
}
.ins-wait-cleared  { background: #E0EEDE; color: #2E6B26; }
.ins-wait-active   { background: #FFF6E6; color: #854F0B; }
.ins-wait-excluded { background: #FEE2E2; color: #A32D2D; }
.ins-wait-meta { flex: 1; min-width: 0; }
.ins-wait-name {
  font-size: 12.5px; color: #1B2520; font-weight: 500; margin: 0;
}
.ins-wait-detail { font-size: 11px; color: #707975; margin: 2px 0 0; }
.ins-wait-status {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; flex: 0 0 auto;
}
.ins-wait-status-cleared  { background: #E0EEDE; color: #2E6B26; }
.ins-wait-status-active   { background: #FFF6E6; color: #854F0B; }
.ins-wait-status-excluded { background: #FEE2E2; color: #A32D2D; }

.ins-network-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
}
.ins-network-card .ti { font-size: 22px; color: #083D36; flex: 0 0 auto; }
.ins-nc-name { font-size: 13px; color: #1B2520; font-weight: 600; margin: 0; }
.ins-nc-sub  { font-size: 11px; color: #707975; margin: 2px 0 0; }

.ins-excl-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #F0EEEA;
  font-size: 12.5px; color: #1B2520;
}
.ins-excl-row:last-child { border-bottom: none; }
.ins-excl-row .ins-muted { color: #94A0A8; }

.ins-notes-card { padding: 14px; font-size: 12.5px; color: #1B2520; line-height: 1.5; white-space: pre-wrap; }
.ins-muted { color: #707975; }

/* ── Insurance form ─────────────────────────────────────────────────────── */
.ins-form-error {
  background: #FEE2E2; color: #7F1D1D;
  border: 1px solid #FCA5A5; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px;
  font-size: 13px;
}
.ins-form-section {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
.ins-form-section-title {
  font-size: 11px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 12px;
}
.ins-form-help {
  font-size: 11.5px; color: #707975; margin: -8px 0 12px;
}
.ins-form-field {
  display: block; margin-bottom: 12px;
}
.ins-form-field:last-child { margin-bottom: 0; }
.ins-form-field > span {
  display: block; font-size: 11.5px; color: #4a5664;
  font-weight: 500; margin-bottom: 5px;
}
.ins-form-field > span em {
  color: #A32D2D; font-style: normal; margin-left: 2px;
}
.ins-form-field input,
.ins-form-field select,
.ins-form-field textarea {
  width: 100%; box-sizing: border-box;
  padding: 8px 12px; border-radius: 7px;
  border: 1px solid #DBE2DE; background: #FCFBF8;
  font-size: 13px; color: #1B2520; font-family: inherit;
}
.ins-form-field input:focus,
.ins-form-field select:focus,
.ins-form-field textarea:focus {
  outline: none; border-color: #083D36;
  box-shadow: 0 0 0 3px rgba(8,61,54,.1);
}
.ins-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.ins-form-members {
  display: flex; flex-direction: column; gap: 6px;
}
.ins-member-checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  border: 1px solid #DBE2DE; background: #FCFBF8;
  cursor: pointer; font-size: 13px; color: #1B2520;
}
.ins-member-checkbox:hover { background: #F0EEEA; }
.ins-member-checkbox input[type="checkbox"] {
  width: auto; margin: 0; flex: 0 0 auto;
}
.ins-mc-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: #083D36; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.ins-mc-name { flex: 1; }

.ins-form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Post-ingestion sheet (.pis-*)
   ═══════════════════════════════════════════════════════════════════════════ */
body.pis-locked { overflow: hidden; }

.pis-sheet {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: flex-end; justify-content: center;
}
.pis-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  animation: pis-fade-in .25s ease;
}
.pis-panel {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 28px rgba(0,0,0,.18);
}
.pis-panel.pis-open { transform: translateY(0); }
@keyframes pis-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.pis-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #DBE2DE; margin: 8px auto 0;
}
.pis-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 16px;
  border-bottom: 1px solid #F0EEEA;
}
.pis-head-ic {
  width: 36px; height: 36px; border-radius: 50%;
  background: #E0EEDE; color: #2E6B26;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 auto;
}
.pis-head-tx { flex: 1; min-width: 0; }
.pis-head-tx h2 {
  font-size: 15px; color: #1B2520; margin: 0; font-weight: 700;
}
.pis-head-tx p { font-size: 12px; color: #707975; margin: 1px 0 0; }
.pis-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: #707975;
  display: flex; align-items: center; justify-content: center;
}
.pis-close:hover { background: #F0EEEA; color: #1B2520; }

.pis-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}

.pis-doc-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: #F8F6F1;
  border-radius: 9px; margin-bottom: 14px;
}
.pis-doc-thumb {
  width: 36px; height: 36px; border-radius: 7px;
  background: linear-gradient(135deg, #094D43 0%, #0A6655 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex: 0 0 auto;
}
.pis-doc-info { flex: 1; min-width: 0; }
.pis-doc-info p { margin: 0; font-size: 12px; color: #1B2520; line-height: 1.3; }
.pis-doc-info p:first-child { font-weight: 600; }
.pis-doc-info p + p { font-size: 11px; color: #707975; margin-top: 2px; }

.pis-file-type-card {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 12px; margin-bottom: 16px;
}
.pis-ft-label {
  font-size: 11px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 8px;
}
.pis-ft-row { display: flex; align-items: center; gap: 10px; }
.pis-ft-icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: #E8F0EE; color: #083D36;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex: 0 0 auto;
}
.pis-ft-meta { flex: 1; min-width: 0; }
.pis-ft-type { font-size: 13.5px; color: #1B2520; font-weight: 600; margin: 0; }
.pis-ft-detect { font-size: 11px; color: #707975; margin: 2px 0 0; line-height: 1.35; }
.pis-ft-change {
  background: transparent; border: 1px solid #DBE2DE;
  border-radius: 6px; padding: 5px 10px;
  font-size: 11.5px; color: #083D36; font-weight: 500;
  cursor: pointer; font-family: inherit; flex: 0 0 auto;
}
.pis-ft-change:hover { background: #F0EEEA; }

.pis-sec { margin-bottom: 16px; }
.pis-sh {
  font-size: 11px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 8px;
}

.pis-fields {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #DBE2DE; border-radius: 9px;
  overflow: hidden;
}
.pis-field {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #F0EEEA;
  gap: 10px;
}
.pis-field:last-child { border-bottom: none; }
.pis-field-lbl { font-size: 11.5px; color: #707975; flex: 0 0 auto; }
.pis-field-val {
  font-size: 12.5px; color: #1B2520; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 8px; border-radius: 5px;
  transition: background .15s;
  text-align: right;
}
.pis-field-val:hover { background: #F0EEEA; }
.pis-field-val .ti { font-size: 12px; color: #94A0A8; }

.pis-panels-list {
  display: flex; flex-direction: column; gap: 8px;
}
.pis-panel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: #fff;
  border: 1px solid #DBE2DE; border-radius: 9px;
}
.pis-panel-tick {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 auto;
}
.pis-tick-ok       { background: #E0EEDE; color: #2E6B26; }
.pis-tick-flagged  { background: #FFF6E6; color: #854F0B; }
.pis-tick-critical { background: #FEE2E2; color: #A32D2D; }
.pis-panel-info { flex: 1; min-width: 0; }
.pis-panel-name { font-size: 13px; color: #1B2520; font-weight: 600; margin: 0; }
.pis-panel-count { font-size: 11px; color: #707975; margin: 2px 0 0; }
.pis-panel-flag {
  font-size: 10.5px; padding: 3px 8px; border-radius: 10px;
  font-weight: 600; flex: 0 0 auto;
}
.pis-flag-ok       { background: #E0EEDE; color: #2E6B26; }
.pis-flag-flagged  { background: #FFF6E6; color: #854F0B; }
.pis-flag-critical { background: #FEE2E2; color: #A32D2D; }

.pis-trend-list {
  display: flex; flex-direction: column; gap: 6px;
}
.pis-trend-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: #fff;
  border: 1px solid #DBE2DE; border-radius: 9px;
  cursor: pointer; font-family: inherit;
  font-size: 13px; color: #1B2520; text-align: left;
  transition: border-color .15s, background .15s;
}
.pis-trend-link:hover { border-color: #083D36; background: #F0EEEA; }
.pis-trend-link > .ti:first-child {
  color: #083D36; font-size: 16px; flex: 0 0 auto;
}
.pis-trend-link > span { flex: 1; min-width: 0; }
.pis-trend-link > .ti:last-child { color: #94A0A8; font-size: 14px; }

.pis-doctor-card {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 12px;
}
.pis-doc-head-row { display: flex; align-items: center; gap: 10px; }
.pis-doc-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: #E8F0EE; color: #083D36;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 auto;
}
.pis-doc-name { font-size: 13.5px; color: #1B2520; font-weight: 600; margin: 0; }
.pis-doc-spec { font-size: 11.5px; color: #707975; margin: 2px 0 0; }
.pis-doc-edit {
  font-size: 11.5px; color: #083D36; font-weight: 500;
  cursor: pointer; padding: 4px 10px;
  border-radius: 5px; background: #F0EEEA; flex: 0 0 auto;
}
.pis-doc-edit:hover { background: #DBE2DE; }
.pis-doc-details-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #F0EEEA;
}
.pis-doc-dr-lbl { display: block; font-size: 10.5px; color: #707975; margin-bottom: 2px; }
.pis-doc-dr-val { font-size: 12.5px; color: #1B2520; font-weight: 500; }

.pis-med-list { display: flex; flex-direction: column; gap: 8px; }
.pis-med-row {
  display: flex; gap: 10px; padding: 11px 12px;
  background: #fff; border: 1px solid #DBE2DE; border-radius: 9px;
}
.pis-med-ic {
  width: 28px; height: 28px; border-radius: 6px;
  background: #FFF6E6; color: #854F0B;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex: 0 0 auto;
}
.pis-med-meta { flex: 1; min-width: 0; }
.pis-med-name { font-size: 13px; color: #1B2520; font-weight: 600; margin: 0; }
.pis-med-rx  { font-size: 11.5px; color: #707975; margin: 2px 0 0; }
.pis-med-inst { font-size: 11px; color: #94A0A8; margin: 4px 0 0; line-height: 1.4; }

.pis-section-card {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  padding: 4px 12px;
}
.pis-finding-row {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #F0EEEA;
}
.pis-finding-row:last-child { border-bottom: none; }
.pis-finding-kind {
  font-size: 11px; color: #707975; flex: 0 0 100px;
  text-transform: uppercase; letter-spacing: .03em;
}
.pis-finding-text { font-size: 12.5px; color: #1B2520; flex: 1; }

.pis-foot {
  display: flex; gap: 10px; padding: 14px 20px;
  border-top: 1px solid #F0EEEA;
  background: #fff;
  flex: 0 0 auto;
}
.pis-btn-primary {
  flex: 1; padding: 11px; border-radius: 9px;
  background: #083D36; color: #fff;
  border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  transition: background .15s;
}
.pis-btn-primary:hover { background: #0A4D43; }
.pis-btn-ghost {
  flex: 0 0 120px; padding: 11px; border-radius: 9px;
  background: #fff; color: #1B2520;
  border: 1px solid #DBE2DE; cursor: pointer;
  font-size: 13.5px; font-weight: 500; font-family: inherit;
}
.pis-btn-ghost:hover { background: #F0EEEA; }

.pis-loading {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1B2520; color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; z-index: 9100;
}

/* Picker overlays (file type + member) */
.pis-picker-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.pis-picker-card {
  background: #fff; border-radius: 12px;
  padding: 16px; width: 100%; max-width: 380px;
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
  max-height: 80vh; display: flex; flex-direction: column;
}
.pis-picker-title {
  font-size: 14px; color: #1B2520; font-weight: 600; margin: 0 0 4px;
}
.pis-picker-help {
  font-size: 11.5px; color: #707975; margin: 0 0 12px; line-height: 1.4;
}
.pis-picker-list {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px; overflow-y: auto;
}
.pis-picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: #fff; border: 1px solid transparent;
  font-size: 13px; color: #1B2520;
  cursor: pointer; font-family: inherit; text-align: left;
  width: 100%;
}
.pis-picker-row:hover { background: #F0EEEA; }
.pis-picker-active { background: #E8F0EE; border-color: #083D36; font-weight: 600; }
.pis-picker-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: #083D36; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex: 0 0 auto;
}
.pis-picker-name { flex: 1; }
.pis-picker-row .ti { color: #083D36; }
.pis-picker-cancel {
  padding: 10px; border-radius: 8px;
  background: #fff; border: 1px solid #DBE2DE;
  cursor: pointer; font-size: 13px; color: #1B2520; font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Comparison sheet (.cmp-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.cmp-sheet {
  position: fixed; inset: 0; z-index: 9200;
  display: flex; align-items: flex-end; justify-content: center;
}
.cmp-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  animation: pis-fade-in .25s ease;
}
.cmp-panel {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 28px rgba(0,0,0,.18);
}
.cmp-panel.cmp-open { transform: translateY(0); }
.cmp-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #DBE2DE; margin: 8px auto 0;
}
.cmp-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
}
.cmp-head-tx { flex: 1; min-width: 0; }
.cmp-head-tx h2 {
  font-size: 15px; color: #1B2520; font-weight: 700; margin: 0;
}
.cmp-sub { font-size: 11.5px; color: #707975; }
.cmp-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: #707975;
  display: flex; align-items: center; justify-content: center;
}
.cmp-close:hover { background: #F0EEEA; color: #1B2520; }

.cmp-range-chips {
  display: flex; gap: 6px; padding: 0 20px 12px;
  border-bottom: 1px solid #F0EEEA;
}
.cmp-range-chip {
  padding: 6px 14px; border-radius: 14px;
  background: #fff; border: 1px solid #DBE2DE;
  font-size: 12px; color: #1B2520; cursor: pointer;
  font-family: inherit; font-weight: 500;
  transition: all .15s;
}
.cmp-range-chip:hover { border-color: #083D36; }
.cmp-range-chip.active {
  background: #083D36; border-color: #083D36; color: #fff;
}

.cmp-body {
  overflow-y: auto; padding: 16px 20px;
  flex: 1;
}

.cmp-empty {
  text-align: center; padding: 48px 24px;
  color: #707975;
}
.cmp-empty .ti { font-size: 36px; margin-bottom: 12px; }
.cmp-empty p { font-size: 13px; }

.cmp-chart-card {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 11px;
  padding: 14px;
  margin-bottom: 16px;
}
.cmp-chart-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 12px;
}
.cmp-stat-val {
  font-size: 22px; color: #083D36; font-weight: 700;
  letter-spacing: -.01em; line-height: 1.1;
}
.cmp-stat-unit { font-size: 12.5px; color: #707975; font-weight: 500; margin-left: 4px; }
.cmp-stat-lbl  { font-size: 11px; color: #707975; margin-top: 2px; }
.cmp-chart-meta { text-align: right; }
.cmp-trend {
  font-size: 12px; font-weight: 600;
  display: inline-block; padding: 3px 8px;
  border-radius: 10px;
}
.cmp-trend-down { background: #E0EEDE; color: #2E6B26; }
.cmp-trend-up   { background: #FFF6E6; color: #854F0B; }
.cmp-trend-flat { background: #F0EEEA; color: #707975; }
.cmp-span { font-size: 10.5px; color: #707975; margin-top: 4px; }

.cmp-chart-svg {
  width: 100%; height: 150px; display: block;
}

.cmp-section { margin-top: 8px; }
.cmp-sh-title {
  font-size: 11px; color: #707975; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 8px;
}
.cmp-reading-list {
  background: #fff; border: 1px solid #DBE2DE; border-radius: 10px;
  overflow: hidden;
}
.cmp-reading-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid #F0EEEA;
}
.cmp-reading-row:last-child { border-bottom: none; }
.cmp-reading-date { font-size: 11.5px; color: #707975; flex: 0 0 90px; }
.cmp-reading-value { font-size: 13px; color: #1B2520; font-weight: 600; flex: 1; }
.cmp-reading-flag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 10px;
  font-weight: 600; flex: 0 0 auto;
}
.cmp-flag-normal   { background: #E0EEDE; color: #2E6B26; }
.cmp-flag-high     { background: #FFF6E6; color: #854F0B; }
.cmp-flag-low      { background: #E6F0FF; color: #1E3A8A; }
.cmp-flag-critical { background: #FEE2E2; color: #A32D2D; }

.cmp-loading {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1B2520; color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; z-index: 9300;
}

/* ══════════════════════════════════════════════════════════════════════════
 * Build fb — Records Hub lens cards (replaces the 2×3 icon grid)
 * ══════════════════════════════════════════════════════════════════════════ */
.hub-lens-card {
  display: block;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.hub-lens-card:hover { border-color: #083D36; }
.hub-lens-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.hub-lens-title { font-size: 15px; font-weight: 500; color: var(--color-text-primary); }
.hub-lens-sub { font-size: 12px; color: var(--color-text-tertiary); margin-top: 3px; }
.hub-lens-count {
  font-size: 13px; font-weight: 600; color: #083D36;
  background: rgba(8,61,54,0.07); border-radius: 999px;
  padding: 2px 10px; flex-shrink: 0; margin-left: 12px;
}
.hub-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-pill {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 500; white-space: nowrap;
}
.hub-pill-series-green {
  background: rgba(8,61,54,0.07); border: 1px solid rgba(8,61,54,0.25); color: #083D36;
}
.hub-pill-series-amber {
  background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.30); color: #854F0B;
}
.hub-pill-body {
  background: rgba(8,61,54,0.06); border: 1px solid rgba(8,61,54,0.20); color: #083D36;
}
.hub-pill-more {
  background: transparent; border: 1px solid var(--color-border-tertiary); color: var(--color-text-tertiary);
}
.hub-pill-ep-open {
  background: #FAEEDA; border: 1px solid rgba(217,119,6,0.30); color: #854F0B;
}
.hub-pill-ep-closed {
  background: #F5F3EF; border: 1px solid var(--color-border-tertiary); color: #404945;
}
.hub-pill-med {
  background: #E1F5EE; border: 1px solid rgba(8,61,54,0.20); color: #083D36;
}
.hub-pill-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #D97706; margin-right: 4px; vertical-align: 1px;
}

/* ══════════════════════════════════════════════════════════════════════════
 * Build fb — Health Snapshot profile cards + vital tiles
 * ══════════════════════════════════════════════════════════════════════════ */
.snap-card {
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 14px;
}
.vital-tile {
  padding: 8px 10px;
  border-radius: 8px;
  border: 0.5px solid var(--color-border-tertiary);
}
.vital-good { background: #F0FDF4; border-color: rgba(22,163,74,0.2); }
.vital-good div:nth-child(2) { color: #15803D; }
.vital-watch { background: #FFFBEB; border-color: rgba(217,119,6,0.25); }
.vital-watch div:nth-child(2) { color: #B45309; }
.vital-alert { background: #FEF2F2; border-color: rgba(220,38,38,0.25); }
.vital-alert div:nth-child(2) { color: #DC2626; }

/* ══════════════════════════════════════════════════════════════════════════
 * Build fc — Add Member 4-step wizard components
 * ══════════════════════════════════════════════════════════════════════════ */
.wiz-field { margin-bottom: 16px; }
.wiz-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 6px; }
.wiz-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 0.5px solid var(--color-border-tertiary); background: #fff;
  font-size: 14px; font-family: inherit; color: var(--color-text-primary);
  outline: none;
}
.wiz-input:focus { border-color: #083D36; }
.wiz-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-chip {
  padding: 8px 14px; border-radius: 10px; font-size: 13px;
  border: 0.5px solid var(--color-border-tertiary); background: #fff;
  color: var(--color-text-primary); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.wiz-chip:hover { border-color: #083D36; }
.wiz-chip-active, .wiz-chip.wiz-chip-active {
  background: #083D36; color: #fff; border-color: #083D36;
}
.wiz-type-btn {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: 12px; border: 0.5px solid var(--color-border-tertiary);
  background: #fff; cursor: pointer; font-family: inherit; text-align: left;
  color: var(--color-text-primary);
}
.wiz-type-active, .wiz-type-btn.wiz-type-active {
  background: #083D36; color: #fff; border-color: #083D36;
}
.wiz-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border-radius: 10px; border: none;
  background: #083D36; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.wiz-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border-radius: 10px;
  border: 0.5px solid var(--color-border-tertiary); background: #fff;
  color: var(--color-text-primary); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}

/* ══════════════════════════════════════════════════════════════════════════
 * Build fd — Series accordion (expandable condition cards)
 * ══════════════════════════════════════════════════════════════════════════ */
.series-card-header { display: flex; align-items: center; padding: 14px; gap: 8px; }
.series-card-body { display: none; border-top: 0.5px solid var(--color-border-tertiary); }
.series-expanded .series-card-body { display: block; }
.series-expanded .series-chevron { transform: rotate(180deg); }

/* ══════════════════════════════════════════════════════════════════════════
 * BUILD fk — Visual polish for v4.3 mockups (p13/p16/p30/p31/p33)
 * Added: AI Inferences rich cards, Medications cards, Add Sheet 2×2 grid,
 *        Private dark banner + Personal notes, Profile 4-method share footer
 * ══════════════════════════════════════════════════════════════════════════ */

/* ── AI Inferences rich cards (p31) ─────────────────────────────────── */
.ai-inf { margin: 0 0 16px; padding: 0 12px; }
.ai-inf-disclaimer {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 14px; margin-bottom: 12px;
  background: rgba(8,61,54,0.06);
  border: 1px solid rgba(8,61,54,0.12);
  border-radius: 10px;
}
.ai-inf-disclaimer i { font-size: 14px; color: #083D36; flex-shrink: 0; margin-top: 1px; }
.ai-inf-disclaimer p { font-size: 11px; color: #083D36; line-height: 1.5; margin: 0; }
.ai-inf-disclaimer strong { font-weight: 600; }

.ai-inf-sh {
  font-size: 12px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 14px 0 8px; display: flex; align-items: center; gap: 8px;
}
.ai-inf-sh:first-of-type { margin-top: 0; }
.ai-inf-count {
  font-size: 10px; background: #F0EEEA; color: #707975;
  padding: 2px 7px; border-radius: 999px; font-weight: 500;
}

.ai-inf-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.ai-inf-card-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 10px; }
.ai-inf-card-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ai-inf-card-icon i { font-size: 18px; }
.ai-inf-icon-attention { background: #FCEBEB; }
.ai-inf-icon-attention i { color: #DC2626; }
.ai-inf-icon-good { background: rgba(15,110,86,0.10); }
.ai-inf-icon-good i { color: #0F6E56; }
.ai-inf-icon-pattern { background: #E6F1FB; }
.ai-inf-icon-pattern i { color: #0C447C; }
.ai-inf-icon-rec { background: rgba(60,52,137,0.08); }
.ai-inf-icon-rec i { color: #3C3489; }

.ai-inf-card-meta { flex: 1; min-width: 0; }
.ai-inf-card-title {
  font-size: 14px; font-weight: 500; color: var(--color-text-primary, #1B1C1A);
  line-height: 1.3; margin: 0;
}
.ai-inf-card-member {
  font-size: 11px; color: var(--color-text-tertiary, #707975);
  margin: 3px 0 0; display: flex; align-items: center; gap: 4px;
}
.ai-inf-av {
  width: 14px; height: 14px; border-radius: 50%; color: #fff;
  font-size: 8px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-inf-card-body {
  font-size: 12px; color: var(--color-text-secondary, #404945);
  line-height: 1.55; margin: 0 0 10px;
}
.ai-inf-card-body strong { font-weight: 500; color: var(--color-text-primary, #1B1C1A); }
.ai-inf-card-evidence {
  background: #FBF9F5; border-radius: 8px; padding: 10px 12px;
  display: flex; gap: 10px; align-items: center;
}
.ai-inf-card-evidence i { font-size: 14px; color: var(--color-text-tertiary, #707975); flex-shrink: 0; }
.ai-inf-card-evidence p { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 0; line-height: 1.4; }

/* Build fv (AUDIT-007): per-card action CTAs. Two pills max per card.
   "See trend" only on metric-backed cards; "Ask Arogya AI" on every card. */
.ai-inf-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.ai-inf-cta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  background: #FBF9F5;
  color: #083D36;
  border: 1px solid var(--color-border-tertiary, #E2E8F0);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
}
.ai-inf-cta:hover  { background: #F0EEEA; }
.ai-inf-cta:active { background: #E6E4DF; }
.ai-inf-cta i      { font-size: 13px; color: #083D36; }
.ai-inf-cta i.ti-arrow-right { font-size: 11px; opacity: 0.5; }

/* ── Medications rich cards (p13) ───────────────────────────────────── */
.med-section-h {
  font-size: 12px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 10px;
}
.med-add-btn {
  font-size: 11px; color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  text-decoration: none; flex-shrink: 0;
}
.med-add-btn i { font-size: 13px; }

.med-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 14px; margin-bottom: 9px;
}
.med-card-head { display: flex; gap: 12px; align-items: flex-start; }
.med-card-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.med-card-icon i { font-size: 20px; }
.med-tint-brand   { background: rgba(8,61,54,0.08); }
.med-tint-brand i { color: #083D36; }
.med-tint-amber   { background: rgba(217,119,6,0.08); }
.med-tint-amber i { color: #854F0B; }
.med-tint-purple  { background: rgba(60,52,137,0.08); }
.med-tint-purple i { color: #3C3489; }
.med-tint-blue    { background: #E6F1FB; }
.med-tint-blue i  { color: #0C447C; }
.med-tint-default { background: rgba(8,61,54,0.08); }
.med-tint-default i { color: #083D36; }

.med-card-body { flex: 1; min-width: 0; }
.med-card-name { font-size: 15px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0; }
.med-card-dose { font-size: 12px; color: var(--color-text-secondary, #404945); margin: 3px 0 0; }
.med-card-since { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 2px 0 0; }

.med-card-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.med-badge { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 500; }
.med-badge-active { background: rgba(15,110,86,0.1); color: #0F6E56; }
.med-badge-series { background: rgba(8,61,54,0.06); border: 1px solid rgba(8,61,54,0.15); color: #083D36; }
.med-badge-refill { background: #FAEEDA; border: 1px solid rgba(217,119,6,0.25); color: #854F0B; }

.med-card-foot {
  border-top: 1px solid #F0EEEA; margin-top: 12px; padding-top: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.med-card-foot-label { font-size: 11px; color: var(--color-text-tertiary, #707975); flex: 1; min-width: 0; }
.med-card-foot-action {
  font-size: 11px; color: #083D36; font-weight: 500;
  text-decoration: none; flex-shrink: 0;
}

.med-add-card {
  background: #F5F3EF; border: 1px dashed #BFC9C4; border-radius: 14px;
  padding: 18px; text-align: center; margin-bottom: 9px; cursor: pointer;
}
.med-add-card > i { font-size: 28px; color: #9CA3AF; display: block; margin-bottom: 8px; }
.med-add-card-title { font-size: 13px; font-weight: 500; color: #404945; margin: 0 0 4px; }
.med-add-card-sub { font-size: 12px; color: #9CA3AF; line-height: 1.4; margin: 0; }
.med-add-methods { display: flex; gap: 8px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
.med-add-method {
  font-size: 12px; padding: 7px 16px; border-radius: 999px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  background: transparent; color: #083D36; border: 1px solid #083D36;
}
.med-add-method-primary { background: #083D36; color: #fff; border: none; }
.med-add-method i { font-size: 14px; }

.med-history-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; opacity: 0.72;
}
.med-history-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 11px; color: var(--color-text-tertiary, #707975);
}
.med-history-doctor i { font-size: 11px; }
.med-history-sep { color: var(--color-text-quaternary, #BFC9C4); }
.med-history-date { margin-left: auto; }
.med-history-row {
  display: flex; gap: 10px; align-items: flex-start; padding: 6px 0;
  border-top: 0.5px solid #F0EEEA;
}
.med-history-row:first-of-type { border-top: none; padding-top: 4px; }
.med-history-row-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: #F5F3EF; display: flex; align-items: center; justify-content: center;
}
.med-history-row-icon i { font-size: 14px; color: #9CA3AF; }
.med-history-row-name { font-size: 12px; color: #707975; margin: 0; font-weight: 500; }
.med-history-row-freq { font-size: 11px; color: #9CA3AF; margin: 1px 0 0; }

/* ── Add Sheet 2×2 grid (p16) ─────────────────────────────────────── */
.add-sheet-panel {
  background: #FBF9F5; width: 100%; max-width: 460px;
  border-radius: 28px 28px 0 0; padding: 0 0 22px;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
  max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.add-sheet-handle-row { display: flex; justify-content: center; padding: 10px 0 6px; }
.add-sheet-handle { width: 36px; height: 4px; background: #D5D0C7; border-radius: 999px; }
.add-sheet-head {
  padding: 4px 20px 14px; display: flex;
  justify-content: space-between; align-items: center;
}
.add-sheet-title { font-size: 18px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); }
.add-sheet-subtitle { font-size: 12px; color: var(--color-text-tertiary, #707975); margin-top: 2px; }
.add-sheet-close {
  width: 32px; height: 32px; border-radius: 50%; background: #F0EEEA;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #707975;
}
.add-sheet-close i { font-size: 16px; }
.add-sheet-body { padding: 4px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; }

.add-sheet-context {
  background: rgba(8,61,54,0.06); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.add-sheet-context i { font-size: 16px; color: #083D36; }
.add-sheet-context-text { flex: 1; font-size: 12px; color: var(--color-text-primary, #1B1C1A); }
.add-sheet-context-text strong { font-weight: 500; }
.add-sheet-context-change { font-size: 11px; color: #083D36; font-weight: 500; text-decoration: none; flex-shrink: 0; }

.add-sheet-primary {
  background: #083D36; border-radius: 16px; padding: 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; margin-bottom: 10px; border: none; width: 100%;
  text-align: left; font-family: inherit;
}
.add-sheet-primary-icon {
  width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.add-sheet-primary-icon i { font-size: 26px; color: #fff; }
.add-sheet-primary-text { flex: 1; color: #fff; }
.add-sheet-primary-text h3 { font-size: 16px; font-weight: 500; margin: 0 0 2px; }
.add-sheet-primary-text p { font-size: 12px; color: rgba(255,255,255,0.75); margin: 0; }
.add-sheet-primary-arrow { color: rgba(255,255,255,0.6); font-size: 18px; flex-shrink: 0; }

.add-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-sheet-tile {
  background: #FBF9F5; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  transition: border-color 0.15s; text-decoration: none;
  text-align: left; font-family: inherit;
}
.add-sheet-tile:hover { border-color: #083D36; }
.add-sheet-tile-icon {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(8,61,54,0.08);
  display: flex; align-items: center; justify-content: center;
}
.add-sheet-tile-icon i { font-size: 20px; color: #083D36; }
.add-sheet-tile h4 { font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0; }
.add-sheet-tile p { font-size: 11px; color: var(--color-text-tertiary, #707975); line-height: 1.35; margin: 0; }

.add-sheet-divider {
  font-size: 11px; font-weight: 500; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 18px 0 10px;
}
.add-sheet-row {
  background: #FBF9F5; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 11px 14px;
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  margin-bottom: 6px; text-decoration: none; font-family: inherit;
}
.add-sheet-row-icon {
  width: 30px; height: 30px; border-radius: 8px; background: rgba(8,61,54,0.06);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.add-sheet-row-icon i { font-size: 16px; color: #083D36; }
.add-sheet-row-label { flex: 1; font-size: 13px; color: var(--color-text-primary, #1B1C1A); }
.add-sheet-row-chev { font-size: 14px; color: #BFC9C4; }

/* ── Private dark banner + Personal notes (p33) ────────────────────── */
.priv-banner-dark {
  background: #2C2C2A; margin: 0 0 12px;
  border-radius: 0 0 14px 14px;
  padding: 14px 16px 16px;
}
.priv-banner-dark-inner {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 11px 13px;
  display: flex; gap: 11px; align-items: flex-start;
}
.priv-banner-dark-lock {
  width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.priv-banner-dark-lock i { font-size: 14px; color: #EF9F27; }
.priv-banner-dark-title { font-size: 12px; font-weight: 500; color: #fff; margin: 0 0 2px; }
.priv-banner-dark-sub { font-size: 11px; color: rgba(255,255,255,0.75); line-height: 1.5; margin: 0; }

.priv-notes { padding: 0 14px; margin-bottom: 18px; }
.priv-notes-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 0 10px;
}
.priv-notes-h {
  font-size: 12px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.priv-notes-count {
  font-size: 10px; background: #F0EEEA; color: #707975;
  padding: 2px 7px; border-radius: 999px; font-weight: 500;
}
.priv-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 14px; margin-bottom: 10px; position: relative;
}
.priv-card::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px;
  background: #2C2C2A; border-radius: 14px 0 0 14px;
}
.priv-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.priv-card-type {
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  background: #F0EEEA; color: #707975; font-weight: 500;
}
.priv-card-type-note { background: rgba(60,52,137,0.08); color: #3C3489; }
.priv-card-type-observation { background: rgba(8,61,54,0.08); color: #083D36; }
.priv-card-type-draft { background: #FAEEDA; color: #854F0B; }
.priv-card-date { font-size: 11px; color: #9CA3AF; flex: 1; }
.priv-card-act {
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #707975;
}
.priv-card-act i { font-size: 15px; }
.priv-card-title { font-size: 14px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0 0 5px; }
.priv-card-body { font-size: 12px; color: var(--color-text-secondary, #404945); line-height: 1.55; margin: 0; }
.priv-card-tags { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.priv-card-tag {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: #F5F3EF; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  color: var(--color-text-secondary, #404945); font-weight: 500;
}
.priv-add {
  background: #FBF9F5; border: 1px dashed #BFC9C4; border-radius: 14px;
  padding: 18px; text-align: center; cursor: pointer; margin-bottom: 10px;
  width: 100%; font-family: inherit;
}
.priv-add > i { font-size: 22px; color: #707975; display: block; }
.priv-add-title { font-size: 13px; font-weight: 500; color: #404945; margin: 6px 0 0; }
.priv-add-sub { font-size: 11px; color: #9CA3AF; }

.priv-trackers-h {
  font-size: 12px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 0 14px; margin: 8px 0 10px;
}

/* ── Profile 4-method share footer (p30) ────────────────────────────── */
.profile-share-card {
  background: rgba(8,61,54,0.06); border: 1px solid rgba(8,61,54,0.15);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.profile-share-last {
  font-size: 11px; color: #083D36; margin: 0 0 10px; line-height: 1.5;
}
.profile-share-last i { font-size: 13px; vertical-align: -2px; margin-right: 4px; }
.profile-share-last strong { font-weight: 500; }
.profile-share-last-empty { color: #404945; }

.profile-share-actions { display: flex; gap: 6px; }
.profile-share-btn {
  flex: 1; padding: 9px 4px; border-radius: 8px;
  background: #fff; border: 1px solid rgba(8,61,54,0.2);
  color: #083D36; font-size: 11px; font-weight: 500; cursor: pointer;
  font-family: inherit; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.profile-share-btn:hover { background: rgba(8,61,54,0.04); }
.profile-share-btn i { font-size: 16px; }

/* ══════════════════════════════════════════════════════════════════════════
 * BUILD fl — Closure Prompts (FR-CL-01/02/03) — mockup arogya_sheet_closure_prompt
 * ══════════════════════════════════════════════════════════════════════════ */
.cp-overlay {
  position: fixed; inset: 0; background: rgba(20,20,18,0.55);
  z-index: 910; display: none; align-items: flex-end; justify-content: center;
}
.cp-overlay.open { display: flex; }
.cp-sheet {
  background: #fff; width: 100%; max-width: 460px;
  border-radius: 28px 28px 0 0; padding: 0 0 18px;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.cp-handle-row { display: flex; justify-content: center; padding: 10px 0 6px; }
.cp-handle { width: 36px; height: 4px; background: #D5D0C7; border-radius: 999px; }
.cp-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%; background: #F0EEEA;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #707975;
}
.cp-body { padding: 4px 20px 16px; overflow-y: auto; flex: 1; }

.cp-incident {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; background: #FBF9F5; border-radius: 10px; margin-bottom: 14px;
}
.cp-incident-icon {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(217,119,6,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cp-incident-icon i { font-size: 16px; color: #854F0B; }
.cp-incident-meta { flex: 1; min-width: 0; }
.cp-incident-name { font-size: 13px; font-weight: 500; color: #1B1C1A; margin: 0; }
.cp-incident-detail { font-size: 11px; color: #707975; margin: 1px 0 0; }
.cp-incident-day {
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  background: rgba(217,119,6,0.12); color: #854F0B; font-weight: 600;
  flex-shrink: 0;
}

.cp-greeting { font-size: 12px; color: #707975; margin: 0 0 3px; }
.cp-question { font-size: 16px; font-weight: 500; color: #1B1C1A; line-height: 1.35; margin: 0 0 14px; }

.cp-status-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.cp-status-opt {
  padding: 11px 4px; border-radius: 10px;
  border: 1.5px solid var(--color-border-tertiary, #E2E8F0); background: #fff;
  cursor: pointer; text-align: center; transition: all 0.15s; font-family: inherit;
}
.cp-status-opt:hover { background: rgba(8,61,54,0.04); }
.cp-status-opt .em { font-size: 20px; display: block; line-height: 1; margin-bottom: 4px; }
.cp-status-opt .lbl { font-size: 11px; font-weight: 500; color: #1B1C1A; }
.cp-status-opt.selected { border-color: #0F6E56; background: rgba(15,110,86,0.06); }
.cp-status-opt.selected .lbl { color: #0F6E56; }

.cp-when-block {
  background: rgba(15,110,86,0.05); border: 1px solid rgba(15,110,86,0.2);
  border-radius: 10px; padding: 12px; margin-bottom: 16px; display: none;
}
.cp-when-block.show { display: block; }
.cp-when-title { font-size: 12px; font-weight: 500; color: #0F6E56; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.cp-when-title i { font-size: 14px; }
.cp-when-options { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.cp-when-opt {
  padding: 8px; border-radius: 8px; border: 1px solid rgba(15,110,86,0.2);
  background: #fff; font-size: 12px; color: #1B1C1A; cursor: pointer;
  text-align: center; font-family: inherit; font-weight: 500;
}
.cp-when-opt:hover { border-color: #0F6E56; }
.cp-when-opt.selected { background: #0F6E56; color: #fff; border-color: #0F6E56; }
.cp-when-help {
  font-size: 10px; color: #404945; margin: 8px 0 0;
  line-height: 1.5; font-style: italic;
}

.cp-add-section { margin-bottom: 14px; }
.cp-add-sh {
  font-size: 11px; font-weight: 500; color: #707975;
  text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px;
}
.cp-add-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.cp-add-btn {
  padding: 11px 6px; border-radius: 10px;
  border: 1px dashed #BFC9C4; background: #FBF9F5; cursor: pointer;
  text-align: center; font-family: inherit; text-decoration: none;
}
.cp-add-btn:hover { border-color: #083D36; background: rgba(8,61,54,0.04); }
.cp-add-btn i { font-size: 18px; color: #707975; display: block; margin-bottom: 4px; }
.cp-add-btn span { font-size: 10px; color: #404945; font-weight: 500; line-height: 1.2; display: block; }

.cp-why-helps {
  background: rgba(60,52,137,0.05); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 12px; display: flex; gap: 9px; align-items: flex-start;
}
.cp-why-helps > i { font-size: 14px; color: #3C3489; flex-shrink: 0; margin-top: 1px; }
.cp-why-title { font-size: 11px; font-weight: 500; color: #3C3489; margin: 0 0 4px; }
.cp-why-items { font-size: 11px; color: #404945; line-height: 1.5; margin: 0; padding: 0; list-style: none; }
.cp-why-items li { padding-left: 11px; position: relative; }
.cp-why-items li::before { content: '•'; position: absolute; left: 2px; color: #3C3489; }
.cp-why-items em { color: #3C3489; font-style: italic; }

.cp-footer {
  display: flex; gap: 8px; padding-top: 10px;
  border-top: 1px solid #F0EEEA; margin-top: 6px;
}
.cp-snooze {
  background: transparent; border: none; color: #707975;
  padding: 11px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.cp-submit {
  flex: 1; padding: 11px; border-radius: 999px; background: #083D36;
  color: #fff; border: none; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.cp-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Command Centre — pending closure prompts (build fl) */
.cc-closure-prompts { margin: 0 0 14px; padding: 0 14px; }
.cc-cp-h { font-size: 12px; font-weight: 500; color: #854F0B; text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 8px; }
.cc-cp-card {
  background: #fff; border: 1px solid rgba(217,119,6,0.25);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  text-decoration: none;
}
.cc-cp-card-icon {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(217,119,6,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cc-cp-card-icon i { font-size: 16px; color: #854F0B; }
.cc-cp-card-meta { flex: 1; min-width: 0; }
.cc-cp-card-title { font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0; }
.cc-cp-card-sub { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 2px 0 0; }
.cc-cp-card-arrow { color: #BFC9C4; font-size: 16px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
 * BUILD fm — Insurance Coverage Analysis (F-FM-01..12)
 * Mockup: design/mockups/arogya_mockup_insurance_analysis.html
 * ══════════════════════════════════════════════════════════════════════════ */

/* Top-bar Re-analyse button */
.ia-refresh-btn {
  font-size: 11px; color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: inherit;
}
.ia-refresh-btn:hover { background: rgba(255,255,255,0.22); }
.ia-refresh-btn i { font-size: 13px; }

/* Hero policy card */
.ia-hero { padding: 12px 14px 0; }
.ia-hero-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 14px;
  display: flex; align-items: center; gap: 13px; margin-bottom: 10px;
}
.ia-hero-mark {
  width: 44px; height: 44px; border-radius: 11px;
  background: rgba(8,61,54,0.08); color: #083D36;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.ia-hero-meta { flex: 1; min-width: 0; }
.ia-hero-name { font-size: 14px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0 0 3px; line-height: 1.3; }
.ia-hero-sub { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 0; line-height: 1.4; }
.ia-renewal-pill {
  font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: rgba(217,119,6,0.12); color: #854F0B; font-weight: 500;
}

/* Score strip */
.ia-score-strip {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.ia-score-cell { text-align: center; }
.ia-score-num { font-size: 24px; font-weight: 600; line-height: 1; margin-bottom: 3px; }
.ia-score-covered { color: #0F6E56; }
.ia-score-partial { color: #854F0B; }
.ia-score-not     { color: #DC2626; }
.ia-score-lbl { font-size: 10px; color: var(--color-text-tertiary, #707975); text-transform: uppercase; letter-spacing: 0.3px; }

/* PED bar */
.ia-ped-bar {
  background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.2);
  border-radius: 10px; padding: 10px 13px;
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; color: #854F0B; margin-bottom: 14px;
}
.ia-ped-bar i { font-size: 14px; }
.ia-ped-bar strong { font-weight: 500; }

/* Member sections */
.ia-member-section { padding: 0 14px 6px; margin-bottom: 18px; }
.ia-member-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 14px; border-bottom: 1px solid #F0EEEA; margin-bottom: 12px;
}
.ia-member-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #083D36;
  color: #fff; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ia-member-name { font-size: 14px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0; }
.ia-member-age { font-size: 11px; color: var(--color-text-tertiary, #707975); font-weight: 400; }
.ia-member-sub { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 2px 0 0; }

/* Section headers */
.ia-sh {
  font-size: 12px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 14px 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.ia-sh i { font-size: 13px; }

/* Condition / medication / age row */
.ia-cond-row {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 12px 13px; margin-bottom: 8px;
  border-left: 3px solid #E2E8F0;
}
.ia-cond-row.ia-verdict-covered     { border-left-color: #0F6E56; }
.ia-cond-row.ia-verdict-partial     { border-left-color: #854F0B; }
.ia-cond-row.ia-verdict-waiting     { border-left-color: #0C447C; }
.ia-cond-row.ia-verdict-not_covered { border-left-color: #DC2626; }
.ia-cond-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.ia-cond-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); }
.ia-cond-note { font-size: 11px; color: var(--color-text-secondary, #404945); line-height: 1.5; margin: 0; }
.ia-cond-note strong { font-weight: 500; }
.ia-cond-clause {
  font-size: 10px; color: #3C3489; text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 6px;
}

/* Verdict pill */
.ia-verdict { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 500; flex-shrink: 0; }
.ia-verdict-pill-covered     { background: rgba(15,110,86,0.1);  color: #0F6E56; }
.ia-verdict-pill-partial     { background: rgba(217,119,6,0.1);  color: #854F0B; }
.ia-verdict-pill-waiting     { background: rgba(12,68,124,0.1);  color: #0C447C; }
.ia-verdict-pill-not_covered { background: rgba(220,38,38,0.1);  color: #DC2626; }

/* Age-relevant block */
.ia-age-block {
  background: rgba(60,52,137,0.04); border: 1px solid rgba(60,52,137,0.12);
  border-radius: 12px; padding: 12px; margin-bottom: 12px;
}
.ia-age-explain {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11px; color: #3C3489; line-height: 1.5;
  padding-bottom: 10px; border-bottom: 1px solid rgba(60,52,137,0.15);
  margin-bottom: 10px;
}
.ia-age-explain i { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.ia-age-row {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 10px; padding: 11px 12px; margin-bottom: 8px;
  border-left: 3px solid #E2E8F0;
}
.ia-age-row.ia-verdict-covered     { border-left-color: #0F6E56; }
.ia-age-row.ia-verdict-partial     { border-left-color: #854F0B; }
.ia-age-row.ia-verdict-waiting     { border-left-color: #0C447C; }
.ia-age-row.ia-verdict-not_covered { border-left-color: #DC2626; }
.ia-age-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.ia-age-row-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); }
.ia-age-prev { font-size: 11px; color: var(--color-text-secondary, #404945); line-height: 1.5; margin: 0 0 6px; }
.ia-age-rel  { font-size: 11px; color: var(--color-text-secondary, #404945); line-height: 1.5; margin: 0 0 6px; }
.ia-age-rel strong { font-weight: 500; color: #3C3489; }
.ia-age-checks {
  font-size: 11px; color: var(--color-text-tertiary, #707975);
  margin: 6px 0;
}
.ia-age-checks summary { cursor: pointer; color: #3C3489; padding: 4px 0; }
.ia-age-checks ul { padding-left: 20px; margin: 4px 0 6px; line-height: 1.5; }
.ia-age-checks li { font-size: 11px; }
.ia-age-ayush {
  font-size: 11px; color: #0F6E56; line-height: 1.5; margin: 6px 0;
  background: rgba(15,110,86,0.06); padding: 6px 9px; border-radius: 6px;
  display: flex; gap: 6px; align-items: flex-start;
}
.ia-age-ayush i { font-size: 12px; flex-shrink: 0; margin-top: 2px; }
.ia-age-source { font-size: 10px; color: var(--color-text-quaternary, #9CA3AF); margin: 6px 0 0; }
.ia-age-source a { color: #3C3489; text-decoration: none; }
.ia-age-source a:hover { text-decoration: underline; }

/* Recommendations */
.ia-recs { padding: 0 14px; margin-bottom: 20px; }
.ia-rec-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 13px;
  display: flex; gap: 12px; margin-bottom: 8px;
}
.ia-rec-num {
  width: 28px; height: 28px; border-radius: 50%; background: #083D36;
  color: #fff; font-weight: 500; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ia-rec-text { flex: 1; }
.ia-rec-title { font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0 0 4px; }
.ia-rec-detail { font-size: 12px; color: var(--color-text-secondary, #404945); line-height: 1.55; margin: 0; }
.ia-rec-members { font-size: 10px; color: var(--color-text-tertiary, #707975); margin: 6px 0 0; font-style: italic; }

/* Compare CTA */
.ia-compare-cta { padding: 0 14px; margin-bottom: 16px; }
.ia-compare-link {
  display: flex; align-items: center; gap: 9px;
  background: rgba(60,52,137,0.06); border-radius: 10px;
  padding: 11px 14px; font-size: 13px; color: #3C3489;
  font-weight: 500; text-decoration: none;
}
.ia-compare-link:hover { background: rgba(60,52,137,0.1); }
.ia-compare-link i { font-size: 15px; }

/* Disclaimer */
.ia-disclaimer {
  margin: 14px;
  background: #FBF9F5; border-radius: 10px; padding: 10px 13px;
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 11px; color: var(--color-text-tertiary, #707975); line-height: 1.5;
}
.ia-disclaimer i { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

/* Compare view */
.ia-cmp-intro { font-size: 13px; color: var(--color-text-secondary, #404945); margin: 0 0 16px; line-height: 1.5; }
.ia-cmp-policies {
  display: grid; grid-auto-columns: minmax(140px, 1fr); grid-auto-flow: column;
  gap: 8px; margin-bottom: 12px; overflow-x: auto;
}
.ia-cmp-policy-cell {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 10px; padding: 11px; text-align: center;
}
.ia-cmp-policy-cell-head { background: transparent; border: none; padding: 11px 0; font-size: 11px; color: var(--color-text-tertiary, #707975); text-align: left; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.ia-cmp-policy-mark { width: 32px; height: 32px; border-radius: 8px; background: rgba(8,61,54,0.08); color: #083D36; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; margin-bottom: 5px; }
.ia-cmp-policy-name { font-size: 11px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); line-height: 1.3; margin: 0; }
.ia-cmp-policy-si   { font-size: 10px; color: var(--color-text-tertiary, #707975); margin-top: 2px; }
.ia-cmp-policy-score { font-size: 10px; color: var(--color-text-secondary, #404945); margin-top: 4px; display: flex; justify-content: center; gap: 6px; }
.ia-cmp-policy-link { font-size: 10px; color: #083D36; text-decoration: none; display: block; margin-top: 6px; }
.ia-cmp-row { display: grid; grid-auto-columns: minmax(140px, 1fr); grid-auto-flow: column; gap: 8px; margin-bottom: 6px; align-items: center; }
.ia-cmp-cond-cell { font-size: 12px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); padding: 8px 0; }
.ia-cmp-verdict-cell { background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0); border-radius: 8px; padding: 8px; text-align: center; }

/* Build fx (AUDIT-021): "What we'd suggest" block on /insurance/compare.
   Per AD-103 only renders when compare_policies returns ≥1 suggestion. */
.ia-cmp-suggest { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--color-border-tertiary, #E2E8F0); }
.ia-cmp-suggest-title {
  font-size: 12px; font-weight: 600; color: var(--color-text-primary, #1B1C1A);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 12px;
  display: flex; align-items: center; gap: 6px;
}
.ia-cmp-suggest-title i { font-size: 14px; color: #B45309; }
.ia-cmp-suggest-card {
  background: #fff; border: 0.5px solid var(--color-border-tertiary, #E2E8F0);
  border-left: 3px solid #B45309;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
}
.ia-cmp-suggest-strongest { border-left-color: #3B6D11; }
.ia-cmp-suggest-gap       { border-left-color: #C2410C; }
.ia-cmp-suggest-dominated { border-left-color: #6B7280; }
.ia-cmp-suggest-card-title { font-size: 12px; font-weight: 600; margin: 0 0 4px; color: var(--color-text-primary, #1B1C1A); }
.ia-cmp-suggest-card-body  { font-size: 12px; line-height: 1.5; margin: 0; color: var(--color-text-secondary, #404945); }

/* Family Home command-centre insurance section */
.cc-insurance { margin: 0 0 14px; padding: 0 14px; }
.cc-ia-h { font-size: 12px; font-weight: 500; color: #3C3489; text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 8px; }
.cc-ia-card {
  background: #fff; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  text-decoration: none;
}
.cc-ia-renewal      { border-color: rgba(217,119,6,0.25); }
.cc-ia-coverage_gap { border-color: rgba(60,52,137,0.25); }
.cc-ia-card-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(60,52,137,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cc-ia-renewal .cc-ia-card-icon { background: rgba(217,119,6,0.12); }
.cc-ia-renewal .cc-ia-card-icon i { color: #854F0B; }
.cc-ia-card-icon i { font-size: 16px; color: #3C3489; }
.cc-ia-card-meta { flex: 1; min-width: 0; }
.cc-ia-card-title { font-size: 13px; font-weight: 500; color: var(--color-text-primary, #1B1C1A); margin: 0; }
.cc-ia-card-sub { font-size: 11px; color: var(--color-text-tertiary, #707975); margin: 2px 0 0; }
.cc-ia-card-arrow { color: #BFC9C4; font-size: 16px; flex-shrink: 0; }

/* Policy card "View coverage analysis" CTA row */
.ins-policy-cta-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin: 10px -14px -14px;
  border-top: 1px solid #F0EEEA;
  background: rgba(8,61,54,0.04);
  border-radius: 0 0 14px 14px;
  font-size: 12px; font-weight: 500; color: #083D36;
  cursor: pointer;
}
.ins-policy-cta-row i:first-child { font-size: 14px; }
.ins-policy-cta-row:hover { background: rgba(8,61,54,0.07); }

/* ══════════════════════════════════════════════════════════════════════════
 * BUILD fo — Single-Metric Trending sheet (F-FO-01 through F-FO-14)
 * Mockup: design/mockups/arogya_sheet_comparison.html (misleading filename,
 * but it IS the single-metric trending mockup)
 * ══════════════════════════════════════════════════════════════════════════ */

/* Overlay & sheet shell */
.mt-overlay {
  position: fixed; inset: 0; background: rgba(20,20,18,0.55);
  z-index: 920; display: flex; align-items: flex-end; justify-content: center;
}
.mt-sheet {
  background: #fff; width: 100%; max-width: 460px;
  border-radius: 28px 28px 0 0; padding: 0 0 8px;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
  max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column;
}
@media (min-width: 768px) {
  .mt-sheet { border-radius: 16px; margin-bottom: 16px; }
}

.mt-handle-row { display: flex; justify-content: center; padding: 10px 0 4px; }
.mt-handle { width: 36px; height: 4px; background: #D5D0C7; border-radius: 999px; }

.mt-head {
  padding: 8px 20px 14px; display: flex; align-items: center; gap: 10px;
}
.mt-head h2 {
  flex: 1; font-size: 17px; font-weight: 500;
  color: var(--color-text-primary, #1B1C1A); line-height: 1.3; margin: 0;
}
.mt-sub {
  display: block; font-size: 12px; color: var(--color-text-tertiary, #707975);
  font-weight: 400; margin-top: 2px;
}
.mt-close {
  width: 32px; height: 32px; border-radius: 50%; background: #F0EEEA;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #707975; flex-shrink: 0;
}
.mt-close i { font-size: 16px; }

/* Range chips */
.mt-range-chips { display: flex; gap: 6px; padding: 0 20px 12px; }
.mt-range-chip {
  font-size: 11px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--color-border-tertiary, #E2E8F0); background: #fff;
  color: var(--color-text-primary, #1B1C1A); cursor: pointer;
  font-weight: 500; font-family: inherit;
}
.mt-range-chip:hover { background: rgba(8,61,54,0.04); }
.mt-range-chip-active { background: #083D36; color: #fff; border-color: #083D36; }

/* Body (scrollable) */
.mt-body { padding: 0 20px 16px; overflow-y: auto; flex: 1; }

/* Chart card */
.mt-chart-card {
  background: #FBF9F5; border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.mt-chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.mt-chart-stat .mt-stat-val-wrap { display: flex; align-items: baseline; gap: 3px; line-height: 1; }
.mt-stat-val { font-size: 28px; font-weight: 500; color: #0F6E56; line-height: 1; }
.mt-stat-unit { font-size: 14px; color: var(--color-text-tertiary, #707975); }
.mt-stat-date { font-size: 11px; color: var(--color-text-tertiary, #707975); margin-top: 4px; }
.mt-chart-meta { text-align: right; }
.mt-trend-summary { font-size: 12px; color: #0F6E56; font-weight: 500; }
.mt-span { font-size: 11px; color: var(--color-text-tertiary, #707975); margin-top: 2px; }

.mt-svg-wrap { width: 100%; }
.mt-svg { width: 100%; height: 140px; display: block; }

/* Section headers inside sheet body */
.mt-section { margin-bottom: 14px; }
.mt-sh {
  font-size: 11px; font-weight: 500; color: var(--color-text-tertiary, #707975);
  text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 8px;
}

/* All-readings table */
.mt-readings-list { display: flex; flex-direction: column; gap: 6px; }
.mt-reading-row {
  display: grid;
  grid-template-columns: 64px 70px 1fr 46px;
  align-items: center; gap: 8px;
  padding: 9px 11px; background: #fff;
  border: 1px solid var(--color-border-tertiary, #E2E8F0);
  border-radius: 10px;
}
.mt-reading-date { font-size: 11px; color: var(--color-text-tertiary, #707975); }
.mt-reading-val { font-size: 14px; font-weight: 500; }
.mt-reading-unit { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary, #707975); }
.mt-reading-bar-wrap {
  height: 6px; background: #F0EEEA; border-radius: 999px; overflow: hidden;
}
.mt-reading-bar { height: 100%; border-radius: 999px; transition: width 0.3s; }
.mt-reading-source { font-size: 10px; color: var(--color-text-quaternary, #9CA3AF); text-align: right; }
.mt-empty {
  font-size: 12px; color: var(--color-text-tertiary, #707975);
  font-style: italic; padding: 14px 6px; text-align: center;
}

/* Insight card */
.mt-insight-card {
  background: rgba(60,52,137,0.06); border: 1px solid rgba(60,52,137,0.15);
  border-radius: 12px; padding: 12px 14px;
  display: flex; gap: 9px; align-items: flex-start;
}
.mt-insight-card > i { font-size: 16px; color: #3C3489; flex-shrink: 0; margin-top: 1px; }
.mt-insight { font-size: 12px; color: var(--color-text-primary, #1B1C1A); line-height: 1.55; margin: 0; }
.mt-insight strong { font-weight: 500; }

/* Clinical context (collapsible) */
.mt-clinical { background: #FBF9F5; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.mt-clinical summary {
  font-size: 12px; color: #083D36; font-weight: 500; cursor: pointer;
  list-style: none; display: flex; align-items: center; gap: 7px;
  padding: 4px 0;
}
.mt-clinical summary::-webkit-details-marker { display: none; }
.mt-clinical summary i { font-size: 13px; }
.mt-clinical-body { padding: 10px 0 4px; }
.mt-clinical-p { font-size: 12px; color: var(--color-text-secondary, #404945); line-height: 1.6; margin: 0 0 8px; }
.mt-clinical-india { background: #fff; padding: 8px 10px; border-radius: 8px; border-left: 3px solid #083D36; }
.mt-clinical-doctor { background: rgba(217,119,6,0.06); padding: 8px 10px; border-radius: 8px; border-left: 3px solid #D97706; }

/* Footer */
.mt-footer {
  display: flex; gap: 8px; padding: 12px 20px;
  border-top: 1px solid #F0EEEA;
  background: #fff;
}
.mt-btn {
  flex: 1; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.mt-btn i { font-size: 14px; }
.mt-btn-out { background: #fff; border: 1px solid var(--color-border-secondary, #C9C5BC); color: var(--color-text-primary, #1B1C1A); }
.mt-btn-out:hover { background: #FBF9F5; }
.mt-btn-pri { background: #083D36; border: none; color: #fff; }
.mt-btn-pri:hover { background: #0a4942; }
