:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: #091426;
  color: #e9f0f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at -10% -10%, rgba(79, 165, 255, 0.24), transparent 60%),
    radial-gradient(850px 550px at 110% 0%, rgba(0, 98, 185, 0.2), transparent 60%),
    linear-gradient(165deg, #0d1d37 0%, #071122 45%, #050b16 100%);
  color: #e9f0f8;
}

.app-shell {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-screen {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.brand-panel,
.auth-card {
  background: rgba(8, 18, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.card {
  border-radius: 16px;
}

.brand-panel {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  padding: 32px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, #2a78ec, #59cbff);
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8fd3ff;
}

.brand-panel h1,
.auth-header h2 {
  margin: 0 0 12px;
  line-height: 1.15;
}

.brand-copy,
.auth-header p {
  margin: 0;
  color: #adc0d7;
  line-height: 1.55;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.feature-list li {
  padding-left: 16px;
  position: relative;
  color: #dbe7f4;
}

.feature-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2d7df6;
}

.form-card,
form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.95rem;
  color: #dce7f6;
}

input,
textarea,
button,
select {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  color: #f6f8fb;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #2d7df6;
  box-shadow: 0 0 0 3px rgba(45, 125, 246, 0.16);
}

button {
  cursor: pointer;
  border: none;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

button:hover {
  filter: brightness(1.04);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-btn {
  background: linear-gradient(135deg, #2d7df6, #55c4ff);
  color: #fff;
  font-weight: 600;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.09);
  color: #f6f8fb;
}

.full-width {
  width: 100%;
}

.main-panel {
  width: min(1480px, 100%);
  height: calc(100vh - 40px);
}

.main-panel[hidden] {
  display: none !important;
}

.mail-workspace {
  display: grid;
  grid-template-columns: 56px 235px 1fr;
  gap: 0;
  align-items: stretch;
  height: 100%;
  background: #0f1f37;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(151, 190, 231, 0.2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.icon-rail {
  background: #1f2f3a;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 0;
}

.rail-group {
  display: grid;
  gap: 10px;
}

.rail-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #b8c8d6;
  background: rgba(255, 255, 255, 0.06);
}

.rail-icon.active {
  color: #fff;
  background: #3796f6;
}

.folder-panel {
  background: #142742;
  color: #dce7f6;
  border-left: 1px solid rgba(151, 190, 231, 0.18);
  border-right: 1px solid rgba(151, 190, 231, 0.18);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 0;
}

.folder-panel .eyebrow {
  color: #8fb3d4;
  letter-spacing: 0.2em;
}

.mailbox-head h2 {
  margin: 3px 0 0;
  color: #eff6ff;
  font-size: 0.98rem;
  word-break: break-word;
}

.folder-list {
  display: grid;
  gap: 4px;
}

.folder-item {
  text-align: left;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #d5e5f5;
  padding: 9px 10px;
  font-weight: 500;
  border: 1px solid transparent;
}

.folder-item::before {
  margin-right: 8px;
  opacity: 0.85;
}

.folder-item[data-folder="INBOX"]::before { content: "📥"; }
.folder-item[data-folder="Archive"]::before { content: "🗄"; }
.folder-item[data-folder="Drafts"]::before { content: "✎"; }
.folder-item[data-folder="Sent"]::before { content: "➤"; }
.folder-item[data-folder="Spam"]::before { content: "⚠"; }
.folder-item[data-folder="Trash"]::before { content: "🗑"; }

.folder-item:hover {
  background: rgba(96, 160, 228, 0.18);
}

.folder-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2d7df6, #55c4ff);
  border-color: rgba(185, 225, 255, 0.6);
}

.folder-panel .secondary-btn {
  background: #213a59;
  color: #eef5ff;
  border-radius: 10px;
  padding: 10px;
}

.mail-status,
.status {
  color: #9ed8ff;
  min-height: 20px;
  margin: 0;
  font-size: 0.87rem;
}

.mail-status.error,
.status.error {
  color: #c94848;
}

.mail-content {
  background: #0f213b;
  color: #dbe9f7;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.mail-topbar {
  border-radius: 0;
  border-bottom: 1px solid rgba(151, 190, 231, 0.2);
  padding: 11px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #142742;
}

.topbar-title h3 {
  margin: 0;
  font-size: 1rem;
  color: #eff6ff;
}

.topbar-title span {
  color: #a4bfd8;
  font-size: 0.86rem;
}

.topbar-actions .primary-btn {
  padding: 9px 14px;
  border-radius: 10px;
}

.mail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 36%) 1fr;
  gap: 0;
  min-height: 360px;
  background: #10233d;
}

.message-list-panel,
.message-read-panel {
  border-radius: 0;
  overflow: auto;
  background: #10233d;
  padding: 0;
}

.message-list-panel {
  border-right: 1px solid rgba(151, 190, 231, 0.2);
}

.message-item {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(151, 190, 231, 0.14);
  border-left: 3px solid transparent;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin: 0;
  background: #10233d;
}

.message-item:hover {
  background: rgba(67, 132, 204, 0.24);
}

.message-item.active {
  border-left-color: #3796f6;
  background: rgba(63, 134, 214, 0.32);
}

.message-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.message-meta strong {
  color: #edf5ff;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-meta span,
.message-item small {
  color: #a4bfd8;
  font-size: 0.8rem;
}

.message-item small {
  white-space: nowrap;
}

.empty-state {
  padding: 26px 18px;
  color: #a4bfd8;
  text-align: center;
}

.message-read-panel {
  padding: 16px;
}

.message-detail {
  color: #dbe9f7;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.message-action-btn {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #eaf3ff;
  font-size: 0.86rem;
}

.message-action-btn.danger {
  background: rgba(197, 72, 72, 0.18);
  color: #ffd5d5;
}

.message-detail p,
.detail-card p {
  margin: 0;
  color: #c5d8eb;
}

.message-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0a182b;
  border: 1px solid rgba(151, 190, 231, 0.22);
  padding: 12px;
  border-radius: 10px;
  color: #dbe9f7;
  margin: 0;
}

.detail-card {
  display: grid;
  gap: 10px;
}

.detail-card h3 {
  margin: 0;
  color: #eff6ff;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 0.96rem;
  color: #eaf3ff;
}

.section-title span {
  color: #a4bfd8;
  font-size: 0.84rem;
}

.compose-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: 12px;
  overflow-y: auto;
}

