* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font, Arial, sans-serif);
  color: var(--text, #111827);
  background: var(--bg, transparent);
  height: 100vh;
}

.app-header {
  padding: 16px 20px 8px;
  background: transparent;
  border-bottom: 1px solid transparent;
  text-align: center;
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text, #111827);
}

.app-subtitle {
  font-size: 13px;
  color: var(--muted, #E8E2F8);
  margin-top: 4px;
}
.app-version { margin-left: 6px; opacity: 0.9; font-weight: 600; }

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: 24px 16px 80px; /* reserve space for status bar */
}

.hidden { display: none !important; }

.screen {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#vaultOpsScreen {
  padding-bottom: 90px;
}

#helpCircleScreen {
  padding-bottom: 90px;
}

.ops-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  color: #111827 !important;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  color: #111827 !important;
}

.ops-table th,
.ops-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  font-size: 14px;
  color: #111827 !important;
}

.ops-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  z-index: 1;
  text-align: left;
  font-weight: 800;
  color: #111827;
}

.ops-table tr:nth-child(even) td {
  background: rgba(249,250,251,0.6);
}

.ops-table .ops-actions {
  white-space: nowrap;
}

.ops-table .ops-btn {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827 !important;
  font-weight: 700;
  cursor: pointer;
  margin-right: 6px;
}

@media (min-width: 900px) {
  .vs-stack {
    max-width: 1100px;
  }
  .screen {
    max-width: 1100px;
  }
}

.ops-table .ops-btn:hover {
  background: #f3f4f6;
}

.ops-table .ops-btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.ops-table .ops-btn-primary:hover {
  background: #1d4ed8;
}

.ops-table .ops-btn-danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.ops-table .ops-btn-danger:hover {
  background: #991b1b;
}

.vs-authbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px;
}

.home-links {
  margin-top: 8px;
}


.help-surface-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.help-surface-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.help-outbox-widget,
.help-outbox-manage-card {
  width: 100%;
  margin-bottom: 10px;
}

