/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Logo blue #29abe2 — medical palette built around it */
  --brand:        #0b5f8a;
  --brand-light:  #29abe2;
  --brand-dark:   #0a3d5c;
  --brand-pale:   #e8f6fd;
  --accent:       #29abe2;
  --accent-light: #6cc7ef;
  --text-primary: #0f2537;
  --text-secondary: #46617a;
  --text-muted:   #7d93a8;
  --bg-page:      #f2f8fc;
  --bg-card:      #ffffff;
  --bg-input:     #ffffff;
  --border:       #dcebf5;
  --border-focus: #29abe2;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 3px rgba(10,61,92,.06), 0 1px 2px rgba(10,61,92,.04);
  --shadow-md:    0 6px 20px rgba(10,61,92,.10);
  --shadow-lg:    0 12px 36px rgba(10,61,92,.14);
  --green:        #0f7b5e;
  --green-bg:     #e6f7f2;
  --amber:        #b45309;
  --amber-bg:     #fef3cd;
  --red:          #b91c1c;
  --red-bg:       #fce8e8;
  --gray:         #6b7280;
  --gray-bg:      #f3f4f6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(41,171,226,.07), transparent 60%),
    radial-gradient(900px 400px at -10% 30%, rgba(11,95,138,.05), transparent 55%),
    var(--bg-page);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Lobby ── */
#lobby-screen {
  min-height: 100vh;
  background: linear-gradient(150deg, #0a3d5c 0%, #0b5f8a 45%, #29abe2 100%);
  display: flex;
  flex-direction: column;
}

.lobby-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
}

.lobby-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-nav-icon { font-size: 1.6rem; }

.lobby-nav-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.lobby-nav-img {
  height: 70px;
  width: auto;
}

.login-logo-img {
  width: 100px;
  height: auto;
  margin: 0 auto 0.5rem;
  display: block;
}

.lobby-signin-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}
.lobby-signin-btn:hover { background: rgba(255,255,255,0.28); }

.lobby-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 2rem;
  text-align: center;
}

.lobby-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.lobby-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.lobby-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.lobby-cta-btn {
  background: #fff;
  color: var(--brand);
  border: none;
  padding: 13px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.lobby-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

.lobby-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.lobby-feature {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem;
  text-align: center;
  backdrop-filter: blur(6px);
}

.lobby-feature-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }
.lobby-feature-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 0.4rem; }
.lobby-feature-desc { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.5; }

/* ── Login Modal ── */
#login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.login-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Login Screen (inside modal) ── */
#login-screen, #new-password-screen { display: block; background: none; padding: 0; min-height: unset; }

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-mark {
  width: 56px;
  height: 56px;
  background: var(--brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 26px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: border-color .15s;
}

.form-group input:focus {
  border-color: var(--border-focus);
}

#login-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background .15s;
}

#login-btn:hover:not(:disabled) { background: var(--brand-light); }
#login-btn:disabled { opacity: .6; cursor: not-allowed; }

.login-msg {
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

#login-error {
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

/* ── Auth tabs ── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 9px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
  background: var(--brand);
  color: #fff;
}
.auth-tab:not(.active):hover { background: var(--bg-hover); }

#register-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 4px;
}
#register-btn:hover:not(:disabled) { background: var(--brand-light); }
#register-btn:disabled { opacity: .6; cursor: not-allowed; }

#reset-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 4px;
}
#reset-btn:hover:not(:disabled) { background: var(--brand-light); }
#reset-btn:disabled { opacity: .6; cursor: not-allowed; }

#new-password-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 4px;
}
#new-password-btn:hover:not(:disabled) { background: var(--brand-light); }
#new-password-btn:disabled { opacity: .6; cursor: not-allowed; }

.forgot-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.forgot-link:hover { color: var(--brand); }

/* ── Portal Screen ── */
#portal-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ── */
.portal-topbar {
  background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand) 60%, #1a7fb5 100%);
  color: #fff;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(10,61,92,.25);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  font-size: 20px;
}

