/*
 * 4-column, 2-row grid — equal-width columns.
 * Row 1: photo | identity | contact | activity (top half)
 * Row 2: status | assign | delinquency | activity (bottom half)
 * Activity spans both rows.
 */
.member-summary__primary {
  display: grid;
  grid-template-areas:
    'photo  identity contact  activity'
    'status assign   delinq   activity';
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: var(--ph-space-md);
  flex: 1 1 auto;
  min-height: 0;
}

.member-summary__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-summary__cell--photo {
  grid-area: photo;
}

.member-summary__cell--identity {
  grid-area: identity;
}

.member-summary__cell--status {
  grid-area: status;
}

.member-summary__cell--assign {
  grid-area: assign;
}

.member-summary__cell--contact {
  grid-area: contact;
}

.member-summary__cell--delinquency {
  grid-area: delinq;
}

/*
 * Activity card spans both grid rows and contains scrollable child sections.
 * Remove overflow:hidden to allow child sections (.member-comments, .member-summary__activity)
 * to scroll independently when content exceeds available vertical space.
 */
.member-summary__cell--activity {
  grid-area: activity;
  border-radius: var(--ph-radius-lg);
  background: var(--ph-color-surface-accent);
  border: 1px solid var(--ph-color-border-soft);
  padding: var(--ph-space-sm) var(--ph-space-sm) var(--ph-space-md);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm);
  box-shadow: var(--ph-shadow-card);
  overflow: visible; /* Changed from hidden to allow child sections to scroll */
  min-height: 0; /* Ensure flexbox children can shrink below content size for scroll to work */
}

/* Photo cell — fills full card height, image or placeholder as visual anchor */
.member-photo-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--ph-radius-sm);
  border: 1px solid var(--ph-color-border-soft);
  background: var(--ph-color-surface-muted);
  overflow: hidden;
}

/* Viewport clips the scaled image independently of the toolbar */
.member-photo-viewport {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.member-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.member-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ph-color-border-soft);
  font-size: 3.5rem;
}

/* Upload button — prominent bar at the bottom */
.member-photo-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ph-space-2xs);
  padding: var(--ph-space-xs) var(--ph-space-sm);
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-surface);
  background: var(--ph-color-primary);
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.member-photo-upload:hover {
  background: #1e3a8a; /* darker blue on hover */
  text-decoration: none;
}

.member-photo-upload input[type="file"] {
  display: none;
}

/* Edit (crop) overlay — appears on hover, top-left */
.member-photo-edit {
  position: absolute;
  top: var(--ph-space-2xs);
  left: var(--ph-space-2xs);
  width: 28px;
  height: 28px;
  border-radius: var(--ph-radius-sm);
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: var(--ph-color-surface);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.member-photo-wrapper:hover .member-photo-edit {
  opacity: 1;
}

.member-photo-edit:hover {
  background: var(--ph-color-primary);
}

/* Edit mode — active crop/pan state */
.member-photo-wrapper--editing .member-photo {
  cursor: grab;
}

.member-photo-wrapper--editing .member-photo:active {
  cursor: grabbing;
}

.member-photo-wrapper--editing .member-photo-edit,
.member-photo-wrapper--editing .member-photo-delete {
  display: none;
}

/* Hide upload bar, toolbar replaces it */
.member-photo-wrapper--editing .member-photo-upload {
  display: none;
}

/* Edit mode toolbar — replaces upload bar at bottom */
.member-photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ph-space-2xs);
  padding: var(--ph-space-xs);
  background: rgba(0, 0, 0, 0.75);
  flex-shrink: 0;
}

.member-photo-toolbar button {
  border: none;
  border-radius: var(--ph-radius-sm);
  padding: var(--ph-space-2xs) var(--ph-space-xs);
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  font-weight: var(--ph-font-weight-label);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--ph-space-2xs);
  transition: background 0.15s ease;
}

.member-photo-toolbar__save {
  background: var(--ph-color-success);
  color: var(--ph-color-surface);
}

.member-photo-toolbar__save:hover {
  filter: brightness(0.9);
}

.member-photo-toolbar__cancel {
  background: rgba(255, 255, 255, 0.15);
  color: var(--ph-color-surface);
}

.member-photo-toolbar__cancel:hover {
  background: rgba(255, 255, 255, 0.3);
}

.member-photo-toolbar__reset {
  background: rgba(255, 255, 255, 0.15);
  color: var(--ph-color-surface);
}

.member-photo-toolbar__reset:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Zoom hint — inside viewport, above toolbar */
.member-photo-zoom-hint {
  position: absolute;
  bottom: var(--ph-space-xs);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: var(--ph-color-surface);
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  padding: var(--ph-space-2xs) var(--ph-space-xs);
  border-radius: var(--ph-radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.member-photo-wrapper--editing .member-photo-zoom-hint {
  opacity: 1;
}

/* Delete overlay — appears on hover over the photo area */
.member-photo-delete {
  position: absolute;
  top: var(--ph-space-2xs);
  right: var(--ph-space-2xs);
  width: 28px;
  height: 28px;
  border-radius: var(--ph-radius-sm);
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: var(--ph-color-surface);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.member-photo-wrapper:hover .member-photo-delete {
  opacity: 1;
}

.member-photo-delete:hover {
  background: var(--ph-color-danger);
}

/* Contact section — force black text on all display values per stakeholder */
.member-summary__cell--contact .info-field__display {
  color: var(--ph-color-text-primary); /* T4 — Black, not muted */
}
.member-summary__cell--contact .info-field__display a.info-field__link {
  color: var(--ph-color-text-primary);
}
.member-summary__cell--contact .info-field__display a.info-field__link:hover,
.member-summary__cell--contact .info-field__display a.info-field__link:focus-visible {
  color: var(--ph-color-primary);
  text-decoration: underline;
}

.member-summary__more-toggle {
  align-self: flex-start;
  border: 1px solid var(--ph-color-border-highlight);
  background: var(--ph-color-surface-accent);
  color: var(--ph-color-primary);
  font-weight: var(--ph-font-weight-label);
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  border-radius: var(--ph-radius-pill);
  padding: 0.45rem 1.25rem;
  cursor: pointer;
  transition:
    background var(--ph-transition-quick),
    border-color var(--ph-transition-quick),
    color var(--ph-transition-quick);
}

.member-summary__more-toggle:hover,
.member-summary__more-toggle:focus-visible {
  background: var(--ph-color-accent-soft);
  border-color: var(--ph-color-accent-bright);
  color: var(--ph-color-accent);
  outline: none;
}

.member-summary__toggle-bar {
  margin-top: var(--ph-space-sm);
}

.member-summary__more {
  width: 100%;
}

.member-summary__more-grid {
  margin-top: var(--ph-space-sm);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--ph-space-md);
}

@media (max-width: 1500px) {
  .member-summary__primary {
    grid-template-areas:
      'photo    identity activity'
      'contact  contact  activity'
      'status   assign   activity'
      'delinq   delinq   activity';
    grid-template-columns: 1fr 1fr minmax(0, 1fr);
    grid-template-rows: auto;
  }
}

@media (max-width: 1080px) {
  .member-summary__primary {
    grid-template-areas:
      'photo'
      'identity'
      'contact'
      'status'
      'assign'
      'delinq'
      'activity';
    grid-template-columns: minmax(0, 1fr);
  }

  .member-summary--condensed {
    height: auto;
    overflow: visible;
  }

  .member-summary__cell--photo {
    max-width: 200px;
  }
}
/*
 * site.css
 * --------
 * Global scaffolding and shared widgets layered on top of css/theme.css.
 * Define palette/spacing tokens in theme.css first, then consume them here
 * via var(--ph-*) helpers so features inherit the same visual language.
 */

/* ==========================================================================
   Card Hierarchy Utilities
   ========================================================================== */
/**
 * Three-level card system for visual elevation:
 * - Level 1: Primary surfaces (member panels, batch panels)
 * - Level 2: Secondary surfaces (detail panels, period blocks)
 * - Level 3: Tertiary surfaces (stage cards, counters, chips)
 */

.ph-card {
  background: var(--ph-color-surface);
  border: var(--ph-card-border);
  border-radius: var(--ph-card-radius);
}

.ph-card--level-1 {
  box-shadow: var(--ph-shadow-card);
}

.ph-card--level-2 {
  box-shadow: var(--ph-card-shadow-secondary);
}

.ph-card--level-3 {
  border-radius: var(--ph-radius-sm);
  box-shadow: var(--ph-card-shadow-tertiary);
}

/* ==========================================================================
   Chip & Badge Utilities
   ========================================================================== */
/**
 * Three semantic families of chips:
 * - Filter: User-selectable filter pills
 * - Status: State display badges (active/inactive/pending)
 * - Warning: Review flags and alerts
 */

/* Base chip styles */
.ph-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--ph-radius-pill);
  font-size: var(--ph-font-size-t5);
  font-weight: var(--ph-font-weight-label);
  letter-spacing: var(--ph-letter-spacing-caps);
  text-transform: uppercase;
  transition:
    background var(--ph-transition-quick),
    border-color var(--ph-transition-quick);
}

/* Family A: Filter Chips (selectable, interactive) */
.ph-chip--filter {
  background: var(--ph-chip-bg);
  color: var(--ph-chip-text);
  border: 1px solid var(--ph-chip-border);
  cursor: pointer;
}

.ph-chip--filter:hover,
.ph-chip--filter:focus-visible {
  background: var(--ph-chip-highlight-bg);
  border-color: var(--ph-chip-highlight-border);
  outline: none;
}

.ph-chip--filter.is-active {
  background: var(--ph-color-primary-soft);
  border-color: var(--ph-color-primary);
  color: var(--ph-color-primary);
}

/* Family B: Status Chips (display-only) */
.ph-chip--status {
  background: var(--ph-color-surface-muted);
  color: var(--ph-color-text-muted);
  border: 1px solid transparent;
}

.ph-chip--status-success {
  background: var(--ph-color-status-balanced-bg);
  color: var(--ph-color-success);
}

.ph-chip--status-warning {
  background: var(--ph-color-status-positive-bg);
  color: var(--ph-color-warning);
}

.ph-chip--status-danger {
  background: var(--ph-color-danger-soft);
  color: var(--ph-color-danger);
}

/* Family C: Warning Chips (review flags) */
.ph-chip--warning {
  background: var(--ph-variant-badge-bg);
  color: var(--ph-variant-badge-text);
  border: 1px solid var(--ph-variant-badge-border);
}

.ph-chip--warning-severe {
  background: var(--ph-auto-exclude-badge-bg);
  color: var(--ph-auto-exclude-badge-text);
  border: 1px solid var(--ph-auto-exclude-badge-border);
}