.help-outbox-compact-row {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.help-outbox-compact-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.help-outbox-compact-age,
.help-outbox-compact-recips {
  font-size: 13px;
  color: var(--muted, #374151);
}

.help-compact-stage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.help-compact-stage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.help-compact-stage-label,
.help-compact-stage-count {
  font-size: 11px;
  line-height: 1.2;
}

.help-compact-stage-label {
  color: var(--muted, #374151);
  font-weight: 700;
}

.help-compact-stage-count {
  color: var(--text, #111827);
}

.help-compact-stage-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.help-outbox-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.help-outbox-count,
.help-outbox-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #111827);
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  padding: 6px 10px;
}

.help-progress-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-progress-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted, #374151);
}

.help-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.help-progress-fill {
  height: 100%;
  border-radius: inherit;
}

.help-progress-track-low {
  background: rgba(220, 38, 38, 0.22);
}

.help-progress-track-partial {
  background: rgba(217, 119, 6, 0.22);
}

.help-progress-track-complete {
  background: rgba(22, 163, 74, 0.22);
}

.help-progress-fill-progress,
.help-progress-fill-complete {
  background: #16a34a;
}

.help-progress-fill-empty {
  background: transparent;
}

.help-outbox-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted, #374151);
}

.help-recipient-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.help-recipient-row {
  margin-top: 0;
}

@media (max-width: 640px) {
  .help-outbox-compact-main {
    align-items: flex-start;
    gap: 6px;
  }

  .help-compact-stage-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.link-button {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.settings-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.settings-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #111827);
  letter-spacing: -0.2px;
}

.settings-section {
  width: 100%;
  background: var(--surface, rgba(255,255,255,0.92));
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-card, 10px);
  box-shadow: var(--shadow-1, none);
  padding: var(--space-2, 14px);
  margin-top: 12px;
}

.settings-subtitle {
  font-weight: 700;
  color: var(--text, #111827);
  margin-bottom: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-row label {
  font-weight: 700;
  color: var(--text, #111827);
}

.settings-row select {
  padding: 10px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 12px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #111827);
}

#sponsorInstructionsDefinitionScreen select {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

#sponsorInstructionsDefinitionScreen select option {
  background: #fff;
  color: #111827;
}

.settings-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

#helpButton {
    width: 100%;
    min-height: var(--btn-h, 54px);
    padding: 12px 16px;
    font-size: 18px;
    background-color: var(--primary, #4285f4);
    color: var(--primary-contrast, #fff);
    border: 1px solid transparent;
    border-radius: var(--radius-btn, 16px);
    cursor: pointer;
    transition: none;
}

#helpButton:hover {
    transform: none;
    box-shadow: none;
    background-color: var(--primary, #3b82f6);
}

#helpButton:active {
    transform: none;
    box-shadow: none;
    background-color: var(--primary, #2563eb);
}

#helpButton:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Orientation copy - compact, muted and centered to preserve primary action prominence */
.home-orientation {
  font-size: 14px;
  color: var(--muted, #6b7280);
  margin-bottom: 8px;
  text-align: center;
  max-width: 78%;
  line-height: 1.3;
  margin-left: auto;
  margin-right: auto;
}

.home-readiness {
  width: 100%;
  margin: 0 0 12px;
}

.home-setup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-setup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.home-setup-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.home-setup-label {
  flex: 1 1 auto;
  font-weight: 600;
  line-height: 1.35;
}

.home-setup-item .vs-btn {
  flex: 0 0 auto;
  min-width: 64px;
}

/* Login helper (anonymous/passkey) uses a smaller muted style */
#loginHelper {
  font-size: 13px;
  color: var(--muted, #6b7280);
  margin-top: 8px;
  text-align: center;
  max-width: 84%;
  margin-left: auto;
  margin-right: auto;
}

.login-helper-actions {
  margin-top: 8px;
  text-align: center;
}

.public-acquisition-entry {
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  text-align: left;
}

#loginMotif {
  padding: 4px 0 8px;
}

#loginMotif img {
  width: min(38vw, 160px);
}

.public-acquisition-heading {
  color: var(--text, #f8fafc);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.public-acquisition-note {
  margin: 7px 0 12px;
  color: var(--muted, #cbd5e1);
  font-size: 0.86rem;
  line-height: 1.45;
}

.public-acquisition-status {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.62);
  outline: none;
}

.public-acquisition-status:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.public-acquisition-status[data-state="success"] {
  border-color: rgba(52, 211, 153, 0.7);
}

.public-acquisition-status[data-state="failed"],
.public-acquisition-status[data-state="canceled"] {
  border-color: rgba(251, 191, 36, 0.7);
}

.public-acquisition-status-title {
  color: var(--text, #f8fafc);
  font-weight: 800;
  line-height: 1.35;
}

.public-acquisition-status-body {
  margin-top: 5px;
  color: var(--muted, #cbd5e1);
  font-size: 0.88rem;
  line-height: 1.45;
}

.public-acquisition-status .vs-btn {
  margin-top: 10px;
}

.login-helper-actions .vs-link {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  color: var(--primary, #60a5fa);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}

.login-helper-actions .vs-link:hover,
.login-helper-actions .vs-link:focus {
  color: var(--primary-strong, #93c5fd);
}

/* Bottom status bar */
/* Durable spacing rule:
   When the shell manages a persistent fixed footer we add a body-level
   class so shell screens reserve space and avoid being obscured by the
   fixed footer. instructions.html uses body.instructions-page and sets
   #status to position: static, so it is not affected. */
.shell-has-fixed-footer .vs-main,
.shell-has-fixed-footer .vs-stack,
.shell-has-fixed-footer .container {
  padding-bottom: 80px; /* match footer height + safe gap */
}

#status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#status.status-idle {
  background: var(--surface-2, #1e3a8a);
}

#status.status-requested {
  background: var(--danger, #b91c1c);
}

/* Reusable action-result feedback placed beside the action that produced it. */
.vs-action-feedback {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}

.vs-action-feedback:empty {
  display: none;
}

.vs-action-feedback[data-feedback-state="progress"],
.vs-action-feedback[data-feedback-state="info"] {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #2e1065;
}

.vs-action-feedback[data-feedback-state="success"] {
  background: #dcfce7;
  border-color: #16a34a;
  color: #052e16;
}

.vs-action-feedback[data-feedback-state="error"] {
  background: #fee2e2;
  border-color: #dc2626;
  color: #450a0a;
}

/* Header follows status colors */
.app-header.status-idle {
  background: var(--surface-2, #1e3a8a);
  color: #fff;
  border-bottom-color: var(--surface-2, #1e3a8a);
}
.app-header.status-requested {
  background: var(--danger, #b91c1c);
  color: #fff;
  border-bottom-color: var(--danger, #b91c1c);
}
.app-header.status-idle .app-subtitle,
.app-header.status-requested .app-subtitle {
  color: var(--muted, #E8E2F8);
}
.app-header.status-idle .app-title,
.app-header.status-requested .app-title {
  color: #ffffff;
}

/* Modal styles */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.modal-content { position: relative; background: #fff; color: #111827; padding: 20px; border-radius: 10px; min-width: 280px; max-width: min(520px, 90vw); box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 1; border: 1px solid #e5e7eb; }
.modal-content h2 { margin-bottom: 10px; font-size: 18px; color: #b91c1c; font-weight: 800; }
.modal-content p { margin-bottom: 16px; }
.modal-content ul { margin: 0; padding-left: 20px; }
.modal-content li { margin: 8px 0; line-height: 1.5; }
.modal-content .help-guidance-section { display: grid; gap: 12px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.modal-content .help-guidance-section h3 { margin: 0; color: #111827; font-size: 17px; }
.modal-content .help-guidance-source { margin: 0; color: #4b5563; font-size: 14px; }
.modal-content .help-guidance-entry { border: 1px solid #d1d5db; border-radius: 10px; padding: 12px; background: #fff; color: #111827; overflow-wrap: anywhere; }
.modal-content .help-guidance-entry strong { display: block; margin-bottom: 6px; }
.modal-content .help-guidance-entry a { color: #1d4ed8; }

.modal-content #modal-close,
.modal-content #modal-secondary,
.modal-content #modal-tertiary {
  min-height: var(--btn-h, 48px);
  font-size: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-btn, 14px);
}

#inviteChoiceDialog .invite-choice-content {
  width: min(680px, 92vw);
  max-width: 680px;
}
#inviteNameDialog .invite-choice-content { width: min(520px, 92vw); max-width: 520px; }
#inviteNameDialog h2 { color: #111827; }
#inviteNameDialog label { display: block; color: #111827; font-weight: 700; margin: 12px 0 8px; }
#inviteNameDialog input { width: 100%; max-width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; background: #eceef2; color: #111827; border: 1px solid #9ca3af; font-size: 18px; }
#inviteNameDialog p { color: #374151; line-height: 1.4; }
#inviteNameDialog .vs-btn-secondary {
  background: #ffffff;
  border-color: #6b7280;
  color: #111827;
}
#inviteChoiceDialog h2 { color: #111827; }
.invite-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.invite-choice-option {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #f9fafb;
}
.invite-choice-option p {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 650;
}
.invite-choice-option .vs-btn { width: 100%; }
.invite-choice-option.is-unavailable { opacity: .65; }
.invite-choice-cancel {
  margin-top: 16px;
  color: #111827;
  background: #fff;
  border: 1px solid #6b7280;
}
@media (max-width: 560px) {
  .invite-choice-grid { grid-template-columns: 1fr; }
  #inviteChoiceDialog .invite-choice-content { max-height: 90vh; overflow-y: auto; }
}

 #profileDialogOverlay .modal-content input,
 #profileDialogOverlay .modal-content select,
 #profileDialogOverlay .modal-content textarea {
  color: #111827;
 }

 #profileDialogOverlay .modal-content .vs-input,
 #profileDialogOverlay .modal-content .vs-select,
 #profileDialogOverlay .modal-content .vs-textarea {
  background: #ffffff;
  border-color: #d1d5db;
 }

 #profileDialogOverlay .modal-content .vs-input::placeholder,
 #profileDialogOverlay .modal-content .vs-textarea::placeholder {
  color: #6b7280;
 }

 #profileDialogOverlay .modal-content .settings-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
 }

 #profileDialogOverlay .modal-content .settings-row label {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  margin: 0;
  color: #111827;
 }

 #opsSponsorDialogOverlay .modal-content {
  color: #111827;
 }

 #opsSponsorDialogOverlay {
  padding: 12px;
 }

 #opsSponsorDialogOverlay .modal-content {
  width: min(860px, 94vw);
  max-height: min(90vh, 860px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
 }

 #opsSponsorDialogTitle {
  flex: 0 0 auto;
 }

 #opsSponsorDialogBody {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
 }

 #opsSponsorDialogOverlay .modal-content .vs-card-muted,
 #opsSponsorDialogOverlay .modal-content .settings-subtitle {
  color: #111827;
 }

 #opsSponsorDialogOverlay .modal-content .vs-card {
  color: var(--text, #ffffff);
 }

 #opsSponsorDialogOverlay .modal-content .vs-card .vs-card-muted {
  color: var(--muted, #d6cde6);
 }

 #opsSponsorDialogOverlay .modal-content input,
 #opsSponsorDialogOverlay .modal-content select,
 #opsSponsorDialogOverlay .modal-content textarea {
  color: #111827;
 }

 #opsSponsorDialogOverlay .modal-content .vs-input,
 #opsSponsorDialogOverlay .modal-content .vs-select,
 #opsSponsorDialogOverlay .modal-content .vs-textarea {
  background: #ffffff;
  border-color: #d1d5db;
 }

 #opsSponsorDialogOverlay .modal-content .vs-textarea {
  width: 100%;
  border-radius: 12px;
 }

 #opsSponsorDialogOverlay .modal-content .vs-input::placeholder,
 #opsSponsorDialogOverlay .modal-content .vs-textarea::placeholder {
  color: #6b7280;
 }

 #opsSponsorDialogOverlay .modal-content .vs-btn-secondary {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
 }

 #opsSponsorDialogOverlay .billing-reviews-list {
  max-width: none;
  gap: var(--space-2);
 }

 #opsSponsorDialogOverlay .billing-reviews-list > p {
  margin: 0;
 }

 #opsSponsorDialogOverlay .billing-review-card {
  width: 100%;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
 }

 #opsSponsorDialogOverlay .billing-review-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
 }

 #opsSponsorDialogOverlay .billing-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
 }

 #opsSponsorDialogOverlay .billing-review-actions .vs-btn {
  min-width: min(100%, 180px);
  text-align: center;
 }

 #opsSponsorDialogOverlay .billing-review-actions .vs-btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--muted);
 }

