* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.5;
}
.app { max-width: 1280px; margin: 0 auto; padding: 24px; }
.brand { font-size: 12px; color: #64748b; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.06em; }
h1 { margin: 0 0 4px; font-size: 28px; }
.subtle {
  color: #64748b;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

/* Section headers sit above description/subtle text in size and weight */
.section-title,
.account-card h4,
.profile-grid h4,
.loan-repayments-title,
.panel-head h3,
.panel-head h4,
.card h3,
.loan-lot-summary strong {
  font-weight: 600;
  color: #1e293b;
}

.flexxforms-embed-host {
  width: 100%;
  min-height: 400px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.flexxforms-embed-host iframe,
.flexxforms-embed-mount iframe,
.flexxforms-public-embed-frame {
  width: 100%;
  display: block;
  border: 0;
  min-height: 400px;
}

.flexxforms-embed-frame {
  width: 100%;
  min-height: 400px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  display: block;
}
.flexxforms-apply-card {
  max-width: 960px;
}

.flexxforms-catalog {
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.flexxforms-catalog-head h4 {
  margin: 0 0 6px;
  color: #312e81;
}

.flexxforms-catalog-head .hint {
  margin: 0;
}

.flexxforms-catalog-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.flexxforms-catalog-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.flexxforms-catalog-item-title {
  display: block;
  font-size: 1.05rem;
  color: #0f172a;
}

.flexxforms-catalog-item-id {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  word-break: break-all;
}

.flexxforms-catalog-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.flexxforms-catalog-item-actions .hint {
  margin: 0;
  font-weight: 600;
  color: #334155;
}

.flexxforms-assign-btn.is-linked {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
}

.flexxforms-id-input.is-assigned {
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.flexxforms-applications-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.flexxforms-application-card {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.flexxforms-application-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flexxforms-application-checklist {
  margin: 10px 0 0;
  padding-left: 18px;
}

.flexxforms-application-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.flexxforms-manual-ids-head {
  margin: 0 0 10px;
}

.flexxforms-catalog-group-title {
  margin: 16px 0 8px;
}

.flexxforms-catalog-group-title:first-child {
  margin-top: 0;
}

.flexxforms-catalog-loading,
.flexxforms-catalog-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

@media (min-width: 720px) {
  .flexxforms-catalog-item {
    flex-wrap: nowrap;
  }
}

.flexxforms-use-as {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.loan-agreement-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 10px;
  background: #fff;
}

/* Headings and section leads use full content width (no premature wraps) */
h1,
h2,
h3,
h4,
.section-title,
.panel-head h2,
.panel-head h3,
.panel-head h4,
.card h3,
.hint,
.subtle,
.public-about-lead,
.public-bylaws-intro,
.profile-disclosure-note,
.account-card-hint {
  max-width: none;
}

.section-title {
  margin: 20px 0 8px;
  font-size: 16px;
}

.account-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.profile-grid h4 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.loan-repayments-title {
  margin: 16px 0 4px;
  font-size: 14px;
}

.loan-lot-summary strong {
  font-size: 15px;
}

.profile-disclosure summary {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: #1e293b;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.member-portal #mainTabs {
  display: none;
}
.member-portal #panel-my-account > .panel-head > h2 {
  display: none;
}
.tab {
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.tab.active { background: #1e7a4e; color: #fff; border-color: #1e7a4e; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}
.panel-head-actions { display: flex; gap: 8px; align-items: center; }
.panel-head-actions.action-tips-row {
  flex-wrap: wrap;
  row-gap: 10px;
}
.action-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.info-tip:hover,
.info-tip:focus-visible {
  border-color: #2563eb;
  color: #2563eb;
  outline: none;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: min(280px, 72vw);
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.info-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.info-tip:hover::after,
.info-tip:hover::before,
.info-tip:focus-visible::after,
.info-tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f1f5f9; }
th { background: #f8fafc; font-weight: 600; }
tfoot td { font-weight: 700; border-top: 2px solid #cbd5e1; border-bottom: 0; background: #f8fafc; }
tr.detail-subtotal td { font-weight: 700; border-top: 1px solid #cbd5e1; }
.btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.btn.primary { background: #1e7a4e; color: #fff; border-color: #135c3f; }
.btn:disabled,
.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #94a3b8;
  border-color: #94a3b8;
  color: #fff;
}
.btn.link { border: none; background: none; color: #135c3f; padding: 0; }
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #1e293b; }
.hint { color: #64748b; font-size: 12.5px; margin: 0 0 12px; line-height: 1.55; }
.card form { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.status { font-size: 13px; margin-top: 10px; min-height: 20px; }
.status.ok { color: #047857; }
.status.err { color: #b91c1c; }
.preview {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  overflow: auto;
  max-height: 200px;
}
.detail {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.detail.hidden { display: none; }
.money { font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.profile-card { display: grid; gap: 20px; }
.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.profile-photo-wrap { text-align: center; }
.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e2e8f0;
  background: #f8fafc;
}
.photo-caption {
  margin: 8px 0 0;
  font-size: 11px;
  color: #94a3b8;
}
.my-profile-card .profile-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.my-profile-card .profile-photo-upload,
.profile-card .profile-photo-upload {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.my-profile-card .profile-photo-upload input[type="file"],
.profile-card .profile-photo-upload input[type="file"] {
  max-width: 220px;
  font-size: 12px;
}
.my-profile-card .profile-photo-upload .profile-photo-submit-btn,
.profile-card .profile-photo-upload .profile-photo-submit-btn {
  width: 100%;
  min-height: 44px;
  font-weight: 600;
}
.profile-summary h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #1e293b; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.profile-grid section {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
}
.profile-grid dl { margin: 0; }
.profile-grid dt {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
  text-transform: none;
}
.book-label {
  text-transform: none;
}
.profile-grid dt:first-child { margin-top: 0; }
.profile-grid dd {
  margin: 2px 0 0;
  font-size: 14px;
}
.profile-field {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.profile-field-label {
  font-weight: 600;
  color: #334155;
}
.profile-field-value { color: #0f172a; }
.profile-field-empty::after { content: "\00a0"; }
.profile-disclosure {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 16px;
  background: #fff;
}
.profile-disclosure summary::-webkit-details-marker { display: none; }
.profile-disclosure summary::before {
  content: "▸ ";
  color: #64748b;
}
.profile-disclosure[open] summary::before { content: "▾ "; }
.import-panel-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 600;
}
.import-panel-title {
  color: #0f172a;
}
.import-panel-hint {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.4;
}
.import-panel-section summary::-webkit-details-marker { display: none; }
.import-panel-section summary::before {
  content: "▸ ";
  color: #64748b;
}
.import-panel-section[open] summary::before { content: "▾ "; }
.import-subsection {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.import-subsection-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  font-weight: 600;
  font-size: 14px;
}
.import-subsection .import-panel-title {
  font-size: 14px;
}
.import-subsection .import-panel-hint {
  font-size: 12px;
}
.import-subsection summary::-webkit-details-marker { display: none; }
.import-subsection summary::before {
  content: "▸ ";
  color: #64748b;
}
.import-subsection[open] summary::before { content: "▾ "; }
.import-subsection .profile-disclosure-body {
  padding: 0 14px 14px;
}
.import-subsection .import-subsection {
  background: #fff;
}
.profile-disclosure-body {
  padding: 0 16px 16px;
}
.profile-disclosure-body > * + * {
  margin-top: 16px;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.field-row[hidden] {
  display: none;
}
.amount-preview {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.profile-disclosure-note {
  margin: 0 0 12px;
}
.profile-disclosure-emergency .entry-form {
  max-width: 420px;
}
.member-tx-table th,
.member-tx-table td {
  white-space: nowrap;
}
.member-tx-table tr {
  white-space: nowrap;
}
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
}
.file-list li:hover { background: #f1f5f9; border-color: #cbd5e1; }
.file-list li.selected { background: #eaf6ee; border-color: #1e7a4e; }
.file-list li .badge {
  font-size: 11px;
  padding: 4px 8px;
  background: #f5f6f4;
  color: #3a4742;
  border-radius: 6px;
}
.file-list.empty-item { padding: 20px; text-align: center; color: #94a3b8; cursor: default; border: none; background: transparent; }
.statement-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  margin-bottom: 10px;
}
.statement-browse { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: #64748b; }
.statement-selected {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
}
.statement-selected.hidden { display: none; }
.progress-wrapper { margin-top: 16px; }
.progress-wrapper.hidden { display: none; }
.progress-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e7a4e, #0c3a2b);
  width: 0%;
  transition: width 0.2s ease;
}
.progress-text, .progress-member { font-size: 13px; color: #64748b; }
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.book-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.book-card:hover {
  border-color: #1e7a4e;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.12);
}
.book-card:focus-visible {
  outline: 2px solid #1e7a4e;
  outline-offset: 2px;
}
.book-card.accent { border-color: #1e7a4e; background: #eaf6ee; }
.book-card.reconcile-warn { border-color: #f59e0b; background: #fffbeb; }
.dashboard-card {
  text-align: left;
}
.monthly-status-report-card {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 0;
}
.monthly-status-report-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.monthly-status-report-summary-text {
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
}
.monthly-status-report-summary .badge { flex-shrink: 0; }
.monthly-status-report-body .subtle { margin-top: 0; }
.monthly-status-settings-panel { margin-top: 12px; }
.monthly-status-performance-overview {
  background: #eaf6ee;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
  white-space: pre-line;
}
.my-cooperative-reports-panel {
  margin: 16px 0;
}
.my-cooperative-reports-body .subtle {
  margin-top: 0;
}
.my-cooperative-reports-body .file-list {
  margin-top: 12px;
}
.my-cooperative-reports-body .file-list li.cooperative-report-row {
  display: block;
  padding: 0;
  margin-bottom: 10px;
  background: transparent;
  border: none;
  cursor: default;
}
.cooperative-report-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
}
.cooperative-report-open:hover,
.cooperative-report-open:focus-visible {
  background: #eaf6ee;
  border-color: #1e7a4e;
  outline: none;
}
.cooperative-report-open-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e7a4e;
}
.cooperative-report-open-title {
  color: #0f172a;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}
.cooperative-report-open-hint {
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.cooperative-report-viewer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
}
.cooperative-report-viewer.hidden {
  display: none !important;
}
.cooperative-report-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.cooperative-report-viewer-title {
  flex: 1 1 180px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  min-width: 0;
}
.cooperative-report-viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e2e8f0;
}
.cooperative-report-viewer-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 8px 16px;
  background: #64748b;
}
.cooperative-report-viewer-canvas canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  margin: 0 auto 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}
.cooperative-report-viewer-canvas.hidden,
.cooperative-report-viewer-frame.hidden {
  display: none !important;
}
.cooperative-report-viewer-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
body.cooperative-report-viewer-open {
  overflow: hidden;
}
@media (max-width: 900px) {
  .cooperative-report-viewer {
    height: 100dvh;
    max-height: -webkit-fill-available;
  }
  .cooperative-report-viewer-toolbar {
    flex-shrink: 0;
    padding: 10px 12px;
    gap: 8px;
  }
  .cooperative-report-viewer-title {
    flex: 1 0 100%;
    order: -1;
    font-size: 13px;
    line-height: 1.35;
  }
  .cooperative-report-viewer-toolbar .btn {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
    justify-content: center;
  }
}
.my-meetings-panel {
  margin-top: 16px;
}
.my-meetings-body .subtle,
.my-meeting-agenda {
  margin-top: 6px;
  white-space: pre-wrap;
}
.cooperative-meeting-form {
  margin: 16px 0;
  max-width: 640px;
}
.cooperative-meeting-form textarea {
  min-height: 72px;
  resize: vertical;
}
.cooperative-meetings-list .cooperative-meeting-item {
  margin-bottom: 14px;
}
.cooperative-meeting-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cooperative-meeting-agenda,
.cooperative-meeting-actions {
  margin-top: 6px;
  white-space: pre-wrap;
}
.cooperative-meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.monthly-status-performance-overview.hidden { display: none; }
.monthly-status-report-card .toggle-row,
.monthly-status-report-card .field-row,
.monthly-status-report-body .toggle-row,
.monthly-status-report-body .field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  font-size: 13px;
}
.monthly-status-report-actions { margin-top: 12px; flex-wrap: wrap; }
.month-end-auto-publish-toggle.is-on {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}
.month-end-auto-publish-toggle.is-off {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
.bank-import-conflicts {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}
.bank-import-conflicts.hidden { display: none; }
.bank-import-conflicts ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.bank-import-conflicts li { margin: 4px 0; }
.expense-report-labels-panel { margin-top: 16px; }
.expense-report-add-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 10px 0 4px;
}
.expense-report-add-label-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: min(280px, 100%);
  flex: 1;
}
.expense-report-add-label-field input {
  width: 100%;
  font: inherit;
  padding: 6px 8px;
}
.expense-report-labels-table-wrap { max-height: 360px; overflow: auto; margin: 12px 0; }
.expense-report-labels-table td.money,
.expense-report-labels-table th.money { text-align: right; white-space: nowrap; }
.expense-report-labels-table select,
.expense-report-labels-table input[type="text"] {
  width: 100%;
  min-width: 140px;
  font: inherit;
  padding: 6px 8px;
}
.expense-report-labels-table .other-label-input { margin-top: 6px; }
.operational-expenses-preview-panel { margin-top: 16px; }
.operational-expenses-preview-summary,
.operational-expense-group-summary,
.operational-expense-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.operational-expense-group { margin-top: 8px; }
.operational-expense-row.flat {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 8px;
  padding: 12px 14px;
}
.operational-expense-detail-table td.money,
.operational-expense-detail-table th.money,
.operational-expense-row-head .money,
.operational-expense-group-summary .money {
  text-align: right;
  white-space: nowrap;
}
.operational-expenses-preview-summary .badge,
.operational-expense-group-summary .money {
  margin-left: auto;
}
.operational-expense-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 2px solid #cbd5e1;
  font-weight: 600;
}
.btn.linkish {
  background: none;
  border: none;
  color: #1e7a4e;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.books-detail.hidden,
.books-summary.hidden { display: none; }
.books-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.books-detail-view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.books-detail-view-tabs.hidden { display: none; }
.books-detail-view-tab {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.books-detail-view-tab.active {
  background: #1e7a4e;
  border-color: #1e7a4e;
  color: #fff;
}
.detail-member-row { cursor: pointer; }
.detail-member-row:hover { background: #eaf6ee; }
.detail-drill-row { cursor: pointer; }
.detail-drill-row:hover { background: #eaf6ee; }
.detail-expand-row td:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-expand-toggle {
  border: 0;
  background: #eaf6ee;
  color: #1e7a4e;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
  line-height: 1;
}
.detail-expand-toggle:hover { background: #bae6fd; }
.detail-member-link { font-weight: 600; }
.detail-expand-panel > td {
  background: #f8fafc;
  padding: 0 12px 12px 44px;
}
.detail-nested-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.detail-nested-table th,
.detail-nested-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.detail-nested-table th {
  background: #f1f5f9;
  text-align: left;
  font-size: 12px;
}
.detail-nested-table tr:last-child td { border-bottom: 0; }
.detail-expand-empty { margin: 10px 0 4px; }
.book-label { font-size: 12px; color: #64748b; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.book-amount { font-size: 22px; font-weight: 700; margin: 0; }
.book-note { font-size: 11px; color: #94a3b8; margin: 6px 0 0; }
.members-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.members-list-pane {
  min-width: 0;
}
.members-list-pane .member-row { cursor: pointer; }
.members-list-pane .member-row.selected { background: #eaf6ee; }
.membership-status-disclosure {
  margin: 12px 0 0;
  width: 100%;
}
.membership-status-disclosure > summary {
  font-weight: 650;
  color: #1e293b;
}
.members-search-row {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.members-search-label { flex: 1 1 280px; max-width: 420px; }
.members-search-row input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}
.members-former-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.members-former-toggle input { margin: 0; }
.bank-append-approve-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0.35rem 0 0.75rem;
}
.bank-append-notes-cell .bank-append-approve-as-is {
  margin-top: 0.35rem;
}
.membership-status-form {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  gap: 10px;
}
.membership-status-form label { display: grid; gap: 4px; font-size: 13px; }
.membership-status-form select,
.membership-status-form input,
.membership-status-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
}
.badge.former { background: #fef3c7; color: #92400e; }
.member-password-reset-result {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.member-password-reset-result h4 { margin: 0 0 8px; }
.member-password-reset-dl {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 6px 12px;
  margin: 10px 0;
}
.member-password-reset-dl dt { font-weight: 600; color: #334155; }
.member-password-reset-dl dd { margin: 0; }
.member-password-reset-dl code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}
.member-password-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.member-number {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.member-profile-pane {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  min-height: 400px;
  overflow: visible;
}
.empty-pane { color: #94a3b8; padding: 40px 20px; text-align: center; }
.my-account-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.my-account-panel.deposit {
  background: #f0fdf4;
  border-color: #86efac;
}
.my-account-panel.loan {
  background: #fff7ed;
  border-color: #fdba74;
}
.my-account-panel.share {
  background: #eef2ff;
  border-color: #a5b4fc;
}
.my-account-panel-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}
.my-account-panel-title {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}
.my-account-panel-balance {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}
.my-account-panel .profile-disclosure-body h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.account-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.account-card {
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.account-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.account-card.selected {
  box-shadow: 0 0 0 2px #2563eb;
  border-color: #2563eb;
}
.account-card.deposit { background: #f0fdf4; border-color: #86efac; }
.account-card.deposit.selected { border-color: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.account-card.loan { background: #fff7ed; border-color: #fdba74; }
.account-card.loan.selected { border-color: #ea580c; box-shadow: 0 0 0 2px #ea580c; }
.account-card.share { background: #eef2ff; border-color: #a5b4fc; }
.account-card.share.selected { border-color: #4f46e5; box-shadow: 0 0 0 2px #4f46e5; }

/* Share Capital surfaces stay hidden until the Cooperative enables the feature in Membership Policy. */
.share-capital-col { display: none; }
body.share-capital-enabled th.share-capital-col,
body.share-capital-enabled td.share-capital-col { display: table-cell; }
body.share-capital-enabled details.share-capital-col { display: block; }
body.share-capital-enabled a.share-capital-col { display: block; }
body.loans-disabled .loans-col { display: none !important; }
.account-card .subtle {
  font-size: 12px;
  line-height: 1.4;
}
.account-card-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #64748b;
}
.account-detail-wrap {
  margin: 0 0 20px;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
}
.account-panel-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}
.member-account-cell {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.member-account-cell:hover {
  text-decoration-color: #2563eb;
  color: #1d4ed8;
}

.loan-lot-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.loan-lot-card.inline { margin: 8px 0 0; }
.loan-lot-disclosure > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.loan-lot-disclosure > summary::-webkit-details-marker { display: none; }
.loan-lot-disclosure > summary::before {
  content: "▸ ";
  color: #64748b;
  font-size: 12px;
}
.loan-lot-disclosure[open] > summary::before { content: "▾ "; }
.loan-lot-disclosure[open] > summary {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.loan-lot-summary-meta { margin-left: auto; font-size: 12px; }
.loan-lot-body { padding-top: 4px; }
.loan-lot-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.loan-lot-actions .btn.small { margin-left: 0; }
.loan-schedule-disclosure { margin: 12px 0; }
.loan-repayments-hint { margin: 0 0 8px; }
.my-loan-card > summary.my-loan-summary {
  align-items: center;
}
.my-loan-card > summary.my-loan-summary h4 {
  margin: 0;
}
.loan-lot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
tr.loan-row { cursor: pointer; }
tr.loan-row:hover { background: #f8fafc; }
.loan-detail-cell { background: #f8fafc; }
.btn.small {
  padding: 4px 10px;
  font-size: 12px;
  margin-left: auto;
}
.loan-lot-head .btn.small { flex-shrink: 0; }
.account-balance { font-size: 24px; font-weight: 700; margin: 0; }
.bank-append-preview-table select {
  width: 100%;
  min-width: 9rem;
  max-width: 14rem;
  font-size: 12px;
  padding: 4px 6px;
}
.table-wrap.compact th, .table-wrap.compact td { padding: 8px 10px; }
.record-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  #appOrgSubtitle,
  .session-user {
    display: none;
  }
  #panel-my-account > .hint { display: none; }
  .my-profile-card .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .my-profile-card .profile-photo-upload,
  .profile-card .profile-photo-upload {
    width: 100%;
    max-width: 280px;
  }
  .my-profile-card .profile-photo-upload input[type="file"],
  .profile-card .profile-photo-upload input[type="file"] {
    max-width: 100%;
  }
  .my-profile-card .profile-photo-upload .profile-photo-submit-btn,
  .profile-card .profile-photo-upload .profile-photo-submit-btn {
    width: 100%;
  }
  .profile-summary-hint,
  .profile-disclosure:not([open]) .profile-disclosure-note,
  .profile-disclosure:not([open]) .profile-upload-label {
    display: none;
  }
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-disclosure summary {
    padding: 14px 12px;
    font-size: 15px;
  }
  .account-card .subtle,
  .account-card-hint {
    display: none;
  }
  .account-card[aria-expanded="true"] .subtle,
  .account-card[aria-expanded="true"] .account-card-hint {
    display: block;
  }
  .description-toggle {
    display: inline-flex;
  }
  #panel-my-account:not(.show-descriptions) .member-tx-table .col-description {
    display: none;
  }
}
.description-toggle {
  display: none;
}
.record-grid .record-section.card,
.record-section.card.record-recent {
  padding: 0;
  margin-bottom: 0;
  margin-top: 0;
  min-width: 0;
  overflow: visible;
  width: 100%;
}
.record-section summary.record-section-summary {
  font-weight: 600;
  font-size: 16px;
  color: #1e293b;
  padding: 16px 20px;
  cursor: pointer;
}
.record-section .profile-disclosure-body {
  padding: 0 20px 20px;
}
.record-section .profile-disclosure-body > .subtle:first-child {
  margin-top: 0;
}
.record-section .record-section-collapse {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.record-recent {
  margin-bottom: 16px;
}
.record-grid .card {
  min-width: 0;
  overflow: visible;
}
.record-section .entry-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
  align-items: start;
}
.record-section .entry-form > label:has(.member-picker),
.record-section .entry-form > label:has(input[type="checkbox"]),
.record-section .entry-form > label:has(input[type="file"]),
.record-section .entry-form > label:has(input[name="name"]),
.record-section .entry-form > label:has(input[name="addressLine1"]),
.record-section .entry-form > label:has(input[name="addressLine2"]),
.record-section .entry-form > label:has(input[name="description"]),
.record-section .entry-form > label:has(input[name="notes"]),
.record-section .entry-form > label:has(input[name="label"]) {
  grid-column: 1 / -1;
}
.record-section .entry-form > button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .record-section .entry-form {
    grid-template-columns: 1fr;
  }
  .record-section .entry-form > label,
  .record-section .entry-form > button[type="submit"] {
    grid-column: 1;
  }
}
.entry-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.entry-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  min-width: 0;
}
.entry-form input,
.entry-form select,
.entry-form textarea {
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.entry-form .btn { margin-top: 4px; align-self: flex-start; }
.member-picker,
.suggest-picker {
  position: relative;
  width: 100%;
  min-width: 0;
}
.member-picker-input,
.suggest-picker-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.member-picker-list,
.suggest-picker-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.member-picker-list.hidden,
.suggest-picker-list.hidden { display: none; }
.member-picker-list li,
.suggest-picker-list li {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-picker-list li:hover,
.member-picker-list li.active,
.suggest-picker-list li:hover,
.suggest-picker-list li.active {
  background: #eaf6ee;
}
.member-picker-list .member-picker-meta {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}
.member-picker-empty,
.suggest-picker-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}

.hidden { display: none !important; }
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #eaf6ee 0%, #f1f5f9 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.session-bar { text-align: right; }
.session-user { margin: 0 0 8px; font-size: 14px; color: #334155; }
.logout-btn {
  padding: 8px 10px;
  line-height: 0;
  color: #334155;
}
.logout-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.readonly-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}
.login-foot { margin-top: 14px; font-size: 13px; }
.portal-links { margin: 0; padding-left: 20px; }
.portal-links li { margin-bottom: 6px; }

.platform-shell .platform-panel { padding: 0 4px 24px; }
.platform-org-table .platform-org-actions { white-space: nowrap; }
.platform-org-table .btn-small {
  font-size: 12px;
  padding: 4px 8px;
  margin: 2px 0;
}
.platform-subscription-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.platform-subscription-body > p { margin: 0; }
.platform-subscription-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.platform-subscription-summary p { margin: 0; }
.platform-subscription-summary .subscription-grace-banner,
.platform-subscription-summary .subscription-banner { margin-top: 4px; }
.platform-subscription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.platform-check-instructions {
  background: #eaf6ee;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.platform-check-instructions p { margin: 0; }
.platform-check-instructions .field-row { margin-top: 4px; }
.subscription-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.subscription-active { background: #dcfce7; color: #166534; }
.subscription-warning { background: #fef3c7; color: #92400e; }
.subscription-info { background: #dbeafe; color: #1e40af; }
.subscription-muted { background: #f3f4f6; color: #4b5563; }
.badge.subscription-active,
.badge.subscription-warning,
.badge.subscription-info,
.badge.subscription-muted {
  font-size: 12px;
}
.subscription-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
}
.subscription-grace-banner {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.public-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf6ee 0%, #f8fafc 40%);
}
.public-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 24px 0;
  max-width: 960px;
  margin: 0 auto;
}
.public-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.public-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}
.public-article,
.public-bylaws {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.public-about-content h1 {
  margin-top: 0;
  margin-bottom: 1rem;
}
.public-about-content h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.public-about-crosslink,
.public-bylaws-intro {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.public-header-actions .btn.active {
  background: #1e7a4e;
  color: #fff;
  border-color: #1e7a4e;
}
.public-about-lead {
  font-size: 1.1rem;
  color: #334155;
}
.public-about-figure {
  margin: 1.5rem 0;
}
.public-about-figure img {
  width: 100%;
  border-radius: 12px;
  display: block;
}
.public-about-figure figcaption {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #64748b;
}
.public-about-cta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.public-bylaws-actions {
  margin-bottom: 12px;
}
.public-bylaws-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.public-pages-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 12px 0 8px;
  border: 1px solid #cfe5d6;
  border-radius: 10px;
  background: #f3faf6;
  color: #334155;
  font-size: 13px;
}
.public-pages-links-label {
  color: #475569;
  font-weight: 600;
}
.public-page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: #1e7a4e;
  color: #1e7a4e;
  font-weight: 600;
  text-decoration: none;
}
.public-page-link:hover {
  background: #1e7a4e;
  color: #fff;
}
.public-page-link-icon {
  font-size: 15px;
  line-height: 1;
}
.public-pages-admin textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.public-pages-content-fields > label.btn {
  display: inline-flex;
  margin-top: 10px;
}
.public-pages-admin .file-list {
  margin: 10px 0 4px;
}
.public-pages-content-fields + .panel-head-actions {
  margin-top: 16px;
}
.public-pages-section {
  margin-top: 12px;
}
.public-pages-section .profile-disclosure-body {
  padding: 0 20px 20px;
}
.public-pages-url-hint {
  margin-top: 0;
}
.public-pages-content-fields.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}
.public-pages-content-fields.is-disabled input,
.public-pages-content-fields.is-disabled textarea,
.public-pages-content-fields.is-disabled button,
.public-pages-content-fields.is-disabled label.btn {
  cursor: not-allowed;
}
.public-admin-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 8px;
}
.public-org-links a.hidden,
.member-public-links a.hidden {
  display: none;
}

.ledger-tx-controls {
  min-width: 11rem;
  vertical-align: top;
}
.ledger-tx-controls .ledger-tx-type {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}
.ledger-tx-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
.ledger-adjustment-prompt-wrap {
  margin: 12px 0 16px;
}
.ledger-adjustment-prompt {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}
.ledger-split-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}
.ledger-split-modal-card {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}
.ledger-split-line {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.ledger-split-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* App notice modal (replaces alert / confirm / prompt) */
.app-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}
.app-notice-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 18px;
  align-items: start;
}
.app-notice-card.app-notice-no-icon {
  grid-template-columns: 1fr;
}
.app-notice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.app-notice-card.variant-info .app-notice-icon {
  background: #eff6ff;
  color: #2563eb;
}
.app-notice-card.variant-success .app-notice-icon {
  background: #f0fdf4;
  color: #16a34a;
}
.app-notice-card.variant-warning .app-notice-icon {
  background: #fffbeb;
  color: #d97706;
}
.app-notice-card.variant-danger .app-notice-icon {
  background: #fef2f2;
  color: #dc2626;
}
.app-notice-content {
  grid-column: 2;
}
.app-notice-card.app-notice-no-icon .app-notice-content {
  grid-column: 1;
}
.app-notice-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}
.app-notice-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  white-space: pre-wrap;
}
.app-notice-input-wrap {
  display: block;
  margin-top: 14px;
}
.app-notice-input-wrap.hidden {
  display: none;
}
.app-notice-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
}
.app-notice-input:focus {
  outline: 2px solid #93c5fd;
  border-color: #3b82f6;
}
.app-notice-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.app-notice-actions .btn.hidden {
  display: none;
}

/* Toast notifications */
.app-toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  animation: app-toast-in 0.28s ease-out;
}
@keyframes app-toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.app-toast.variant-success {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}
.app-toast.variant-danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
}
.app-toast.variant-warning {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}
.app-toast.variant-info {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}
.app-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.app-toast.variant-success .app-toast-icon { background: #dcfce7; color: #16a34a; }
.app-toast.variant-danger .app-toast-icon { background: #fee2e2; color: #dc2626; }
.app-toast.variant-warning .app-toast-icon { background: #fef3c7; color: #d97706; }
.app-toast.variant-info .app-toast-icon { background: #dbeafe; color: #2563eb; }
.app-toast-body {
  flex: 1;
  min-width: 0;
}
.app-toast-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.app-toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}
.app-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.app-toast-close:hover {
  color: #475569;
}

/* Cooperative inbox messaging (all tenants) */
#mainTabs .tab[data-tab="member-messages"] {
  display: none !important;
}

.tab-attention-badge {
  margin-left: 0.35rem;
  vertical-align: middle;
  background: #fee2e2;
  color: #991b1b;
}
.tab-attention-badge.messages-unread-flash,
.tab.has-attention .tab-attention-badge {
  animation: messages-unread-pulse 1.2s ease-in-out infinite;
}
.tab.has-attention {
  border-color: #fca5a5;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.12);
}

.admin-attention-nag {
  margin: 0 0 0.85rem;
}
.admin-attention-nag.hidden {
  display: none;
}
.admin-attention-nag-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border: 1px solid #fda4af;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff1f2 0%, #fff7ed 55%, #fff 100%);
  color: #9f1239;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  animation: messages-entry-glow 1.6s ease-in-out infinite;
}
.admin-attention-nag-btn:hover,
.admin-attention-nag-btn:focus-visible {
  outline: none;
  border-color: #f43f5e;
}
.admin-attention-nag-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e11d48;
  flex-shrink: 0;
  animation: messages-unread-pulse 1.2s ease-in-out infinite;
}

.messages-panel-head {
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.messages-panel-lead {
  margin: 0.35rem 0 0;
  max-width: none;
  font-size: 0.95rem;
  color: #64748b;
}

.messages-entry-card {
  margin: 0 0 1.15rem;
  padding: 1rem 1.15rem;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(30, 122, 78, 0.09), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #fff 72%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.messages-entry-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 52px;
  font-size: 1.05rem;
  border-radius: 12px;
}
.messages-entry-hint {
  margin: 0.6rem 0 0;
  text-align: center;
}
.messages-unread-badge,
.badge.messages-unread-flash {
  background: #fee2e2;
  color: #991b1b;
}
.messages-unread-badge.messages-unread-flash,
#openMyMessagesBtn.has-unread .messages-unread-badge {
  animation: messages-unread-pulse 1.2s ease-in-out infinite;
}
@keyframes messages-unread-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
#openMyMessagesBtn.has-unread {
  animation: messages-entry-glow 1.6s ease-in-out infinite;
}
@keyframes messages-entry-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 122, 78, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(30, 122, 78, 0); }
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.15fr);
  gap: 1.15rem;
  align-items: start;
}
.member-messages-layout {
  grid-template-columns: minmax(0, 720px);
  justify-content: start;
}

.messages-surface {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  background: #fff;
}
.messages-card-head {
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #eef2f7;
}
.messages-card-head h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.messages-card-head .subtle {
  margin: 0;
}

.messages-form.card form,
.messages-form {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.95rem;
}
.messages-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  font-weight: 400;
}
.messages-field-label {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}
.messages-field-hint {
  margin: 0.15rem 0 0;
}
.messages-form input[type="text"],
.messages-form textarea {
  width: 100%;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
  font: inherit;
  color: #0f172a;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.messages-form input[type="text"]:focus,
.messages-form textarea:focus {
  outline: none;
  border-color: #86c5a3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 122, 78, 0.14);
}
.messages-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.messages-form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.15rem;
}
.messages-form-actions .btn.primary {
  min-width: 148px;
  border-radius: 11px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
}

.messages-audience-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.messages-folder-seg {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.messages-folder-btn {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.messages-folder-btn.active {
  background: #fff;
  color: #135c3f;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.messages-email-notices {
  min-width: 0;
}
.messages-audience-option {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.messages-audience-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.messages-audience-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.messages-audience-option input:checked + span {
  background: #fff;
  color: #135c3f;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.messages-audience-option:hover span {
  color: #0f172a;
}

.messages-recipient-picker {
  margin: -0.2rem 0 0;
}
.messages-recipient-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.messages-recipient-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e7a4e;
}
.messages-recipient-count:empty {
  display: none;
}
.messages-recipient-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.35rem;
  background: #f8fafc;
}
.messages-recipient-list label {
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  margin: 0;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
}
.messages-recipient-list input[type="checkbox"] {
  width: auto;
  flex: none;
  margin: 0;
  padding: 0;
  accent-color: #1e7a4e;
}
.messages-recipient-list label:hover {
  background: #fff;
}
.messages-recipient-list label:has(input:checked) {
  background: #eaf6ee;
  box-shadow: inset 0 0 0 1px #bbf7d0;
}

.messages-rich-shell {
  border: 1px solid #d7e0ea;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.messages-rich-shell:focus-within {
  border-color: #86c5a3;
  box-shadow: 0 0 0 3px rgba(30, 122, 78, 0.14);
}
.messages-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.messages-format-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 0.55rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}
.messages-format-btn:hover,
.messages-format-btn:focus-visible {
  background: #fff;
  border-color: #cbd5e1;
  outline: none;
}
.messages-format-btn:active {
  background: #eaf6ee;
  border-color: #86c5a3;
}
.messages-format-btn-wide {
  min-width: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}
.messages-format-sep {
  width: 1px;
  height: 18px;
  margin: 0 0.2rem;
  background: #dbe3ee;
}
.messages-rich-editor {
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
  padding: 0.95rem 1.05rem;
  background: #fff;
  line-height: 1.6;
  outline: none;
}
.messages-rich-editor-compact {
  min-height: 110px;
  max-height: 240px;
}
.messages-rich-editor:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
}
.messages-rich-editor h1,
.messages-rich-editor h2,
.messages-rich-editor h3,
.messages-md-body h1,
.messages-md-preview h1,
.messages-md-body h2,
.messages-md-preview h2,
.messages-md-body h3,
.messages-md-preview h3 {
  margin: 0.75rem 0 0.4rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.messages-rich-editor p,
.messages-md-body p,
.messages-md-preview p {
  margin: 0.45rem 0;
}
.messages-rich-editor ul,
.messages-rich-editor ol,
.messages-md-body ul,
.messages-md-preview ul,
.messages-md-body ol,
.messages-md-preview ol {
  margin: 0.45rem 0 0.45rem 1.2rem;
}

.messages-attach-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.messages-attach-field:hover {
  border-color: #86c5a3;
  background: #eaf6ee;
}
.messages-attach-field-compact {
  padding: 0.7rem 0.85rem;
}
.messages-attach-title {
  font-weight: 650;
  color: #0f172a;
}
.messages-attach-hint {
  font-size: 0.85rem;
  color: #64748b;
}
.messages-attach-field input[type="file"] {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: #475569;
}
.messages-attachment-list {
  list-style: none;
  margin: -0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.messages-attachment-list:empty {
  display: none;
}
.messages-attachment-list li {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eaf6ee;
  color: #075985;
  font-size: 0.82rem;
  font-weight: 600;
}

.messages-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.messages-thread-list > li.hint {
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px dashed #d7e0ea;
  border-radius: 14px;
  background: #f8fafc;
}
.messages-thread-list li {
  margin: 0;
}
.messages-thread-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 10px;
  background: transparent;
  padding: 0.8rem 0.55rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.messages-thread-list li:last-child .messages-thread-item {
  border-bottom: 0;
}
.messages-thread-item:hover,
.messages-thread-item:focus-visible {
  background: #f4faf6;
  outline: none;
}
.messages-thread-item.has-unread {
  background: linear-gradient(90deg, rgba(30, 122, 78, 0.05), transparent 60%);
}
.messages-thread-avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: hsl(var(--avatar-hue, 140) 42% 90%);
  color: hsl(var(--avatar-hue, 140) 45% 30%);
}
.messages-thread-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.messages-thread-item-title {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.messages-thread-item-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
}
.messages-thread-item.has-unread .messages-thread-item-name,
.messages-thread-item.has-unread .messages-thread-item-subject {
  font-weight: 700;
}
.messages-thread-item-subject {
  color: #334155;
  font-size: 0.88rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messages-thread-item-preview {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messages-thread-item-meta {
  color: #94a3b8;
  font-size: 0.78rem;
  flex: none;
}
.messages-thread-item-side {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 38px;
}
.messages-thread-item-side:empty {
  display: none;
}

.messages-thread-toolbar {
  margin-bottom: 0.65rem;
}
.messages-back-btn {
  border-radius: 999px;
  padding-left: 0.85rem;
  padding-right: 0.95rem;
}
.messages-thread-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f7;
}
.messages-thread-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}
.messages-thread-head .subtle {
  margin: 0;
}

.messages-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0 0 1rem;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 0.35rem 0.15rem 0.35rem 0;
  scroll-behavior: smooth;
}
.messages-thread-empty {
  margin: 1.25rem 0;
  padding: 1.35rem 1rem;
  text-align: center;
  border: 1px dashed #d7e0ea;
  border-radius: 14px;
  background: #f8fafc;
}
.messages-bubble {
  position: relative;
  max-width: min(100%, 640px);
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 16px 6px;
  padding: 0.9rem 1.05rem;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.messages-bubble.from-self {
  align-self: flex-end;
  background: #eaf6ee;
  border-color: #bbf7d0;
  border-radius: 16px 16px 6px 16px;
}
.messages-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}
.messages-bubble-meta strong {
  color: #0f172a;
  font-weight: 650;
}
.messages-bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 0.98rem;
  color: #0f172a;
}
.messages-bubble-body.messages-md-body {
  white-space: normal;
}
.messages-reply-form {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
}

.messages-md-preview,
.messages-md-body {
  line-height: 1.55;
}
.messages-md-preview {
  margin-bottom: 0.85rem;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.messages-md-body code,
.messages-md-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.messages-attachments {
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.messages-attachment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e2e8f0;
  font-size: 0.88rem;
  color: #475569;
}
.messages-attachment-figure {
  margin: 0;
}
.messages-attachment-image {
  display: block;
  max-width: min(100%, 420px);
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.messages-attachment-figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
  .messages-thread-messages {
    max-height: none;
  }
  .messages-audience-seg {
    grid-template-columns: 1fr;
  }
  .messages-panel-head {
    flex-direction: column;
  }
  .messages-thread-view.messages-mobile-focus .messages-reply-form textarea {
    min-height: 120px;
  }
}

.automated-messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.automated-message-placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.automated-message-placeholders code {
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 6px;
}
.automated-message-preview {
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}
.automated-message-form textarea {
  min-height: 220px;
  resize: vertical;
  font-family: inherit;
}

.schedule-loan-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}
.schedule-loan-label input {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.dues-section-label {
  font-weight: 600;
  margin: 8px 0 6px;
}
#membershipPolicyDuesScheduleRow {
  margin: 16px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
}
#duesYearRows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 12px;
}
.dues-year-actions {
  margin-bottom: 10px;
}
.dues-year-actions .btn {
  padding: 6px 14px;
}
#duesHistoryWrap {
  margin-top: 14px;
}
#duesHistoryList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dues-year-row input.dues-year-input {
  width: 90px;
}
.dues-year-row input.dues-year-amount {
  width: 140px;
}
.dues-year-stamp {
  font-size: 12px;
}
.dues-history-line {
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}

#annualDuesSection > * + * { margin-top: 14px; }
.dues-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.dues-controls-row .dues-year-field { flex-wrap: nowrap; }
#annualDuesYear { width: 110px; }
#annualDuesTableWrap { margin-top: 20px; }
#annualDuesTableWrap > .hint { margin: 0 0 10px; }

.mfa-secret-code {
  display: inline-block;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-alt, #f3f4f6);
  user-select: all;
}