.topbar-logo-img {
  height: 40px;
  width: auto;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  font-size: 13px;
  opacity: .85;
}

.topbar-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}

.topbar-btn:hover { background: rgba(255,255,255,.25); }

/* ── Nav ── */
.portal-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  flex-shrink: 0;
}

.nav-tab {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}

.nav-tab:hover { color: var(--brand); background: var(--brand-pale); }
.nav-tab.active { color: var(--brand); border-bottom-color: var(--brand-light); }

/* ── Portal Body ── */
.portal-body {
  flex: 1;
  padding: 1.75rem 1.5rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.portal-section { display: none; }
.portal-section.active { display: block; }

.section-header {
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  padding-left: 14px;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow .2s;
}
.section-card:hover { box-shadow: var(--shadow-lg); }

.section-header h2 { position: relative; padding-left: 14px; }
.section-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
}

.section-loading {
  display: none;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 1rem 0;
}

.section-content {
  transition: opacity .2s;
}

.empty-state {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.data-error {
  font-size: 13px;
  color: var(--red);
  background: var(--red-bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.error-hint {
  opacity: .7;
  font-style: italic;
}

/* ── Journey ── */
.journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.journey-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.stage-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-page);
  flex-shrink: 0;
}

.stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.stage-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.stage-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--brand-pale);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 20px;
}

.stage-check {
  font-size: 13px;
  color: var(--accent);
}

.stage-connector {
  width: 2px;
  height: 14px;
  background: var(--border);
  margin-left: 8px;
}

.journey-stage.stage-done .stage-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.journey-stage.stage-done .stage-name { color: var(--text-primary); }

.journey-stage.stage-active .stage-dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-pale);
}

.journey-stage.stage-active .stage-name {
  font-weight: 600;
  color: var(--brand);
}

.journey-notes {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.milestone-item {
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.milestone-item:last-child { border-bottom: none; }
.milestone-item p { color: var(--text-secondary); margin-top: 3px; font-size: 13px; }

/* ── Journey reimagined ── */
.jrn-profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
  margin-bottom: 1rem; position: relative;
}

.jrn-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.2); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.jrn-profile-info { flex: 1; min-width: 0; }
.jrn-name  { font-size: 18px; font-weight: 600; margin-bottom: 5px; }
.jrn-badges{ display: flex; flex-wrap: wrap; gap: 5px; }
.jrn-badge { font-size: 11px; font-weight: 600; background: rgba(255,255,255,.18); padding: 2px 9px; border-radius: 20px; }
.jrn-tz    { font-size: 12px; opacity: .7; margin-top: 5px; }

.jrn-priority { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; flex-shrink: 0; }
.jrn-priority-normal { background: rgba(255,255,255,.15); color: #fff; }
.jrn-priority-high   { background: #fce8e8; color: #b91c1c; }

.jrn-facts-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 1.25rem;
}
.jrn-fact { background: var(--bg-page); border-radius: var(--radius-md); padding: 10px 14px; }
.jrn-fact-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.jrn-fact-val   { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.jrn-warn       { color: var(--amber) !important; }
.jrn-stage-val  { color: var(--brand); }

.jrn-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px;
}

/* ══ Journey — landing-page redesign (jhx) ══ */
/* Neutralize the outer section-card so the hero can go full-bleed */
#section-journey .section-card {
  padding: 0; background: transparent; border: none; box-shadow: none;
}
#section-journey .section-card:hover { box-shadow: none; }

/* Hero */
.jhx-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: linear-gradient(125deg, var(--brand-dark) 0%, var(--brand) 55%, #1a7fb5 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.9rem;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: jhxFade .5s ease both;
}
.jhx-hero-glow {
  position: absolute;
  top: -60%; right: -10%;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(41,171,226,.55), transparent 65%);
  pointer-events: none;
}
.jhx-hero-main { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.jhx-avatar {
  width: 62px; height: 62px; border-radius: 18px; flex-shrink: 0;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
  backdrop-filter: blur(4px);
}
.jhx-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; opacity: .75; margin-bottom: 4px;
}
.jhx-name { font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; }
.jhx-stage {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 9px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.16); padding: 5px 13px; border-radius: 999px;
}
.jhx-stage-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7;
  box-shadow: 0 0 0 0 rgba(110,231,183,.7); animation: jhxPulse 2s infinite;
}