/* Help configuration and response fields: keep the brighter surface scoped to these workflows. */
.sponsor-help-text-input {
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  overflow-y: hidden;
  resize: none;
}

.help-field-description {
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#sponsorInstructionsDefinitionScreen .vs-input,
#sponsorInstructionsDefinitionScreen .vs-select,
#sponsorInstructionsDefinitionScreen .vs-textarea,
#instructionsInfoFields .vs-input,
#instructionsInfoFields .vs-select,
#instructionsInfoFields .vs-textarea,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-input,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-select,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-textarea {
  background: #e9ebef;
  color: #17202d;
  border: 2px solid #a9b1bf;
}

#sponsorInstructionsDefinitionScreen .vs-input::placeholder,
#sponsorInstructionsDefinitionScreen .vs-textarea::placeholder,
#instructionsInfoFields .vs-input::placeholder,
#instructionsInfoFields .vs-textarea::placeholder,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-input::placeholder,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-textarea::placeholder {
  color: #4e5968;
  opacity: 1;
}

#sponsorInstructionsDefinitionScreen .vs-select option,
#instructionsInfoFields .vs-select option,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-select option {
  background: #e9ebef;
  color: #17202d;
}

#sponsorInstructionsDefinitionScreen .vs-input:focus-visible,
#sponsorInstructionsDefinitionScreen .vs-select:focus-visible,
#sponsorInstructionsDefinitionScreen .vs-textarea:focus-visible,
#instructionsInfoFields .vs-input:focus-visible,
#instructionsInfoFields .vs-select:focus-visible,
#instructionsInfoFields .vs-textarea:focus-visible,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-input:focus-visible,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-select:focus-visible,
#opsSponsorDialogOverlay #opsHelpConfigEditor .vs-textarea:focus-visible {
  border-color: #e5a800;
  outline: 3px solid #f2b705;
  outline-offset: 2px;
}

