/* ══════════════════════════════════════════════════════════════════════
   CAF Professional Passport — personal hub layer
   Loaded only by cafnizer-passport.html. Builds on the page's own tokens
   (--green, --dark, --gold, --border, --muted, --card, --bg). Logical
   properties throughout so Arabic (dir=rtl) mirrors without extra rules.
   ══════════════════════════════════════════════════════════════════════ */

body.passport-page {
  --ph-green: var(--green, #007a3d);
  --ph-green-soft: rgba(0, 122, 61, 0.08);
  --ph-green-line: rgba(0, 122, 61, 0.22);
  --ph-ink: var(--dark, #0f1724);
  --ph-text: var(--text, #172033);
  --ph-muted: #5b6b7f;
  --ph-line: var(--border, #e5ede9);
  --ph-surface: var(--card, #ffffff);
  --ph-canvas: var(--bg, #f0f4f3);
  --ph-gold: #a97a3f;
  --ph-gold-soft: rgba(212, 165, 116, 0.16);
  --ph-danger: #b42318;
  --ph-danger-soft: #fdecea;
  --ph-warn: #8a5a00;
  --ph-warn-soft: #fff6e0;
  --ph-blue: #1d4ed8;
  --ph-blue-soft: rgba(29, 78, 216, 0.08);
  --ph-radius: 16px;
  --ph-shadow: 0 1px 2px rgba(15, 23, 36, 0.04), 0 4px 18px rgba(15, 23, 36, 0.05);
}

/* Hub-rendered sections replace their legacy counterparts only once real
   hub data has arrived; if the hub is unavailable the legacy page stays. */
body.hub-ready [data-legacy-hub] { display: none !important; }
body:not(.hub-ready) [data-hub-only] { display: none !important; }
body.hub-ready [data-hub-only] { display: block; }
body.hub-ready [data-hub-only].ph-flex { display: flex; }
body.hub-ready [data-hub-only].ph-grid { display: grid; }

/* ── Hero refinements ─────────────────────────────────────────────────── */
body.passport-page .profile-card { box-shadow: var(--ph-shadow); border-color: var(--ph-line); overflow: hidden; }

/* Cover banner with official CAF geometric fallback pattern. Uploaded photos
   are fitted in full; the dark surround prevents distortion or cropping. */
body.passport-page .profile-banner {
  position: relative;
  height: 230px;
  background-color: #004d26;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(212, 165, 116, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 200, 83, 0.22) 0%, transparent 45%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 2px, transparent 2px, transparent 16px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 2px, transparent 2px, transparent 16px),
    linear-gradient(135deg, #004120 0%, #006633 45%, #008744 100%);
  background-size: cover;
  background-position: calc(var(--cover-pos-x, 50) * 1%) calc(var(--cover-pos-y, 50) * 1%);
  overflow: hidden;
  transition: height 0.2s ease;
}
body.passport-page .profile-banner.has-cover {
  background-color: #0c1510;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat;
}
.profile-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 45%, rgba(15, 23, 36, 0.6) 100%);
  pointer-events: none;
}
.profile-banner-badge {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 5;
  background: rgba(15, 23, 36, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 165, 116, 0.45);
  color: #f7d794;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.cover-actions-group {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 5;
  display: flex;
  gap: 8px;
  align-items: center;
}
.cover-action-btn, .cover-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 23, 36, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cover-action-btn:hover, .cover-photo-btn:hover {
  background: rgba(0, 122, 61, 0.92);
  border-color: rgba(0, 200, 83, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}
html[dir="rtl"] body.passport-page .profile-banner-badge { left: auto; right: 20px; }
html[dir="rtl"] body.passport-page .cover-actions-group { right: auto; left: 20px; }
html[dir="rtl"] body.passport-page .cover-photo-btn { right: auto; left: 16px; }

/* Overlapping Avatar Composition */
body.passport-page .profile-avatar-section {
  position: relative;
  margin-top: -60px;
  margin-inline-start: 24px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
}
body.passport-page .profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(15, 23, 36, 0.18), 0 2px 6px rgba(15, 23, 36, 0.08);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.passport-page .profile-avatar.has-photo {
  cursor: zoom-in;
}
body.passport-page .profile-avatar.has-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(15, 23, 36, 0.25);
}
body.passport-page #profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.passport-page #profile-avatar-initials {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #007a3d, #004d26);
  color: #ffffff;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
body.passport-page .profile-photo-btn {
  position: absolute;
  inset-inline-end: -6px;
  bottom: 4px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #007a3d;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
body.passport-page .profile-photo-btn:hover {
  background: #00994d;
  transform: scale(1.08);
}

body.passport-page .profile-identity { min-width: 0; padding-top: 4px; }
body.passport-page .profile-name { font-size: 26px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-headline { font-size: 14.5px; font-weight: 700; color: var(--ph-text); margin: -2px 0 8px; overflow-wrap: anywhere; }
.ph-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .01em;
  border: 1px solid var(--ph-line); background: var(--ph-surface); color: var(--ph-muted);
  white-space: nowrap;
}
.ph-chip.verified { background: var(--ph-green-soft); color: var(--ph-green); border-color: var(--ph-green-line); }
.ph-chip.gold { background: var(--ph-gold-soft); color: var(--ph-gold); border-color: rgba(169, 122, 63, .28); }
.ph-chip.warn { background: var(--ph-warn-soft); color: var(--ph-warn); border-color: rgba(138, 90, 0, .25); }
.ph-chip.danger { background: var(--ph-danger-soft); color: var(--ph-danger); border-color: rgba(180, 35, 24, .25); }
.ph-chip.blue { background: var(--ph-blue-soft); color: var(--ph-blue); border-color: rgba(29, 78, 216, .2); }
.ph-verified-tick {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ph-green); color: #fff; font-size: 12px; font-weight: 900; flex-shrink: 0;
}
.ph-viewer-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 14px; border-radius: 12px;
  background: #f5f8ff; border: 1px solid #d6e2ff; color: #1e3a8a; font-size: 12.5px; font-weight: 600;
}
.ph-viewer-banner strong { font-weight: 900; }

/* Hero photo controls (self) */
.ph-photo-menu { position: relative; }
.ph-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 190px; padding: 6px; border-radius: 12px;
  background: var(--ph-surface); border: 1px solid var(--ph-line); box-shadow: 0 12px 40px rgba(15, 23, 36, .18);
}
.ph-menu[hidden] { display: none; }
.ph-menu button, .ph-menu label, .ph-menu a {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ph-text); text-align: start; text-decoration: none;
}
.ph-menu button:hover, .ph-menu label:hover, .ph-menu a:hover { background: var(--ph-green-soft); color: var(--ph-green); }
.ph-menu .danger { color: var(--ph-danger); }

/* ── Section navigator ─────────────────────────────────────────────────── */
.ph-nav {
  position: sticky; top: 46px; z-index: 90;
  margin: 0 0 16px; padding: 6px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ph-line); border-radius: 14px; box-shadow: var(--ph-shadow);
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.ph-nav::-webkit-scrollbar { display: none; }
.ph-nav a {
  flex-shrink: 0; padding: 8px 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 800; color: var(--ph-muted); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.ph-nav a:hover { color: var(--ph-green); background: var(--ph-green-soft); }
.ph-nav a.active { color: #fff; background: var(--ph-green); }
.ph-anchor { scroll-margin-top: 120px; }

/* ── Dashboard ─────────────────────────────────────────────────────────── */
.ph-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ph-stat {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px 16px; border-radius: 14px; text-align: start;
  background: var(--ph-surface); border: 1px solid var(--ph-line); box-shadow: var(--ph-shadow);
  font: inherit; color: inherit; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.ph-stat:hover { transform: translateY(-1px); border-color: var(--ph-green-line); box-shadow: 0 6px 22px rgba(15, 23, 36, .09); }
.ph-stat:focus-visible { outline: 3px solid rgba(0, 122, 61, .35); outline-offset: 2px; }
.ph-stat .ph-stat-ico { font-size: 16px; line-height: 1; }
.ph-stat .ph-stat-num { font-size: 26px; font-weight: 950; color: var(--ph-ink); line-height: 1.05; letter-spacing: -.01em; }
.ph-stat .ph-stat-lbl { font-size: 11px; font-weight: 800; color: var(--ph-muted); text-transform: uppercase; letter-spacing: .06em; }
.ph-stat .ph-stat-sub { font-size: 11.5px; color: var(--ph-muted); overflow-wrap: anywhere; }
.ph-stat.wide { grid-column: span 2; }
.ph-stat.warn { border-color: rgba(138, 90, 0, .3); background: linear-gradient(180deg, #fffaf0, #fff); }
.ph-stat.danger { border-color: rgba(180, 35, 24, .3); background: linear-gradient(180deg, #fff5f4, #fff); }
.ph-meter { height: 6px; border-radius: 999px; background: #e7eeea; overflow: hidden; margin-top: 4px; }
.ph-meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #007a3d, #00b050); }

/* ── Cards / sections ──────────────────────────────────────────────────── */
.ph-sec { background: var(--ph-surface); border: 1px solid var(--ph-line); border-radius: var(--ph-radius); box-shadow: var(--ph-shadow); overflow: hidden; }
.ph-sec-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 12px; border-bottom: 1px solid var(--ph-line); }
.ph-sec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; color: var(--ph-ink); letter-spacing: .01em; min-width: 0; }
.ph-sec-title .ico { font-size: 16px; }
.ph-sec-sub { font-size: 11.5px; color: var(--ph-muted); font-weight: 600; }
.ph-sec-actions { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ph-sec-body { padding: 14px 18px 16px; }
.ph-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 13px; border-radius: 9px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: inherit; font-size: 12px; font-weight: 800; color: var(--ph-text);
  background: var(--ph-surface); border: 1px solid var(--ph-line); transition: all .14s;
}
.ph-btn:hover { border-color: var(--ph-green); color: var(--ph-green); background: var(--ph-green-soft); }
.ph-btn.primary { background: var(--ph-green); border-color: transparent; color: #fff; }
.ph-btn.primary:hover { background: #00913f; color: #fff; }
.ph-btn.ghost { border-color: transparent; background: none; color: var(--ph-green); padding: 0 8px; }
.ph-btn.danger { color: var(--ph-danger); }
.ph-btn.danger:hover { background: var(--ph-danger-soft); border-color: rgba(180, 35, 24, .3); }
.ph-btn[disabled] { opacity: .5; cursor: not-allowed; }
.ph-btn:focus-visible, .ph-nav a:focus-visible { outline: 3px solid rgba(0, 122, 61, .35); outline-offset: 2px; }

.ph-src {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ph-muted); background: #f2f5f4; border: 1px solid var(--ph-line); white-space: nowrap;
}
.ph-src.caf { color: var(--ph-green); background: var(--ph-green-soft); border-color: var(--ph-green-line); }
.ph-src.user { color: #475569; }
.ph-src.auto { color: #0e7490; background: rgba(8, 145, 178, .08); border-color: rgba(8, 145, 178, .22); }

/* Intentional, compact empty states */
.ph-empty { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #f7faf9; border: 1px dashed #d5e3dc; }
.ph-empty .ico { font-size: 20px; line-height: 1; flex-shrink: 0; opacity: .85; }
.ph-empty strong { display: block; font-size: 12.5px; color: var(--ph-ink); margin-bottom: 2px; }
.ph-empty p { font-size: 12px; color: var(--ph-muted); line-height: 1.5; margin: 0; }
.ph-empty .ph-btn { margin-top: 8px; }

.ph-skeleton { border-radius: 10px; background: linear-gradient(90deg, #eef3f1 25%, #f7faf9 37%, #eef3f1 63%); background-size: 400% 100%; animation: ph-shimmer 1.3s ease infinite; }
@keyframes ph-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ph-skeleton { animation: none; } .ph-stat, .ph-nav a { transition: none; } }

/* Lists of records */
.ph-list { display: flex; flex-direction: column; gap: 10px; }
.ph-item {
  display: flex; gap: 12px; align-items: flex-start; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--ph-line); border-radius: 12px; background: var(--ph-surface);
  position: relative;
}
a.ph-item, button.ph-item { text-decoration: none; color: inherit; font: inherit; text-align: start; cursor: pointer; width: 100%; }
a.ph-item:hover, button.ph-item:hover { border-color: var(--ph-green-line); box-shadow: 0 4px 16px rgba(15, 23, 36, .06); }
.ph-item-ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--ph-green-soft); color: var(--ph-green); font-size: 18px; overflow: hidden;
}
.ph-item-ico img { width: 100%; height: 100%; object-fit: cover; }
.ph-item-main { flex: 1; min-width: 0; }
.ph-item-title { font-size: 13px; font-weight: 850; color: var(--ph-ink); line-height: 1.3; overflow-wrap: anywhere; }
.ph-item-meta { font-size: 11.5px; color: var(--ph-muted); margin-top: 2px; overflow-wrap: anywhere; }
.ph-item-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ph-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ph-item-desc { font-size: 12px; color: var(--ph-text); margin-top: 6px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.ph-progress { width: 100%; height: 6px; border-radius: 999px; background: #e7eeea; overflow: hidden; margin-top: 7px; }
.ph-progress > i { display: block; height: 100%; background: var(--ph-green); border-radius: inherit; }

.ph-subhead { font-size: 10.5px; font-weight: 900; color: var(--ph-muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; }
.ph-subhead:first-child { margin-top: 0; }

/* Certificates */
.ph-cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ph-cert {
  position: relative; padding: 14px 14px 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--ph-line); background: linear-gradient(160deg, #ffffff 60%, #f6fbf8);
}
.ph-cert::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--ph-green); }
.ph-cert.user::before { background: #94a3b8; }
.ph-cert.expired::before, .ph-cert.revoked::before { background: var(--ph-danger); }
.ph-cert.expired, .ph-cert.revoked { background: #fffafa; }
.ph-cert-title { font-size: 13px; font-weight: 850; color: var(--ph-ink); line-height: 1.3; margin: 6px 0 2px; overflow-wrap: anywhere; }
.ph-cert-meta { font-size: 11.5px; color: var(--ph-muted); line-height: 1.5; }
.ph-cert-num { font-family: 'Courier New', monospace; font-size: 11px; color: var(--ph-ink); letter-spacing: .03em; }
.ph-cert-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* Activity timeline */
.ph-timeline { position: relative; display: flex; flex-direction: column; gap: 2px; }
.ph-tl { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.ph-tl + .ph-tl { border-top: 1px solid #eef3f1; }
.ph-tl-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--ph-green-soft); color: var(--ph-green); font-size: 14px;
}
.ph-tl-dot.update { background: var(--ph-gold-soft); color: var(--ph-gold); }
.ph-tl-dot.certificate { background: rgba(29, 78, 216, .08); color: var(--ph-blue); }
.ph-tl-main { flex: 1; min-width: 0; }
.ph-tl-title { font-size: 12.5px; font-weight: 800; color: var(--ph-ink); overflow-wrap: anywhere; }
.ph-tl-meta { font-size: 11px; color: var(--ph-muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ph-tl-body { font-size: 12.5px; color: var(--ph-text); margin-top: 5px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.ph-composer { display: grid; gap: 8px; padding: 12px; margin-bottom: 12px; border-radius: 12px; background: #f7faf9; border: 1px solid var(--ph-line); }
.ph-composer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* Gallery */
.ph-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-photo {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; cursor: zoom-in;
  background: #e9efec; border: 0; padding: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.ph-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ph-photo:hover img, .ph-photo:focus-visible img { transform: scale(1.04); }
.ph-photo:focus-visible { outline: 3px solid var(--ph-green); outline-offset: 2px; }
.ph-photo-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 36, 0.28); opacity: 0; transition: opacity 0.2s ease; pointer-events: none; z-index: 2;
}
.ph-photo:hover .ph-photo-overlay, .ph-photo:focus-visible .ph-photo-overlay { opacity: 1; }
.ph-photo-zoom-ico {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15, 23, 36, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); transform: scale(0.85); transition: transform 0.2s ease;
}
.ph-photo:hover .ph-photo-zoom-ico, .ph-photo:focus-visible .ph-photo-zoom-ico { transform: scale(1); }
.ph-photo-cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff;
  font-size: 10.5px; font-weight: 700; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 3;
}
.ph-photo-lock { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(15, 23, 36, .7); color: #fff; border-radius: 999px; font-size: 10px; padding: 2px 7px; font-weight: 800; z-index: 3; }
.ph-lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(6, 12, 20, .94); display: grid; grid-template-rows: auto 1fr auto; }
.ph-lightbox[hidden] { display: none; }
.ph-lb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; color: #fff; z-index: 10; }
.ph-lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 56px; position: relative; overflow: hidden; }
.ph-lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-in; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); user-select: none; }
.ph-lb-stage img.zoomed { transform: scale(1.65); cursor: zoom-out; max-width: none; max-height: none; }
.ph-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .15); color: #fff; font-size: 22px; display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 0.15s; }
.ph-lb-nav:hover { background: rgba(255, 255, 255, .28); }
.ph-lb-nav.prev { inset-inline-start: 12px; }
.ph-lb-nav.next { inset-inline-end: 12px; }
.ph-lb-cap { padding: 12px 16px 18px; color: rgba(255, 255, 255, .88); font-size: 13px; text-align: center; overflow-wrap: anywhere; z-index: 10; }
.ph-lb-top .ph-btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ph-lb-top .ph-btn:hover { background: rgba(255, 255, 255, .28); border-color: rgba(255, 255, 255, .4); color: #fff; }

/* Key/value rows */
.ph-kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 12px; font-size: 12.5px; }
.ph-kv dt { color: var(--ph-muted); font-weight: 700; font-size: 11.5px; }
.ph-kv dd { margin: 0; color: var(--ph-text); font-weight: 650; min-width: 0; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ph-mask { font-family: 'Courier New', monospace; letter-spacing: .06em; }
.ph-private-note { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: #f5f7fb; border: 1px solid #e2e8f0; color: #475569; font-size: 11.5px; line-height: 1.5; margin-bottom: 12px; }

/* Completeness */
.ph-complete-ring { display: flex; align-items: center; gap: 14px; }
.ph-complete-ring svg { flex-shrink: 0; }
.ph-complete-pct { font-size: 22px; font-weight: 950; color: var(--ph-ink); }
.ph-missing { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.ph-missing button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--ph-line); background: #fbfcfc; cursor: pointer; text-align: start;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--ph-text);
}
.ph-missing button:hover { border-color: var(--ph-green-line); color: var(--ph-green); }
.ph-missing button[disabled] { cursor: default; color: var(--ph-muted); }
.ph-missing .plus { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ph-green-soft); color: var(--ph-green); font-weight: 900; flex-shrink: 0; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
body.passport-page .passport-body { grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
body.passport-page .left-col > *, body.passport-page .right-col > * { flex-shrink: 0; }
body.passport-page .left-col, body.passport-page .right-col { gap: 16px; min-width: 0; }
@media (max-width: 1000px) { body.passport-page .passport-body { grid-template-columns: 1fr; } }

/* ── Edit drawer ────────────────────────────────────────────────────────── */
.ph-drawer-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 36, .5); }
.ph-drawer-backdrop[hidden], .ph-drawer[hidden] { display: none; }
.ph-drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 1001;
  width: min(620px, 100vw); display: grid; grid-template-rows: auto auto 1fr auto;
  background: var(--ph-surface); box-shadow: -18px 0 60px rgba(15, 23, 36, .25);
}
.ph-drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--ph-line); }
.ph-drawer-title { font-size: 16px; font-weight: 900; color: var(--ph-ink); }
.ph-drawer-close { margin-inline-start: auto; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--ph-line); background: none; cursor: pointer; font-size: 16px; }
.ph-tabs { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--ph-line); scrollbar-width: none; }
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tabs button {
  flex-shrink: 0; padding: 7px 11px; border-radius: 9px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 800; color: var(--ph-muted); white-space: nowrap;
}
.ph-tabs button.active { background: var(--ph-green-soft); color: var(--ph-green); }
.ph-drawer-body { overflow-y: auto; padding: 18px 20px 24px; }
.ph-drawer-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--ph-line); background: #fafcfb; }
.ph-drawer-foot .ph-status { margin-inline-end: auto; }

.ph-form { display: grid; gap: 14px; }
.ph-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph-field { display: grid; gap: 5px; min-width: 0; }
.ph-field > span { font-size: 11px; font-weight: 800; color: var(--ph-muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ph-field small { font-size: 11px; color: var(--ph-muted); text-transform: none; letter-spacing: 0; font-weight: 600; }
.ph-field .err { color: var(--ph-danger); font-size: 11px; font-weight: 700; }
body.passport-page .ph-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.passport-page .ph-form select,
body.passport-page .ph-form textarea,
body.passport-page .ph-composer textarea,
body.passport-page .ph-composer select,
body.passport-page .ph-composer input:not([type="checkbox"]) {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 9px;
  border: 1px solid #d5dfda; background: #fff; color: var(--ph-text);
  font: inherit; font-size: 13px; text-align: start; text-align-last: auto; line-height: 1.4;
}
body.passport-page .ph-form textarea, body.passport-page .ph-composer textarea { min-height: 96px; resize: vertical; }
body.passport-page .ph-form input[readonly], body.passport-page .ph-form select[disabled], body.passport-page .ph-form input[disabled] {
  background: #f3f6f5; color: #475569; cursor: not-allowed;
}
body.passport-page .ph-form input:focus, body.passport-page .ph-form select:focus, body.passport-page .ph-form textarea:focus,
body.passport-page .ph-composer textarea:focus { outline: none; border-color: var(--ph-green); box-shadow: 0 0 0 3px rgba(0, 122, 61, .12); }
.ph-check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ph-text); line-height: 1.5; }
.ph-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ph-green); }
.ph-legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: #f7faf9; border: 1px solid var(--ph-line); font-size: 11.5px; color: var(--ph-muted); }
.ph-tags-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #d5dfda; border-radius: 9px; background: #fff; min-height: 42px; align-items: center; }
.ph-tags-input .ph-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--ph-green-soft); color: var(--ph-green); font-size: 12px; font-weight: 700; }
html[dir="rtl"] .ph-tags-input .ph-tag { padding: 3px 9px 3px 4px; }
.ph-tags-input .ph-tag button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 13px; width: 20px; height: 20px; border-radius: 50%; }
body.passport-page .ph-tags-input input { border: 0 !important; box-shadow: none !important; min-height: 28px !important; flex: 1; min-width: 120px; padding: 2px 4px !important; }
.ph-status { font-size: 12px; font-weight: 700; }
.ph-status.ok { color: var(--ph-green); }
.ph-status.err { color: var(--ph-danger); }
.ph-status.busy { color: var(--ph-muted); }