/* Progress ring */
.jhx-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; z-index: 1; }
.jhx-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.jhx-ring-bg { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 9; }
.jhx-ring-fg {
  fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset 1.3s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 6px rgba(255,255,255,.5));
}
.jhx-ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.jhx-ring-pct { font-size: 27px; font-weight: 800; line-height: 1; }
.jhx-ring-pct span { font-size: 14px; font-weight: 600; opacity: .8; }
.jhx-ring-sub { font-size: 11px; opacity: .75; margin-top: 3px; }

/* Program chips */
.jhx-chips {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 14px;
  animation: jhxFade .5s ease .1s both;
}
.jhx-chip {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 14px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.jhx-chip:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: var(--brand-light);
}
.jhx-chip-ic {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-pale); border-radius: 11px;
  color: var(--brand);
}
.jhx-chip-ic svg { width: 20px; height: 20px; }
.jhx-chip-body { display: flex; flex-direction: column; min-width: 0; }
.jhx-chip-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.jhx-chip-val { font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Up-next callout */
.jhx-next {
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; padding: 14px 16px;
  background: linear-gradient(100deg, var(--brand-pale), #fff);
  border: 1px solid var(--border); border-left: 4px solid var(--brand-light);
  border-radius: var(--radius-md);
  animation: jhxFade .5s ease .15s both;
  transition: transform .18s, box-shadow .18s;
}
.jhx-next:hover { transform: translateX(3px); box-shadow: var(--shadow-md); }
.jhx-next-ic {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-sm);
  color: var(--brand);
}
.jhx-next-ic svg { width: 22px; height: 22px; }
.jhx-next-complete .jhx-next-ic { color: var(--green); }
.jhx-next-body { flex: 1; }
.jhx-next-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 700; }
.jhx-next-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }
.jhx-next-arrow { font-size: 20px; color: var(--brand-light); font-weight: 700; }
.jhx-next-complete { background: linear-gradient(100deg, var(--green-bg), #fff); border-left-color: var(--green); }
.jhx-next-complete .jhx-next-label { color: var(--green); }

/* Interactive milestone timeline */
.jhx-timeline-head {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin: 1.75rem 0 .25rem; padding-left: 2px;
}
.jhx-timeline-head span { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.jhx-timeline { position: relative; margin-top: 1rem; }

.jhx-ms {
  position: relative; display: flex; gap: 16px;
  padding: 0 0 22px 0; cursor: pointer;
  animation: jhxSlide .45s ease both;
  animation-delay: calc(.06s * var(--i) + .2s);
}
.jhx-ms:last-child { padding-bottom: 0; }
/* connector line */
.jhx-ms-line {
  position: absolute; left: 21px; top: 42px; bottom: -4px; width: 2.5px;
  background: var(--border); border-radius: 2px;
}
.jhx-ms:last-child .jhx-ms-line { display: none; }
.jhx-done .jhx-ms-line { background: linear-gradient(var(--brand-light), var(--brand-light)); }

.jhx-ms-node {
  position: relative; z-index: 1; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: transform .18s, border-color .18s, box-shadow .18s, color .18s;
}
.jhx-ms-ic { line-height: 0; }
.jhx-ms-ic svg { width: 20px; height: 20px; }
.jhx-done .jhx-ms-node { border-color: var(--brand-light); background: var(--brand-pale); color: var(--brand); }
.jhx-current .jhx-ms-node {
  border-color: var(--brand-light);
  color: var(--brand);
  box-shadow: 0 0 0 5px rgba(41,171,226,.16);
  animation: jhxNodePulse 2s infinite;
}
.jhx-upcoming .jhx-ms-node { opacity: .7; }
.jhx-ms:hover .jhx-ms-node { transform: scale(1.08); }

.jhx-ms-content { flex: 1; padding-top: 3px; min-width: 0; }
.jhx-ms-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jhx-ms-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.jhx-upcoming .jhx-ms-title { color: var(--text-muted); }
.jhx-ms-tag {
  font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--gray-bg); color: var(--text-secondary);
}
.jhx-done .jhx-ms-tag { background: var(--brand-pale); color: var(--brand); }
.jhx-current .jhx-ms-tag { background: var(--amber-bg); color: var(--amber); }
.jhx-ms-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
  margin-top: 4px; max-height: 0; overflow: hidden;
  opacity: 0; transition: max-height .28s ease, opacity .28s ease, margin-top .28s ease;
}
.jhx-ms.open .jhx-ms-desc { max-height: 70px; opacity: 1; }
.jhx-current .jhx-ms-desc { max-height: 70px; opacity: 1; } /* current auto-expanded */

@keyframes jhxFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes jhxSlide { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes jhxPulse { 0% { box-shadow: 0 0 0 0 rgba(110,231,183,.7); } 70% { box-shadow: 0 0 0 8px rgba(110,231,183,0); } 100% { box-shadow: 0 0 0 0 rgba(110,231,183,0); } }
@keyframes jhxNodePulse { 0% { box-shadow: 0 0 0 3px rgba(41,171,226,.22); } 70% { box-shadow: 0 0 0 9px rgba(41,171,226,0); } 100% { box-shadow: 0 0 0 3px rgba(41,171,226,0); } }

@media (max-width: 600px) {
  .jhx-hero { justify-content: center; text-align: center; }
  .jhx-hero-main { flex-direction: column; text-align: center; }
}

/* Journey fields grid — exact Monday columns shown to the client */
.jf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.jf-item {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.jf-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-bottom: 5px;
}
.jf-val { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.jf-done     { color: var(--green); }
.jf-warn     { color: var(--red); }
.jf-progress { color: var(--amber); }
.jf-empty    { color: var(--text-muted); font-weight: 500; }

/* Milestone checklist */
.ms-grid { display: flex; flex-direction: column; gap: 0; }
.ms-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.ms-item:last-child { border-bottom: none; }
.ms-icon  { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.ms-label { flex: 1; font-size: 13px; color: var(--text-secondary); }
.ms-val   { font-size: 12px; font-weight: 500; }

.ms-done .ms-icon { background: var(--green-bg); color: var(--green); }
.ms-done .ms-val  { color: var(--green); }
.ms-warn .ms-icon { background: var(--amber-bg); color: var(--amber); }
.ms-warn .ms-val  { color: var(--amber); }
.ms-pending .ms-icon { background: var(--bg-page); color: var(--text-muted); border: 1px solid var(--border); }
.ms-pending .ms-val  { color: var(--text-muted); }

/* ── Documents ── */
.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.doc-item:last-child { border-bottom: none; }

.doc-icon { font-size: 20px; flex-shrink: 0; }

.doc-info { flex: 1; min-width: 0; }

.doc-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.doc-status {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-signed, .status-complete, .status-approved {
  background: var(--green-bg);
  color: var(--green);
}

.status-pending, .status-review {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-rejected { background: var(--red-bg); color: var(--red); }

.doc-link {
  font-size: 13px;
  color: var(--brand-light);
  text-decoration: none;
  white-space: nowrap;
}

.doc-link:hover { text-decoration: underline; }

/* ── Calendar ── */
.cal-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 1.25rem 0 .75rem;
}

.cal-section-label:first-child { margin-top: 0; }

.cal-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cal-item:last-child { border-bottom: none; }

.cal-date-block {
  width: 44px;
  flex-shrink: 0;
  text-align: center;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 5px 4px;
}

.cal-month { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--brand); }
.cal-day { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.cal-nodate { font-size: 11px; color: var(--text-muted); padding: 6px 0; }

.cal-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.cal-loc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.cal-note { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.past-appointments {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.past-appointments summary {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}

.past-appointments summary:hover { color: var(--text-secondary); }

/* ── Matching ── */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.match-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f2f8fc 0%, #e8f6fd 100%);
}

.match-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.match-name-block { flex: 1; }
.match-name       { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.match-location   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.match-status-badge {
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
}
.match-status-approved  { background: var(--green-bg);  color: var(--green); }
.match-status-screening { background: var(--amber-bg);  color: var(--amber); }
.match-status-matched   { background: var(--brand-pale); color: var(--brand); }

.match-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr));
  gap: 0; padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.match-stat {
  padding: 12px 0;
  border-right: 1px solid var(--border);
  text-align: center;
}
.match-stat:last-child { border-right: none; }
.match-stat-val   { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.match-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

.match-delivery-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
}
.match-delivery-label { font-weight: 600; color: var(--text-primary); }

.match-notes {
  padding: 1rem 1.5rem;
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.65;
  border-bottom: 1px solid var(--border);
}
.match-notes-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 5px; }

.match-footer {
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.match-prev-badge {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}

.match-accept-btn {
  padding: 10px 24px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.match-accept-btn:hover { background: var(--brand-light); }
.match-accept-btn:disabled { opacity: .6; cursor: not-allowed; }

.match-decision-btns { display: flex; align-items: center; gap: 8px; }

.match-decline-btn {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.match-decline-btn:hover {
  background: var(--red-bg); color: var(--red); border-color: var(--red);
}

.match-declined-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  background: var(--red-bg); color: var(--red);
  padding: 8px 16px; border-radius: var(--radius-sm);
}

.match-accepted-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  background: var(--green-bg); color: var(--green);
  padding: 8px 16px; border-radius: var(--radius-sm);
}

/* ── Updates ── */
.update-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.update-item:last-child { border-bottom: none; }

.update-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.update-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.update-date {
  font-size: 12px;
  color: var(--text-muted);
}

.update-context {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-light);
  margin-bottom: 5px;
}

.update-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── IP Tracker ── */
.ipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.ipt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.ipt-card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Embryo Arrow Progress Bar ── */
.embryo-progress-bar {
  display: flex;
  width: 100%;
  margin-bottom: 0.75rem;
}

.epb-step {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px 10px 18px;
  background: #d1d5db;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
  transition: background 0.3s;
}

.epb-step:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  padding-left: 10px;
}

.epb-last {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
}

/* Pending */
.epb-step { background: #c5c9d0; color: #fff; }

/* Done */
.epb-step.epb-done { background: #1a9e6e; }

/* Active (current step) */
.epb-step.epb-active { background: #e67e22; }

/* On hold */
.epb-step.epb-hold { background: #c0392b; }

.embryo-status-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 0.75rem;
  min-height: 18px;
}

.epb-stopped {
  background: #fce8e8;
  color: #b91c1c;
  border: 1.5px solid #f5c6c6;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* stepper dots */
.ipt-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}

.ipt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.ipt-dot.done { background: var(--accent-light); }
.ipt-dot.cur  { background: var(--brand); width: 22px; border-radius: 4px; }

.ipt-eyebrow { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ipt-step-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.ipt-step-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.ipt-step-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1rem;
}

.ipt-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ipt-btn:hover { background: var(--brand-pale); color: var(--brand); border-color: var(--brand-light); }
.ipt-btn.finish { background: var(--brand); color: #fff; border-color: var(--brand); }
.ipt-btn.finish:hover { background: var(--brand-light); }

/* PGT results panel */
.pgt-results-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background .12s;
}

.pgt-results-btn:hover { background: var(--brand-pale); color: var(--brand); }
.pgt-results-btn.open { background: var(--brand-pale); color: var(--brand); border-color: var(--brand-light); }

#pgt-results-panel {
  display: none;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

#pgt-results-panel.visible { display: block; }

.pgt-summary-row {
  display: flex;
  gap: 12px;
  margin-bottom: 1rem;
}

.pgt-stat {
  flex: 1;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.pgt-stat-num { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.pgt-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ipt-embryo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.ipt-embryo-row:last-child { border-bottom: none; }

.ipt-embryo-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-page);
  color: var(--text-secondary);
}

.en-green { background: var(--green-bg); color: var(--green); }
.en-amber { background: var(--amber-bg); color: var(--amber); }
.en-red   { background: var(--red-bg);   color: var(--red);   }

.ipt-embryo-info { flex: 1; }
.ipt-embryo-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.ipt-embryo-detail { font-size: 12px; color: var(--text-muted); }

/* PGT note */
.pgt-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary, #f5f7fa);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* PGT progress bar */
.pgt-progress-bar-wrap { margin: 4px 0 8px; }
.pgt-progress-track { height: 6px; background: var(--border); border-radius: 99px; margin-bottom: 16px; }
.pgt-progress-fill  { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.pgt-prog-steps     { display: flex; align-items: flex-start; justify-content: space-between; }
.pgt-prog-step      { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; width: 60px; text-align: center; }
.pgt-prog-connector { flex: 1; }
.pgt-prog-dot       { width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--border); margin-bottom: 5px; transition: all 0.3s; }
.pgt-prog-dot.done  { background: var(--primary); border-color: var(--primary); }
.pgt-prog-dot.cur   { background: white; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.pgt-prog-lbl       { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* badges */
.ipt-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.ipt-badge-green { background: var(--green-bg); color: var(--green); }
.ipt-badge-amber { background: var(--amber-bg); color: var(--amber); }
.ipt-badge-red   { background: var(--red-bg);   color: var(--red); }
.ipt-badge-gray  { background: var(--gray-bg);   color: var(--gray); }

/* CGT cards */
.cgt-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cgt-card-name { font-size: 14px; font-weight: 500; color: var(--text-primary); flex: 1; }
.cgt-card-lbl { font-size: 12px; color: var(--text-muted); }

/* ── Important Update Banner ── */
.imp-banner {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  color: #fff;
  margin-bottom: 1.25rem;
  overflow: hidden;
  animation: imp-slide-in .4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes imp-slide-in {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.imp-banner-inner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 1.1rem 1.25rem;
}

.imp-banner-icon { font-size: 26px; flex-shrink: 0; margin-top: 1px; }

.imp-banner-body { flex: 1; min-width: 0; }
.imp-banner-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: 4px; }
.imp-banner-text  { font-size: 15px; font-weight: 500; line-height: 1.5; }

.imp-banner-dismiss {
  flex-shrink: 0; align-self: center;
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 20px; cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.imp-banner-dismiss:hover { background: rgba(255,255,255,.32); }

.imp-banner-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; cursor: pointer;
  transition: background .15s;
}
.imp-banner-mini:hover { background: rgba(255,255,255,.08); }
.imp-mini-dot   { font-size: 15px; }
.imp-mini-label { font-size: 13px; font-weight: 500; flex: 1; }
.imp-mini-arrow { font-size: 18px; opacity: .6; }

/* ── Pregnancy Tracker ── */
.preg-card { background: linear-gradient(135deg, #0a3d5c 0%, #0b5f8a 55%, #1a7fb5 100%) !important; border: none !important; color: #fff; }

.preg-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.preg-card-title  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-bottom: 4px; }
.preg-week-display{ font-size: 32px; font-weight: 700; line-height: 1; }
.preg-week-sub    { font-size: 13px; opacity: .75; margin-top: 4px; }

.preg-due-block {
  text-align: right; flex-shrink: 0;
  background: rgba(255,255,255,.12); border-radius: var(--radius-md);
  padding: 10px 14px;
}
.preg-due-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.preg-due-date  { font-size: 15px; font-weight: 600; margin-top: 2px; }

.preg-progress-wrap { margin-bottom: 1.25rem; }
.preg-progress-bg   { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.preg-progress-fill { height: 100%; background: rgba(255,255,255,.85); border-radius: 4px; transition: width .6s ease; }

.preg-trimester-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; opacity: .6; font-weight: 500;
}

.preg-milestone-box {
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.preg-milestone-week  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .7; margin-bottom: 4px; }
.preg-milestone-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.preg-milestone-body  { font-size: 13px; opacity: .85; line-height: 1.6; }

.preg-upcoming-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; opacity: .6; margin-bottom: 8px; }
.preg-upcoming-list  { display: flex; flex-direction: column; gap: 6px; }
.preg-upcoming-item  {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.08); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px;
}
.preg-upcoming-wk { font-size: 11px; font-weight: 700; opacity: .6; min-width: 44px; }

.preg-edit-row    { margin-bottom: 1rem; }
.preg-edit-label  { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; opacity: .6; margin-bottom: 4px; }
.preg-edit-view   { display: flex; align-items: center; gap: 10px; }
.preg-edit-view span { font-size: 14px; font-weight: 500; }
.preg-edit-btn    { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer; }
.preg-edit-btn:hover { background: rgba(255,255,255,.25); }
.preg-reset-btn   { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.7); font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer; margin-left: 2px; }
.preg-reset-btn:hover { background: rgba(255,80,80,.3); border-color: rgba(255,120,120,.4); color: #fff; }
.preg-edit-form   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preg-date-input  { padding: 6px 10px; border-radius: var(--radius-sm); border: none; font-size: 14px; background: rgba(255,255,255,.9); color: var(--text-primary); }
.preg-save-btn    { background: #fff; color: var(--brand); border: none; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer; }
.preg-cancel-btn  { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; }

/* ── GC Tracker ── */
.gc-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand-pale); color: var(--brand);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.gc-cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}

.gc-cal-month-label {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
}

.gc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.gc-cal-header {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 0;
}

.gc-cal-day {
  min-height: 52px; padding: 5px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: default;
  position: relative;
}

.gc-cal-day.has-appt {
  background: var(--brand-pale);
  border-color: rgba(41,128,185,.2);
  cursor: pointer;
}

.gc-cal-day.has-appt:hover { border-color: var(--brand-light); }

.gc-cal-day.today { border-color: var(--brand) !important; }

.gc-cal-day.other-month { opacity: 0.3; }

.gc-day-num {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  line-height: 1;
}

.gc-cal-day.today .gc-day-num { color: var(--brand); font-weight: 700; }

.gc-day-dot {
  display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px;
}

.gc-dot {
  width: 6px; height: 6px; border-radius: 50%;
}

.gc-dot-scheduled { background: var(--brand-light); }
.gc-dot-completed { background: var(--accent); }
.gc-dot-cancelled { background: var(--text-muted); }

/* Appointment cards */
.gc-appt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gc-appt-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.gc-appt-header:hover { background: var(--bg-page); }

.gc-appt-date-block {
  width: 46px; flex-shrink: 0; text-align: center;
  background: var(--bg-page); border-radius: var(--radius-sm); padding: 5px 4px;
}

.gc-appt-date-block .cal-month { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--brand); }
.gc-appt-date-block .cal-day   { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1; }

.gc-appt-info { flex: 1; min-width: 0; }

.gc-appt-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  text-transform: capitalize;
}

.gc-appt-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.gc-appt-chevron {
  font-size: 12px; color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}

.gc-appt-card.open .gc-appt-chevron { transform: rotate(180deg); }

.gc-appt-body {
  display: none; padding: 0 16px 16px; border-top: 1px solid var(--border);
}

.gc-appt-card.open .gc-appt-body { display: block; }

.gc-appt-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin: 12px 0 6px;
}

.gc-results-box {
  background: var(--bg-page); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; color: var(--text-secondary);
  line-height: 1.6;
}

.gc-followup-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  background: var(--amber-bg); color: var(--amber);
  padding: 4px 10px; border-radius: 20px; margin-top: 8px;
}

.gc-docs-empty {
  font-size: 13px; color: var(--text-muted);
  padding: 8px 0;
}

/* Appt type badges */
.gc-type-badge {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px;
  display: inline-block;
}

.gc-type-labs      { background: #e6f1fb; color: #185fa5; }
.gc-type-ultrasound{ background: #e1f5ee; color: #0f6e56; }
.gc-type-followup  { background: #faeeda; color: #b45309; }
.gc-type-other     { background: var(--gray-bg); color: var(--gray); }

/* ── PGT Scenes ── */
.ipt-scene { display: none; }
.ipt-scene.active { display: block; }

/* ── Watchlist ── */
.wl-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 1.25rem;
  border-bottom: 1px solid var(--border);
}
.wl-card:last-child { border-bottom: none; }
.wl-board-name { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px; }
.wl-item-name  { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.wl-notes      { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.wl-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wl-date       { font-size: 12px; color: var(--text-muted); }
.wl-remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 4px; }
.wl-remove-btn:hover { background: var(--red-bg); color: var(--red); }
.wl-watch-btn {
  font-size: 12px; padding: 6px 12px;
  background: var(--bg-page); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer;
}
.wl-watch-btn:hover { background: var(--brand-pale); color: var(--brand); border-color: var(--brand-light); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .portal-topbar { padding: 0 1rem; }
  .portal-nav { padding: 0 1rem; }
  .portal-body { padding: 1.25rem 1rem; }
  .topbar-user { display: none; }
}

/* ── Our Team ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.5rem;
}

.team-card {
  perspective: 1000px;
  height: 260px;
  cursor: pointer;
}

.team-card.no-flip { cursor: default; }

.team-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.team-card.flipped .team-card-inner {
  transform: rotateY(180deg);
}

.team-card-front,
.team-card-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.team-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-card-front .team-name-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  color: #fff;
  text-align: left;
}

.team-card-front .team-name-tag .tn-name { font-size: 14px; font-weight: 600; }
.team-card-front .team-name-tag .tn-role { font-size: 11.5px; opacity: 0.85; }

.team-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 1.1rem 0.9rem;
  background: var(--accent);
  color: #fff;
}

.team-card-back .tb-name { font-size: 16px; font-weight: 700; }
.team-card-back .tb-role { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }
.team-card-back .tb-contact {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.35;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.5);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.team-card-back .tb-contact:hover { text-decoration-color: #fff; }

/* ── Schedule a Meeting ── */
.schedule-note-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 1.25rem;
}

.schedule-note-icon { font-size: 24px; line-height: 1; }

.schedule-note-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.schedule-note-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.calendly-frame {
  width: 100%;
  height: 720px;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  .calendly-frame { height: 850px; }
}

/* ── Notification bell ── */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-bell-btn:hover { background: rgba(255,255,255,0.22); }

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e0473e;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--brand, #0b5f8a);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-height: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.notif-dropdown-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.notif-dropdown-list {
  overflow-y: auto;
  max-height: 370px;
}

.notif-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.notif-row:last-child { border-bottom: none; }

.notif-row .notif-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.notif-row .notif-row-context {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.notif-row .notif-row-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-row.unseen { background: #f0faf7; }

/* New updates popup */
#notif-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,30,40,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
}

.notif-popup-box {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.notif-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.notif-popup-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-popup-close {
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.notif-popup-list {
  overflow-y: auto;
  padding: 4px 18px;
}

.notif-popup-list .notif-row { padding: 14px 0; }

.notif-popup-btn {
  margin: 14px 18px 18px;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.notif-popup-btn:hover { opacity: 0.92; }

/* ── IP Tracker change toast ── */
.ipt-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 16px 20px 14px;
  min-width: 280px;
  max-width: 340px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), opacity 0.3s ease;
  pointer-events: none;
}
.ipt-toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.ipt-toast-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.ipt-toast-body { flex: 1; }
.ipt-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}
.ipt-toast-msg {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  white-space: pre-line;
}
.ipt-toast-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-top: -2px;
}
.ipt-toast-close:hover { color: #555; }