/* Onboarding & shell visual refinements (ITEM-UX-018B) */
.onboarding-card {
  padding: 18px;
  gap: 12px;
}

/* ITEM-UX-027: Ensure onboarding cards have extra bottom clearance when the shell
   renders a fixed footer/status rail so primary controls remain readable. This is a
   minimal, scoped layout rule that preserves existing visuals when the footer is absent. */
.shell-has-fixed-footer #onboardingScreen .onboarding-card {
  padding-bottom: calc(80px + 16px); /* footer height (80px) + safe gap */
}

/* ITEM-UX-031: Mobile clipping fix
   Constrain the onboarding *content* card on narrow viewports so very long step
   content scrolls inside the lower card instead of extending under the fixed
   footer. We target the content card specifically and subtract more of the
   stacked header/progress heights from the viewport to ensure the actionable
   lower card fits above the footer at narrow widths. */
@media (max-width: 540px) {
  /* Use natural document flow on narrow screens.
     The earlier sticky in-card action row could overlap onboarding copy and
     fields on real mobile devices. Let the whole screen scroll and reserve
     enough footer-safe space instead. */
  .shell-has-fixed-footer #onboardingScreen {
    min-height: calc(100vh - 80px);
  }

  .shell-has-fixed-footer #onboardingScreen .onboarding-top {
    display: block;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingContentCard {
    display: block;
    max-height: none;
    overflow: visible;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingContentCard > #onboardingBody {
    overflow: visible;
    padding-bottom: 0;
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingContentCard .contacts-row {
    position: static;
    bottom: auto;
    z-index: auto;
    background: transparent;
    padding-top: 0;
    margin-top: 16px !important;
    margin-bottom: 0;
    justify-content: stretch !important;
    gap: 10px;
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingContentCard .contacts-row > .vs-btn {
    flex: 1 1 100%;
    width: 100%;
    min-height: 52px;
    position: static;
    z-index: auto;
  }

  .shell-has-fixed-footer #onboardingScreen .vs-title-row {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .shell-has-fixed-footer #onboardingScreen .vs-title-row > div[style*="margin-left:auto"] {
    margin-left: 0 !important;
    width: 100%;
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingSupportHint {
    white-space: normal;
  }

  .shell-has-fixed-footer #onboardingScreen #onboardingStepLabel {
    line-height: 1.35;
    white-space: normal;
  }
}