.compose-modal[hidden] {
  display: none;
}

.compose-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 20, 0.72);
  backdrop-filter: blur(2px);
}

.compose-dialog {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: #10233d;
  border: 1px solid rgba(151, 190, 231, 0.24);
  padding: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-dialog {
  width: min(820px, calc(100vw - 24px));
}

.settings-content {
  display: grid;
  gap: 16px;
}

.settings-section {
  background: #0a182b;
  border: 1px solid rgba(151, 190, 231, 0.18);
  border-radius: 14px;
  padding: 14px;
}

.settings-section h3 {
  margin: 0 0 10px;
  color: #eff6ff;
  font-size: 0.95rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.settings-row {
  display: grid;
  gap: 4px;
}

.settings-row strong {
  color: #b7d5f3;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-row span,
.settings-list li,
.settings-placeholder {
  color: #d9e8f7;
  line-height: 1.45;
}

.settings-list {
  margin: 0;
  padding-left: 18px;
  color: #d9e8f7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill.ok {
  background: rgba(55, 180, 120, 0.16);
  color: #aef0cc;
}

.status-pill.warn {
  background: rgba(205, 154, 52, 0.16);
  color: #ffd890;
}

.compose-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compose-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compose-actions-header {
  padding: 0;
  position: static;
  background: transparent;
  backdrop-filter: none;
}

.compose-actions-header .primary-btn,
.compose-actions-header .secondary-btn {
  min-width: 0;
  padding: 9px 14px;
}

.compose-dialog label {
  color: #cfe2f6;
  font-size: 0.88rem;
}

.compose-dialog input,
.compose-dialog textarea {
  background: #0a182b;
  color: #eaf3ff;
  border: 1px solid rgba(151, 190, 231, 0.24);
  padding: 10px 12px;
}

.compose-dialog form {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding-right: 4px;
}

.compose-editor-shell {
  display: grid;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}

.compose-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(151, 190, 231, 0.16);
}

.compose-toolbar button,
.compose-toolbar select,
.compose-toolbar input[type="color"] {
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(151, 190, 231, 0.18);
  background: rgba(15, 33, 59, 0.9);
  color: #edf5ff;
  padding: 0 8px;
  font-size: 0.86rem;
}

.compose-toolbar button {
  min-width: 32px;
  padding: 0 8px;
  font-weight: 600;
}

.compose-toolbar select {
  min-width: 94px;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(151, 190, 231, 0.2);
}

.toolbar-color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c7d8ea;
  font-size: 0.8rem;
}

.toolbar-color span {
  white-space: nowrap;
}

.toolbar-color input[type="color"] {
  width: 42px;
  padding: 2px;
}

.compose-editor {
  min-height: 160px;
  max-height: calc(100vh - 360px);
  flex: 1 1 auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(151, 190, 231, 0.2);
  background: rgba(8, 18, 34, 0.75);
  color: #f5f9ff;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: auto;
  outline: none;
}

.compose-editor:empty::before {
  content: attr(data-placeholder);
  color: #8199b4;
}

.compose-editor:focus {
  border-color: #55c4ff;
  box-shadow: 0 0 0 3px rgba(45, 125, 246, 0.16);
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 2px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(16, 35, 61, 0.06), rgba(16, 35, 61, 0.96) 28%);
  backdrop-filter: blur(6px);
}

