/* Personal colour theme only. Existing layout, spacing and typography stay intact. */
body.p32-theme-dark {
  --p32-bg: #12151a;
  --p32-card: #1b1f26;
  --p32-ink: #e8ebf1;
  --p32-muted: #a4adba;
  --p32-line: #343b47;
  --p32-orange-dark: #ffad6d;
  --p32-warn: #ff9a8f;
  --p32-positive: #62d69a;
  --p32-negative: #ff9189;
  --p32-portal-ink: #e8ebf1;
  --p32-portal-muted: #a4adba;
  --subtle-fg: #12151a;
  --subtle-bg: #1b1f26;
  --fg-color: #1b1f26;
  --bg-color: #12151a;
  --card-bg: #1b1f26;
  --text-color: #e8ebf1;
  --text-light: #e8ebf1;
  --text-muted: #a4adba;
  --border-color: #343b47;
  --control-bg: #222730;
  --control-bg-on-gray: #222730;
  --input-bg: #222730;
  --disabled-control-bg: #292e37;
  --shadow-color: rgba(0, 0, 0, .35);
  background-color: #12151a;
  color: #e8ebf1;
  color-scheme: dark;
}

body.p32-theme-dark .p32-work,
body.p32-theme-dark .p32-messenger {
  --p32-bg: #12151a;
  --p32-card: #1b1f26;
  --p32-ink: #e8ebf1;
  --p32-muted: #a4adba;
  --p32-line: #343b47;
  --p32-line-strong: #4a5361;
  --p32-orange-dark: #ffad6d;
  --p32-mm-bg: #12151a;
  --p32-mm-card: #1b1f26;
  --p32-mm-panel: #1b1f26;
  --p32-mm-chat: #12151a;
  --p32-mm-ink: #e8ebf1;
  --p32-mm-muted: #a4adba;
  --p32-mm-line: #343b47;
  --p32-mm-line-strong: #4a5361;
  --p32-mm-orange-soft: #35232e;
  --p32-list-row-hover: rgba(235, 92, 151, .16);
}

body.p32-theme-dark .p32-portal-header,
body.p32-theme-dark .p32-erp-rail,
body.p32-theme-dark .p32-worker-header,
body.p32-theme-dark .p32-card,
body.p32-theme-dark .card,
body.p32-theme-dark .portal-section,
body.p32-theme-dark .portal-footer,
body.p32-theme-dark .p32-messenger-inbox,
body.p32-theme-dark .p32-messenger-detail,
body.p32-theme-dark .p32-messenger-detail-content,
body.p32-theme-dark .p32-messenger-conversation-head,
body.p32-theme-dark .p32-client-drawer,
body.p32-theme-dark .p32-messenger-compose,
body.p32-theme-dark .p32-messenger-dialog form,
body.p32-theme-dark .p32-messenger-dialog,
body.p32-theme-dark .p32-messenger-conversation-menu > div,
body.p32-theme-dark .p32-messenger-message-menu > div,
body.p32-theme-dark .p32-messenger-advanced-popover,
body.p32-theme-dark .p32-erp-profile-popover,
body.p32-theme-dark .p32-portal-account-menu,
body.p32-theme-dark .dropdown-menu,
body.p32-theme-dark .modal-content,
body.p32-theme-dark .popover,
body.p32-theme-dark .frappe-card {
  background-color: #1b1f26;
  border-color: #343b47;
  color: #e8ebf1;
}

body.p32-theme-dark .p32-messenger-shell,
body.p32-theme-dark .p32-messenger-message-list,
body.p32-theme-dark .p32-messenger-empty,
body.p32-theme-dark .p32-messenger-role-state,
body.p32-theme-dark .p32-messenger-channel-summary,
body.p32-theme-dark .p32-work {
  background-color: #12151a;
  color: #e8ebf1;
}