/* ITEM-UX-031 repair: on small mobile viewports when the shell renders a fixed
   footer and onboarding is the active surface, avoid vertically centering the
   onboarding scaffold. This keeps the onboarding content and the in-card action
   row positioned above the footer without changing footer behavior or the
   broader shell layout. Scope is intentionally narrow. */
@media (max-width: 390px) {
  body.shell-has-fixed-footer.onboarding-active .vs-stack,
  body.shell-has-fixed-footer.onboarding-active .container,
  body.shell-has-fixed-footer.onboarding-active .vs-main {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
    padding-top: 12px;
  }

  /* A small safe tweak so the content card can align above the footer on very
     narrow screens while preserving the existing .onboarding-card rules. */
  body.shell-has-fixed-footer.onboarding-active #onboardingScreen {
    padding-bottom: calc(80px + 8px);
  }

  body.shell-has-fixed-footer.onboarding-active #onboardingScreen .onboarding-card {
    padding: 16px;
  }

  body.shell-has-fixed-footer.onboarding-active #onboardingScreen #onboardingStepHeading {
    font-size: 24px;
    line-height: 1.15;
  }

  body.shell-has-fixed-footer.onboarding-active #onboardingScreen #onboardingBody {
    font-size: 16px;
    line-height: 1.45;
  }
}

/* Additional scoped safety:
   - Limit layout impact strictly to the onboarding screen.
   - Ensure the controls-row receives a small safe gap and paints above
     the fixed footer to avoid accidental overlap in complex shells. */
.shell-has-fixed-footer #onboardingScreen {
  padding-bottom: calc(80px + 16px); /* provide screen-level clearance as well */
}
.shell-has-fixed-footer #onboardingScreen .contacts-row {
  z-index: 2; /* ensure primary control area paints above fixed footer */
}
.shell-has-fixed-footer #onboardingScreen .contacts-row > .vs-btn {
  position: relative;
  z-index: 2;
}

/* Progress: stronger hierarchy and numeric markers for scanability */
.onboarding-progress {
  display: flex;
  gap: 12px;
  list-style: none;
  align-items: center;
  padding-left: 0;
  /* allow horizontal scrolling on very small viewports so layout doesn't break */
  overflow-x: auto;
}

/* Base step token - flexible so we can alter layout on small viewports */
.onboarding-step {
  color: var(--muted);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  background: transparent;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: flex-start;
}

/* Completed state visually distinct from upcoming/current */
.onboarding-step.completed {
  background: rgba(16, 185, 129, 0.06);
  color: #065f46;
}
.onboarding-step.completed .onboarding-step-number {
  background: #10b981;
}

/* Numeric badge */
.onboarding-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  background: #2563eb;
  flex: 0 0 auto;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* Title text next to the badge - clearer label */