.ph-chip--warning-info {
  background: var(--ph-legit-variant-bg);
  color: var(--ph-legit-variant-text);
  border: 1px solid var(--ph-legit-variant-border);
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.ph-text-t1 {
  font-size: var(--ph-font-size-t1);
}
.ph-text-t2 {
  font-size: var(--ph-font-size-t2);
}
.ph-text-t3 {
  font-size: var(--ph-font-size-t3);
}
.ph-text-t4 {
  font-size: var(--ph-font-size-t4);
}
.ph-text-t5 {
  font-size: var(--ph-font-size-t5);
}

.ph-text-heading {
  font-weight: var(--ph-font-weight-heading);
}
.ph-text-semibold {
  font-weight: var(--ph-font-weight-semibold);
}
.ph-text-label {
  font-weight: var(--ph-font-weight-label);
}
.ph-text-body {
  font-weight: var(--ph-font-weight-body);
}

.ph-text-caps {
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
}

/* Layout primitives ------------------------------------------------------ */

main > .container {
  padding: 15px 15px 20px;
  /* Maintains legacy spacing around primary content regions. */
}

/* Site Footer -------------------------------------------------------------- */
/* Enterprise footer: utility bar with copyright, version, and credit.
   Follows L0 theme philosophy: understated, functional, data-dense. */

.ph-footer {
  background-color: var(--ph-color-surface-muted);
  border-top: 1px solid var(--ph-color-border-soft);
  padding: var(--ph-space-sm) 0;
  margin-top: auto;
}

.ph-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ph-space-sm);
  font-size: var(--ph-font-size-t5); /* T5 — Meta text */
  color: var(--ph-color-text-muted);
}

.ph-footer__copyright {
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary);
}

.ph-footer__version {
  font-family: var(--ph-font-mono);
  letter-spacing: var(--ph-letter-spacing-tight);
  color: var(--ph-color-text-soft);
  background: var(--ph-color-surface);
  padding: 0.15rem var(--ph-space-xs);
  border-radius: var(--ph-radius-xs);
  border: 1px solid var(--ph-color-border-soft);
}

.ph-footer__credit {
  color: var(--ph-color-text-muted);
}

.ph-footer__credit a {
  color: var(--ph-color-primary);
  text-decoration: none;
}

.ph-footer__credit a:hover {
  text-decoration: underline;
}

/* Danger zone — destructive-action footer shared by financial edit screens.
   Consumers: views/ledger/editItem.php, views/trans/update.php (Trello #240). */

.ph-danger-zone {
  margin-top: var(--ph-space-lg);
  border: 1px solid var(--ph-color-status-negative-border);
  border-radius: var(--ph-radius-lg);
  background: var(--ph-color-surface);
}

.ph-danger-zone__head {
  padding: var(--ph-space-sm) var(--ph-space-lg);
  border-bottom: 1px dashed var(--ph-color-status-negative-border);
  color: var(--ph-color-danger);
  font-size: var(--ph-font-size-t5);
  font-weight: var(--ph-font-weight-heading);
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
}

.ph-danger-zone__body { padding: var(--ph-space-md) var(--ph-space-lg); }

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .ph-footer__inner {
    flex-direction: column;
    text-align: center;
    gap: var(--ph-space-xs);
  }
}

/* Legacy footer class - kept for backwards compatibility */
.footer {
  background-color: var(--ph-color-surface-muted);
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  height: 60px;
}

.footer > .container {
  padding-right: 15px;
  padding-left: 15px;
}

.not-set {
  color: var(--ph-color-negative-strong);
  font-style: italic;
}

/* Data grid affordances --------------------------------------------------- */

a.asc:after,
a.desc:after {
  content: '';
  left: 3px;
  display: inline-block;
  width: 0;
  height: 0;
  border: solid 5px transparent;
  margin: 4px 4px 2px 4px;
  background: transparent;
}

a.asc:after {
  border-bottom: solid 7px var(--ph-color-text-default);
  border-top-width: 0;
}

a.desc:after {
  border-top: solid 7px var(--ph-color-text-default);
  border-bottom-width: 0;
}

.grid-view th {
  white-space: nowrap;
}

.hint-block {
  display: block;
  margin-top: 5px;
  color: var(--ph-color-text-hint);
}

.error-summary {
  color: var(--ph-color-feedback-error-text);
  background: var(--ph-color-feedback-error-bg);
  border-left: 3px solid var(--ph-color-feedback-error-border);
  padding: 10px 20px;
  margin: 0 0 15px 0;
}

/* Navbar tweaks ----------------------------------------------------------- */

.nav li > form > button.logout {
  padding-top: 7px;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 767px) {
  .nav li > form > button.logout {
    display: block;
    text-align: left;
    width: 100%;
    padding: 10px 0;
  }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
  outline: none;
}

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

/* Legacy form layout bridge (migrated from phmis.css) ------------------ */

.dv-label,
.dv-label-lg {
  text-align: right;
  color: var(--ph-color-text-muted, #4b5563);
  font-weight: 600;
  font-size: 0.875rem;
}

.dv-label {
  max-width: 100px;
  width: 100px;
}

.dv-label-lg {
  max-width: 150px;
  width: 150px;
}

.dv-blank-label {
  text-align: right;
  color: var(--ph-color-text-inverse, #ffffff) !important;
}

.dv-input,
.dv-input-lg,
.dv-input-xl,
.dv-input-xxl {
  font-size: 1rem;
  font-weight: 400;
}

.dv-input {
  max-width: 150px;
  width: 150px;
}

.dv-input-lg {
  max-width: 300px;
  width: 300px;
}

.dv-input-xl {
  max-width: 600px;
  width: 600px;
}

.dv-input-xxl {
  max-width: 1000px;
  width: 1000px;
}

.w625 {
  width: 6.25%;
}

.w125 {
  width: 12.5%;
}

.w100 {
  width: 10%;
}

.w25 {
  width: 25%;
}

.w166 {
  width: 16.6%;
}

.float-right {
  float: right;
}

.form-validation-error {
  color: var(--ph-color-danger, #dc2626);
  font-style: italic;
  font-size: 0.75rem;
}

.no-border {
  border-style: none !important;
}

.border-top {
  border-top-style: solid !important;
  border-bottom-style: none !important;
}

textarea {
  resize: none;
  overflow: hidden;
  min-height: 50px;
}

.menu {
  padding: 0.025rem !important;
  font-size: 0.875rem;
}

.sub-menu {
  padding: 0.0125rem !important;
  font-size: 0.75rem !important;
}

.div-flex {
  display: flex;
}

.div-flex > * {
  padding: 10px;
}

.white {
  color: var(--ph-color-text-inverse, #ffffff) !important;
}

.fixed {
  table-layout: auto;
}

td::after {
  display: block;
}

.tb-cell {
  margin: 0;
  display: block;
}

.div-center-container {
  display: flex;
  justify-content: center;
  padding: 0.25rem;
}

.border-solid {
  border-style: solid;
}

.grid-button {
  padding: 0.125rem !important;
  font-size: 0.875rem;
}

.ph-grid-cell {
  padding: 0.25rem 0.5rem 0.25rem 0.25rem !important;
}

.ph-grid {
  display: inline-block;
  text-wrap: nowrap;
}

.ph-readonly {
  background-color: var(--ph-color-surface-muted, #f5f5f5);
}

.ph-btn {
  padding: 0.25rem !important;
  font-size: 0.875rem;
}

/* Layout + navigation wrappers (legacy bridge) ------------------------- */

.ph-site-container {
  max-width: clamp(320px, 92vw, 1560px);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.5rem, 1.2vw, 1rem);
  padding-right: clamp(0.5rem, 1.2vw, 1rem);
  width: 100%;
}

/* Consolidated mobile navbar rules at max-width 768px moved to line ~1489 near other navbar definitions for better maintainability. */

#mainNavbar {
  border-bottom: 1px solid var(--ph-color-nav-context-border, #e3e9f1);
  box-shadow: 0 2px 6px rgba(20, 40, 60, 0.04);
}

.ph-navbar-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.ph-navbar-container .navbar-brand {
  margin-right: 0.75rem;
  flex: 0 0 auto;
}

.ph-navbar-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1 1 auto;
  min-width: 0;
}

.ph-quick-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 0.2rem 0;
  scrollbar-width: none;
}

.ph-quick-nav::-webkit-scrollbar {
  display: none;
}

.ph-quick-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.3rem; /* T3 — Bigger for readability */
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ph-color-nav-pill-text, #1f2d3d);
  border: 1px solid transparent;
  background: var(--ph-color-nav-pill-bg, rgba(244, 247, 252, 0.9));
  transition:
    background var(--ph-transition-default, 0.18s ease),
    color var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease),
    transform var(--ph-transition-quick, 0.16s ease);
  white-space: nowrap;
}

.ph-quick-nav-link:hover,
.ph-quick-nav-link:focus-visible {
  background: var(--ph-color-nav-pill-bg-hover, #e4ecfa);
  color: var(--ph-color-text-primary, #1f2937);
  outline: none;
}

.ph-quick-nav-link.active {
  background: var(--ph-color-nav-pill-active-bg, #dce6ff);
  border-color: var(--ph-color-nav-pill-active-border, #5d8edc);
  color: var(--ph-color-nav-pill-active-text, #1d3f70);
  box-shadow: 0 2px 4px rgba(69, 107, 162, 0.12);
}

.ph-quick-nav-link--icon {
  width: 3rem;
  padding: 0.6rem 0.55rem;
  justify-content: center;
}

.ph-quick-nav-link--icon i {
  font-size: 1.2rem;
}

.ph-quick-nav-link--special {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border-color: #fde68a;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.1);
}

.ph-quick-nav-link--special:hover,
.ph-quick-nav-link--special:focus-visible {
  background: #fde68a;
  color: #78350f;
  border-color: #fcd34d;
}

.ph-quick-nav-link--special.active {
  background: #fcd34d;
  color: #78350f;
  border-color: #fbbf24;
}

/* Trello button - purple/violet to indicate external/new feature */
.ph-quick-nav-link--trello {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #6b21a8;
  border-color: #c4b5fd;
  box-shadow: 0 1px 2px rgba(107, 33, 168, 0.1);
}

.ph-quick-nav-link--trello:hover,
.ph-quick-nav-link--trello:focus-visible {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #a78bfa;
}

.ph-quick-nav-link--trello.active {
  background: #ddd6fe;
  color: #5b21b6;
  border-color: #a78bfa;
}

.ph-navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}

/* Member summary workspace -------------------------------------------- */

.member-summary {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-md);
  background: var(--ph-gradient-card);
  padding: var(--ph-space-lg);
  border-radius: var(--ph-radius-xl);
  box-shadow: var(--ph-shadow-panel);
  position: relative;
}

.member-summary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--ph-color-border-soft);
}

/* 
 * Condensed mode: Keep primary grid at natural row heights without scroll.
 * The grid's minmax(220px, 1fr) will determine row size based on content.
 * We don't lock height here because that causes rows to collapse on expand.
 */
.member-summary--condensed {
  overflow: hidden;
}

/* 
 * Expanded mode: Allow natural flow and scroll for secondary sections.
 * The primary grid maintains its natural 2-row height (c+f for activity column).
 * Secondary sections (.member-summary__more-grid) render below in their own grid context.
 */
.member-summary--expanded {
  height: auto;
  overflow: visible;
}

.member-summary__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.member-summary__identity {
  min-width: 0;
}

.member-summary__title {
  margin: 0;
  font-size: var(--ph-font-size-t1); /* T1 — Page title */
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary);
}