body.p32-theme-dark .p32-portal-navigation-item,
body.p32-theme-dark .p32-erp-nav-item,
body.p32-theme-dark .p32-erp-profile > summary,
body.p32-theme-dark .p32-messenger-conversation-heading h1,
body.p32-theme-dark .p32-messenger-contact-name,
body.p32-theme-dark .p32-messenger-organization,
body.p32-theme-dark .p32-messenger-conversation,
body.p32-theme-dark .p32-messenger-conversation-name,
body.p32-theme-dark .p32-messenger-message,
body.p32-theme-dark .p32-messenger-message-copy,
body.p32-theme-dark .p32-messenger-message-html,
body.p32-theme-dark .p32-messenger-empty,
body.p32-theme-dark .p32-client-drawer,
body.p32-theme-dark .p32-messenger-dialog,
body.p32-theme-dark .p32-messenger-dialog label,
body.p32-theme-dark .p32-messenger-conversation-menu button,
body.p32-theme-dark .p32-messenger-message-menu button,
body.p32-theme-dark .p32-messenger-message-menu a,
body.p32-theme-dark .p32-messenger-orders-toggle,
body.p32-theme-dark .p32-messenger-order-context-indicator,
body.p32-theme-dark .p32-messenger-detail-message,
body.p32-theme-dark .p32-work h1,
body.p32-theme-dark .p32-work h2,
body.p32-theme-dark .p32-work h3,
body.p32-theme-dark .p32-work label,
body.p32-theme-dark .p32-work a,
body.p32-theme-dark .portal-container,
body.p32-theme-dark .portal-footer a {
  color: #e8ebf1;
}

body.p32-theme-dark .p32-messenger-conversation-meta,
body.p32-theme-dark .p32-messenger-conversation-preview,
body.p32-theme-dark .p32-messenger-conversation-time,
body.p32-theme-dark .p32-messenger-message-footer,
body.p32-theme-dark .p32-messenger-message-time,
body.p32-theme-dark .p32-messenger-dialog-intro,
body.p32-theme-dark .p32-messenger-dialog-kicker,
body.p32-theme-dark .p32-messenger-compose textarea::placeholder,
body.p32-theme-dark .p32-work .text-muted,
body.p32-theme-dark small {
  color: #a4adba;
}

body.p32-theme-dark input,
body.p32-theme-dark textarea,
body.p32-theme-dark select,
body.p32-theme-dark .form-control,
body.p32-theme-dark .p32-messenger-search-label,
body.p32-theme-dark .p32-messenger-compose-row,
body.p32-theme-dark .p32-messenger-advanced-popover,
body.p32-theme-dark .p32-messenger-advanced input,
body.p32-theme-dark .p32-messenger-advanced select,
body.p32-theme-dark .p32-messenger-link-results,
body.p32-theme-dark .p32-messenger-new-email-dialog input,
body.p32-theme-dark .p32-messenger-new-email-dialog select {
  background-color: #222730;
  border-color: #414a58;
  color: #e8ebf1;
  caret-color: #e8ebf1;
}

body.p32-theme-dark input::placeholder,
body.p32-theme-dark textarea::placeholder {
  color: #8f99a8;
}

body.p32-theme-dark .p32-portal-account summary:hover,
body.p32-theme-dark .p32-portal-account summary:focus-visible,
body.p32-theme-dark .p32-portal-account[open] summary,
body.p32-theme-dark .p32-portal-account-link:hover,
body.p32-theme-dark .p32-portal-account-link:focus-visible,
body.p32-theme-dark .p32-erp-profile > summary:hover,
body.p32-theme-dark .p32-erp-profile[open] > summary,
body.p32-theme-dark .p32-erp-profile-popover a:hover,
body.p32-theme-dark .p32-messenger-conversation-menu button:hover,
body.p32-theme-dark .p32-messenger-message-menu button:hover,
body.p32-theme-dark .p32-messenger-message-menu a:hover,
body.p32-theme-dark .p32-messenger-orders-toggle:hover,
body.p32-theme-dark .p32-messenger-message-actions button:hover,
body.p32-theme-dark .p32-messenger-message-actions a:hover,
body.p32-theme-dark .p32-messenger-reply-close:hover,
body.p32-theme-dark .p32-client-drawer-close:hover,
body.p32-theme-dark .dropdown-item:hover {
  background-color: #2a303a;
}