.onboarding-step .onboarding-step-title {
  display: inline-block;
  white-space: nowrap;
  font-weight: 700;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Current step stronger contrast */
.onboarding-step.current {
  background: rgba(66, 139, 255, 0.12);
  color: #0456d6;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(4,86,214,0.06);
}
.onboarding-step.current .onboarding-step-number {
  background: #0456d6;
}

/* Mobile: stack badge above the title to avoid heavy truncation and improve scanability */
@media (max-width: 540px) {
  /* Use a compact two-row grid layout on narrow viewports so all steps remain
     visible and labels can wrap without heavy truncation. We flow columns so
     each column holds up to two steps (top/bottom), allowing more steps to
     remain legible without widening the component. */
  .onboarding-progress {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    gap: 8px;
    align-items: start;
    overflow-x: auto;
  }

  .onboarding-step {
    /* Allow the grid to control wrapping; avoid forcing a large min-width so
       labels can wrap naturally. Keep the stacked badge+title presentation. */
    min-width: 0;
    padding: 6px 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: normal;
    width: auto;
  }

  .onboarding-step-number {
    width: 26px;
    height: 26px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  .onboarding-step .onboarding-step-title {
    display: block;
    white-space: normal;
    font-size: 12px;
    text-align: center;
    max-width: 120px;
    overflow: visible;
    line-height: 1.15;
  }

  /* emphasize state differences a bit stronger on small screens */
  .onboarding-step.current {
    box-shadow: 0 3px 8px rgba(4,86,214,0.08);
    transform: none;
  }
  .onboarding-step.completed {
    box-shadow: none;
    transform: none;
    opacity: 0.95;
  }
}

/* Make the support affordance more obvious while reusing existing token.
   Slightly tone down weight and ensure consistent button sizing when used
   in the title row so it reads as a deliberate secondary action. */
.support-strong {
  background: #fff;
  color: #0456d6;
  border: 1px solid rgba(4,86,214,0.12);
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  transition: background 120ms ease, transform 80ms ease;
}
.support-strong:hover {
  background: rgba(4,86,214,0.04);
  transform: translateY(-1px);
}

/* When used in the title row, keep the affordance visually secondary and
   aligned with the header layout (it already lives inside a right-aligned container). */
.vs-title-row .support-strong {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: none;
}

/* Info block for awaiting/revoked shells to group details cleanly */
.info-block {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #E8E2F8;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.info-block .awaiting-lead,
.info-block .revoked-lead {
  color: #ffffff;
  font-weight: 700;
}

.info-block .awaiting-meta,
.info-block .revoked-meta,
.info-block .awaiting-next,
.info-block .revoked-next {
  margin-top: 8px;
}

/* Scoped minor adjustments to onboarding status and body spacing */
#onboardingBody {
  margin-top: 12px;
  line-height: 1.5;
  display: block;
}

/* Improve vertical rhythm inside onboarding cards without changing behavior.
   Keep rules narrowly scoped to onboarding so other screens are unaffected. */
.onboarding-card .vs-stack {
  gap: 12px;
}

.onboarding-card .vs-field {
  margin-top: 12px;
  margin-bottom: 10px;
}

/* Ensure common content elements inside the onboarding body have consistent spacing */
#onboardingBody p,
#onboardingBody div,
#onboardingBody ul,
#onboardingBody textarea,
#onboardingBody input,
#onboardingBody label {
  margin-top: 8px;
}

/* Slightly increase list spacing for clarity */
#onboardingBody ul {
  margin-top: 10px;
  padding-left: 18px;
}

#onboardingStatus {
  margin-top: 12px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.02);
}

/* Onboarding support/info/status rules consolidated earlier in the file (deduplicated) */

/* Auth + Contacts */
.auth {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  max-width: none;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  z-index: auto;
}

.contacts {
  width: 100%;
}

.legal-card {
  max-width: 680px;
}

.legal-document-list {
  display: grid;
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

.legal-document-group {
  display: grid;
  gap: 9px;
}

.legal-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
  cursor: pointer;
}

.legal-confirmation input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.legal-document-action,
.legal-document-action .vs-btn {
  width: 100%;
}

.legal-document-action .vs-btn {
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.legal-decision-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 22px;
}

.legal-decision-actions .vs-btn {
  width: 100%;
}

@media (max-width: 520px) {
  .legal-document-list {
    gap: 18px;
    margin-top: 18px;
  }

  .legal-decision-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.login-row,
.contacts-row,
.me-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.login-row input,
.contacts-row input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

#sponsorGuidanceStatus:not(:empty) {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: var(--body);
  font-weight: 700;
  padding: 8px 12px;
}

.login-status {
  font-size: 0.9rem;
  color: var(--muted, #374151);
}

.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text, #111827);
}
#primaryOnboardInviteLinkRow { flex-wrap: wrap; gap: 8px; }
#primaryOnboardInviteLink { flex-basis: 100%; }

.contacts-list {
  margin-top: 6px;
  max-height: 180px;
  overflow: auto;
}

.outbox-screen-list {
  max-height: none;
}

/* Scoped Help circle header: stronger orientation and visual grouping */
#helpCircleScreen .settings-header {
  background: var(--surface, rgba(17,24,39,0.92));
  padding: 12px;
  border-radius: 12px;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  color: #ffffff;
}
#helpCircleScreen .settings-header .settings-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #ffffff;
}

#outboxScreen .settings-header {
  background: var(--surface, rgba(17,24,39,0.92));
  padding: 12px;
  border-radius: 12px;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  color: #ffffff;
}

#outboxScreen .settings-header .settings-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #ffffff;
}
.help-circle-header-strap {
  font-size: 13px;
  color: var(--muted, #d6cde6);
  margin-top: 6px;
  line-height: 1.3;
}

/* Ensure the header back affordance is visible on the white header surface.
   We do not change markup — support common back-button tokens used in the
   app (e.g. .back-button, .back-btn) and ensure icon fills use currentColor. */
#helpCircleScreen .settings-header .vs-btn-ghost,
#helpCircleScreen .settings-header .back-button,
#helpCircleScreen .settings-header .back-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
#helpCircleScreen .settings-header .vs-btn-ghost:focus,
#helpCircleScreen .settings-header .back-button:focus,
#helpCircleScreen .settings-header .back-btn:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  outline-offset: 2px;
}
#helpCircleScreen .settings-header .vs-btn-ghost svg,
#helpCircleScreen .settings-header .back-button svg,
#helpCircleScreen .settings-header .back-btn svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