.member-summary__meta {
  margin: 0.25rem 0 0;
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  color: var(--ph-color-text-muted);
}

.member-summary__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.member-summary__workspace-menu {
  /* Keep the workspace dropdown aligned with the action chip without burning extra vertical spacing. */
  display: inline-flex;
  margin: 0;
}

.member-summary__workspace-menu .dropdown-toggle {
  white-space: nowrap;
}

/* Grouped dropdown menu styling */
.member-workspace-dropdown {
  min-width: 200px;
  padding: 0.5rem 0;
}

.member-workspace-dropdown .dropdown-header {
  font-size: var(--ph-font-size-t5);
  font-weight: var(--ph-font-weight-label);
  letter-spacing: var(--ph-letter-spacing-caps);
  text-transform: uppercase;
  color: var(--ph-color-text-muted);
  padding: 0.5rem 1rem 0.25rem;
  margin-top: 0.25rem;
}

.member-workspace-dropdown .dropdown-header:first-child {
  margin-top: 0;
}

.member-workspace-dropdown .dropdown-item {
  font-size: var(--ph-font-size-t4);
  padding: 0.4rem 1rem 0.4rem 1.25rem;
}

.member-workspace-dropdown .dropdown-item.active {
  background: var(--ph-color-primary);
  color: #fff;
}

.member-workspace-dropdown .dropdown-item:hover:not(.active) {
  background: var(--ph-color-surface-alt);
}

.member-summary__action,
.density-toggle {
  border: 1px solid var(--ph-color-border-strong);
  background: var(--ph-color-surface-muted);
  color: var(--ph-color-text-default);
  border-radius: var(--ph-radius-pill);
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  padding: 0.35rem 0.9rem;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition:
    background var(--ph-transition-quick),
    border-color var(--ph-transition-quick);
}

.member-summary__action:hover,
.member-summary__action:focus-visible,
.density-toggle:hover,
.density-toggle:focus-visible {
  outline: none;
  background: var(--ph-color-surface);
  border-color: var(--ph-color-border-strong);
}

.density-toggle.is-active {
  background: var(--ph-color-surface-accent);
  border-color: var(--ph-color-border-strong);
  font-weight: var(--ph-font-weight-label);
}

.member-summary__density {
  display: inline-flex;
  border: 1px solid var(--ph-color-border-strong);
  border-radius: var(--ph-radius-pill);
  overflow: hidden;
}

.info-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--ph-radius-pill);
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  font-weight: var(--ph-font-weight-label);
  letter-spacing: var(--ph-letter-spacing-normal);
  text-transform: uppercase;
  background: var(--ph-color-surface-muted);
  color: var(--ph-color-text-muted);
}

.info-chip--success {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.info-chip--danger {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.info-chip--warning {
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.info-chip--secondary {
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
}

.info-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto; /* Stretch to fill grid cell */
  border-radius: var(--ph-radius-lg);
  background: var(--ph-color-surface);
  border: var(--ph-card-border);
  box-shadow: var(--ph-shadow-card);
  overflow: hidden;
}

.info-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ph-space-xs);
  padding: 0.5rem 0.75rem;
  background: var(--ph-stripe-even); /* Distinct but not overpowering */
  border-bottom: 1px solid var(--ph-border-grid-strong); /* Hard border for structure */
}

.info-section__title {
  margin: 0;
  font-size: var(--ph-font-size-t5); /* T5 — Section header */
  letter-spacing: var(--ph-letter-spacing-caps-wide);
  text-transform: uppercase;
  color: var(--ph-color-primary);
}

.info-section__link {
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  color: var(--ph-color-accent);
  text-decoration: none;
  font-weight: var(--ph-font-weight-label);
}

.info-section__link:hover,
.info-section__link:focus-visible {
  text-decoration: underline;
  color: var(--ph-color-accent-bright);
  outline: none;
}

.info-section__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto; /* Stretch to fill available section height */
  gap: 0; /* Eliminate gap - rows define their own borders */
  padding: var(--ph-space-xs) 0; /* Tighter vertical, no horizontal for full-bleed rows */
  background: var(--ph-color-surface);
}

.info-field {
  display: flex;
  align-items: center; /* Vertically center content in rows */
  gap: 0.5rem;
  padding: 0.25rem 0.75rem; /* Tighter padding for density */
  min-height: 36px; /* Consistent row height across all cards */
  border-bottom: 1px solid var(--ph-border-grid); /* Hard border for structure */
  transition: background var(--ph-transition-quick);
}

/* Zebra striping for row tracking */
.info-field:nth-child(even) {
  background: var(--ph-stripe-even);
}

.info-field:hover {
  background: var(--ph-stripe-hover);
}

.info-field:last-child {
  border-bottom: none;
}

.info-field--editable {
  cursor: pointer;
}

.info-field--editable:hover,
.info-field--editable:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.info-field--editing {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.32);
}

.info-field--copied {
  background: rgba(34, 197, 94, 0.14);
}

.info-field__label {
  flex: 0 0 100px; /* Widened from 88px to reduce label wrapping */
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  letter-spacing: var(--ph-letter-spacing-caps);
  text-transform: uppercase;
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-muted); /* Stronger label contrast */
}