/* Crop / upload dialogs */
.ph-modal-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(15, 23, 36, .6); display: grid; place-items: center; padding: 16px; }
.ph-modal-backdrop[hidden] { display: none; }
.ph-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--ph-surface); border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.ph-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ph-line); font-weight: 900; color: var(--ph-ink); }
.ph-modal-body { padding: 16px 18px; display: grid; gap: 14px; }
.ph-modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--ph-line); }
.ph-crop-stage { position: relative; width: 100%; background: #0f1724; border-radius: 12px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.ph-crop-stage:active { cursor: grabbing; }
.ph-crop-stage canvas { display: block; width: 100%; height: auto; }
.ph-crop-stage.round::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(15, 23, 36, .55); pointer-events: none; }
.ph-zoom { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ph-muted); font-weight: 700; }
.ph-zoom input { flex: 1; accent-color: var(--ph-green); }
body.passport-page .ph-zoom input[type="range"] { min-height: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.ph-preview-row { display: flex; gap: 12px; align-items: center; }
.ph-preview-row img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }

/* Documents */
.ph-doc-ico { background: #eef2ff; color: #3730a3; }

/* Print: professional CV by default; a private copy only when the
   Passport holder asks for it. Scans, medical and admin data never print. */
.ph-print-head { display: none; }
@media print {
  .ph-nav, .ph-sec-actions, .ph-composer, .ph-drawer, .ph-drawer-backdrop, .ph-modal-backdrop, .ph-lightbox,
  .ph-photo-menu, .ph-viewer-banner, [data-print="never"], .ph-cert-actions, .ph-missing button .plus,
  #medical-report-sec, #bank-doc-sec, #kit-sizes-sec, #hotel-room-sec, #admin-sensitive-sec, #owner-admin-banner,
  #ph-documents, #ph-gallery, .cafnizer-bnav, .mobile-back-bar, .caf-asst-launcher, .caf-asst-panel,
  .cover-actions-group, .cover-photo-btn, .profile-photo-btn { display: none !important; }
  body:not(.ph-print-private) [data-print="private"] { display: none !important; }
  body.passport-page .passport-body { grid-template-columns: 250px 1fr; }
  body.passport-page .profile-banner {
    height: 80px !important;
    background-image: none !important;
    background-color: #004d26 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.passport-page .profile-avatar-section {
    margin-top: -40px !important;
  }
  body.passport-page .profile-avatar {
    width: 80px !important;
    height: 80px !important;
    border-width: 3px !important;
  }
  body.passport-page #profile-avatar-initials {
    font-size: 24px !important;
  }
  .ph-sec, .ph-stat, .ph-item, .ph-cert { box-shadow: none !important; break-inside: avoid; }
  .ph-dash { grid-template-columns: repeat(4, 1fr); }
  .ph-print-head { display: block; font-size: 10px; color: #475569; margin-bottom: 8px; }
  a[href]::after { content: none !important; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ph-nav { top: 44px; border-radius: 0; margin-inline: -12px; border-inline: 0; }
  .ph-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ph-stat.wide { grid-column: span 2; }
  .ph-stat .ph-stat-num { font-size: 21px; }
  body.passport-page .profile-banner { height: 140px !important; }
  body.passport-page .profile-name { font-size: 20px !important; }
  body.passport-page .profile-avatar-section { margin-top: -44px; margin-inline-start: 14px; }
  body.passport-page .profile-avatar { width: 88px !important; height: 88px !important; border-width: 3px !important; }
  body.passport-page #profile-avatar-initials { font-size: 26px !important; }
  body.passport-page .profile-photo-btn { width: 28px !important; height: 28px !important; font-size: 12px !important; bottom: 2px !important; inset-inline-end: -4px !important; }
  .ph-form .row2 { grid-template-columns: 1fr; }
  .ph-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .ph-kv dd { margin-bottom: 8px; }
  .ph-item { padding: 11px 12px; }
  .ph-item-side { align-items: flex-start; }
  .ph-gallery { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
  .ph-lb-stage { padding: 0 8px; }
  .ph-lb-nav { top: auto; bottom: 12px; transform: none; width: 38px; height: 38px; font-size: 18px; }
  .ph-lb-nav.prev { inset-inline-start: 16px; }
  .ph-lb-nav.next { inset-inline-end: 16px; }
  .ph-sec-head { flex-wrap: wrap; }
  .ph-drawer { width: 100vw; }
}
@media (max-width: 420px) {
  .ph-item { flex-wrap: wrap; }
  .ph-item-side { flex-direction: row; width: 100%; }
}

/* ── Identity hierarchy: hero side column + compact CAF Digital ID ─────── */
.ph-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-top: 18px; }
.ph-hero-side .profile-actions { padding-top: 0; justify-content: flex-end; }
body.hub-ready .ph-id-card[data-hub-only] { display: flex; }
.ph-id-card[hidden] { display: none !important; }
.ph-id-card {
  position: relative;
  align-items: center; gap: 14px; padding: 12px 18px 12px 14px; border-radius: 14px; cursor: pointer; text-align: start;
  border: 1px solid rgba(212, 165, 116, 0.45);
  background: linear-gradient(135deg, #07150e 0%, #0c2717 55%, #133a24 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 122, 61, 0.12);
  font: inherit; min-width: 260px; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ph-id-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #d4a574 0%, #00b050 50%, #d4a574 100%);
}
.ph-id-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 165, 116, 0.75);
  box-shadow: 0 8px 28px rgba(0, 122, 61, 0.28);
}
.ph-id-card:focus-visible { outline: 2px solid #00b050; outline-offset: 2px; }
.ph-id-qr { width: 62px; height: 62px; border-radius: 8px; background: #fff; padding: 4px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.ph-id-text { display: grid; gap: 2px; min-width: 0; }
.ph-id-lbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #a4c7b2; font-weight: 900; }
.ph-id-val { font-family: ui-monospace, Consolas, monospace; font-size: 15px; font-weight: 850; letter-spacing: .04em; color: #fff; direction: ltr; unicode-bidi: isolate; }
.ph-id-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #f7d794; }
.ph-id-state.verified { color: #6ee7a7; }

/* ── Full CAF Digital ID card (modal, Passport section, print) ─────────── */
.ph-idc {
  border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(212, 165, 116, 0.4);
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 36, 0.12);
}
.ph-idc-top {
  position: relative;
  background: linear-gradient(135deg, #07150e 0%, #0d2a19 50%, #154228 100%);
  color: #fff; padding: 20px 22px; display: flex; gap: 16px; align-items: center; overflow: hidden;
}
.ph-idc-top::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #d4a574 0%, #00b050 50%, #d4a574 100%);
}
.ph-idc-photo { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; border: 3px solid #d4a574; box-shadow: 0 4px 14px rgba(0,0,0,0.3); flex-shrink: 0; }
.ph-idc-initials { display: grid; place-items: center; background: linear-gradient(135deg, #007a3d, #004d26); font-size: 28px; font-weight: 900; color: #fff; }
.ph-idc-who { min-width: 0; }
.ph-idc-org { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #d4a574; font-weight: 900; }
.ph-idc-name { font-size: 19px; font-weight: 900; color: #fff; margin-top: 1px; overflow-wrap: anywhere; }
.ph-idc-line { font-size: 12.5px; color: rgba(255, 255, 255, .9); margin-top: 2px; }
.ph-idc-body {
  display: flex; gap: 20px; align-items: center; padding: 20px 22px; flex-wrap: wrap;
  background: radial-gradient(circle at 100% 0%, rgba(0, 122, 61, 0.04) 0%, transparent 60%), #fff;
}
.ph-idc-qr { border: 2px solid #007a3d; border-radius: 12px; padding: 8px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.06); flex-shrink: 0; }
.ph-idc-facts { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; font-size: 13px; min-width: 220px; }
.ph-idc-k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ph-muted); font-weight: 900; }
.ph-idc-id { font-family: ui-monospace, Consolas, monospace; font-weight: 850; font-size: 16px; color: #07150e; direction: ltr; unicode-bidi: isolate; }
.ph-idc-foot { padding: 0 22px 16px; font-size: 11px; color: var(--ph-muted); line-height: 1.5; border-top: 1px solid var(--ph-line); padding-top: 12px; }
#ph-digital-id .ph-idc-body { padding: 16px 20px; }
#ph-digital-id .ph-idc-qr { width: 120px; height: 120px; }

/* ── Live Previews for Cover Reposition ────────────────────────────────── */
.ph-portrait-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}
.ph-portrait-notice span:first-child {
  font-size: 16px;
  line-height: 1;
}
.ph-preview-container {
  display: grid; gap: 12px; background: #f7faf9; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--ph-line);
}
.ph-preview-title {
  font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--ph-muted);
}
.ph-preview-row {
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
}
.ph-preview-card {
  display: grid; gap: 6px;
}
.ph-preview-card span {
  font-size: 11px; font-weight: 750; color: var(--ph-text);
}
.ph-preview-canvas-wrap {
  border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.12); border: 1px solid var(--ph-line); background: #0f1724;
}
.ph-preview-canvas-wrap.desktop canvas { width: 260px; height: 58px; display: block; }
.ph-preview-canvas-wrap.mobile canvas { width: 140px; height: 58px; display: block; }

/* ── Completeness grouping and collapsed state ─────────────────────────── */
.ph-complete-group { margin-top: 12px; }
.ph-complete-group-head {
  font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ph-gold); margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.ph-complete-collapsed {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin-top: 12px; border-radius: 10px;
  background: var(--ph-green-soft); border: 1px solid var(--ph-green-line);
  color: var(--ph-green); font-size: 12.5px; font-weight: 800; flex-wrap: wrap;
}
.ph-complete-toggle {
  background: none; border: 0; color: var(--ph-green); font: inherit; font-size: 11.5px;
  font-weight: 800; cursor: pointer; text-decoration: underline; padding: 2px 6px;
}

/* ── Core Profile checklist + Assignment readiness ─────────────────────── */
.ph-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ph-checklist li { display: flex; }
.ph-checklist li > span, .ph-checklist button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 13px; text-align: start;
}
.ph-checklist button { border: 1px dashed var(--ph-green-line); background: var(--ph-green-soft); color: var(--ph-ink); cursor: pointer; font-weight: 700; }
.ph-checklist .mark { width: 18px; text-align: center; font-weight: 900; flex-shrink: 0; }
.ph-checklist li.done .mark { color: var(--ph-green); }
.ph-checklist li.done > span { color: var(--ph-muted); }
.ph-checklist li.todo .mark { color: var(--ph-warn); }
.ph-ready { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ph-line); }
.ph-ready-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ── Onboarding: complete your CAF Professional Passport ──────────────── */
body.hub-ready .ph-onboard[data-hub-only][hidden] { display: none !important; }
.ph-onboard {
  margin: 14px 0; padding: 18px 20px; border-radius: var(--ph-radius); border: 1px solid var(--ph-green-line);
  background: linear-gradient(135deg, #f2fbf6, #ffffff 60%); box-shadow: var(--ph-shadow);
}
.ph-onboard-title { font-size: 18px; font-weight: 900; color: var(--ph-ink); }
.ph-onboard-lead { margin: 6px 0 10px; color: var(--ph-text); }
.ph-onboard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.ph-onboard-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ph-meter.big { height: 10px; }

/* ── Drawer: grouped tabs and Account & Security ──────────────────────── */
.ph-tabs { align-items: stretch; gap: 10px; }
.ph-tab-group { display: flex; align-items: center; gap: 2px; flex-shrink: 0; padding-inline-end: 10px; border-inline-end: 1px solid var(--ph-line); }
.ph-tab-group:last-child { border-inline-end: 0; }
.ph-tab-group-label { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 900; color: var(--ph-gold); margin-inline-end: 4px; white-space: nowrap; }
.ph-account-box { border: 1px solid var(--ph-line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; margin: 0; }
.ph-account-box legend { font-weight: 900; font-size: 13px; padding: 0 6px; }

/* ── Account & Security ───────────────────────────────────────────────── */
.ph-pw-wrap { position: relative; display: block; }
.ph-pw-wrap input { width: 100%; padding-inline-end: 64px; }
.ph-pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); min-width: 48px; min-height: 30px; padding: 4px 8px; border: 1px solid var(--ph-line); border-radius: 8px; background: var(--ph-surface); color: var(--ph-green); font-size: 11px; font-weight: 800; cursor: pointer; }
.ph-pw-eye:focus-visible { outline: 2px solid var(--ph-green); outline-offset: 2px; }
.ph-pw-meter { height: 6px; border-radius: 999px; background: var(--ph-line); overflow: hidden; }
.ph-pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s ease, background-color .2s ease; }
.ph-pw-meter[data-score="1"] span { width: 25%; background: var(--ph-danger); }
.ph-pw-meter[data-score="2"] span { width: 50%; background: var(--ph-warn); }
.ph-pw-meter[data-score="3"] span { width: 75%; background: var(--ph-gold); }
.ph-pw-meter[data-score="4"] span { width: 100%; background: var(--ph-green); }
.ph-security-list .ph-item-side .ph-btn { white-space: nowrap; }
.ph-security-next { margin: 12px 0 0; }
@media (max-width: 560px) {
  .ph-security-list .ph-item { flex-wrap: wrap; }
  .ph-security-list .ph-item-side { flex-basis: 100%; }
  .ph-security-list .ph-item-side .ph-btn { width: 100%; justify-content: center; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ph-pw-meter span { transition: none; } }

/* ── Owner / administrator review banner ──────────────────────────────── */
.ph-review { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ph-review-who { font-size: 15px; }

@media (max-width: 1000px) {
  body.passport-page .profile-banner { height: 180px !important; }
}
@media (max-width: 760px) {
  body.passport-page .profile-card-body {
    display: flex;
    flex-direction: column;
    padding: 0 16px 20px;
    gap: 12px;
  }
  body.passport-page .profile-avatar-section {
    order: 1;
    margin-top: -44px;
    margin-inline-start: 12px;
  }
  body.passport-page .profile-identity {
    order: 2;
    padding-top: 0;
    width: 100%;
    min-width: 0;
  }
  .ph-hero-side {
    order: 3;
    align-items: stretch;
    width: 100%;
    padding-top: 0;
    margin-left: 0 !important;
    margin-inline-start: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .ph-hero-side .ph-id-card {
    order: 1;
    min-width: 0;
    width: 100%;
  }
  .ph-hero-side .profile-actions {
    order: 2;
    justify-content: flex-start;
    padding-top: 0;
    width: 100%;
    gap: 6px;
  }
  body.passport-page .profile-banner { height: 140px !important; }
}
@media print {
  .ph-id-card, .ph-onboard { display: none !important; }
}

/* Attribute-driven visibility for legacy hero/top-bar elements the hub controls. */
.tb-verified[hidden], .caf-id-pill[hidden] { display: none !important; }

/* Digital ID that the database has not issued (an administrative problem, shown plainly). */
.ph-id-card.missing { cursor: default; background: linear-gradient(135deg, #3b3f46, #23262b); }
.ph-id-card.missing .ph-id-qr, .ph-id-card.missing img[hidden] { display: none; }
.ph-idc-id.missing { font-family: inherit; font-size: 13px; color: #b45309; letter-spacing: 0; }
/* The field a "missing item" button opened. */
.ph-field.ph-needs { outline: 2px solid #f59e0b; outline-offset: 4px; border-radius: 8px; }