/* Sponsor header & layout refinements (ITEM-UX-049-A)
   - stronger, clearer title/strap for sponsor surfaces
   - align sponsor cards/content to match app layout (stretch instead of centered)
   - minor visual lift to the sponsor settings header to match other screens */
.sponsor-screen {
  align-items: stretch;
}

/* Use the allowed header contract — do not introduce a custom dark background.
   Preserve existing layout/spacing while deferring background, border and shadow
   to the shell's permitted header treatment. */
.sponsor-screen .settings-header {
  padding: 12px;
  border-radius: 10px;
  align-items: center;
  gap: 10px;
}

/* Title: maintain strong weight but inherit color from the allowed header contract */
.sponsor-screen .settings-header .settings-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: inherit;
}

/* Strapline: inherit muted color so it works with the allowed header background */
.sponsor-strap {
  font-size: 13px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
  line-height: 1.3;
}

/* Ensure back/ghost buttons remain readable by inheriting color and using the
   standard border token so they contrast on the allowed header background. */
.sponsor-screen .settings-header .vs-btn-ghost,
.sponsor-screen .settings-header .back-button,
.sponsor-screen .settings-header .back-btn {
  background: transparent;
  color: inherit;
  border: 1px solid var(--border, rgba(0,0,0,0.04));
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.sponsor-screen .settings-header .vs-btn-ghost:focus,
.sponsor-screen .settings-header .back-button:focus,
.sponsor-screen .settings-header .back-btn:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  outline-offset: 2px;
}

.sponsor-screen .settings-header .vs-btn-ghost svg,
.sponsor-screen .settings-header .back-button svg,
.sponsor-screen .settings-header .back-btn svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}
/* Make sponsor cards use the same card spacing/alignment as other settings screens */
.sponsor-screen .vs-card.settings-section {
  width: 100%;
  margin: 0 0 12px 0;
  padding: 12px;
  box-shadow: var(--shadow-1, none);
  border-radius: var(--radius-card, 10px);
  background: var(--surface, rgba(255,255,255,0.92));
  border: 1px solid var(--border, #e5e7eb);
}

/* Make invite/contact rows read more like cards inside the Help circle */
#helpCircleScreen .contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: 320px;
  overflow: auto;
}

/* Card-like row appearance (keeps existing DOM structure and actions intact) */
#helpCircleScreen .contacts-list .contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 12px;
  background: var(--surface, rgba(17,24,39,0.92));
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  border-bottom: none;
  color: #ffffff;
}

#primaryOnboardInviteRow #createOnboardInviteButton {
  min-height: 48px;
  font-weight: 700;
}

#helpCircleScreen .help-circle-invite-card,
#helpCircleScreen .help-circle-status-card {
  width: 100%;
}

#helpCircleScreen .help-circle-seat-row {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 185, 32, 0.58);
  border-radius: 10px;
  background: rgba(245, 185, 32, 0.12);
}

#helpCircleScreen #shareSeatsAvailableLabel {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#helpCircleScreen .help-circle-seat-available,
#helpCircleScreen .help-circle-seat-pending {
  display: block;
}

#helpCircleScreen .help-circle-seat-pending {
  margin-top: 3px;
  color: #f1e5ff;
  font-size: 0.875rem;
  font-weight: 600;
}

#helpCircleScreen .help-circle-status-card {
  padding: 14px;
  border: 1px solid rgba(170, 130, 220, 0.48);
  border-radius: 14px;
  background: rgba(59, 29, 94, 0.92);
}

#helpCircleScreen .help-circle-scroll-frame {
  position: relative;
  min-width: 0;
  padding-right: 13px;
}

#helpCircleScreen .contacts-section .contacts-list {
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

#helpCircleScreen .contacts-section .contact-row {
  flex: 0 0 auto;
}

#helpCircleScreen .contacts-section .contacts-list::-webkit-scrollbar {
  display: none;
}

#helpCircleScreen .help-circle-scroll-track {
  position: absolute;
  top: 6px;
  right: 0;
  bottom: 0;
  display: block;
  width: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
}

#helpCircleScreen .help-circle-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  border-radius: 6px;
  background: #cbb1ea;
}

#helpCircleScreen .help-circle-refresh-row {
  margin-top: 16px;
}

#helpCircleScreen .help-circle-refresh-row .vs-btn {
  min-height: 44px;
}