.info-field__value {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.info-field__display {
  min-width: 0;
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  color: var(--ph-color-text-primary);
}

.info-field__display a {
  color: var(--ph-color-primary);
  text-decoration: none;
}

.info-field--monospace .info-field__display {
  font-family: var(--ph-font-mono);
  letter-spacing: var(--ph-letter-spacing-tight);
}

.info-field__display a:hover,
.info-field__display a:focus-visible {
  text-decoration: underline;
}

.info-field__placeholder {
  color: var(--ph-color-text-muted);
}

.info-field__chips {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.info-field__copy {
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: var(--ph-color-surface-soft);
  color: var(--ph-color-text-soft);
  border-radius: var(--ph-radius-pill);
  padding: 0.2rem 0.55rem;
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--ph-transition-quick),
    border-color var(--ph-transition-quick);
}

.info-field__copy:hover,
.info-field__copy:focus-visible {
  background: var(--ph-color-accent-soft);
  border-color: var(--ph-color-accent-bright);
  outline: none;
}

/* SSN Reveal button - prominent eye icon button */
.info-field__reveal {
  border: 1px solid var(--ph-color-accent-bright, #3b82f6);
  background: var(--ph-color-accent-soft, #eff6ff);
  color: var(--ph-color-accent-bright, #3b82f6);
  border-radius: var(--ph-radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: var(--ph-font-size-t5);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--ph-transition-quick);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.info-field__reveal::before {
  content: '👁';
  font-size: 0.85em;
}

.info-field__reveal .visually-hidden {
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.info-field__reveal:hover,
.info-field__reveal:focus-visible {
  background: var(--ph-color-accent-bright, #3b82f6);
  color: #fff;
  border-color: var(--ph-color-accent-bright, #3b82f6);
  outline: none;
  transform: scale(1.02);
}

.info-field__reveal:disabled {
  opacity: 0.6;
  cursor: wait;
}

.member-summary__rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ph-space-xs);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(215, 226, 246, 0.7);
}

.member-summary__rail-header h2 {
  margin: 0;
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  letter-spacing: var(--ph-letter-spacing-caps);
  text-transform: uppercase;
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary);
}

/* 
 * Comments section with independent vertical scrolling.
 * Takes all available vertical space within the activity card (100%).
 * The parent (.member-summary__cell--activity) spans 2 grid rows, and this section
 * fills that entire space, scrolling when content exceeds the available height.
 * This maximizes the use of the grid's vertical space for comments.
 */
.member-comments {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm);
  margin-bottom: var(--ph-space-md);
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.member-comments__header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.member-comments__header h3 {
  margin: 0;
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
  color: var(--ph-color-text-primary);
}

.member-comments__header p {
  margin: 0;
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  color: var(--ph-color-text-soft);
}

.member-comments__form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.member-comments__form textarea {
  resize: vertical;
  min-height: 3.4rem;
  border-radius: var(--ph-radius-md);
  border: 1px solid rgba(208, 219, 239, 0.9);
  padding: 0.55rem 0.65rem;
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  line-height: 1.4;
  color: var(--ph-color-text-primary);
  background: var(--ph-color-surface);
}

.member-comments__form textarea:focus-visible {
  border-color: var(--ph-color-accent-bright);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.member-comments__form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.member-comments__submit {
  border: none;
  border-radius: var(--ph-radius-pill);
  background: var(--ph-color-accent);
  color: var(--ph-color-text-inverse);
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  font-weight: var(--ph-font-weight-label);
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: opacity var(--ph-transition-quick);
}

.member-comments__submit:hover,
.member-comments__submit:focus-visible {
  opacity: 0.9;
}

.member-comments__form--busy {
  opacity: 0.65;
  pointer-events: none;
}

.member-comments__error {
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  color: var(--ph-color-danger);
}

.member-comments__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;    /* Fill all remaining vertical space in the Activity rail */
  min-height: 0;   /* Allow flex shrink below content height; required for overflow-y to engage */
  overflow-y: auto;
  padding-right: 0.25rem; /* Slight padding for scrollbar clearance */
}

.member-comments__empty {
  margin: 0;
  font-size: var(--ph-font-size-t5); /* T5 — Small meta */
  color: var(--ph-color-text-soft);
  font-style: italic;
}

/* Comment entry — clean lines, no boxing, hover-reveal actions */
.member-comment {
  position: relative;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--ph-color-border-soft);
}

.member-comment:last-child {
  border-bottom: none;
}

.member-comment__avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ph-color-primary);
  color: #fff;
  font-weight: var(--ph-font-weight-label);
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.member-comment__body {
  flex: 1 1 auto;
  min-width: 0;
}

.member-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.member-comment__author {
  font-weight: var(--ph-font-weight-label);
  font-size: var(--ph-font-size-t5); /* T5 — tighter */
  color: var(--ph-color-text-primary);
}

/* Separator dot after author */
.member-comment__author::after {
  content: '·';
  margin-left: 0.35rem;
  color: var(--ph-color-text-soft);
  font-weight: 400;
}

.member-comment__timestamp {
  font-size: var(--ph-font-size-t5); /* T5 */
  color: var(--ph-color-text-soft);
}

.member-comment__text {
  margin: 0;
  font-size: var(--ph-font-size-t5); /* T5 */
  color: var(--ph-color-text-primary);
  word-break: break-word;
  line-height: 1.4;
}

/* Actions — inline in header, hover-reveal */
.member-comment__actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.member-comment:hover .member-comment__actions,
.member-comment:focus-within .member-comment__actions {
  opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
  .member-comment__actions {
    opacity: 1;
  }
}

.member-comment__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: var(--ph-radius-xs);
  background: transparent;
  color: var(--ph-color-text-soft);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  text-decoration: none;
}

.member-comment__action:hover,
.member-comment__action:focus-visible {
  color: var(--ph-color-primary);
  background: var(--ph-color-surface-accent);
  outline: none;
}

.member-comment__action--delete:hover,
.member-comment__action--delete:focus-visible {
  color: var(--ph-color-danger);
  background: rgba(220, 38, 38, 0.08);
}

/* Legacy comment badge — indicates imported from old system */
.member-comment__legacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border: none;
  border-radius: var(--ph-radius-sm);
  background: var(--ph-color-surface-accent);
  color: var(--ph-color-text-soft);
  font-size: var(--ph-font-size-t6);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.member-comment__legacy-badge:hover,
.member-comment__legacy-badge:focus-visible {
  background: var(--ph-color-info-light, #e0f2fe);
  color: var(--ph-color-info, #0284c7);
  outline: none;
}

.member-comment__legacy-badge i {
  font-size: 0.75rem;
}

/* Comment edit form layout */
.comment-edit-form {
  margin-top: var(--ph-space-md);
}

.comment-edit-form__body {
  max-width: 48rem;
}

.comment-edit-form__body textarea {
  font-size: var(--ph-font-size-t4);
  line-height: 1.5;
}

/*
 * Activity list section with independent vertical scrolling.
 * Takes 1/4 of the vertical space (flex:1) while comments take 3/4 (flex:3).
 * Positioned below comments in the activity card, this section scrolls
 * independently when activity entries exceed available vertical space.
 */
.member-summary__activity {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
  flex: 1 1 0; /* Take 1x space (1/4 of total when comments have flex:3), can shrink, base size 0 */
  overflow-y: auto; /* Changed from hidden to enable vertical scrolling */
  min-height: 0; /* Critical: allows flexbox child to shrink below content size */
}

.member-summary__activity-extra {
  margin-top: var(--ph-space-sm, 0.75rem);
  padding-top: var(--ph-space-sm, 0.75rem);
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
}

.workspace-activity {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--ph-radius-md, 12px);
  background: var(--ph-color-surface, #ffffff);
  border: 1px solid rgba(208, 219, 239, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.workspace-activity--placeholder {
  opacity: 0.75;
  background: var(--ph-color-surface-accent, #f2f6ff);
  border-style: dashed;
}

.workspace-activity__icon {
  flex: 0 0 auto;
}

.workspace-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
}

.workspace-activity--placeholder .workspace-icon {
  background: rgba(148, 163, 184, 0.3);
}

.workspace-icon--clipboard {
  background: rgba(8, 145, 178, 0.22);
}

.workspace-icon--eye {
  background: rgba(236, 72, 153, 0.22);
}

.workspace-icon--pen {
  background: rgba(245, 158, 11, 0.22);
}

.workspace-icon--credit-card {
  background: rgba(16, 185, 129, 0.25);
}

.workspace-icon--activity {
  background: rgba(79, 70, 229, 0.2);
}

.workspace-icon--external-link {
  background: rgba(99, 102, 241, 0.25);
}

.workspace-icon--chat {
  background: rgba(14, 165, 233, 0.25);
}

.workspace-activity__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.workspace-activity__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.workspace-activity__title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ph-color-text-primary, #0f172a);
}

.workspace-activity__timestamp {
  font-size: 0.72rem;
  color: var(--ph-color-text-soft, #6b7280);
}

.workspace-activity__description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ph-color-text-default, #1f2937);
}

.workspace-activity__link {
  font-size: 0.75rem;
  color: var(--ph-color-text-link, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.workspace-activity__link:hover,
.workspace-activity__link:focus-visible {
  text-decoration: underline;
  color: var(--ph-color-accent-bright, #3b82f6);
}

.editor-popover {
  min-width: 260px;
  background: var(--ph-color-surface-default, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.65);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  z-index: 1300;
}

.editor-popover__content {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-popover__header,
.editor-popover__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.editor-popover__header span {
  font-weight: 600;
  color: var(--ph-color-text-default, #1f2937);
}

.editor-popover__field {
  display: flex;
}

.editor-popover__input {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color var(--ph-transition-quick, 0.18s ease),
    box-shadow var(--ph-transition-quick, 0.18s ease);
}

.editor-popover__input:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.editor-popover__save {
  border: none;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.9);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background var(--ph-transition-quick, 0.18s ease);
}

.editor-popover__save:hover,
.editor-popover__save:focus-visible {
  background: rgba(37, 99, 235, 0.95);
  outline: none;
}

.editor-popover__error {
  color: #b91c1c;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.editor-popover--busy {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 768px) {
  .member-summary {
    padding: 1.1rem;
  }

  .info-field__label {
    flex-basis: 120px;
  }
}

/* Member summary --------------------------------------------------------- */

.member-overview {
  background: var(--ph-color-surface, #ffffff);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-lg, 14px);
  padding: var(--ph-space-lg, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-lg, 1.75rem);
}

.member-overview__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ph-space-sm, 0.75rem);
}

.member-overview__title-block {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-2xs, 0.25rem);
  min-width: 0;
}

.member-overview__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ph-color-text-strong, #0f172a);
}

.member-overview__meta {
  font-size: 0.85rem;
  color: var(--ph-color-text-soft, #6b7280);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__header-actions {
  display: flex;
  align-items: center;
  gap: var(--ph-space-sm, 0.75rem);
}

.member-overview__header-actions .dropdown {
  margin-bottom: 0 !important;
}

.member-overview__status {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.member-overview__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: var(--ph-space-lg, 1.75rem);
}

.member-overview__summary {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-md, 1.25rem);
}

.member-overview__group {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-xs, 0.5rem);
  border-top: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding-top: var(--ph-space-sm, 0.75rem);
}

.member-overview__group:first-child {
  border-top: none;
  padding-top: 0;
}

.member-overview__group-title {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ph-color-text-muted, #4b5563);
}

.member-overview__rows {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__row {
  display: grid;
  grid-template-columns: minmax(140px, 0.55fr) minmax(0, 1fr);
  align-items: baseline;
  gap: var(--ph-space-xs, 0.5rem);
  font-size: 0.95rem;
}

.member-overview__label {
  color: var(--ph-color-text-soft, #6b7280);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.member-overview__value {
  color: var(--ph-color-text-default, #212529);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__copy {
  background: none;
  border: none;
  color: var(--ph-color-text-soft, #6b7280);
  font-size: 0.75rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.member-overview__copy.is-copied {
  color: var(--ph-color-primary, #1d4ed8);
}

.member-overview__pill {
  margin-left: var(--ph-space-xs, 0.5rem);
  font-size: 0.72rem;
  text-transform: none;
}

.member-overview__link-row {
  display: flex;
  justify-content: flex-end;
}

.member-overview__link {
  color: var(--ph-color-text-primary, #1f2937);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ph-transition-default, 0.18s ease);
}

.member-overview__link:hover,
.member-overview__link:focus-visible {
  border-color: currentColor;
  outline: none;
}

.member-overview__activity {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
  max-height: calc(100vh - 260px);
  min-height: 320px;
}

.member-overview__activity-header {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__activity-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ph-color-text-soft, #6b7280);
}

.member-overview__activity-feed {
  flex: 1;
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-md, 12px);
  padding: var(--ph-space-sm, 0.75rem) var(--ph-space-md, 1.25rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
}

.member-overview__activity-entry {
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__activity-meta {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ph-color-text-muted, #4b5563);
  display: flex;
  justify-content: space-between;
  gap: var(--ph-space-xs, 0.5rem);
}

.member-overview__activity-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ph-color-text-default, #212529);
}

.member-overview__activity-empty {
  text-align: center;
  color: var(--ph-color-text-soft, #6b7280);
  font-size: 0.9rem;
}

.member-overview__modules {
  border-top: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding-top: var(--ph-space-sm, 0.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-2xs, 0.25rem);
}

.member-overview__modules-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-color-text-muted, #4b5563);
}

.member-overview__modules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ph-space-xs, 0.5rem);
}

.member-overview__modules-list li::after {
  content: '';
}

@media (max-width: 1024px) {
  .member-overview__body {
    grid-template-columns: 1fr;
  }

  .member-overview__activity {
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .member-overview {
    padding: var(--ph-space-md, 1.25rem);
  }

  .member-overview__title {
    font-size: 1.5rem;
  }

  .member-overview__row {
    grid-template-columns: 1fr;
  }
}

/* Member lookup ----------------------------------------------------------- */

.member-lookup {
  display: grid;
  gap: var(--ph-space-lg, 1.75rem);
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 992px) {
  .member-lookup {
    grid-template-columns: 1fr;
  }
}

.member-lookup__panel,
.member-lookup__results {
  background: var(--ph-color-surface, #ffffff);
  border-radius: var(--ph-radius-lg, 14px);
  box-shadow: var(--ph-shadow-card, 0 8px 14px rgba(30, 64, 175, 0.06));
  padding: var(--ph-space-lg, 1.75rem);
}

.member-lookup__title {
  font-size: var(--ph-font-size-t1); /* T1 — Page title */
  font-weight: var(--ph-font-weight-heading);
  margin-bottom: var(--ph-space-sm, 0.75rem);
  color: var(--ph-color-text-strong, #0f172a);
}

.member-lookup__lead {
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  color: var(--ph-color-text-muted, #4b5563);
  margin-bottom: var(--ph-space-md, 1.25rem);
}

.member-lookup__field {
  margin-bottom: var(--ph-space-sm, 0.75rem);
}

.member-lookup__input {
  font-size: var(--ph-font-size-t2); /* T2 — Prominent input */
  padding: 1rem 1.1rem;
}

/* Advanced Search Toggle Button */
.member-lookup__toggle-wrapper {
  margin-bottom: var(--ph-space-sm, 0.75rem);
}

.member-lookup__toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--ph-font-size-t5); /* T5 - Small meta */
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary);
  border: 1px solid var(--ph-color-border-soft);
  background: var(--ph-color-surface);
  border-radius: var(--ph-radius-sm, 10px);
  padding: 0.5rem 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
}

.member-lookup__toggle-btn:hover {
  background: var(--ph-color-surface-accent);
  border-color: var(--ph-color-border-strong);
}

.member-lookup__toggle-btn:focus-visible {
  outline: 2px solid var(--ph-color-primary);
  outline-offset: 2px;
}

.member-lookup__toggle-icon {
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.member-lookup__toggle-btn[aria-expanded="true"] .member-lookup__toggle-icon {
  transform: rotate(180deg);
}

/* Advanced Search Panel */
.member-lookup__advanced {
  /* Always visible per Jenny — used daily, not a dropdown */
  max-height: 400px;
  overflow: visible;
  opacity: 1;
  margin-top: var(--ph-space-sm);
  padding-top: var(--ph-space-md);
  border-top: 1px solid var(--ph-color-border-soft);
}

.member-lookup__advanced-grid {
  display: grid;
  gap: var(--ph-space-md, 1.25rem);
  grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
}

/* Single column on mobile */
@media (max-width: 768px) {
  .member-lookup__advanced-grid {
    grid-template-columns: 1fr;
  }
}

.member-lookup__advanced-field {
  margin-bottom: 0; /* Grid provides spacing */
}

.member-lookup__advanced-field label {
  font-size: var(--ph-font-size-t5);
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: block;
}

.member-lookup__advanced-field input {
  font-size: var(--ph-font-size-t4);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ph-color-border-soft);
  border-radius: var(--ph-radius-sm);
  transition: all 0.2s ease;
  width: 100%;
}

.member-lookup__advanced-field input:focus {
  border-color: var(--ph-color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.member-lookup__form-actions {
  display: flex;
  gap: var(--ph-space-sm, 0.75rem);
  align-items: center;
  justify-content: flex-start;
  margin-bottom: var(--ph-space-sm, 0.75rem);
  margin-top: var(--ph-space-md, 1.25rem);
}

.member-lookup__results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--ph-space-sm, 0.75rem);
  gap: var(--ph-space-sm, 0.75rem);
}

.member-lookup__summary {
  font-weight: 600;
  color: var(--ph-color-text-primary, #1f2937);
}

.member-lookup__hint {
  color: var(--ph-color-text-muted, #4b5563);
  font-size: 0.9rem;
}

.member-lookup__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-xs, 0.35rem);
}

.member-lookup__list-item {
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-md, 10px);
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition:
    background var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease),
    box-shadow var(--ph-transition-default, 0.18s ease);
}

/* Mouse mode: hover provides the highlight */
.member-lookup__list[data-interaction='mouse'] .member-lookup__list-item:hover {
  background: var(--ph-color-surface-accent, #f2f6ff);
  border-color: var(--ph-color-border-highlight, #bed0ff);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Mouse mode: suppress focus styling so only hover applies */
.member-lookup__list[data-interaction='mouse'] .member-lookup__list-item:focus,
.member-lookup__list[data-interaction='mouse'] .member-lookup__list-item:focus-visible {
  background: inherit;
  border-color: var(--ph-color-border-soft, #dde3f1);
  outline: none;
  box-shadow: none;
}

/* Keyboard mode: .is-active and focus-visible provide the highlight, suppress hover */
.member-lookup__list[data-interaction='keyboard'] .member-lookup__list-item:hover {
  /* Suppress hover in keyboard mode */
  background: inherit;
  border-color: var(--ph-color-border-soft, #dde3f1);
  box-shadow: none;
}

.member-lookup__list[data-interaction='keyboard'] .member-lookup__list-item.is-active,
.member-lookup__list[data-interaction='keyboard'] .member-lookup__list-item:focus-visible {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--ph-color-border-highlight, #6b8bfd);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
}

.member-lookup__row {
  display: flex;
  gap: var(--ph-space-sm, 0.75rem);
  align-items: flex-start;
}

.member-lookup__cell {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.member-lookup__name {
  font-size: var(--ph-font-size-t4); /* T4 — Body text */
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-primary, #1f2937);
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-normal);
}

.member-lookup__cell--name {
  flex: 1.1 1 0;
}

.member-lookup__cell--address {
  flex: 1.3 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  max-width: 300px;
}

.member-lookup__address-line {
  display: block;
  font-size: var(--ph-font-size-t5);
  color: var(--ph-color-text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.member-lookup__cell--phone,
.member-lookup__cell--phone2 {
  flex: 0.8 1 0;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 150px;
}

.member-lookup__address {
  font-weight: 500;
  color: var(--ph-color-text-primary, #1f2937);
}

.member-lookup__muted {
  color: var(--ph-color-text-soft, #6b7280);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.member-lookup__empty {
  margin-top: var(--ph-space-sm, 0.75rem);
  color: var(--ph-color-text-muted, #4b5563);
}

.ph-nav-notifications {
  margin: 0;
}

.ph-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--ph-color-nav-bg, #1f3d7a);
  color: var(--ph-color-text-inverse, #ffffff);
  border: 0;
  transition:
    background var(--ph-transition-default, 0.18s ease),
    transform var(--ph-transition-quick, 0.16s ease);
}

.ph-menu-trigger:hover,
.ph-menu-trigger:focus {
  background: var(--ph-color-nav-bg-hover, #193265);
  color: var(--ph-color-text-inverse, #ffffff);
}

.ph-menu-trigger:focus-visible {
  outline: 2px solid var(--ph-color-nav-outline, #91b4ff);
  outline-offset: 2px;
}

.ph-menu-trigger:active {
  transform: translateY(1px);
}

.ph-menu-icon {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.ph-menu-label {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

main#main.ph-site-container {
  padding-top: 1rem;
  max-width: clamp(320px, 92vw, 1560px);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.75rem, 1.5vw, 1rem);
  padding-right: clamp(0.75rem, 1.5vw, 1rem);
}

@media (min-width: 992px) {
  main#main.ph-site-container {
    padding-top: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Mobile navbar simplification: collapse quick nav pills so only logo, alerts, and menu remain to avoid horizontal scrolling. */

  /* Legacy navbar selectors (Bootstrap 5 base classes) */
  .navbar-brand img {
    max-height: 44px;
  }

  .navbar-nav .nav-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .navbar .fa-solid.fa-bars {
    font-size: 1.05rem;
  }

  /* Custom navbar components */
  .ph-navbar-container {
    gap: var(--ph-space-sm, 0.75rem);
    padding-top: var(--ph-space-xs, 0.5rem);
    padding-bottom: var(--ph-space-xs, 0.5rem);
  }

  .ph-navbar-main {
    justify-content: flex-end;
    gap: var(--ph-space-xs, 0.5rem);
  }

  .ph-quick-nav {
    display: none;
  }

  .ph-navbar-actions {
    gap: var(--ph-space-xs, 0.5rem);
  }

  .ph-menu-trigger {
    padding: 0.5rem 0.9rem;
  }

  .ph-menu-label {
    display: none;
  }
}

.ph-navbar-context {
  background: var(--ph-color-nav-context-bg, #f6f8fb);
  border-bottom: 1px solid var(--ph-color-nav-context-border, #e3e9f1);
  position: sticky;
  top: 0;
  z-index: 900;
}

.ph-context-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.ph-context-breadcrumb .breadcrumb {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.ph-context-title span {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ph-color-nav-context-title, #14324f);
}

@media (max-width: 768px) {
  .ph-context-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .ph-context-title span {
    font-size: 1rem;
  }
}

/* Offcanvas + login adjustments ----------------------------------------- */

.offcanvas .list-group-item {
  border: none;
}

.offcanvas .accordion-button {
  padding: 0.5rem 1rem;
}

.offcanvas .accordion-body a {
  padding-left: 0.25rem;
}

.offcanvas {
  max-width: 320px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--ph-color-surface, #ffffff);
  border-radius: 0.5rem;
}

.login-card .card-body {
  padding: 1.75rem;
}

.login-title {
  color: var(--ph-color-nav-context-title, #14324f);
  font-weight: 600;
}

.site-login .form-control {
  height: calc(2.25rem + 0.5rem);
}

.site-login .btn-lg {
  padding: 0.75rem 1rem;
}

@media (max-width: 576px) {
  .login-card {
    max-width: 340px;
    margin: 0 0.5rem;
  }
}

.member-lookup__status-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ph-color-text-muted, #4b5563);
}

.member-lookup__status-tag--active {
  color: var(--ph-color-success, #16a34a);
}

.member-lookup__status-tag--inactive {
  color: var(--ph-color-text-soft, #6b7280);
}

.member-lookup__status-tag--retired {
  color: var(--ph-color-accent-bright, #3b82f6);
}

.member-lookup__status-tag--danger {
  color: var(--ph-color-danger, #dc2626);
}

.member-lookup__status-tag--muted {
  color: var(--ph-color-text-muted, #4b5563);
}
.member-lookup__email {
  font-weight: 500;
  color: var(--ph-color-text-primary, #1f2937);
  overflow-wrap: anywhere;
}

.ph-home-hero {
  text-align: center;
  max-width: 1040px;
  margin: 0 auto 2rem;
}

.ph-home-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--ph-radius-pill, 999px);
  background: var(--ph-color-accent-soft, #e0e7ff);
  color: var(--ph-color-accent, #4338ca);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ph-home-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.75rem 0 0.25rem;
}

.ph-home-subtitle {
  margin: 0;
  color: var(--ph-color-text-muted, #4b5563);
  font-size: 1rem;
}

.ph-home-frame {
  background: var(--ph-color-surface, #ffffff);
  border-radius: var(--ph-radius-xl, 18px);
  box-shadow: var(--ph-shadow-deep, 0 18px 45px rgba(15, 23, 42, 0.08));
  padding: 1.75rem 2rem 2.25rem;
  max-width: 1040px;
  margin: 0 auto;
}

.ph-home-frame-title {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ph-color-primary, #1d4ed8);
}

.ph-home-grid {
  display: grid;
  gap: 1.5rem 1.25rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .ph-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ph-home-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.15rem; /* tightened */
  border-radius: var(--ph-radius-md, 12px);
  background: var(--ph-gradient-card, linear-gradient(90deg, #fbfdff 0%, #f2f6ff 100%));
  border: 1px solid var(--ph-color-border-subtle, #e1e9ff);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ph-shadow-card, 0 8px 14px rgba(30, 64, 175, 0.06));
  transition:
    transform var(--ph-transition-quick, 0.16s ease),
    box-shadow var(--ph-transition-quick, 0.16s ease),
    border-color var(--ph-transition-quick, 0.16s ease);
}

.ph-home-item:hover,
.ph-home-item:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--ph-shadow-float, 0 16px 28px rgba(59, 130, 246, 0.18));
  border-color: var(--ph-color-border-highlight, #bed0ff);
  outline: none;
}

.ph-home-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--ph-radius-md, 12px);
  background: var(--ph-color-accent-bright, #3b82f6);
  color: var(--ph-color-text-inverse, #ffffff);
  font-size: var(--ph-font-size-t3); /* T3 — Prominent icon size (was 1.1rem) */
  flex-shrink: 0;
}

.ph-home-item-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ph-home-item-title {
  font-size: var(--ph-font-size-t2); /* T2 — Section headers, prominent (was T3) */
  font-weight: var(--ph-font-weight-label);
}

.ph-home-item-desc {
  font-size: var(--ph-font-size-t4); /* T4 — Body text (was 0.95rem) */
  color: var(--ph-color-text-muted, #4b5563);
}

.ph-home-item-label {
  font-size: var(--ph-font-size-t2); /* T2 — Section headers, prominent */
  font-weight: var(--ph-font-weight-label);
  letter-spacing: var(--ph-letter-spacing-normal);
}

.ph-home-item--feature {
  align-items: flex-start;
  padding: 1.2rem 1.4rem;
  min-height: 120px; /* reduced */
}

.ph-home-item--feature .ph-home-item-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: var(--ph-radius-md, 12px);
  font-size: var(--ph-font-size-t3); /* T3 — Prominent (was 1.15rem) */
}

.ph-home-item--feature .ph-home-item-title {
  font-size: var(--ph-font-size-t2); /* T2 — Section headers (was T3) */
}

.ph-home-item--classic {
  justify-content: flex-start;
  padding: 0.85rem 1.05rem;
  min-height: 64px; /* tightened */
}

.ph-home-item--classic .ph-home-item-icon {
  width: 2.2rem;
  height: 2.2rem;
}

.ph-home-item-badge {
  margin-left: auto;
  padding: 0.32rem 0.85rem;
  border-radius: var(--ph-radius-pill, 999px);
  background: var(--ph-color-badge-neutral, #e5e7eb);
  color: var(--ph-color-text-muted, #4b5563);
  font-size: var(--ph-font-size-t5); /* T5 — Small meta (was 0.72rem, upgraded to 0.875rem) */
  font-weight: var(--ph-font-weight-label);
  letter-spacing: var(--ph-letter-spacing-caps);
  text-transform: uppercase;
}

/* placeholder styling removed — unwired tiles use '#' links and share regular tile styles */

.ph-home-full {
  margin-top: 2rem;
}

.ph-home-item--full {
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.75rem;
}

.ph-home-item--full .ph-home-item-copy {
  align-items: center;
  text-align: center;
}

.ph-home-meta {
  margin: 1.75rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--ph-color-text-soft, #6b7280);
  font-size: var(--ph-font-size-t5); /* T5 — Small meta (was 0.85rem) */
  max-width: 1040px;
}

.ph-home-meta-item {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .ph-home {
    padding: 1.5rem 1rem 2.5rem;
  }

  .ph-home-frame {
    padding: 1.5rem;
  }

  .ph-home-item {
    padding: 1.05rem 1.35rem;
  }

  .ph-home-item--feature {
    padding: 1.35rem 1.6rem;
    min-height: 140px;
  }

  .ph-home-item-title {
    font-size: var(--ph-font-size-t2); /* T2 — Mobile size (was T3) */
  }
}

/* Deprecated tile variant: muted appearance, strikethrough title support */
.ph-home-item--deprecated {
  align-items: flex-start;
  padding: 1.2rem 1.4rem;
  min-height: 120px;
  opacity: 0.65;
  background: var(--ph-color-surface-alt, #f4f8fb);
  border-color: var(--ph-color-border-soft, #dde3f1);
}

.ph-home-item--deprecated:hover {
  opacity: 0.85;
}

.ph-home-item--deprecated .ph-home-item-icon {
  width: 2.8rem;
  height: 2.8rem;
  background: var(--ph-color-text-soft, #6b7280);
}

.ph-home-item--deprecated .ph-home-item-title {
  font-size: var(--ph-font-size-t2); /* T2 — Section headers (was T3) */
  color: var(--ph-color-text-muted, #4b5563);
}

.ph-home-item--deprecated .ph-home-item-desc {
  font-size: var(--ph-font-size-t5); /* T5 — Small meta (was 0.85rem) */
  font-style: italic;
  color: var(--ph-color-text-soft, #6b7280);
}

/* Classic-deprecated variant: normal row size with deprecated styling */
.ph-home-item--classic-deprecated {
  justify-content: flex-start;
  padding: 0.85rem 1.05rem;
  min-height: 64px;
  opacity: 0.65;
  background: var(--ph-color-surface-alt, #f4f8fb);
  border-color: var(--ph-color-border-soft, #dde3f1);
}

.ph-home-item--classic-deprecated:hover {
  opacity: 0.85;
}

.ph-home-item--classic-deprecated .ph-home-item-icon {
  width: 2.2rem;
  height: 2.2rem;
  background: var(--ph-color-text-soft, #6b7280);
}

.ph-home-item--classic-deprecated .ph-home-item-title {
  font-size: var(--ph-font-size-t2); /* T2 — Section headers (was 1.1rem hardcoded) */
  font-weight: var(--ph-font-weight-label);
  color: var(--ph-color-text-muted, #4b5563);
}

.ph-home-item--classic-deprecated .ph-home-item-desc {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ph-color-text-soft, #6b7280);
  margin-top: 0.15rem;
}

/* Secondary drill-down menu (theme-aligned) ------------------------------- */

.ph-menu {
  padding: 1.75rem 0 3rem;
  max-width: 960px;
  margin: 0 auto;
  color: var(--ph-color-text-primary, #1f2937);
}

.ph-menu-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.ph-menu-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--ph-radius-pill, 999px);
  background: var(--ph-color-surface-halo, #dbeafe);
  color: var(--ph-color-primary, #1d4ed8);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.ph-menu-title {
  margin: 0.85rem 0 0.4rem;
  font-size: 1.85rem;
  font-weight: 700;
}

.ph-menu-summary {
  margin: 0;
  color: var(--ph-color-text-muted, #4b5563);
  font-size: 1rem;
}

.ph-menu-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ph-menu-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-radius: var(--ph-radius-lg, 14px);
  border: 1px solid var(--ph-color-border-subtle, #e1e9ff);
  background: var(--ph-gradient-card-alt, linear-gradient(90deg, #fbfdff 0%, #f3f6ff 100%));
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ph-shadow-panel, 0 12px 24px rgba(30, 64, 175, 0.08));
  transition:
    transform var(--ph-transition-default, 0.18s ease),
    box-shadow var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease);
}

.ph-menu-item:hover,
.ph-menu-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--ph-shadow-float, 0 16px 28px rgba(59, 130, 246, 0.18));
  border-color: var(--ph-color-border-highlight, #bed0ff);
  outline: none;
}

.ph-menu-item-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ph-menu-item-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.ph-menu-item-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--ph-radius-pill, 999px);
  background: var(--ph-color-badge-bg, #ede9fe);
  color: var(--ph-color-badge-text, #5b21b6);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ph-menu-item-desc {
  color: var(--ph-color-text-muted, #4b5563);
  font-size: 0.95rem;
  line-height: 1.45;
}

.ph-menu-empty {
  margin: 2rem 0;
  text-align: center;
  color: var(--ph-color-text-soft, #6b7280);
  font-size: 0.95rem;
}

.ph-menu-back {
  margin-top: 2.25rem;
  text-align: center;
}

.ph-menu-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  background: var(--ph-color-primary, #1d4ed8);
  color: var(--ph-color-text-inverse, #ffffff);
  border-radius: var(--ph-radius-pill, 999px);
  text-decoration: none;
  font-weight: 600;
  transition:
    background var(--ph-transition-default, 0.18s ease),
    transform var(--ph-transition-default, 0.18s ease);
}

.ph-menu-back-link:hover,
.ph-menu-back-link:focus-visible {
  background: var(--ph-color-primary-strong, #1e40af);
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 768px) {
  .ph-menu {
    padding: 1.5rem 1rem 2.5rem;
  }

  .ph-menu-item {
    padding: 0.9rem 1.05rem;
  }

  .ph-menu-title {
    font-size: 1.55rem;
  }
}

/* Payments add form ------------------------------------------------------ */

.payment-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--ph-space-lg, 1.75rem);
  margin-bottom: var(--ph-space-xl, 2.25rem);
}

@media (max-width: 768px) {
  .payment-shell {
    grid-template-columns: 1fr;
  }

  .payment-context {
    order: -1; /* Keep context at top on mobile */
  }
}

.payment-context {
  background: var(--ph-color-nav-context-bg, #f6f8fb);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-xl, 18px);
  padding: var(--ph-space-md, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
  transition:
    background var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease),
    box-shadow var(--ph-transition-default, 0.18s ease);
}

.payment-context header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ph-color-nav-context-title, #14324f);
}

.payment-context .member-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ph-color-text-soft, #6b7280);
}

.payment-context--balanced {
  background: var(--ph-color-status-balanced-bg, #dcfce7);
  border-color: var(--ph-color-status-balanced-border, #86efac);
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.3);
}

.payment-context--positive {
  background: var(--ph-color-status-positive-bg, #fef3c7);
  border-color: var(--ph-color-status-positive-border, #facc15);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.payment-context--negative {
  background: var(--ph-color-danger-soft, #fee2e2);
  border-color: var(--ph-color-status-negative-border, #f87171);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

.payment-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ph-space-sm, 0.75rem);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-lg, 14px);
  padding: var(--ph-space-sm, 0.75rem) var(--ph-space-md, 1.25rem);
  background: var(--ph-color-surface-soft, #fbfdff);
  transition:
    background var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease),
    box-shadow var(--ph-transition-default, 0.18s ease),
    color var(--ph-transition-default, 0.18s ease);
}

.payment-status__totals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ph-space-md, 1.25rem);
}

.payment-status__totals div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.payment-status__totals span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ph-color-text-soft, #6b7280);
  font-weight: 600;
}

.payment-status__totals strong {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--ph-color-text-primary, #1f2937);
}

.payment-status__message {
  margin: 0;
  flex: 1;
  min-width: 220px;
  font-size: 0.85rem;
  color: var(--ph-color-text-muted, #4b5563);
}

.payment-status__actions {
  display: flex;
  align-items: center;
}

.payment-status.is-balanced {
  background: var(--ph-color-status-balanced-bg, #dcfce7);
  border-color: var(--ph-color-status-balanced-border, #86efac);
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.3);
}

.payment-status.is-balanced .payment-status__message {
  color: var(--ph-color-success, #16a34a);
}

.payment-status.is-positive {
  background: var(--ph-color-status-positive-bg, #fef3c7);
  border-color: var(--ph-color-status-positive-border, #facc15);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.payment-status.is-positive .payment-status__message {
  color: var(--ph-color-warning, #f97316);
}

.payment-status.is-negative {
  background: var(--ph-color-danger-soft, #fee2e2);
  border-color: var(--ph-color-status-negative-border, #f87171);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

.payment-status.is-negative .payment-status__message {
  color: var(--ph-color-danger, #dc2626);
}

.ledger-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--ph-space-sm, 0.75rem);
  margin: 0;
}

.ledger-summary div {
  background: var(--ph-color-surface, #ffffff);
  border-radius: var(--ph-radius-lg, 14px);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
}

.ledger-summary dt {
  margin: 0 0 0.25rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ph-color-text-soft, #6b7280);
}

.ledger-summary dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ph-color-text-primary, #1f2937);
}

.payment-shell .balance-positive {
  color: var(--ph-color-danger, #dc2626);
}

.payment-shell .balance-clear {
  color: var(--ph-color-success, #16a34a);
}

/* Init credit surplus display */
.ledger-summary--surplus .balance-credit {
  color: var(--ph-color-success, #16a34a);
  font-weight: 600;
}

/* Init surplus tracker — live feedback during credit application */
.init-tracker {
  padding: var(--ph-space-xs) var(--ph-space-sm);
  border-radius: var(--ph-radius-sm);
  background: var(--ph-color-surface-soft);
  border: 1px solid var(--ph-color-border-soft);
  font-size: var(--ph-font-size-t5); /* T5 — Detail text */
  margin-top: var(--ph-space-xs);
}
.init-tracker__row {
  display: flex;
  justify-content: space-between;
  padding: var(--ph-space-2xs) 0;
}
.init-tracker--active {
  border-color: var(--ph-color-success, #16a34a);
  background: color-mix(in srgb, var(--ph-color-success) 8%, var(--ph-color-surface));
}
.init-tracker--active .init-tracker__row strong {
  color: var(--ph-color-success, #16a34a);
}
.init-tracker--exceeded {
  border-color: var(--ph-color-danger, #dc2626);
  background: var(--ph-color-danger-soft, #fee2e2);
}
.init-tracker--exceeded .init-tracker__row strong {
  color: var(--ph-color-danger, #dc2626);
}
.init-tracker__message {
  color: var(--ph-color-danger, #dc2626);
  font-weight: 600;
  margin: var(--ph-space-2xs) 0 0;
  font-size: var(--ph-font-size-t5); /* T5 — Detail text */
}

.ledger-periods {
  background: var(--ph-color-surface, #ffffff);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-lg, 14px);
  padding: var(--ph-space-sm, 0.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
}

.ledger-periods h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--ph-color-nav-context-title, #14324f);
}

.ledger-periods__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ph-color-text-soft, #6b7280);
}

.ledger-periods ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ledger-periods li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-md, 12px);
  padding: 0.45rem 0.65rem;
  background: var(--ph-color-surface-accent, #f2f6ff);
}

.payment-main {
  background: var(--ph-color-surface, #ffffff);
  border-radius: var(--ph-radius-xl, 18px);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding: var(--ph-space-lg, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-lg, 1.75rem);
}

.payment-panel {
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-xl, 18px);
  padding: var(--ph-space-md, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: var(--ph-space-sm, 0.75rem);
}

.payment-panel legend {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ph-color-nav-context-title, #14324f);
}

.payment-shell .field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ph-space-md, 1.25rem);
}

.payment-shell .field-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.payment-shell .control-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ph-color-text-soft, #6b7280);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.payment-shell .form-control {
  border-radius: var(--ph-radius-md, 12px);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding: 0.45rem 0.6rem;
  box-shadow: none;
}

.payment-shell .receipt-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.payment-shell .receipt-row__manual {
  width: 7rem;
  flex-shrink: 0;
}

.payment-shell .receipt-row__toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ph-color-text-primary, #1f2937);
  white-space: nowrap;
}

.payment-shell .receipt-row__hint {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--ph-color-text-soft, #6b7280);
  margin-top: 0.25rem;
}

/* Receipt + Note combined row */
.payment-shell .field-block--receipt-row {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--ph-space-md, 1.25rem);
  align-items: flex-start;
}

.payment-shell .field-block--auto-receipt {
  flex: 0 0 auto;
  width: 90px;
}

.payment-shell .field-block--manual-receipt {
  flex: 0 0 auto;
  width: 90px;
}

.payment-shell .field-block--note {
  flex: 1 1 auto;
  min-width: 120px;
}

.payment-shell .field-block--note .form-control {
  width: 100%;
}

/* Mobile: stack receipt row vertically */
@media (max-width: 768px) {
  .payment-shell .field-block--receipt-row {
    flex-direction: column;
    gap: var(--ph-space-sm, 0.75rem);
  }

  .payment-shell .field-block--auto-receipt,
  .payment-shell .field-block--manual-receipt,
  .payment-shell .field-block--note {
    width: 100%;
    min-width: unset;
    flex: none;
  }
}

.payment-shell .checkbox-inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ph-color-text-primary, #1f2937);
}

.payment-shell .field-block--full {
  grid-column: 1 / -1;
}

.payment-shell .field-block--full textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
}

.payment-shell .tender-advanced {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--ph-color-border-soft, #dde3f1);
  padding-top: var(--ph-space-sm, 0.75rem);
}

.payment-shell .tender-advanced__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ph-space-md, 1.25rem);
  margin-top: 0.75rem;
}

/* Refund banner (full-row at top of payment-main) */
.payment-main .refund-banner {
  padding: var(--ph-space-sm, 0.75rem) var(--ph-space-md, 1.25rem);
  background: var(--ph-variant-row-bg, #ffedd5);
  border: 2px solid var(--ph-color-warning, #f97316);
  border-radius: var(--ph-radius-lg, 14px);
  color: var(--ph-variant-badge-text, #9a3412);
  font-size: var(--ph-font-size-t4, 0.9rem);
  font-weight: var(--ph-font-weight-label, 600);
  display: flex;
  align-items: center;
  gap: var(--ph-space-sm, 0.75rem);
}

.payment-main .refund-banner i {
  color: var(--ph-color-warning, #f97316);
  font-size: 1.25rem;
}

.payment-main .refund-banner[hidden] {
  display: none;
}

/* Refund warning banner (legacy, if still used inline) */
.payment-shell .refund-warning {
  margin-top: var(--ph-space-xs, 0.5rem);
  padding: var(--ph-space-xs, 0.5rem) var(--ph-space-sm, 0.75rem);
  background: var(--ph-variant-row-bg, #ffedd5);
  border: 1px solid var(--ph-color-warning, #f97316);
  border-radius: var(--ph-radius-sm, 10px);
  color: var(--ph-variant-badge-text, #9a3412);
  font-size: var(--ph-font-size-t5, 0.78rem);
  font-weight: var(--ph-font-weight-label, 600);
  display: flex;
  align-items: center;
  gap: var(--ph-space-xs, 0.5rem);
}

.payment-shell .refund-warning i {
  color: var(--ph-color-warning, #f97316);
}

/* Refund mode: disabled fields */
.payment-shell .refund-disabled {
  background: var(--ph-color-surface-muted, #f3f4f6) !important;
  color: var(--ph-color-text-muted, #9ca3af) !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Refund mode: active misc field highlight */
.payment-shell .refund-active-field {
  background: var(--ph-variant-row-bg, #ffedd5) !important;
  border-color: var(--ph-color-warning, #f97316) !important;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Credit periods section styling */
.ledger-periods--credits h2 {
  color: var(--ph-color-warning, #f97316);
}

.ledger-periods--credits .credit-amount {
  color: var(--ph-color-success, #059669);
  font-weight: 600;
}

.ledger-periods--credits li {
  border-left: 3px solid var(--ph-color-success, #059669);
}

.payment-shell .payment-panel--lines .line-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ph-space-md, 1.25rem);
}

.payment-shell .line-toolbar__note {
  font-size: 0.78rem;
  color: var(--ph-color-text-soft, #6b7280);
}

.payment-shell .table-wrapper {
  overflow-x: auto;
}

.payment-shell .line-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

.payment-shell .line-table thead th {
  background: var(--ph-color-surface-accent, #f2f6ff);
  border-bottom: 1px solid var(--ph-color-border-soft, #dde3f1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ph-color-text-primary, #1f2937);
  text-transform: uppercase;
  padding: 0.5rem 0.6rem;
}

.payment-shell .line-table tbody td {
  border-bottom: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding: 0.45rem 0.5rem;
  font-size: 0.82rem;
  vertical-align: middle;
}

.payment-shell .line-table input {
  width: 100%;
  border-radius: var(--ph-radius-md, 12px);
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  padding: 0.35rem 0.45rem;
  font-size: 0.82rem;
}

.payment-shell .line-row--adjustments td {
  background: var(--ph-color-surface-soft, #fbfdff);
}

.payment-shell .adjustments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--ph-space-sm, 0.75rem);
}

.payment-shell .adjustments-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ph-color-text-muted, #4b5563);
}

.payment-shell .period-inputs {
  display: flex;
  gap: 0.4rem;
}

.payment-shell .form-control--compact {
  padding: 0.3rem 0.4rem;
  font-size: 0.78rem;
}

/*
 * Keep the actions cell as a normal table-cell so it shares row height with
 * sibling cells. `display: flex` on a <td> makes it ignore the row's grid
 * height (cell renders ~4px shorter than peers, buttons drift up by ~2px).
 * Use sibling margins instead of flex `gap` for the inter-button spacing.
 */
.payment-shell .cell-actions {
  white-space: nowrap;
}

.payment-shell .cell-actions .line-action-btn + .line-action-btn {
  margin-left: 0.5rem;
}

.line-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--ph-radius-md, 12px);
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--ph-color-text-primary, #1f2937);
  transition:
    background var(--ph-transition-default, 0.18s ease),
    border-color var(--ph-transition-default, 0.18s ease),
    color var(--ph-transition-default, 0.18s ease),
    box-shadow var(--ph-transition-default, 0.18s ease);
}

.line-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ph-color-primary-soft, rgba(59, 130, 246, 0.15));
}

.line-action-btn--primary {
  background: var(--ph-color-surface-accent, #f2f6ff);
  border-color: var(--ph-color-border-soft, #dde3f1);
  color: var(--ph-color-primary, #1d4ed8);
}

.line-action-btn--primary:hover,
.line-action-btn--primary:focus-visible {
  background: var(--ph-color-primary-soft, rgba(59, 130, 246, 0.15));
  border-color: var(--ph-color-primary, #1d4ed8);
  color: var(--ph-color-primary-strong, #1e40af);
}

.line-action-btn--ghost {
  background: var(--ph-color-surface, #ffffff);
  border-color: var(--ph-color-border-soft, #dde3f1);
  color: var(--ph-color-text-soft, #6b7280);
}

.line-action-btn--ghost:hover,
.line-action-btn--ghost:focus-visible {
  background: var(--ph-color-surface-accent, #f2f6ff);
  color: var(--ph-color-text-muted, #4b5563);
}

.line-action-btn--danger {
  background: var(--ph-color-danger-soft, #fee2e2);
  border-color: var(--ph-color-status-negative-border, #f87171);
  color: var(--ph-color-danger, #dc2626);
}

.line-action-btn--danger:hover,
.line-action-btn--danger:focus-visible {
  background: rgba(220, 38, 38, 0.12);
  border-color: var(--ph-color-danger, #dc2626);
}

.payment-shell .reset-row[hidden] {
  display: none;
}

.payment-shell .dues-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ph-color-danger, #dc2626);
  margin-top: 0.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--ph-radius-pill, 999px);
  background: var(--ph-color-danger-soft, #fee2e2);
}

.payment-shell .invalid-hint span {
  color: var(--ph-color-danger, #dc2626);
  font-size: 0.78rem;
}

.payment-history {
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-xl, 18px);
  padding: var(--ph-space-md, 1.25rem);
  background: var(--ph-color-surface, #ffffff);
}

.payment-history h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--ph-color-nav-context-title, #14324f);
}

/* Trello #219: scroll the recent-trans grid inside the panel so pagination is unnecessary
   and the in-progress payment form above is never refreshed. Sticky thead keeps column
   labels anchored while the clerk scrolls through history. ~25 rows visible at 720px. */
.payment-history__scroll {
  max-height: 720px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-md, 10px);
  background: var(--ph-color-surface, #ffffff);
}

.payment-history__scroll .grid-view {
  border: 0;
}

.payment-history__scroll table.kv-grid-table > thead th,
.payment-history__scroll table.table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ph-color-surface, #ffffff);
  box-shadow: inset 0 -1px 0 var(--ph-color-border-soft, #dde3f1);
}

.payment-history__scroll .summary {
  position: sticky;
  bottom: 0;
  background: var(--ph-color-surface, #ffffff);
  padding: 0.4rem 0.6rem;
  margin: 0;
  border-top: 1px solid var(--ph-color-border-soft, #dde3f1);
  font-size: 0.8rem;
  color: var(--ph-color-text-muted, #5a6478);
}

/* Trello #224: scroll the employer roster grid inside the panel so dispatch
   agents can flick through the whole member list without paging. Sticky thead
   keeps column labels anchored — pattern mirrors .payment-history__scroll but
   namespaced separately since the WHY differs (no in-progress form to protect,
   just continuous-scan ergonomics). 720px ≈ 25 rows visible. */
.employer-roster__scroll {
  max-height: 720px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--ph-color-border-soft, #dde3f1);
  border-radius: var(--ph-radius-md, 10px);
  background: var(--ph-color-surface, #ffffff);
}

.employer-roster__scroll .grid-view {
  border: 0;
}

.employer-roster__scroll table.kv-grid-table > thead th,
.employer-roster__scroll table.table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ph-color-surface, #ffffff);
  box-shadow: inset 0 -1px 0 var(--ph-color-border-soft, #dde3f1);
}

@media (max-width: 1200px) {
  .payment-shell {
    grid-template-columns: 1fr;
  }

  .payment-shell .payment-context {
    order: 2;
  }
}

@media (max-width: 768px) {
  .payment-shell .line-table {
    min-width: 0;
  }

  .payment-shell .payment-status {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Fix mobile overflow from payment-context */
  .payment-context {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .payment-context header h1 {
    font-size: 1.1rem;
    word-break: break-word;
  }

  .payment-status__totals {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .payment-status__message {
    font-size: 0.85rem;
  }
}

/* =================================================================
 * Monthly Reconciliation Report
 * Neutral admin mode — data density, zebra striping, monospace numbers.
 * All tokens from theme.css. Zero hardcoded values.
 * ================================================================= */

/* ── Page header ── */
.recon-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--ph-space-sm);
  margin-bottom: var(--ph-space-lg);
}

.recon-title {
  font-size: var(--ph-font-size-t1); /* T1 — Page title */
  font-weight: var(--ph-font-weight-heading);
  color: var(--ph-color-text-strong);
  margin: 0;
}

.recon-controls__row {
  display: flex;
  align-items: center;
  gap: var(--ph-space-xs);
}

.recon-month-picker {
  width: 14rem;
  font-size: var(--ph-font-size-t4); /* T4 — Body */
}

/* ── Empty state ── */
.recon-empty {
  text-align: center;
  padding: var(--ph-space-xl) var(--ph-space-md);
  color: var(--ph-color-text-soft);
  font-size: var(--ph-font-size-t3); /* T3 — Prominent */
}

/* ── Section headers ── */
.recon-section {
  margin-bottom: var(--ph-space-lg);
}

.recon-section__header {
  background: var(--ph-color-surface-accent);
  border-bottom: 2px solid var(--ph-color-border-strong);
  padding: var(--ph-space-xs) var(--ph-space-sm);
  font-size: var(--ph-font-size-t3); /* T3 — Section header */
  font-weight: var(--ph-font-weight-heading);
  letter-spacing: var(--ph-letter-spacing-caps);
  color: var(--ph-color-text-strong);
  margin: 0 0 0 0;
}

.recon-section__count {
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  font-weight: var(--ph-font-weight-body);
  color: var(--ph-color-text-muted);
  letter-spacing: var(--ph-letter-spacing-normal);
  margin-left: var(--ph-space-sm);
}

.recon-section__empty {
  padding: var(--ph-space-md);
  color: var(--ph-color-text-soft);
  font-size: var(--ph-font-size-t4); /* T4 — Body */
  font-style: italic;
}

/* ── Table styling ── */
.recon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ph-font-size-t4); /* T4 — Body text (matches trans grid) */
}

.recon-table thead th {
  background: var(--ph-stripe-even);
  border-bottom: 2px solid var(--ph-border-grid-strong);
  font-size: var(--ph-font-size-t4); /* T4 — Header (matches trans grid) */
  font-weight: var(--ph-font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
  color: var(--ph-color-text-muted);
  padding: var(--ph-space-2xs) var(--ph-space-xs);
  white-space: nowrap;
}

.recon-table tbody td {
  border-bottom: 1px solid var(--ph-border-grid);
  padding: var(--ph-space-2xs) var(--ph-space-xs);
  vertical-align: middle;
}

/* Zebra striping */
.recon-table tbody tr:nth-child(even) {
  background: var(--ph-stripe-even);
}

.recon-table tbody tr:hover {
  background: var(--ph-stripe-hover);
}

/* ── Column types ── */
.recon-num {
  font-family: var(--ph-font-mono);
  text-align: right;
  white-space: nowrap;
}

.recon-date {
  font-family: var(--ph-font-mono);
  white-space: nowrap;
  color: var(--ph-color-text-muted);
}

.recon-payer {
  font-weight: var(--ph-font-weight-label);
  white-space: nowrap;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recon-check {
  font-family: var(--ph-font-mono);
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  color: var(--ph-color-text-muted);
}

.recon-period {
  font-family: var(--ph-font-mono);
  white-space: nowrap;
}

.recon-zero {
  color: var(--ph-color-text-soft);
}

/* PPAC — visually de-emphasized (political money, not part of total) */
.recon-ppac {
  color: var(--ph-color-text-soft);
  font-size: var(--ph-font-size-t5); /* T5 — De-emphasized */
}

/* ── Subtotal rows ── */
.recon-subtotal {
  font-weight: var(--ph-font-weight-semibold);
  border-top: 2px solid var(--ph-color-border-strong);
}

.recon-subtotal td {
  padding-top: var(--ph-space-xs) !important;
  padding-bottom: var(--ph-space-xs) !important;
  background: var(--ph-color-surface-soft) !important;
}

.recon-subtotal__label {
  font-weight: var(--ph-font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
  font-size: var(--ph-font-size-t5); /* T5 — Meta */
  color: var(--ph-color-primary);
}

/* ── Grand total bar ── */
.recon-grand {
  background: var(--ph-color-surface-soft);
  border: 1px solid var(--ph-color-border-strong);
  border-radius: var(--ph-radius-sm);
  padding: var(--ph-space-sm) var(--ph-space-md);
  margin-top: var(--ph-space-md);
}

.recon-grand__row {
  display: flex;
  align-items: baseline;
  gap: var(--ph-space-md);
  flex-wrap: wrap;
}

.recon-grand__label {
  font-size: var(--ph-font-size-t3); /* T3 — Grand total label */
  font-weight: var(--ph-font-weight-heading);
  text-transform: uppercase;
  letter-spacing: var(--ph-letter-spacing-caps);
  color: var(--ph-color-text-strong);
}

.recon-grand__value {
  font-size: var(--ph-font-size-t2); /* T2 — Grand total amount */
  font-weight: var(--ph-font-weight-heading);
  font-family: var(--ph-font-mono);
  color: var(--ph-color-text-strong);
}

.recon-grand__detail {
  font-size: var(--ph-font-size-t5); /* T5 — Breakdown */
  font-family: var(--ph-font-mono);
  color: var(--ph-color-text-muted);
}

.recon-grand__ppac {
  margin-top: var(--ph-space-2xs);
  font-size: var(--ph-font-size-t5); /* T5 — PPAC note */
  color: var(--ph-color-text-soft);
  font-family: var(--ph-font-mono);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .recon-header {
    grid-template-columns: 1fr;
    gap: var(--ph-space-xs);
  }

  .recon-title {
    font-size: var(--ph-font-size-t2); /* T2 — Smaller on mobile */
  }

  .recon-grand__row {
    flex-direction: column;
    gap: var(--ph-space-2xs);
  }
}