#totpModal .compose-actions {
  justify-content: flex-end;
}

.compose-actions .primary-btn,
.compose-actions .secondary-btn {
  min-width: 158px;
}

.compose-dialog .primary-btn {
  width: fit-content;
  min-width: 120px;
}

.welcome-screen.is-hidden {
  display: none;
}

@media (max-width: 1220px) {
  .mail-workspace {
    grid-template-columns: 54px 210px 1fr;
  }

  .mail-grid {
    grid-template-columns: 1fr;
  }

  .message-list-panel {
    border-right: none;
    border-bottom: 1px solid rgba(151, 190, 231, 0.2);
    max-height: 280px;
  }
}

@media (max-width: 960px) {
  .welcome-screen {
    grid-template-columns: 1fr;
  }

  .mail-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .icon-rail {
    flex-direction: row;
    border-radius: 16px 16px 0 0;
  }

  .rail-group {
    display: flex;
  }

  .folder-panel {
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(151, 190, 231, 0.2);
    border-bottom: 1px solid rgba(151, 190, 231, 0.2);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .brand-panel,
  .auth-card {
    padding: 18px;
  }

  .mail-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .compose-dialog {
    width: min(760px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    padding: 12px;
  }

  .compose-editor {
    max-height: calc(100vh - 390px);
    min-height: 140px;
  }

  .compose-actions .primary-btn,
  .compose-actions .secondary-btn {
    min-width: 0;
    width: 100%;
  }
}


/* ============================================================ */
/* PROXYCHECK-INSPIRED THEME OVERLAY                              */
/* Cosmetic only — no structural / functional changes             */
/* Reference: https://proxycheck.io/                              */
/* ============================================================ */

:root {
  --pc-bg-0: #060f1e;
  --pc-bg-1: #0a1729;
  --pc-bg-2: #0e2036;
  --pc-line: rgba(148, 200, 255, 0.16);
  --pc-line-soft: rgba(148, 200, 255, 0.08);
  --pc-accent: #4dd0e1;
  --pc-accent-2: #7b6bd6;
  --pc-accent-3: #e26aa9;
}

body {
  background:
    radial-gradient(1200px 620px at -10% -20%, rgba(123, 107, 214, 0.20) 0%, transparent 55%),
    radial-gradient(1000px 540px at 110% -10%, rgba(77, 208, 225, 0.16) 0%, transparent 55%),
    linear-gradient(160deg, #060f1e 0%, #0a1729 55%, #0e2036 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 200, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 200, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px, 42px 42px;
  mask-image: radial-gradient(1400px 800px at 50% 25%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(1400px 800px at 50% 25%, #000 30%, transparent 82%);
  opacity: 0.9;
}

.app-shell,
.welcome-screen,
.main-panel {
  position: relative;
  z-index: 1;
}

/* Modals stay fixed / above everything (do NOT override .compose-modal
   which is position:fixed; inset:0; z-index:30 in the base stylesheet). */
.compose-modal-backdrop {
  background: rgba(3, 10, 22, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- Login welcome screen : proxycheck gradient-ring cards --- */
.brand-panel,
.auth-card {
  background:
    linear-gradient(rgba(10, 20, 36, 0.86), rgba(10, 20, 36, 0.86)) padding-box,
    linear-gradient(135deg, rgba(226, 106, 169, 0.55) 0%, rgba(123, 107, 214, 0.55) 45%, rgba(77, 208, 225, 0.55) 100%) border-box;
  border: 1px solid transparent;
  box-shadow: 0 28px 70px rgba(3, 8, 18, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-panel h1,
.auth-header h2 {
  background: linear-gradient(90deg, #ffffff 0%, #b8e2ff 60%, #4dd0e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  color: var(--pc-accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.brand-badge {
  background: linear-gradient(135deg, #3d8fd8 0%, #4dd0e1 100%);
  box-shadow: 0 10px 24px rgba(77, 208, 225, 0.28);
}

.feature-list li::before {
  color: var(--pc-accent);
}

input:focus,
textarea:focus {
  border-color: rgba(77, 208, 225, 0.55);
  box-shadow: 0 0 0 3px rgba(77, 208, 225, 0.14);
}

.primary-btn {
  background: linear-gradient(135deg, #3d8fd8 0%, #2b6dbb 100%);
  box-shadow: 0 6px 18px rgba(45, 125, 220, 0.24);
  transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(77, 208, 225, 0.32);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 200, 255, 0.14);
}

.secondary-btn:hover {
  border-color: rgba(77, 208, 225, 0.35);
  background: rgba(77, 208, 225, 0.10);
}

/* --- Mail workspace : darker surface + gradient outer ring --- */
.mail-workspace {
  background: #08182c;
  border: 1px solid transparent;
  background:
    linear-gradient(#08182c, #08182c) padding-box,
    linear-gradient(135deg, rgba(226, 106, 169, 0.50) 0%, rgba(123, 107, 214, 0.50) 45%, rgba(77, 208, 225, 0.50) 100%) border-box;
  box-shadow: 0 28px 64px rgba(3, 8, 18, 0.55);
}

.icon-rail {
  background: #0a1a2f;
  border-right: 1px solid rgba(148, 200, 255, 0.10);
}

.rail-icon {
  background: rgba(255, 255, 255, 0.04);
  color: #a4bfd8;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.rail-icon:hover {
  background: rgba(77, 208, 225, 0.10);
  color: #eaf3ff;
}

.rail-icon.active {
  background: linear-gradient(135deg, #3d8fd8, #4dd0e1);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(77, 208, 225, 0.28);
}

.rail-icon-danger {
  color: #ffd0d8;
  background: rgba(226, 106, 169, 0.10);
  border: 1px solid rgba(226, 106, 169, 0.30);
  font-size: 15px;
  line-height: 1;
}

.rail-icon-danger:hover {
  background: linear-gradient(135deg, rgba(226, 106, 169, 0.28), rgba(178, 62, 92, 0.30));
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(226, 106, 169, 0.28);
}

.folder-panel {
  background: #0b1d34;
  border-left: 1px solid rgba(148, 200, 255, 0.10);
  border-right: 1px solid rgba(148, 200, 255, 0.10);
}

.folder-item:hover {
  background: rgba(77, 208, 225, 0.10);
}

.folder-item.active {
  background: linear-gradient(135deg, rgba(77, 208, 225, 0.22), rgba(123, 107, 214, 0.22));
  border-color: rgba(77, 208, 225, 0.42);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(77, 208, 225, 0.14);
}

.mail-content {
  background: #08192e;
}

.mail-topbar {
  background: #0b1d34;
  border-bottom: 1px solid rgba(148, 200, 255, 0.10);
}

.mail-grid {
  background: #08192e;
}

.message-list-panel,
.message-read-panel {
  background: #08192e;
}

.message-list-panel {
  border-right: 1px solid rgba(148, 200, 255, 0.10);
}

.message-item {
  background: transparent;
  border-bottom: 1px solid rgba(148, 200, 255, 0.08);
  transition: background 160ms ease, border-color 160ms ease;
}

.message-item:hover {
  background: rgba(77, 208, 225, 0.06);
}

.message-item.active {
  background: linear-gradient(135deg, rgba(77, 208, 225, 0.14), rgba(123, 107, 214, 0.14));
  border-left-color: #4dd0e1;
}

.message-detail pre {
  background: #06121f;
  border: 1px solid rgba(148, 200, 255, 0.10);
}

.status-pill.ok {
  background: rgba(75, 214, 165, 0.14);
  color: #c1f3dc;
}

.status-pill.warn {
  background: rgba(240, 184, 98, 0.14);
  color: #ffd890;
}

/* Compose / settings dialogs — gradient ring */
.compose-dialog,
.settings-dialog {
  background:
    linear-gradient(#0b1d34, #0b1d34) padding-box,
    linear-gradient(135deg, rgba(226, 106, 169, 0.45) 0%, rgba(123, 107, 214, 0.45) 45%, rgba(77, 208, 225, 0.45) 100%) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
}

.settings-section {
  background: #06121f;
  border: 1px solid rgba(148, 200, 255, 0.10);
}

.compose-toolbar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 200, 255, 0.10);
}

.compose-dialog input,
.compose-dialog textarea {
  background: #06121f;
  border-color: rgba(148, 200, 255, 0.14);
}

/* --- Confirmation modal (themed alertdialog) --- */
.confirm-dialog {
  width: min(460px, calc(100vw - 24px));
  padding: 22px;
  gap: 14px;
  display: flex;
  flex-direction: column;
}

.confirm-dialog .compose-dialog-head {
  margin-bottom: 4px;
}

.confirm-dialog .eyebrow {
  color: #e26aa9;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
}

.confirm-dialog h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  color: #f2f8ff;
  letter-spacing: -0.005em;
}

.confirm-message {
  margin: 0;
  color: #c5d8eb;
  line-height: 1.5;
  font-size: 0.92rem;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.confirm-actions .primary-btn,
.confirm-actions .secondary-btn {
  min-width: 120px;
}

.confirm-actions .primary-btn.danger-btn {
  background: linear-gradient(135deg, #c94a68 0%, #8c2d44 100%);
  box-shadow: 0 6px 18px rgba(201, 74, 104, 0.30);
}

.confirm-actions .primary-btn.danger-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(226, 106, 169, 0.36);
}

/* ═══════════════════════════════════════════════════════
   HTML EMAIL RENDERING (sandboxed iframe)
   ═══════════════════════════════════════════════════════ */
.message-body { margin: 0; }
.message-body-text pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0a182b;
  border: 1px solid rgba(151, 190, 231, 0.22);
  padding: 12px;
  border-radius: 10px;
  color: #dbe9f7;
  margin: 0;
}
.message-html-frame {
  width: 100%;
  min-height: 240px;
  border: 1px solid rgba(151, 190, 231, 0.22);
  border-radius: 10px;
  background: #ffffff;
  display: block;
  color-scheme: light;
}

/* Source toggle (plain text alt when HTML present) */
.message-source {
  margin-top: 12px;
  border: 1px solid rgba(151, 190, 231, 0.22);
  border-radius: 10px;
  background: #0a182b;
  padding: 0;
}
.message-source[open] { padding-bottom: 4px; }
.message-source > summary {
  cursor: pointer;
  padding: 10px 14px;
  color: #97bee7;
  font-size: 13px;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.message-source > summary::-webkit-details-marker { display: none; }
.message-source > summary::before {
  content: "ℹ";
  font-size: 14px;
  color: #4da8da;
}
.message-source > summary:hover { color: #eff6ff; }
.message-source > pre {
  margin: 0 12px 12px;
  padding: 12px;
  background: rgba(10, 15, 24, 0.6);
  border: 1px solid rgba(151, 190, 231, 0.15);
  border-radius: 8px;
  color: #dbe9f7;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.5;
}