#helpCircleScreen .pending-person-details {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
  overflow-wrap: anywhere;
}

#helpCircleScreen .pending-person-name {
  font-size: 1rem;
}

#helpCircleScreen .pending-person-status,
#helpCircleScreen .pending-person-meta {
  font-size: 0.9rem;
  line-height: 1.4;
}

#helpCircleScreen .pending-person-meta {
  color: var(--muted, #d6cde6);
}

/* Ensure row labels and inline content remain dark/legible on the light card surface,
   even when the surrounding shell uses a dark theme. Keep buttons and secondary text
   readable without changing existing behaviors. */
#helpCircleScreen .contacts-list .contact-row > span,
#helpCircleScreen .contacts-list .contact-row > div {
  color: #ffffff;
}

#helpCircleScreen .contacts-list .contact-row button,
#helpCircleScreen .contacts-list .contact-row .vs-btn,
#helpCircleScreen .contacts-list .contact-row .vs-card-muted {
  color: var(--muted, #d6cde6);
}

/* Make help-circle contact-row action buttons render consistently with app tokens.
   Use .vs-btn and lightweight modifiers so existing markup can reuse classes. */
#helpCircleScreen .contacts-list .contact-row .vs-btn {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Secondary action for a pending invitation. */
#helpCircleScreen .contacts-list .contact-row .vs-btn.vs-btn-secondary {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
  color: #ffffff;
  font-weight: 700;
}

/* Contact management stays secondary; removal appears only inside its dialog. */
#helpCircleScreen .contacts-list .contact-row .vs-btn.contact-manage-button {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
  color: #ffffff;
  font-weight: 600;
}

/* Hover affordances (keep subtle and consistent with surrounding card) */
#helpCircleScreen .contacts-list .contact-row .vs-btn:hover {
  background: rgba(0,0,0,0.03);
}
#helpCircleScreen .contacts-list .contact-row .vs-btn.contact-manage-button:hover {
  background: rgba(255,255,255,0.14);
}

#modal.contact-management-modal .modal-content h2,
#modal.contact-management-modal #modal-title {
  color: #111827;
}
#modal.contact-management-modal #modal-message {
  white-space: pre-line;
}
#modal.contact-management-modal #modal-secondary {
  background: #ffffff;
  border: 1px solid #6b7280;
  color: #111827;
}
#modal.contact-management-modal #modal-tertiary {
  background: #eef2ff;
  border: 1px solid #a5b4fc;
  color: #1e40af;
}
#modal.contact-management-modal #modal-tertiary:hover {
  background: #e0e7ff;
}
#modal.contact-management-modal #modal-quaternary {
  background: #eef2ff;
  border: 1px solid #a5b4fc;
  color: #1e40af;
}
#modal.contact-management-modal #modal-quaternary:hover {
  background: #e0e7ff;
}
#modal.contact-management-modal #modal-close {
  background: #b91c1c;
  border: 1px solid #b91c1c;
  color: #ffffff;
}
#modal.contact-management-modal #modal-close:hover {
  background: #991b1b;
}

#modal.contact-label-modal #modal-secondary,
#modal.contact-label-modal #modal-tertiary {
  background: #ffffff;
  border: 1px solid #6b7280;
  color: #111827;
}
#modal.contact-label-modal #modal-title {
  color: #111827;
}

/* Ensure label area is flexible and buttons keep their intrinsic sizing */
#helpCircleScreen .contacts-list .contact-row > span,
#helpCircleScreen .contacts-list .contact-row > div,
#helpCircleScreen .contacts-list .contact-row > button {
  flex: none;
}
#helpCircleScreen .contacts-list .contact-row > span {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 8px;
  word-break: break-word;
}

@media (max-width: 600px) {
  #helpCircleScreen .contacts-list {
    max-height: none;
    overflow: visible;
  }
  #helpCircleScreen .contacts-list .contact-row {
    flex-direction: column;
    align-items: stretch;
  }
  #helpCircleScreen .contacts-list .contact-row > span {
    margin-right: 0;
    width: 100%;
  }
  #helpCircleScreen .contacts-list .contact-row > button {
    align-self: flex-start;
    min-height: 44px;
  }
  #helpCircleScreen .contacts-section .contacts-list {
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Reduce card density on wide viewports while preserving card feel */
@media (min-width: 900px) {
  #helpCircleScreen .contacts-list {
    gap: 6px;
  }
  #helpCircleScreen .contacts-list .contact-row {
    padding: 10px;
    border-radius: 10px;
    /* Reduce visual density on desktop while keeping the dark help-circle surface */
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.06);
    background: var(--surface, rgba(17,24,39,0.92));
  }
}