body.p32-theme-dark .p32-portal-account-identity,
body.p32-theme-dark .p32-portal-header,
body.p32-theme-dark .p32-erp-rail,
body.p32-theme-dark .p32-messenger-conversation-head,
body.p32-theme-dark .p32-client-section,
body.p32-theme-dark .p32-messenger-compose,
body.p32-theme-dark .p32-messenger-dialog header,
body.p32-theme-dark .p32-messenger-dialog footer,
body.p32-theme-dark .modal-header,
body.p32-theme-dark .modal-footer {
  border-color: #343b47;
}

body.p32-theme-dark .p32-portal-account-roles li,
body.p32-theme-dark .p32-messenger-quick-filters > button,
body.p32-theme-dark .p32-messenger-client-channel-bar button,
body.p32-theme-dark .p32-messenger-reply-preview,
body.p32-theme-dark .p32-messenger-order-context-indicator,
body.p32-theme-dark .p32-messenger-message--system,
body.p32-theme-dark .p32-messenger-system-event-text,
body.p32-theme-dark .p32-messenger-full-text,
body.p32-theme-dark .p32-messenger-quote,
body.p32-theme-dark .p32-messenger-attachment-item,
body.p32-theme-dark .p32-messenger-attachment-lightbox-info,
body.p32-theme-dark .p32-messenger-attachment-lightbox-strip {
  background-color: #242a33;
  color: #d9dee7;
}

body.p32-theme-dark .p32-messenger-message-html a,
body.p32-theme-dark .p32-messenger-message-copy a,
body.p32-theme-dark .p32-messenger-full-text a {
  color: #8ebcff;
}

body.p32-theme-dark .p32-messenger-send-action,
body.p32-theme-dark .p32-messenger-advanced-submit,
body.p32-theme-dark .p32-messenger-orders-toggle.is-active,
body.p32-theme-dark .p32-messenger-orders-toggle[aria-pressed="true"],
body.p32-theme-dark .p32-messenger-contact-name[aria-pressed="true"],
body.p32-theme-dark .p32-messenger-organization[aria-pressed="true"],
body.p32-theme-dark .p32-messenger-quick-filters > button.is-active,
body.p32-theme-dark .p32-button:not(.p32-button-secondary),
body.p32-theme-dark .btn-primary {
  background-color: #d62f75;
  border-color: #d62f75;
  color: #fff;
}

body.p32-theme-dark .p32-button-secondary,
body.p32-theme-dark .btn-secondary {
  background-color: #242a33;
  border-color: #414a58;
  color: #e8ebf1;
}

body.p32-theme-dark .p32-menu-danger,
body.p32-theme-dark .p32-portal-account-logout {
  color: #ff9189;
}

body.p32-theme-dark .p32-menu-divider {
  background-color: #343b47;
}

body.p32-theme-dark .p32-messenger-attachment-lightbox,
body.p32-theme-dark .p32-messenger-attachment-lightbox-shell,
body.p32-theme-dark .p32-messenger-attachment-lightbox-header,
body.p32-theme-dark .p32-messenger-attachment-lightbox-stage {
  background-color: #12151a;
  color: #e8ebf1;
}

body.p32-theme-dark .p32-contact-address-book label { color: #d9dee7; }
body.p32-theme-dark .p32-contact-address-book input {
  background-color: #222730;
  border-color: #414a58;
  color: #e8ebf1;
}

/* Only the newly added account row receives its own layout. */
.p32-theme-account-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.p32-theme-account-row label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

.p32-theme-account-row svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.p32-theme-account-row select {
  max-width: 180px;
}
