:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2230;
  --bg-hover: #252a3a;
  --border: #2d3348;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0b4;
  --text-muted: #6b7289;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --touch-min: 44px;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  color-scheme: dark;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

body.sidebar-open {
  overflow: hidden;
  position: relative;
}

:is(html[data-theme="light"], body.light-mode) {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f9fafb;
  --border: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

/* Dark form controls — kill native white input/select backgrounds panel-wide */
.main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
.main select,
.main textarea,
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
.modal select,
.modal textarea,
.login-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.login-box select,
.login-box textarea {
  background-color: #151a27;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.main select,
.modal select,
.login-box select {
  background-color: #151a27;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}

.main input::placeholder,
.main textarea::placeholder,
.modal input::placeholder,
.modal textarea::placeholder,
.login-box input::placeholder,
.login-box textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.main input:focus,
.main select:focus,
.main textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.login-box input:focus,
.login-box select:focus,
.login-box textarea:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.main select option,
.main select optgroup,
.modal select option,
.modal select optgroup,
.login-box select option,
.login-box select optgroup {
  background-color: #1a1d27;
  color: #e8eaed;
}

:is(html[data-theme="light"], body.light-mode) .main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
:is(html[data-theme="light"], body.light-mode) .main select,
:is(html[data-theme="light"], body.light-mode) .main textarea,
:is(html[data-theme="light"], body.light-mode) .modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
:is(html[data-theme="light"], body.light-mode) .modal select,
:is(html[data-theme="light"], body.light-mode) .modal textarea,
:is(html[data-theme="light"], body.light-mode) .login-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
:is(html[data-theme="light"], body.light-mode) .login-box select,
:is(html[data-theme="light"], body.light-mode) .login-box textarea {
  background-color: #ffffff;
  color: var(--text-primary);
}

:is(html[data-theme="light"], body.light-mode) .main select,
:is(html[data-theme="light"], body.light-mode) .modal select,
:is(html[data-theme="light"], body.light-mode) .login-box select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234b5563' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
}

:is(html[data-theme="light"], body.light-mode) .main select option,
:is(html[data-theme="light"], body.light-mode) .main select optgroup,
:is(html[data-theme="light"], body.light-mode) .modal select option,
:is(html[data-theme="light"], body.light-mode) .modal select optgroup,
:is(html[data-theme="light"], body.light-mode) .login-box select option,
:is(html[data-theme="light"], body.light-mode) .login-box select optgroup {
  background-color: #ffffff;
  color: #111827;
}

/* App layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: var(--touch-min);
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.theme-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

html[data-theme="dark"] .theme-toggle-icon--moon,
html[data-theme="light"] .theme-toggle-icon--sun {
  display: none;
}

.theme-toggle-label-dark {
  display: none;
}

html[data-theme="light"] .theme-toggle-label-light {
  display: none;
}

html[data-theme="light"] .theme-toggle-label-dark {
  display: inline;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: var(--touch-min);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.sidebar-nav-label {
  margin: 14px 6px 4px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
}

.nav-icon {
  font-size: 18px;
}

.nav-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.nav-item.active .nav-icon-svg {
  color: #fff;
}

.nav-icon-svg svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-icon-svg--gradient {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.nav-icon-svg--gradient svg {
  width: 20px;
  height: 20px;
}

.nav-item.active .nav-icon-svg--gradient {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

.nav-item.active .nav-icon-svg--gradient svg [stroke^="url("] {
  stroke: #fff;
}

.nav-item.active .nav-icon-svg--gradient svg [fill^="rgba"] {
  fill: rgba(255, 255, 255, 0.18);
}

.nav-item.active .nav-icon-svg--gradient svg circle[fill="#22d3ee"],
.nav-item.active .nav-icon-svg--gradient svg circle[fill="#818cf8"],
.nav-item.active .nav-icon-svg--gradient svg circle[fill="rgba(249,115,22,0.25)"] {
  fill: #fff;
}

/* Send Mail page */
.sendmail-intro {
  margin-bottom: 18px;
}

.sendmail-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.sendmail-step-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.sendmail-step-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.sendmail-step-pill.done {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.sendmail-step-panel.hidden {
  display: none;
}

.sendmail-project-grid {
  margin-top: 4px;
}

.sendmail-project-card.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sendmail-selected-project {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.sendmail-step-actions,
.sendmail-final-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sendmail-reset-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.sendmail-reset-btn {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.sendmail-reset-btn:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
}

.sendmail-editor-quicksend {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.sendmail-editor-quicksend.hidden {
  display: none;
}

.sendmail-editor-quicksend-lead {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.95);
}

.sendmail-editor-quicksend-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.sendmail-editor-quicksend-to {
  flex: 1 1 220px;
  margin: 0;
}

.sendmail-editor-quicksend-subject {
  margin: 10px 0 0;
}

.sendmail-editor-quicksend-send {
  flex: 0 0 auto;
  min-height: 42px;
  padding-left: 20px;
  padding-right: 20px;
  font-weight: 700;
}

.sendmail-sync-fields {
  display: none !important;
}

.sendmail-subject-head--quicksend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin-bottom: 6px;
}

.sendmail-subject-head--quicksend > label {
  margin-bottom: 0;
}

.sendmail-subject-cycler--compact .sendmail-subject-cycle-pill {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.15);
}

.sendmail-subject-cycler--compact .sendmail-subject-cycle-seg {
  min-width: 30px;
  padding: 5px 7px;
  font-size: 11px;
}

.sendmail-subject-cycler--compact .sendmail-subject-cycle-btn {
  padding: 5px 8px;
  font-size: 14px;
}

.sendmail-editor-quicksend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(129, 140, 248, 0.18);
}

.sendmail-editor-quicksend-smtp {
  flex: 1 1 180px;
  min-width: 0;
}

.sendmail-editor-quicksend-meta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
  margin-bottom: 4px;
}

.sendmail-editor-quicksend-smtp-value {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.92);
  word-break: break-word;
}

.sendmail-editor-quicksend-sender {
  flex: 1 1 200px;
  margin: 0;
  min-width: 0;
}

/* Préremplir projet — EMAIL PRE ENVOI uniquement (v222) */
#page-emailpreenvoi .mail-projet-prefill {
  margin: 0 20px 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.18), rgba(15, 23, 42, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#page-emailpreenvoi .mail-projet-prefill-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#page-emailpreenvoi .mail-projet-prefill-lead {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(199, 210, 254, 0.95);
  flex: 1 1 180px;
}

#page-emailpreenvoi .mail-projet-prefill-hint {
  margin: 0 0 12px;
  font-size: 12px;
}

#page-emailpreenvoi .mail-projet-prefill-btn {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44%;
  font-weight: 700;
}

#page-emailpreenvoi .mail-projet-prefill-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#page-emailpreenvoi .mail-projet-prefill-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  background: rgba(15, 23, 42, 0.45);
}

#page-emailpreenvoi .mail-projet-prefill-card-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.85);
}

#page-emailpreenvoi .mail-projet-prefill-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
}

#page-emailpreenvoi .mail-projet-prefill-line--empty {
  color: rgba(248, 113, 113, 0.92);
  font-size: 12px;
}

.email-preenvoi-editor-card {
  margin-top: 14px;
  padding-bottom: 18px;
}

.email-preenvoi-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--inox-edge-soft);
}

.email-preenvoi-editor-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  flex: 1 1 auto;
}

.email-preenvoi-editor-project {
  margin: 0;
  width: 100%;
  font-size: 13px;
  color: rgba(203, 213, 225, 0.78);
}

.email-preenvoi-project-pick {
  padding: 12px 20px 0;
}

.email-preenvoi-project-pick.hidden {
  display: none;
}

#page-emailpreenvoi .email-preenvoi-editor-card .sendmail-embed-wrap {
  margin: 0 20px;
}

#page-emailpreenvoi .email-preenvoi-editor-card .sendmail-draft-date-bar,
#page-emailpreenvoi .email-preenvoi-editor-card .sendmail-html-status,
#page-emailpreenvoi .email-preenvoi-editor-card .sendmail-final-actions {
  margin-left: 20px;
  margin-right: 20px;
}

.sendmail-draft-date-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.sendmail-draft-date-bar.hidden {
  display: none;
}

.sendmail-draft-date-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
}

.sendmail-draft-date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.sendmail-draft-date-row input[type="datetime-local"] {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sendmail-draft-date-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.email-preenvoi-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.email-preenvoi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.email-preenvoi-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.email-preenvoi-empty.hidden {
  display: none;
}

.email-preenvoi-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-preenvoi-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.email-preenvoi-item-main {
  flex: 1;
  min-width: 200px;
}

.email-preenvoi-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.email-preenvoi-item-title-text {
  min-width: 0;
  flex: 1;
}

.email-preenvoi-bank-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  line-height: 0;
}

.email-preenvoi-bank-badge-img {
  display: block;
  max-width: 52px;
  max-height: 22px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.email-preenvoi-bank-badge--text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 6px 8px;
}

.email-preenvoi-bank-badge.bank-tool-btn--sg {
  border-color: rgba(227, 6, 19, 0.45);
  background: rgba(227, 6, 19, 0.12);
}

.email-preenvoi-bank-badge.bank-tool-btn--bnp {
  border-color: rgba(0, 145, 90, 0.5);
  background: rgba(0, 145, 90, 0.1);
}

.email-preenvoi-bank-badge.bank-tool-btn--ce {
  border-color: rgba(239, 7, 18, 0.55);
  background: rgba(239, 7, 18, 0.12);
}

.email-preenvoi-bank-badge.bank-tool-btn--bourso {
  border-color: rgba(255, 77, 166, 0.45);
  background: rgba(255, 77, 166, 0.1);
}

.email-preenvoi-bank-badge.bank-tool-btn--lbp {
  border-color: rgba(0, 168, 255, 0.45);
  background: rgba(0, 168, 255, 0.1);
}

.email-preenvoi-bank-badge.bank-tool-btn--ubs {
  border-color: rgba(230, 0, 0, 0.45);
  background: rgba(230, 0, 0, 0.12);
}

.email-preenvoi-bank-badge.bank-tool-btn--postfinance {
  border-color: rgba(255, 204, 0, 0.45);
  background: rgba(255, 204, 0, 0.1);
}

.email-preenvoi-bank-badge.bank-tool-btn--raiffeisen {
  border-color: rgba(227, 6, 19, 0.4);
  background: rgba(227, 6, 19, 0.08);
}

.email-preenvoi-bank-badge.bank-tool-btn--bcv {
  border-color: rgba(0, 120, 200, 0.45);
  background: rgba(0, 120, 200, 0.1);
}

.email-preenvoi-item-subject {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.email-preenvoi-item-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, var(--text-secondary));
  line-height: 1.45;
}

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

.sendmail-embed-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sendmail-embed-header .sendmail-embed-title {
  flex: 1;
  margin: 0;
  min-width: 140px;
}

.sendmail-html-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sendmail-wizard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sendmail-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sendmail-bank-grid {
  margin-bottom: 4px;
}

.sendmail-bank-chip.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sendmail-projects-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.sendmail-projects-section.hidden {
  display: none;
}

.sendmail-projects-title {
  margin-bottom: 10px;
}

.sendmail-bank-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sendmail-bank-hint.hidden {
  display: none;
}

.sendmail-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sendmail-html {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  resize: vertical;
}

.sendmail-editor-note {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
  line-height: 1.45;
}

.sendmail-embed-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.sendmail-embed-section.hidden {
  display: none;
}

.sendmail-embed-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}


.sendmail-body {
  padding: 0 20px 20px;
}

.sendmail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sendmail-embed-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-primary);
  min-height: 420px;
}

.sendmail-embed-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 24px;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

.sendmail-embed-loading.hidden {
  display: none;
}

.sendmail-embed {
  display: block;
  width: 100%;
  min-height: 72vh;
  border: 0;
  background: #e8e8e8;
}

.sendmail-embed-wrap--rdv {
  min-height: 480px;
}

.sendmail-embed-wrap--rdv .sendmail-embed {
  min-height: 76vh;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

/* Main content */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-hover);
}

.status-badge.online {
  color: var(--success);
}

.datetime {
  font-size: 13px;
  color: var(--text-muted);
}

.content {
  padding: 24px;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Paramètres — toujours visible quand la page est active (évite page blanche en prod) */
#page-settings.page.active,
#page-ribcapture.page.active,
#page-agencecapture.page.active {
  display: block;
  min-height: 120px;
  overflow: visible;
  opacity: 1;
  visibility: visible;
  position: relative;
  z-index: 1;
}

#page-settings .settings-card,
#page-settings .card,
#page-ribcapture .rib-capture-card,
#page-ribcapture .rib-workflow-card,
#page-ribcapture .card,
#page-agencecapture .agence-capture-card,
#page-agencecapture .card {
  opacity: 1;
  visibility: visible;
  max-height: none;
  min-height: 0;
}

#page-settings .settings-form,
#page-settings .settings-ocr-body,
#page-settings .bulk-download-body,
#page-settings .user-ban-panel-body,
#page-ribcapture .rib-capture-body,
#page-ribcapture .rib-capture-form,
#page-ribcapture .rib-workflow-form,
#page-agencecapture .agence-capture-body {
  display: block;
  overflow: visible;
}

#page-ribcapture .rib-workflow-card {
  margin-bottom: 16px;
}

.rib-capture-intro {
  margin-bottom: 12px;
}

.rib-capture-form {
  padding: 0 0 8px;
  max-width: 520px;
}

.rib-capture-ocr-card {
  margin-top: 16px;
}

.rib-capture-nav-link,
.rib-capture-settings-link {
  color: var(--accent, #6366f1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rib-capture-nav-link:hover,
.rib-capture-settings-link:hover {
  opacity: 0.9;
}

.rib-workflow-form {
  max-width: 520px;
}

.settings-static-fallback {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--warning, #f59e0b);
  border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.12);
  font-size: 13px;
  line-height: 1.5;
}

.settings-static-fallback:not([hidden]) {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); }
.stat-icon.flamme {
  background: linear-gradient(135deg, rgba(255, 61, 104, 0.28), rgba(255, 140, 0, 0.22));
  border: 1px solid rgba(255, 160, 100, 0.35);
  box-shadow: 0 2px 12px rgba(255, 61, 104, 0.2);
}
.stat-icon.purple { background: rgba(99, 102, 241, 0.15); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); }
.stat-icon.teal { background: rgba(16, 185, 129, 0.15); }

.stat-card-click {
  cursor: pointer;
  user-select: none;
}

.stat-card-click:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.stat-card-click:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inventory-modal {
  max-width: 520px;
}

.inventory-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.08);
  position: sticky;
  top: 0;
  z-index: 2;
}

.inventory-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.inventory-total-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.inventory-total-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.inventory-total-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.inventory-summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.inventory-search-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inventory-search-input::placeholder {
  color: var(--text-muted);
}

.inventory-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.inventory-summary-actions .btn-sm.is-active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.18);
}

.inventory-dep-chip {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent);
  flex-shrink: 0;
}

.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
}

.inventory-dep-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.inventory-dep-block .inventory-row--dep {
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 44px;
}

.inventory-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.inventory-row-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.35;
}

.inventory-list--dep .inventory-row-text {
  color: var(--text-primary);
}

.inventory-dep-bank-btn {
  flex-shrink: 0;
  font-size: 11px;
  padding: 5px 10px;
  white-space: nowrap;
}

.inventory-dep-bank-btn.is-active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.18);
}

.inventory-dep-banks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.inventory-dep-bank-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inventory-dep-bank-line-text {
  font-size: 13px;
  color: var(--text-muted);
}

.inventory-dep-banks-empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.docs-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}

.docs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 20px 12px;
}

.appareil-dropdown {
  position: relative;
  display: inline-block;
}

.appareil-dropdown-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.appareil-dropdown-btn::after {
  content: '▾';
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.65;
  display: inline-block;
  transition: transform 0.2s;
}

.appareil-dropdown-btn:hover,
.appareil-dropdown.open .appareil-dropdown-btn {
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.appareil-dropdown.open .appareil-dropdown-btn::after {
  transform: rotate(180deg);
}

.appareil-dropdown[data-selected]:not([data-selected="all"]) .appareil-dropdown-btn {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
}

.appareil-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 148px;
  z-index: 60;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.appareil-dropdown.open .appareil-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.appareil-dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.appareil-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}

.appareil-dropdown-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.docs-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.docs-tab:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.35);
}

.docs-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text);
}

.docs-rep-dropdown {
  position: relative;
}

.docs-rep-dropdown-btn::after {
  content: '▾';
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.65;
  display: inline-block;
  transition: transform 0.2s;
}

.docs-rep-dropdown.open .docs-rep-dropdown-btn::after {
  transform: rotate(180deg);
}

.docs-rep-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 148px;
  z-index: 60;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  gap: 2px;
}

.docs-rep-dropdown.open .docs-rep-dropdown-menu {
  display: flex;
}

.docs-rep-dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.docs-rep-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}

.docs-rep-dropdown-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.docs-rep-dropdown-item[data-status="no_rep"].active {
  color: #f87171;
}

.docs-rep-dropdown-item[data-status="en_ligne"].active {
  color: #34d399;
}

.docs-rep-dropdown[data-selected="no_rep"] .docs-rep-dropdown-btn {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.docs-rep-dropdown[data-selected="en_ligne"] .docs-rep-dropdown-btn {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-restore-all {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-restore-all:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-delete-all {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.btn-delete-all:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-icon.btn-restore {
  color: #34d399;
}

.table-actions .btn-restore-row {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.docs-restore-bank-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.docs-restore-bank-grid {
  flex: 1 1 280px;
  margin-top: 0;
}

.docs-restore-bank-bar .btn-restore-all {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Cards */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

/* Activity list */
.activity-list {
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: var(--bg-hover);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.info { background: var(--info); }
.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: var(--warning); }

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 14px;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-btn span {
  font-size: 20px;
}

.maintenance-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 16px 18px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.06) 100%);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}

.maintenance-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.maintenance-action-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.maintenance-action-btn--active {
  border-color: rgba(251, 191, 36, 0.85);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32) 0%, rgba(217, 119, 6, 0.18) 100%);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25) inset, 0 10px 28px rgba(245, 158, 11, 0.18);
}

.maintenance-action-btn--active .maintenance-action-title {
  color: #fde68a;
}

.maintenance-action-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.45));
}

.maintenance-action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.maintenance-action-title {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24;
}

.maintenance-action-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-maintenance {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
}

.btn-maintenance:hover {
  filter: brightness(1.06);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: var(--bg-hover);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tr {
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
  background: var(--bg-hover);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge.running {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge.stopped {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.docs-col-status-by {
  min-width: 140px;
}

.status-by-pseudo {
  font-size: 13px;
  white-space: nowrap;
}

.status-by-date {
  font-size: 11px;
  color: var(--text-muted);
}

.status-by-unknown {
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Logs */
.log-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.log-filters select {
  padding: 8px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.logs-container {
  padding: 16px 20px;
  max-height: 500px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
}

.log-entry {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.log-entry.info { background: rgba(59, 130, 246, 0.08); }
.log-entry.success { background: rgba(52, 211, 153, 0.1); }
.log-entry.warning { background: rgba(245, 158, 11, 0.08); }
.log-entry.error { background: rgba(239, 68, 68, 0.08); }

.log-entry-main {
  display: flex;
  gap: 12px;
  width: 100%;
}

.log-details {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.log-details strong {
  color: var(--text-primary);
}

.log-details-errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.log-details-actions {
  margin-top: 10px;
}

.btn-log-delete-batch {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-log-delete-batch:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

.log-batch-deleted {
  margin-top: 8px;
  color: #fbbf24;
  font-weight: 600;
}

.restock-log-card {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: inherit;
}

.restock-log-card.is-deleted {
  opacity: 0.72;
}

.restock-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.restock-log-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.restock-log-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.restock-log-count {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
}

.restock-log-banks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.restock-bank-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 11px;
  color: var(--text-secondary);
}

.restock-log-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.restock-log-meta span {
  display: inline-block;
  min-width: 88px;
  color: var(--text-muted);
  font-weight: 600;
}

.restock-log-notified {
  margin-top: 8px;
  font-size: 12px;
  color: #93c5fd;
  font-weight: 600;
}

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

.btn-log-flamme {
  background: linear-gradient(135deg, rgba(255, 61, 104, 0.22), rgba(255, 140, 0, 0.18));
  border-color: rgba(255, 120, 80, 0.5);
  color: #ffc4a8;
  font-weight: 800;
}

.btn-log-flamme:hover {
  background: linear-gradient(135deg, #ff3d68, #ff8c00);
  border-color: transparent;
  color: #fff;
}

.restock-log-flamme-done {
  margin-top: 8px;
  font-size: 12px;
  color: #fdba74;
  font-weight: 600;
}

.inventory-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-footer-flamme {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.inventory-footer-flamme strong {
  color: #ff6b4a;
  font-weight: 800;
}

.btn-log-download {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.btn-log-download:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #fff;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-level {
  font-weight: 600;
  width: 70px;
  flex-shrink: 0;
}

.log-level.info { color: var(--info); }
.log-level.success { color: #34d399; }
.log-level.warning { color: var(--warning); }
.log-level.error { color: var(--error); }

/* Documents & Telegram */
.upload-card {
  margin-bottom: 24px;
}

.upload-form {
  padding: 20px;
}

.upload-form > form {
  margin: 0;
}

.upload-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

.upload-progress {
  margin-bottom: 16px;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.upload-progress-status {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-pct {
  font-weight: 700;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.upload-progress-track {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
  transition: width 0.15s ease;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 16px;
}

.upload-file-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  max-height: 180px;
  overflow-y: auto;
}

.upload-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-file-list li:last-child {
  border-bottom: none;
}

.upload-file-size {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.upload-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-file-row input[type="file"] {
  flex: 1 1 220px;
  min-width: 0;
}

.upload-file-row .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

.upload-file-status {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.upload-file-status--added {
  color: #34d399;
}

.upload-file-list-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-hover);
  margin-bottom: 8px;
}

.upload-result {
  margin-top: 16px;
  padding-top: 0;
}

.upload-result.hidden {
  display: none;
}

.upload-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.upload-result-header h3 {
  margin: 0;
  font-size: 16px;
}

.upload-result-hint {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 600;
}

.upload-result-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.upload-result-format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -8px 0 14px;
}

.upload-result-format-row .btn-sm {
  font-size: 13px;
}

.upload-format-modal {
  max-width: 720px;
  width: calc(100% - 32px);
}

.upload-format-block {
  margin-bottom: 16px;
}

.upload-format-pre {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
}

.upload-format-pre--template {
  max-height: 260px;
  opacity: 0.92;
}

.upload-format-template {
  padding-top: 4px;
}

.upload-format-template summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  user-select: none;
}

.upload-result-section {
  margin-bottom: 14px;
}

.upload-result-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-result-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-bank-picker {
  margin-bottom: 12px;
}

.upload-bank-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-bank-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-bank-row .quota-bank-chip {
  min-width: 72px;
  cursor: default;
  pointer-events: none;
}

.upload-bank-row input[type="number"] {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.upload-bank-row input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.upload-bank-row-label {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-assign-summary {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.upload-assign-summary.ok {
  color: #34d399;
}

.upload-assign-summary.warn {
  color: #fbbf24;
}

.upload-validate-btn.validated {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.upload-notify-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-breakdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.upload-breakdown-chip .count {
  font-size: 15px;
}

.upload-notify-btn {
  width: 100%;
  margin-top: 8px;
}

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

.alert-info {
  margin: 16px 20px;
  padding: 14px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.badge.format {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
  white-space: nowrap;
}

.alert-info code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 32px !important;
}

.telegram-info {
  padding: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
}

.info-row span {
  color: var(--text-muted);
  flex-shrink: 0;
}

.info-row code {
  font-size: 12px;
  background: var(--bg-hover);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.telegram-config-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telegram-config-form label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.telegram-config-form label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--text);
  cursor: pointer;
}

.telegram-config-form input[type="text"],
.telegram-config-form input[type="url"],
.telegram-config-form input[type="email"],
.telegram-config-form input[type="number"],
.telegram-config-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 14px;
}

.telegram-config-form .field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.telegram-config-form .field-hint code {
  font-size: 11px;
  word-break: break-all;
}

.telegram-config-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.telegram-info.hidden,
.telegram-config-form.hidden {
  display: none;
}

.telegram-actions {
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.web-secret-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.web-secret-inline-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.web-secret-inline-toggle.is-on {
  border-color: rgba(99, 102, 241, 0.65);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.web-secret-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}

.web-secret-inline-toggle.is-on .web-secret-switch {
  background: var(--accent);
}

.web-secret-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.web-secret-inline-toggle.is-on .web-secret-switch-knob {
  transform: translateX(18px);
}

.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;
}

.web-secret-wrap {
  margin: 0 20px 16px;
  padding: 16px 18px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.web-secret-off-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.web-secret-off-hint.hidden {
  display: none;
}

.web-secret-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
}

.web-secret-link-block.hidden {
  display: none;
}

.web-secret-link-block .field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.45;
}

.web-secret-url-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}

.web-secret-url-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.rep-toggle-wrap {
  padding: 0 20px 20px;
}

.rep-toggle-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rep-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
}

.rep-toggle-btn .rep-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rep-toggle-btn.online {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.rep-toggle-btn.online .rep-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-green 2s infinite;
}

.rep-toggle-btn.offline {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.25);
}

.rep-toggle-btn.offline .rep-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse-red 1.2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 10px #ef4444; }
  50% { opacity: 0.7; transform: scale(1.3); box-shadow: 0 0 18px #ef4444; }
}

.rep-toggle-btn:hover {
  transform: translateY(-1px);
}

.steps-list {
  padding: 20px;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.step-item:last-child {
  border-bottom: none;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-item strong {
  display: block;
  margin-bottom: 4px;
}

.step-item p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Utilisateurs Telegram */
.users-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}

.user-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.user-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.user-pseudo {
  font-size: 14px;
  color: var(--accent-hover);
  margin-bottom: 4px;
}

.user-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.user-badge-count {
  text-align: center;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-badge-count.blocked {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}

.user-badge-count .stat-lock {
  display: block;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 4px;
}

.user-badge-count.blocked .stat-value-sm {
  color: #fbbf24;
}

.stat-value-sm {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.stat-label-sm {
  font-size: 11px;
  color: var(--text-muted);
}

.user-card-body {
  padding: 16px 20px 20px;
}

.user-quota-bar {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.06);
}

.user-quota-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quota-bank-rows {
  margin: 10px 0;
}

.quota-assign-summary {
  margin-bottom: 12px;
}

.user-quota-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quota-appareil-dropdown {
  margin-right: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--border);
}

.quota-appareil-dropdown .appareil-dropdown-btn {
  border-radius: 8px;
  background: var(--bg-hover);
  font-size: 13px;
  padding: 8px 12px;
}

.user-quota-input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.btn-quota-save {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
  color: #34d399;
}

.btn-quota-reset {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-quota-unlocker {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.btn-quota-unlocker.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.user-quota-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.quota-bank-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quota-bank-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.quota-bank-chip:hover {
  transform: translateY(-1px);
}

.quota-bank-chip.active {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.65);
}

.quota-bank-chip.bank-mix { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.quota-bank-chip.bank-mix.active { background: rgba(99, 102, 241, 0.32); color: #c7d2fe; }
.quota-bank-chip.bank-lcl { background: rgba(0, 48, 135, 0.35); color: #4d8bff; }
.quota-bank-chip.bank-lbp { background: rgba(0, 168, 255, 0.25); color: #38c4ff; }
.quota-bank-chip.bank-sg { background: rgba(227, 6, 19, 0.28); color: #ff4d5e; }
.quota-bank-chip.bank-ca { background: rgba(0, 166, 81, 0.28); color: #34d399; }
.quota-bank-chip.bank-ce { background: #ef0712; color: #fff; }
.quota-bank-chip.bank-bourso { background: rgba(255, 77, 166, 0.28); color: #ff6eb4; }
.quota-bank-chip.bank-bnp { background: rgba(0, 166, 81, 0.22); color: #34d399; }
.quota-bank-chip.bank-cm { background: rgba(249, 115, 22, 0.30); color: #fdba74; }
.quota-bank-chip.bank-cm.active { background: rgba(249, 115, 22, 0.42); color: #fed7aa; }
.quota-bank-chip.bank-cic { background: rgba(20, 184, 166, 0.28); color: #5eead4; }
.quota-bank-chip.bank-cic.active { background: rgba(20, 184, 166, 0.40); color: #99f6e4; }

.quota-cp-row {
  margin-top: 10px;
}

.quota-cp-input {
  width: 100%;
  max-width: 280px;
}

.quota-cp-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-card-body h4 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.user-fiches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-fiche-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 14px;
}

.user-fiche-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.user-no-fiches {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.search-bar {
  position: relative;
  margin: 0 20px 12px;
}

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

.search-bar-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.search-bar-input:focus {
  outline: none;
  border-color: var(--accent);
}

.data-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.data-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.data-search-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.data-search-input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.data-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.data-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  line-height: 1;
}

.data-search-clear:hover {
  color: var(--text-primary);
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.docs-count {
  padding: 0 20px 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.badge.tag {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.badge.tag.bank-lcl { background: rgba(0, 48, 135, 0.2); color: #4d8bff; }
.badge.tag.bank-lbp { background: rgba(0, 168, 255, 0.18); color: #38c4ff; }
.badge.tag.bank-sg { background: rgba(227, 6, 19, 0.18); color: #ff4d5e; }
.badge.tag.bank-ca { background: rgba(0, 166, 81, 0.18); color: #34d399; }
.badge.tag.bank-ce { background: #ef0712; color: #fff; }
.badge.tag.bank-bourso { background: rgba(255, 77, 166, 0.18); color: #ff6eb4; }
.badge.tag.bank-cm { background: rgba(249, 115, 22, 0.18); color: #fdba74; }
.badge.tag.bank-cic { background: rgba(20, 184, 166, 0.18); color: #5eead4; }
.badge.tag.bank-default { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge.tag.cc-tag { background: rgba(255, 209, 102, 0.18); color: #ffd166; margin-top: 4px; display: inline-block; }
.badge.cc-icon { background: rgba(255, 209, 102, 0.18); border: 1px solid rgba(255, 209, 102, 0.35); padding: 2px 6px; font-size: 12px; vertical-align: middle; }

.flamme-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, #ff3d68 0%, #ff5a3d 48%, #ff8c00 100%);
  border: 1px solid rgba(255, 200, 150, 0.55);
  box-shadow: 0 2px 10px rgba(255, 61, 104, 0.35);
  vertical-align: middle;
}

.flamme-badge--inline {
  font-size: 9px;
  padding: 2px 8px;
}

.flamme-badge-flame {
  font-size: 10px;
  line-height: 1;
}

.flamme-badge-countdown {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge.flamme-icon {
  /* legacy alias — prefer .flamme-badge */
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff3d68 0%, #ff5a3d 48%, #ff8c00 100%);
  border: 1px solid rgba(255, 200, 150, 0.55);
  vertical-align: middle;
}

.badge.appareil-badge {
  padding: 2px 6px;
  font-size: 11px;
  vertical-align: middle;
  white-space: nowrap;
}

.badge.appareil-iphone {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.badge.appareil-android,
.badge.appareil-samsung {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.badge.appareil-autre {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .user-card-header {
    flex-wrap: wrap;
  }
  .user-fiche-meta {
    margin-left: 0;
    width: 100%;
  }
}

/* Forms */
.settings-form {
  padding: 20px;
  max-width: 520px;
}

.settings-ocr-card,
.settings-rib-ocr-card {
  margin-top: 20px;
}

.settings-ocr-body {
  padding: 20px;
  max-width: 520px;
}

.settings-fiche-filter {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
}

.bulk-download-card {
  margin-top: 20px;
}

.bulk-download-body {
  padding: 20px;
  max-width: 520px;
}

.bulk-bank-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-cp-input {
  width: 100%;
  max-width: 280px;
  margin-bottom: 10px;
}

.bulk-cp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-cp-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.bulk-cp-chip:hover {
  transform: translateY(-1px);
}

.bulk-cp-chip.active {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.bulk-cp-hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bulk-download-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.bulk-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.bulk-download-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bulk-download-modal-question {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.bulk-download-modal-actions .btn-primary,
.bulk-download-modal-actions .btn-bulk-remove {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
}

.btn-bulk-remove {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.btn-history-logs {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.btn-delete-user {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.btn-delete-user:hover {
  background: rgba(239, 68, 68, 0.28);
}

.btn-copy-rez {
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: #c4b5fd;
  font-weight: 800;
}

.btn-copy-rez:hover {
  background: rgba(124, 58, 237, 0.28);
}

.btn-copy-rez.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.btn-copy-rez.active:hover {
  filter: brightness(1.08);
}

.btn-cc-filter {
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: #c4b5fd;
  font-weight: 800;
  min-width: 52px;
  padding: 6px 10px;
}

.btn-cc-filter:hover {
  background: rgba(124, 58, 237, 0.28);
}

.btn-cc-filter.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.btn-cc-filter.active:hover {
  filter: brightness(1.08);
}

.btn-flamme-filter,
.btn-flamme-fiches {
  background: linear-gradient(135deg, rgba(255, 61, 104, 0.16), rgba(255, 140, 0, 0.14));
  border: 1px solid rgba(255, 120, 80, 0.45);
  color: #ffb199;
  font-weight: 800;
}

.btn-flamme-filter:hover,
.btn-flamme-fiches:hover {
  background: linear-gradient(135deg, rgba(255, 61, 104, 0.28), rgba(255, 140, 0, 0.22));
}

.btn-flamme-filter.active {
  background: linear-gradient(135deg, #ff3d68, #ff8c00);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 61, 104, 0.32);
}

.btn-flamme-filter.active:hover {
  filter: brightness(1.08);
}

.docs-cc-bank-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.docs-cc-bank-grid {
  flex: 1 1 280px;
  margin-top: 0;
}

.docs-cc-bank-bar .btn-cc-filter {
  flex-shrink: 0;
}

.user-ban-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.user-ban-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.user-ban-status {
  font-size: 13px;
  color: var(--text-muted);
}

.user-ban-status.banned {
  color: #f87171;
  font-weight: 600;
}

.user-ban-status.ok {
  color: #34d399;
}

.btn-user-ban {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.user-ban-card {
  margin-top: 20px;
}

.user-ban-panel-body {
  padding: 20px;
}

.user-ban-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.user-banned-tag {
  color: #f87171;
  font-weight: 700;
}

.banned-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banned-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.banned-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banned-user-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.history-logs-modal {
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.history-logs-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-log-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.history-log-item.log-no-rep {
  border-left: 3px solid #ef4444;
}

.history-log-item.log-en-ligne {
  border-left: 3px solid #22c55e;
}

.history-log-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.history-log-action {
  font-weight: 700;
}

.history-log-date {
  color: var(--text-muted);
}

.history-log-fiche {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: #151a27;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

:is(html[data-theme="light"], body.light-mode) .form-group input[type="text"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="search"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="tel"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="email"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="password"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="number"],
:is(html[data-theme="light"], body.light-mode) .form-group input[type="url"],
:is(html[data-theme="light"], body.light-mode) .form-group select,
:is(html[data-theme="light"], body.light-mode) .form-group textarea {
  background-color: #ffffff;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Buttons */
.btn-primary {
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 8px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-full {
  width: 100%;
}

/* Login */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-overlay.hidden {
  display: none;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.login-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.login-error {
  color: var(--error);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}

.login-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal notification */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.modal-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.notify-bank-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.notify-bank-chip {
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.notify-bank-chip:hover {
  transform: translateY(-1px);
}

.notify-bank-chip.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  transform: scale(1.03);
}

.notify-bank-chip.bank-lcl { background: rgba(0, 48, 135, 0.35); color: #4d8bff; }
.notify-bank-chip.bank-lbp { background: rgba(0, 168, 255, 0.25); color: #38c4ff; }
.notify-bank-chip.bank-sg { background: rgba(227, 6, 19, 0.28); color: #ff4d5e; }
.notify-bank-chip.bank-ca { background: rgba(0, 166, 81, 0.28); color: #34d399; }
.notify-bank-chip.bank-ce { background: #ef0712; color: #fff; }
.notify-bank-chip.bank-bourso { background: rgba(255, 77, 166, 0.28); color: #ff6eb4; }
.notify-bank-chip.bank-bnp { background: rgba(0, 166, 81, 0.22); color: #34d399; }
.notify-bank-chip.bank-cm { background: rgba(249, 115, 22, 0.30); color: #fdba74; }
.notify-bank-chip.bank-cic { background: rgba(20, 184, 166, 0.28); color: #5eead4; }
.notify-bank-chip.bank-default { background: rgba(99, 102, 241, 0.22); color: #818cf8; }

.notify-word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notify-word-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.notify-word-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--text-primary);
}

.notify-preview {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
}

.notify-message-input {
  width: 100%;
}

.notify-preview-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.notify-preview-text {
  font-size: 20px;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* ── Aperçu maintenance + robot animé ── */
.notify-preview--maintenance {
  padding: 0;
  background: transparent;
  border: none;
}

.notify-preview--maintenance .notify-preview-label {
  margin-bottom: 10px;
}

.maint-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #1c1708 0%, #12141c 55%, #0f1117 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 12px 40px rgba(245, 158, 11, 0.08);
}

.maint-tape {
  height: 26px;
  background: repeating-linear-gradient(
    -45deg,
    #f59e0b 0,
    #f59e0b 14px,
    #111827 14px,
    #111827 28px
  );
  background-size: 40px 40px;
  animation: maint-tape-scroll 1.2s linear infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@keyframes maint-tape-scroll {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}

.maint-scene {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 14px;
}

.maint-robot {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 108px;
}

.robot-antenna {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 14px;
  background: #94a3b8;
  border-radius: 2px;
}

.robot-signal {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 12px #f59e0b;
  animation: maint-signal 1.4s ease-in-out infinite;
}

@keyframes maint-signal {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) scale(0.85); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.robot-head {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 38px;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-radius: 12px 12px 10px 10px;
  border: 2px solid #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.robot-eye {
  position: absolute;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  animation: maint-blink 3.2s step-end infinite;
}

.robot-eye--l { left: 10px; }
.robot-eye--r { right: 10px; }

@keyframes maint-blink {
  0%, 92%, 100% { transform: scaleY(1); opacity: 1; }
  94% { transform: scaleY(0.12); opacity: 0.7; }
}

.robot-body {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 46px;
  background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
  border-radius: 10px;
  border: 2px solid #3730a3;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

.robot-panel {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.robot-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #334155;
}

.robot-led:nth-child(1) { animation: maint-led 1.2s ease-in-out infinite; }
.robot-led:nth-child(2) { animation: maint-led 1.2s ease-in-out 0.25s infinite; }
.robot-led:nth-child(3) { animation: maint-led 1.2s ease-in-out 0.5s infinite; }

@keyframes maint-led {
  0%, 100% { background: #334155; box-shadow: none; }
  50% { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
}

.robot-arm {
  position: absolute;
  top: 8px;
  width: 8px;
  height: 28px;
  background: #64748b;
  border-radius: 4px;
  transform-origin: top center;
}

.robot-arm--l {
  left: -6px;
  animation: maint-arm-l 2.4s ease-in-out infinite;
}

.robot-arm--r {
  right: -6px;
  animation: maint-arm-r 0.55s ease-in-out infinite alternate;
}

@keyframes maint-arm-l {
  0%, 100% { transform: rotate(18deg); }
  50% { transform: rotate(-8deg); }
}

@keyframes maint-arm-r {
  from { transform: rotate(-28deg); }
  to { transform: rotate(14deg); }
}

.robot-wrench {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-20deg);
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.65));
  animation: maint-wrench 0.55s ease-in-out infinite alternate;
}

@keyframes maint-wrench {
  from { transform: translateX(-50%) rotate(-35deg); }
  to { transform: translateX(-50%) rotate(25deg); }
}

.maint-sparks {
  position: absolute;
  top: 78px;
  right: 2px;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.maint-sparks span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
  opacity: 0;
  animation: maint-spark 0.55s ease-out infinite;
}

.maint-sparks span:nth-child(1) { top: 0; left: 8px; animation-delay: 0s; }
.maint-sparks span:nth-child(2) { top: 6px; left: 16px; animation-delay: 0.12s; }
.maint-sparks span:nth-child(3) { top: 12px; left: 4px; animation-delay: 0.22s; }
.maint-sparks span:nth-child(4) { top: 8px; left: 12px; animation-delay: 0.08s; }

@keyframes maint-spark {
  0% { opacity: 0; transform: scale(0.2) translateY(0); }
  35% { opacity: 1; transform: scale(1.2) translateY(-4px); }
  100% { opacity: 0; transform: scale(0.4) translateY(-14px); }
}

.maint-content {
  flex: 1;
  min-width: 0;
}

.maint-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.maint-msg {
  font-size: 18px;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.maint-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.maint-progress {
  height: 4px;
  background: rgba(245, 158, 11, 0.15);
  overflow: hidden;
}

.maint-progress span {
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, transparent, #f59e0b, #fbbf24, transparent);
  animation: maint-progress 1.8s ease-in-out infinite;
}

@keyframes maint-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 1024px) {
  .cards-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(var(--sidebar-width), calc(100vw - 48px));
    max-width: 100%;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    border-radius: 8px;
  }

  .sidebar-close:hover,
  .sidebar-close:focus-visible {
    background: var(--bg-hover);
    outline: none;
  }

  .sidebar-overlay {
    display: none;
    padding: 0;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    padding-top: var(--safe-top);
    padding-left: max(12px, var(--safe-left));
    padding-right: max(12px, var(--safe-right));
    height: auto;
    min-height: calc(var(--topbar-height) + var(--safe-top));
  }

  .page-title {
    font-size: 17px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .datetime {
    display: none;
  }

  .status-badge {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .content {
    padding: 16px max(16px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(16px, var(--safe-left));
    max-width: 100%;
    overflow-x: hidden;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .upload-grid,
  .quick-actions,
  .cards-row,
  .mailtest-workspace,
  .setupconfig-grid,
  .setupconfig-fields,
  .bulksend-grid,
  .smtp-profiles-row {
    grid-template-columns: 1fr !important;
  }

  .bulksend-config-pair {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .bulksend-run-controls {
    width: 100%;
  }

  .bulksend-run-controls .btn-primary,
  .bulksend-run-controls .btn-secondary,
  .bulksend-btn-pause {
    flex: 1 1 auto;
    min-height: var(--touch-min);
  }

  .aws-secret-row,
  .aws-form-actions,
  .aws-progress-inner,
  .aws-import-actions,
  .smtp-profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-toggle-secret,
  .aws-form-actions .btn-primary,
  .aws-form-actions .btn-secondary,
  .aws-import-actions .btn-primary,
  .aws-import-actions .btn-secondary,
  .smtp-profile-actions .btn-primary,
  .smtp-profile-actions .btn-secondary,
  .smtp-profile-remove-btn {
    width: 100%;
    min-height: var(--touch-min);
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
  }

  .card-header-actions,
  .setupconfig-header-actions,
  .aws-results-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-header-actions .btn-sm,
  .card-header-actions .btn-primary,
  .card-header-actions .btn-secondary,
  .setupconfig-header-actions .btn-sm,
  .setupconfig-header-actions select,
  .setupconfig-import-select {
    min-height: var(--touch-min);
  }

  .setupconfig-import-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  /* Touch targets */
  .btn-primary,
  .btn-secondary,
  .btn-sm,
  .btn-full,
  .btn-logout,
  .action-btn,
  .menu-toggle,
  .nav-item,
  .bulksend-btn-pause,
  .maintenance-action-btn {
    min-height: var(--touch-min);
  }

  .btn-primary,
  .btn-secondary,
  .btn-sm {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .btn-icon {
    width: var(--touch-min);
    height: var(--touch-min);
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }

  /* Forms: larger, single-column, usable selects */
  .main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  .main select,
  .main textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  .modal select,
  .modal textarea,
  .form-group input[type="text"],
  .form-group input[type="search"],
  .form-group input[type="tel"],
  .form-group input[type="email"],
  .form-group input[type="password"],
  .form-group input[type="number"],
  .form-group input[type="url"],
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* évite le zoom iOS */
    min-height: var(--touch-min);
    max-width: 100%;
  }

  .main select,
  .modal select,
  .form-group select,
  .setupconfig-import-select {
    min-height: var(--touch-min);
    background-position: right 14px center;
    padding-right: 40px;
  }

  .settings-form,
  .settings-ocr-body,
  .telegram-config-form {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Scroll areas: tables / logs / previews */
  .table-wrapper,
  .logs-container,
  .activity-list,
  .bulksend-log,
  .aws-topo-pre,
  .aws-table-wrap,
  .aws-import-table-wrap,
  .mailtest-preview-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

  .info-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .modal .modal-content,
  .modal-box,
  .login-box {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 12px max(12px, var(--safe-right)) calc(16px + var(--safe-bottom)) max(12px, var(--safe-left));
  }

  .topbar-actions .status-badge {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Outils agence — page Services */
.bank-tools-card {
  margin-bottom: 24px;
}

.bank-tools-intro {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.bank-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.bank-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 132px;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
}

.bank-tool-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
}

.bank-tool-btn-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.bank-tool-btn-logo--ch,
.bank-toolkit-badge--ch {
  font-size: 0;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.bank-tool-btn-logo--ch img,
.bank-toolkit-badge--ch img {
  display: block;
  width: auto;
  height: auto;
  max-width: 72px;
  max-height: 28px;
  object-fit: contain;
}

.bank-tool-btn-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.bank-tool-btn-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.bank-tool-btn-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.bank-tool-btn-arrow {
  position: absolute;
  right: 12px;
  bottom: 14px;
  font-size: 16px;
  color: var(--text-muted);
  opacity: 0.85;
}

.bank-tool-btn--sg {
  border-color: rgba(227, 6, 19, 0.45);
  background: rgba(227, 6, 19, 0.1);
}
.bank-tool-btn--sg .bank-tool-btn-logo {
  background: rgba(227, 6, 19, 0.35);
  color: #ff6b76;
}
.bank-tool-btn--sg:hover {
  box-shadow: 0 8px 28px rgba(227, 6, 19, 0.18);
}

.bank-tool-btn--bnp {
  border-color: rgba(0, 145, 90, 0.5);
  background: rgba(0, 145, 90, 0.1);
}
.bank-tool-btn--bnp .bank-tool-btn-logo {
  background: rgba(0, 145, 90, 0.35);
  color: #5ee9b5;
}
.bank-tool-btn--bnp:hover {
  box-shadow: 0 8px 28px rgba(0, 145, 90, 0.2);
}

.bank-tool-btn--ce {
  border-color: rgba(239, 7, 18, 0.55);
  background: rgba(239, 7, 18, 0.12);
}
.bank-tool-btn--ce .bank-tool-btn-logo {
  background: #ef0712;
  color: #fff;
}
.bank-tool-btn--ce:hover {
  box-shadow: 0 8px 28px rgba(239, 7, 18, 0.2);
}

.bank-tool-btn--bourso {
  border-color: rgba(255, 77, 166, 0.45);
  background: rgba(255, 77, 166, 0.1);
}
.bank-tool-btn--bourso .bank-tool-btn-logo {
  background: rgba(255, 77, 166, 0.32);
  color: #ff9ed0;
  font-size: 9px;
}
.bank-tool-btn--bourso:hover {
  box-shadow: 0 8px 28px rgba(255, 77, 166, 0.18);
}

.bank-tool-btn--lbp {
  border-color: rgba(0, 168, 255, 0.45);
  background: rgba(0, 168, 255, 0.1);
}
.bank-tool-btn--lbp .bank-tool-btn-logo {
  background: rgba(0, 168, 255, 0.3);
  color: #7ddcff;
}
.bank-tool-btn--ubs {
  border-color: rgba(230, 0, 0, 0.45);
  background: linear-gradient(145deg, rgba(230, 0, 0, 0.12), rgba(0, 0, 0, 0.35));
}
.bank-tool-btn--ubs .bank-tool-btn-logo {
  background: #fff;
  color: transparent;
  border: 1px solid rgba(230, 0, 0, 0.25);
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
}
.bank-tool-btn--ubs:hover {
  border-color: rgba(230, 0, 0, 0.75);
}

.bank-toolkit-badge--ubs-img {
  background: #fff;
  color: transparent;
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(230, 0, 0, 0.35);
}

.bank-toolkit-modal--ubs .bank-toolkit-modal-header {
  border-bottom: 2px solid rgba(230, 0, 0, 0.55);
}

.sendmail-embed-bank-logo {
  display: inline-block;
  flex-shrink: 0;
  width: 72px;
  height: 28px;
  background: center / contain no-repeat;
}

.sendmail-embed-bank-logo--ubs {
  background-image: url("../img/banks/ubs.png");
}

.sendmail-embed-header--ubs {
  border-left: 3px solid #E60000;
  padding-left: 10px;
}

.sendmail-embed-wrap--ubs {
  border-color: rgba(230, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(230, 0, 0, 0.08);
}

.bank-tool-btn--postfinance {
  border-color: rgba(255, 204, 0, 0.55);
  background: linear-gradient(145deg, rgba(255, 204, 0, 0.18), rgba(0, 0, 0, 0.28));
}
.bank-tool-btn--postfinance .bank-tool-btn-logo {
  background: #ffcc00;
  color: transparent;
  border: 1px solid rgba(26, 26, 26, 0.2);
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
}
.bank-tool-btn--postfinance:hover {
  border-color: rgba(255, 204, 0, 0.85);
}
.bank-toolkit-badge--postfinance-img {
  background: #ffcc00;
  color: transparent;
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(26, 26, 26, 0.25);
}
.bank-toolkit-modal--postfinance .bank-toolkit-modal-header {
  border-bottom: 2px solid rgba(255, 204, 0, 0.75);
}
.sendmail-embed-bank-logo--postfinance {
  background-image: url("../img/banks/postfinance.png");
}
.sendmail-embed-header--postfinance {
  border-left: 3px solid #ffcc00;
  padding-left: 10px;
}
.sendmail-embed-wrap--postfinance {
  border-color: rgba(255, 204, 0, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.1);
}

.bank-tool-btn--raiffeisen {
  border-color: rgba(227, 6, 19, 0.45);
  background: linear-gradient(145deg, rgba(227, 6, 19, 0.12), rgba(0, 0, 0, 0.35));
}
.bank-tool-btn--raiffeisen .bank-tool-btn-logo {
  background: #fff;
  color: transparent;
  border: 1px solid rgba(227, 6, 19, 0.25);
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
}
.bank-tool-btn--raiffeisen:hover {
  border-color: rgba(227, 6, 19, 0.75);
}
.bank-toolkit-badge--raiffeisen-img {
  background: #fff;
  color: transparent;
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(227, 6, 19, 0.35);
}
.bank-toolkit-modal--raiffeisen .bank-toolkit-modal-header {
  border-bottom: 2px solid rgba(227, 6, 19, 0.55);
}
.sendmail-embed-bank-logo--raiffeisen {
  background-image: url("../img/banks/raiffeisen.png");
}
.sendmail-embed-header--raiffeisen {
  border-left: 3px solid #e30613;
  padding-left: 10px;
}
.sendmail-embed-wrap--raiffeisen {
  border-color: rgba(227, 6, 19, 0.35);
  box-shadow: 0 0 0 1px rgba(227, 6, 19, 0.08);
}

.bank-tool-btn--bcv {
  border-color: rgba(0, 166, 81, 0.45);
  background: linear-gradient(145deg, rgba(0, 166, 81, 0.12), rgba(0, 0, 0, 0.35));
}
.bank-tool-btn--bcv .bank-tool-btn-logo {
  background: #fff;
  color: transparent;
  border: 1px solid rgba(0, 166, 81, 0.25);
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
}
.bank-tool-btn--bcv:hover {
  border-color: rgba(0, 166, 81, 0.75);
}
.bank-toolkit-badge--bcv-img {
  background: #fff;
  color: transparent;
  min-width: 76px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 166, 81, 0.35);
}
.bank-toolkit-modal--bcv .bank-toolkit-modal-header {
  border-bottom: 2px solid rgba(0, 166, 81, 0.55);
}
.sendmail-embed-bank-logo--bcv {
  background-image: url("../img/banks/bcv.png");
}
.sendmail-embed-header--bcv {
  border-left: 3px solid #00a651;
  padding-left: 10px;
}
.sendmail-embed-wrap--bcv {
  border-color: rgba(0, 166, 81, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 166, 81, 0.08);
}

.sendmail-region-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sendmail-region-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.sendmail-region-flag {
  font-size: 1.05em;
  line-height: 1;
}

.sendmail-region-btn.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.18);
  color: var(--text-primary);
}

.sendmail-preset-bar {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 18, 26, 0.45);
}

.sendmail-preset-label {
  margin-bottom: 8px;
}

.sendmail-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sendmail-preset-btn {
  font-weight: 700;
}

.sendmail-preset-btn.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.18);
  color: var(--text-primary);
}

.sendmail-preset-btn--static {
  cursor: default;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

.sendmail-preset-autosave-hint {
  margin: 8px 0 0;
  font-size: 12px;
}

.sendmail-subject-group {
  position: relative;
}

.sendmail-subject-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.sendmail-subject-head > label {
  margin-bottom: 0;
}

.sendmail-subject-cycler {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.sendmail-subject-slot-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.22s ease, opacity 0.22s ease;
}

.sendmail-subject-slot-label.is-option {
  color: rgba(203, 213, 225, 0.92);
}

.sendmail-subject-slot-label.is-initial {
  color: rgba(148, 163, 184, 0.85);
  font-weight: 600;
}

.sendmail-subject-cycle-pill {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 18, 26, 0.55);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sendmail-subject-cycle-btn,
.sendmail-subject-cycle-seg {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  line-height: 1;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.18s ease;
}

.sendmail-subject-cycle-btn {
  padding: 6px 10px;
  font-size: 16px;
  font-weight: 600;
}

.sendmail-subject-cycle-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}

.sendmail-subject-cycle-seg {
  min-width: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sendmail-subject-cycle-seg.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.22);
}

.sendmail-subject-cycle-seg:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sendmail-subject-input.sendmail-subject-input--pulse {
  animation: sendmail-subject-pulse 0.55s ease;
}

@keyframes sendmail-subject-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(148, 163, 184, 0);
    border-color: var(--border);
  }
  35% {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.22);
    border-color: rgba(203, 213, 225, 0.55);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(148, 163, 184, 0);
    border-color: var(--border);
  }
}

.bank-tool-btn--lbp:hover {
  box-shadow: 0 8px 28px rgba(0, 168, 255, 0.18);
}

.bank-toolkit-modal {
  max-width: 560px;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bank-toolkit-modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  background: var(--bg-card);
  gap: 12px;
}

.bank-toolkit-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.bank-toolkit-modal-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-left: auto;
  border: 2px solid rgba(254, 202, 202, 0.9);
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.5);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.bank-toolkit-modal-close:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.55);
  transform: scale(1.04);
}

.bank-toolkit-modal-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.bank-toolkit-modal-open {
  overflow: hidden;
}

.bank-toolkit-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
}

.bank-toolkit-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.bank-toolkit-modal--sg .bank-toolkit-badge {
  background: rgba(227, 6, 19, 0.35);
  color: #ff8a93;
}
.bank-toolkit-modal--bnp .bank-toolkit-badge {
  background: rgba(0, 145, 90, 0.35);
  color: #6ee7b7;
}
.bank-toolkit-modal--ce .bank-toolkit-badge {
  background: #ef0712;
  color: #fff;
}
.bank-toolkit-modal--bourso .bank-toolkit-badge {
  background: rgba(255, 77, 166, 0.32);
  color: #ffb8de;
}
.bank-toolkit-modal--ubs .bank-toolkit-badge {
  background: #E60000;
  color: #fff;
}
.bank-toolkit-modal--lbp .bank-toolkit-badge {
  background: rgba(0, 168, 255, 0.3);
  color: #7ddcff;
}

.bank-toolkit-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0;
}

.bank-toolkit-feature {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.bank-toolkit-feature-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bank-toolkit-feature p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.45;
}

.bank-toolkit-feature .bank-toolkit-feature-head strong {
  color: var(--text-primary);
}

.bank-toolkit-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.bank-toolkit-path-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.bank-toolkit-path {
  flex: 1 1 200px;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  word-break: break-all;
}

.bank-toolkit-path--block {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.bank-toolkit-copy {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.bank-toolkit-open,
.bank-toolkit-link {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.bank-toolkit-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}

.bank-toolkit-link:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}

.bank-tools-panel-link {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.bank-tools-panel-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

button.bank-toolkit-link {
  cursor: pointer;
  font-family: inherit;
}

.bank-toolkit-launcher {
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 14px;
}

.bank-toolkit-launcher-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.bank-toolkit-base-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  .bank-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bank-tools-grid {
    grid-template-columns: 1fr;
  }

  .bank-tool-btn {
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .bank-tool-btn-arrow {
    position: static;
    margin-left: auto;
  }
}

.settings-conseiller-note {
  margin-bottom: 10px;
  color: var(--accent, #6eb5ff);
}

.settings-ocr-body .settings-ocr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-ocr-status {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.settings-ocr-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.mailtest-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mailtest-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.35), rgba(15, 23, 42, 0.92));
}

.mailtest-hero-glow {
  position: absolute;
  inset: -45% auto auto -15%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2), transparent 70%);
  pointer-events: none;
}

.mailtest-hero-header {
  position: relative;
  z-index: 1;
}

.mailtest-hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mailtest-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 13px;
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.2);
}

.mailtest-hero-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a7f3d0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(6, 95, 70, 0.35);
}

.mailtest-hero-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.mailtest-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.mailtest-compose-card,
.mailtest-preview-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(30, 34, 48, 0.98), rgba(24, 27, 38, 0.98));
  box-shadow: var(--shadow);
}

.mailtest-compose-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mailtest-compose-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mailtest-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6ee7b7;
  margin-top: 4px;
}

.mailtest-section-label--editor {
  margin-bottom: 2px;
}

.mailtest-section-icon {
  font-size: 14px;
  line-height: 1;
}

.mailtest-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mailtest-label-icon {
  font-size: 13px;
  line-height: 1;
  opacity: 0.9;
}

.mailtest-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.mailtest-panel-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.mailtest-presets-bar {
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  padding-bottom: 16px;
}

.mailtest-section-label--presets {
  margin-top: 0;
}

.mailtest-presets-hint {
  margin: 0;
  font-size: 12px;
}

.mailtest-presets-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
}

.mailtest-presets-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.mailtest-preset-btn {
  white-space: nowrap;
}

.mailtest-preset-status {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(6, 78, 59, 0.2);
}

.mailtest-preset-status.is-success {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.45);
}

.mailtest-preset-status.is-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
}

.mailtest-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 20px;
  flex: 1;
}

.mailtest-form--enlarged .mailtest-fields-grid {
  gap: 16px 18px;
}

.mailtest-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-bottom: 4px;
}

.mailtest-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mailtest-field--wide {
  grid-column: 1 / -1;
}

.mailtest-smtp-detail {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.28), rgba(15, 23, 42, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mailtest-smtp-detail--compact {
  margin-top: 4px;
  padding: 10px 12px;
}

.mailtest-smtp-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mailtest-smtp-detail-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #a7f3d0;
}

.mailtest-smtp-active-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #064e3b;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  box-shadow: 0 2px 10px rgba(52, 211, 153, 0.35);
}

.mailtest-smtp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.mailtest-smtp-detail-pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mailtest-smtp-detail-pair dt {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mailtest-smtp-detail-pair dd {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}

.mailtest-smtp-detail-note {
  margin: 10px 0 0;
  font-size: 11px;
}

.mailtest-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mailtest-field input,
.mailtest-field select {
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background-color: #151a27;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mailtest-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

.mailtest-field select option {
  background-color: #1a1d27;
  color: #e8eaed;
}

.mailtest-form--enlarged .mailtest-field input,
.mailtest-form--enlarged .mailtest-field select,
.mailtest-presets-bar .mailtest-preset-field input,
.mailtest-presets-bar .mailtest-preset-field select {
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.35;
}

.mailtest-form--enlarged .mailtest-field label,
.mailtest-presets-bar .mailtest-preset-field label {
  font-size: 14px;
}

.mailtest-field input:focus,
.mailtest-field select:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
  outline: none;
}

.mailtest-editor-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mailtest-editor-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mailtest-editor-label-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mailtest-import-html-btn {
  font-size: 12px;
}

.mailtest-editor-label-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mailtest-editor-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6ee7b7;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mailtest-html {
  min-height: 360px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background-color: #0f172a;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 13px;
  resize: vertical;
}

.mailtest-form--enlarged .mailtest-html {
  min-height: 400px;
}

.mailtest-html:focus {
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
  outline: none;
}

.mailtest-preview-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 20px 20px;
  min-height: 0;
}

.mailtest-preview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.mailtest-preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mailtest-preview-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.mailtest-preview-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
  animation: mailtest-live-pulse 2s ease-in-out infinite;
}

@keyframes mailtest-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.mailtest-preview-hint {
  font-size: 12px;
  color: #6ee7b7;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.mailtest-preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, rgba(37, 42, 58, 0.95), rgba(30, 34, 48, 0.95));
}

.mailtest-preview-mailhead {
  padding: 10px 14px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mailtest-preview-mail-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.mailtest-preview-mail-line.hidden {
  display: none;
}

.mailtest-preview-mail-k {
  flex: 0 0 42px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.mailtest-preview-mail-v {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  word-break: break-word;
}

.mailtest-preview-mail-subject .mailtest-preview-mail-v {
  font-weight: 600;
}

.mailtest-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mailtest-preview-dot--red { background: #f87171; }
.mailtest-preview-dot--amber { background: #fbbf24; }
.mailtest-preview-dot--green { background: #34d399; }

.mailtest-preview-chrome-label {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.mailtest-preview-wrap {
  position: relative;
  flex: 1 1 auto;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #e8e8e8;
  min-height: 420px;
  height: min(60vh, 560px);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.15);
}

.mailtest-preview-frame {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  min-height: 420px;
  height: 100%;
  border: 0;
  background: #fff;
}

.mailtest-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.08), rgba(15, 23, 42, 0.06));
}

.mailtest-preview-empty.hidden {
  display: none;
}

.mailtest-preview-empty-inner {
  max-width: 280px;
  text-align: center;
  padding: 20px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(52, 211, 153, 0.35);
  background: rgba(15, 23, 42, 0.35);
}

.mailtest-preview-empty-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
  filter: grayscale(0.2);
}

.mailtest-preview-empty-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.mailtest-preview-empty-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mailtest-editor-block--config {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mailtest-send-block {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mailtest-send-option,
.bulksend-send-option,
.setupconfig-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.mailtest-send-option input,
.bulksend-send-option input,
.setupconfig-checkbox-label input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.mailtest-send-option-hint {
  margin: -4px 0 0;
}

.mailtest-send-status {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
}

.mailtest-send-status.hidden {
  display: none;
}

.mailtest-send-status.is-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(6, 78, 59, 0.35);
}

.mailtest-send-status.is-error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
}

.mailtest-send-status.is-warning {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.25);
}

.mailtest-send-status.is-info {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 58, 138, 0.22);
}

.mailtest-send-status--quick {
  flex: 1 1 100%;
  margin-top: 4px;
}

.mailtest-status-head {
  margin: 0 0 4px;
}

.mailtest-status-smtp {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.mailtest-status-extra {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.mailtest-actions {
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 0;
}

.mailtest-send-btn {
  width: 100%;
  min-height: 2.75rem;
  box-shadow: 0 4px 18px rgba(52, 211, 153, 0.28);
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.mailtest-send-btn.is-loading,
.mailtest-quick-send-btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

.mailtest-quick-strip {
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.22), rgba(24, 27, 38, 0.98));
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.mailtest-quick-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  width: 100%;
}

.mailtest-quick-desc {
  flex: 1 1 100%;
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.mailtest-quick-title {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a7f3d0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(6, 95, 70, 0.35);
  align-self: center;
}

.mailtest-quick-fields {
  display: flex;
  flex: 1 1 280px;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  min-width: 0;
}

.mailtest-quick-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 0;
}

.mailtest-quick-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.mailtest-quick-field input,
.mailtest-quick-field select {
  min-height: 2.25rem;
  padding: 0.4rem 0.65rem;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: #151a27;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

.mailtest-quick-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  padding-right: 32px;
}

.mailtest-quick-field select option {
  background-color: #1a1d27;
  color: #e8eaed;
}

.mailtest-quick-field input:focus,
.mailtest-quick-field select:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.15);
}

.mailtest-quick-send-btn {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0.45rem 1.1rem;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.22);
}

.mailtest-quick-smtp-detail {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(15, 23, 42, 0.45);
}

.mailtest-quick-smtp-detail-head {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #a7f3d0;
}

.mailtest-quick-smtp-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.mailtest-quick-smtp-detail-grid--compact {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(52, 211, 153, 0.15);
}

.mailtest-quick-smtp-detail-pair {
  min-width: 0;
}

.mailtest-quick-smtp-detail-pair dt {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.mailtest-quick-smtp-detail-pair dd {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.mailtest-quick-status {
  flex: 1 1 100%;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  font-size: 12px;
  line-height: 1.45;
}

.mailtest-quick-status.is-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(6, 78, 59, 0.28);
}

.mailtest-quick-status.is-error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.22);
}

.mailtest-quick-status.is-warning {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.22);
}

.mailtest-quick-status-head {
  margin: 0 0 4px;
  color: var(--text);
}

.mailtest-quick-status-smtp {
  margin: 0;
  color: var(--text-secondary);
}

.mailtest-quick-status-extra {
  margin: 6px 0 0;
  color: var(--text-muted);
}

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

  .mailtest-preview-wrap,
  .mailtest-preview-frame {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .mailtest-fields-grid {
    grid-template-columns: 1fr;
  }

  .mailtest-presets-grid {
    grid-template-columns: 1fr;
  }

  .mailtest-presets-actions {
    justify-content: stretch;
  }

  .mailtest-presets-actions .mailtest-preset-btn {
    flex: 1 1 auto;
  }

  .mailtest-smtp-detail-grid {
    grid-template-columns: 1fr;
  }

  .mailtest-field--wide {
    grid-column: auto;
  }

  .mailtest-quick-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .mailtest-quick-send-btn {
    width: 100%;
  }
}

.smtp-page-heading-card {
  margin-bottom: 16px;
}

.smtp-page-intro {
  margin-bottom: 0;
}

.smtp-profiles-row {
  align-items: flex-start;
}

.smtp-profile-card .card-header {
  flex-wrap: wrap;
  gap: 8px;
}

.smtp-active-badge {
  font-size: 12px;
  margin-left: auto;
}

.smtp-active-badge.hidden {
  display: none;
}

.smtp-profile-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.smtp-profile-actions-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.smtp-profile-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}

.smtp-profile-remove-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--error);
  color: #fecaca;
}

.smtp-profile-remove-btn:active {
  transform: scale(0.96);
}

.smtp-profile-remove-btn:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.55);
  outline-offset: 2px;
}

.smtp-active-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.smtp-active-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.smtp-active-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  flex: 1 1 240px;
}

.smtp-active-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.smtp-add-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.55);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(79, 70, 229, 0.2));
  color: #e0e7ff;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.smtp-add-profile-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--accent-hover);
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.45), rgba(99, 102, 241, 0.28));
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.32);
  color: #fff;
}

.smtp-add-profile-btn:active:not(:disabled) {
  transform: translateY(0);
}

.smtp-add-profile-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.smtp-profile-card-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.smtp-profile-delete-btn {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.smtp-profile-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--error);
  color: #fecaca;
}

.smtp-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.smtp-active-chip:hover {
  border-color: var(--success);
  color: var(--text-primary);
}

.smtp-active-chip.is-active {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.smtp-active-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  flex-shrink: 0;
}

.smtp-active-chip.is-active .smtp-active-chip-dot {
  border-color: var(--success);
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.smtp-profile-card-header {
  width: 100%;
}

.smtp-profile-card.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.smtp-use-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.smtp-active-test-btn {
  flex-shrink: 0;
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  white-space: nowrap;
}

.smtp-active-test-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.14);
  border-color: #60a5fa;
  color: #dbeafe;
}

.smtp-active-test-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.smtp-active-swap-btn {
  flex-shrink: 0;
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success);
}

.smtp-active-swap-btn:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: var(--success);
}

.smtp-use-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}

.smtp-use-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s;
}

.smtp-use-switch:has(.smtp-use-radio:checked) {
  color: var(--success);
}

.smtp-use-switch:has(.smtp-use-radio:checked) .smtp-use-switch-track {
  background: var(--success);
}

.smtp-use-switch:has(.smtp-use-radio:checked) .smtp-use-switch-knob {
  transform: translateX(16px);
}

/* --- Envoi en masse (v108) --- */
.bulksend-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bulksend-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(145deg, rgba(12, 74, 110, 0.4), rgba(15, 23, 42, 0.92));
}

.bulksend-hero-glow {
  position: absolute;
  inset: -40% auto auto -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(232, 121, 249, 0.18), transparent 70%);
  pointer-events: none;
}

.bulksend-hero-header {
  position: relative;
  z-index: 1;
}

.bulksend-hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulksend-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 14px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.bulksend-hero-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f0abfc;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 121, 249, 0.4);
  background: rgba(88, 28, 135, 0.35);
}

.bulksend-hero-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.bulksend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .bulksend-grid {
    grid-template-columns: 1fr;
  }
}

.bulksend-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.bulksend-card-body {
  padding: 0 1rem 1rem;
}

.bulksend-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bulksend-file-name {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bulksend-list-textarea {
  width: 100%;
  min-height: 180px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(2, 6, 23, 0.45);
  padding: 0.65rem 0.75rem;
  color: var(--text-primary);
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.bulksend-list-textarea:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.bulksend-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bulksend-topo {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.bulksend-topo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.bulksend-stat {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bulksend-stat--ok strong {
  color: #6ee7b7;
}

.bulksend-stat--bad strong {
  color: #fca5a5;
}

.bulksend-preview {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}

.bulksend-preview--invalid {
  margin-top: 8px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.bulksend-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.bulksend-config-summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(232, 121, 249, 0.25);
  background: rgba(88, 28, 135, 0.12);
}

.bulksend-config-summary-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e9d5ff;
}

.bulksend-config-dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.bulksend-config-pair {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  font-size: 0.82rem;
}

.bulksend-config-pair dt {
  margin: 0;
  color: var(--text-muted);
}

.bulksend-config-pair dd {
  margin: 0;
  word-break: break-word;
}

.bulksend-run-card {
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.bulksend-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bulksend-run-controls {
  display: flex;
  gap: 8px;
}

.bulksend-btn-pause {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.bulksend-run-body {
  padding: 0 1rem 1rem;
}

.bulksend-progress-block {
  margin-bottom: 14px;
}

.bulksend-progress-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.bulksend-progress-detail {
  color: var(--text-muted);
}

.bulksend-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bulksend-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #e879f9);
  transition: width 0.25s ease;
}

.bulksend-current-email {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #7dd3fc;
}

.bulksend-campaign-actions {
  margin-bottom: 14px;
}

.bulksend-log-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.bulksend-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.bulksend-log {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
}

.bulksend-log-line--success {
  color: #6ee7b7;
}

.bulksend-log-line--error {
  color: #fca5a5;
}

.bulksend-log-line--warning {
  color: #fde047;
}

.bulksend-log-line--info {
  color: var(--text-muted);
}

.bulksend-pause-modal {
  max-width: 420px;
}

.bulksend-pause-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Setup config (v118 dark fields + HTML preview) --- */
.setupconfig-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setupconfig-presets-card .setupconfig-presets-body {
  padding: 0 20px 20px;
}

.setupconfig-presets-bar.mailtest-presets-bar {
  padding: 0;
  border-bottom: none;
  margin-bottom: 0;
}

.setupconfig-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.35), rgba(15, 23, 42, 0.92));
}

.setupconfig-hero-glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.16), transparent 70%);
  pointer-events: none;
}

.setupconfig-hero-header {
  position: relative;
  z-index: 1;
}

.setupconfig-hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setupconfig-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 14px;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.setupconfig-hero-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5eead4;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: rgba(19, 78, 74, 0.35);
}

.setupconfig-hero-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.setupconfig-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .setupconfig-grid {
    grid-template-columns: 1fr;
  }
}

.setupconfig-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.setupconfig-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.setupconfig-import-label {
  font-size: 0.8125rem;
  color: var(--text-muted, #8b949e);
  margin: 0;
}

.setupconfig-import-select {
  min-width: 10rem;
  max-width: 14rem;
  font-size: 0.8125rem;
  padding: 6px 10px;
  padding-right: 32px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background-color: #151a27;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
}

.setupconfig-form {
  padding: 0 1rem 1rem;
}

.setupconfig-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.setupconfig-field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .setupconfig-fields {
    grid-template-columns: 1fr;
  }
}

.setupconfig-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary, #94a3b8);
}

.setupconfig-field input,
.setupconfig-field select,
.setupconfig-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background-color: #151a27;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.setupconfig-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}

.setupconfig-field input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.setupconfig-field input:focus,
.setupconfig-field select:focus,
.setupconfig-field textarea:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.setupconfig-field select option,
.setupconfig-field select optgroup {
  background-color: #1a1d27;
  color: #e8eaed;
}

.setupconfig-field input[type="checkbox"] {
  width: auto;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  appearance: auto;
  -webkit-appearance: auto;
  box-shadow: none;
  accent-color: #34d399;
}

.setupconfig-save-status {
  margin: 0.75rem 1rem 0;
  font-size: 0.8125rem;
  color: #6ee7b7;
}

.setupconfig-preview-card .card-header {
  align-items: center;
}

.setupconfig-preview-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

.setupconfig-preview {
  margin: 0 1rem 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.25);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.08);
  white-space: pre;
  overflow-x: auto;
}

.setupconfig-preview-note {
  padding: 0 1rem 1rem;
}

/* HTML visual preview (iframe) — must keep explicit height (mobile flex/overflow used to collapse to 0) */
.setupconfig-preview-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.setupconfig-html-preview-section {
  flex: none;
  min-height: auto;
  padding: 0 1rem 0.25rem;
}

.setupconfig-html-preview-wrap {
  position: relative;
  flex: none;
  display: block;
  width: 100%;
  min-height: 420px;
  height: min(60vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #e8e8e8;
}

.setupconfig-html-preview-frame {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  min-height: 420px;
  height: 100%;
  border: 0;
  background: #fff;
}

.setupconfig-html-preview-wrap .mailtest-preview-empty.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .setupconfig-html-preview-wrap,
  .setupconfig-html-preview-frame {
    min-height: 320px;
    height: min(50vh, 420px);
  }

  .mailtest-preview-wrap,
  .mailtest-preview-frame {
    display: block !important;
    visibility: visible !important;
    min-height: 320px;
    height: min(50vh, 420px);
  }
}

.nav-icon--setupconfig svg {
  width: 24px;
  height: 24px;
}

.setupconfig-load-bar {
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.25rem;
}

.setupconfig-load-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary, #94a3b8);
}

.setupconfig-load-select {
  width: 100%;
  max-width: 28rem;
  font-size: 0.875rem;
  padding: 10px 14px;
  padding-right: 36px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background-color: #151a27;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0b4' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.setupconfig-load-select:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.setupconfig-load-select option {
  background-color: #1a1d27;
  color: #e8eaed;
}

.setupconfig-html-block {
  margin: 0.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.setupconfig-save-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 212, 191, 0.2);
}

.setupconfig-save-unified-btn {
  min-width: 9rem;
}

.setupconfig-save-named-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.25rem;
}

.setupconfig-save-named-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
}

.setupconfig-save-named-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 22rem;
  font-size: 0.875rem;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background-color: #151a27;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.setupconfig-save-named-input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.setupconfig-save-named-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.setupconfig-save-named-btn {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.setupconfig-saved-card {
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88));
}

.setupconfig-saved-header {
  align-items: flex-start;
  gap: 12px;
}

.setupconfig-saved-sub {
  margin: 0.35rem 0 0;
  max-width: 52rem;
}

.setupconfig-saved-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5eead4;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(19, 78, 74, 0.35);
  white-space: nowrap;
}

.setupconfig-saved-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 1rem 1rem;
}

.setupconfig-saved-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.65);
}

.setupconfig-saved-row.is-active {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.setupconfig-saved-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.8);
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.setupconfig-saved-star:hover {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
}

.setupconfig-saved-star.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.35);
}

.setupconfig-saved-body {
  min-width: 0;
}

.setupconfig-saved-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.setupconfig-saved-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f1f5f9;
}

.setupconfig-saved-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fde68a;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.4);
}

.setupconfig-saved-preview {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #94a3b8;
  word-break: break-word;
}

.setupconfig-saved-meta {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.setupconfig-saved-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.setupconfig-saved-empty {
  margin: 0 1rem 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

@media (max-width: 720px) {
  .setupconfig-saved-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .setupconfig-saved-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* ===== AWS SES régions (v118) ===== */
.aws-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aws-page--polished {
  gap: 1.125rem;
}

.aws-page--polished > .card {
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aws-page--polished > .card:focus-within {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.12);
}

.aws-page--polished > .card {
  animation: awsCardFadeIn 0.4s ease backwards;
}

.aws-page--polished > .card:nth-child(2) { animation-delay: 0.04s; }
.aws-page--polished > .card:nth-child(3) { animation-delay: 0.08s; }
.aws-page--polished > .card:nth-child(4) { animation-delay: 0.1s; }

@keyframes awsCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.aws-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(145deg, rgba(124, 45, 18, 0.35), rgba(15, 23, 42, 0.92));
}

.aws-hero-glow {
  position: absolute;
  inset: -45% auto auto -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22), transparent 70%);
  pointer-events: none;
}

.aws-hero-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.aws-hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aws-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 13px;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.2);
}

.aws-hero-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fed7aa;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.4);
  background: rgba(124, 45, 18, 0.4);
}

.aws-hero-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.aws-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.aws-panel-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.aws-form {
  padding: 0 4px 4px;
}

.aws-secret-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.aws-secret-row .aws-input {
  flex: 1;
  min-width: 0;
}

.aws-toggle-secret {
  flex-shrink: 0;
  white-space: nowrap;
}

.aws-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.aws-form-note {
  margin: 0;
}

.aws-progress-card {
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.25), rgba(24, 27, 38, 0.98));
}

.aws-progress-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px;
}

.aws-progress-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.2);
  border-top-color: #fbbf24;
  animation: aws-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes aws-spin {
  to { transform: rotate(360deg); }
}

.aws-summary-card {
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.28), rgba(15, 23, 42, 0.95));
}

.aws-summary-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.aws-summary-score {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #6ee7b7;
  min-width: 7rem;
  line-height: 1.1;
}

.aws-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.aws-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-secondary);
}

.aws-chip--ok { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.4); }
.aws-chip--sandbox { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); }
.aws-chip--denied { color: #fda4af; border-color: rgba(251, 113, 133, 0.4); }
.aws-chip--error { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
.aws-chip--down { color: #94a3b8; border-color: rgba(148, 163, 184, 0.35); }

.aws-table-wrap {
  overflow-x: auto;
}

.aws-regions-table td,
.aws-regions-table th {
  vertical-align: middle;
}

.aws-region-code {
  font-size: 12px;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}

.aws-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.aws-status-pill--ok {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

.aws-status-pill--sandbox {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.aws-status-pill--denied {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
}

.aws-status-pill--error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.aws-status-pill--down {
  color: #94a3b8;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
}

.aws-detail-cell {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 420px;
}

.aws-import-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.aws-import-intro {
  margin: 0 0 12px;
}

.aws-import-toolbar {
  margin-bottom: 10px;
}

.aws-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.btn-aws-primary {
  padding: 8px 16px;
  background: linear-gradient(180deg, #34d399, #059669);
  border: 1px solid rgba(52, 211, 153, 0.65);
  border-radius: 8px;
  color: #042f2e;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-aws-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-aws-primary:focus-visible {
  outline: 2px solid #6ee7b7;
  outline-offset: 2px;
}

.btn-aws-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(100, 116, 139, 0.45);
  color: #94a3b8;
}

.btn-aws-primary.is-ready:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35), 0 8px 24px rgba(16, 185, 129, 0.25);
}

.btn-aws-recheck,
.btn-aws-create-panel,
.btn-aws-load,
.btn-aws-copy,
.btn-aws-remove,
a.btn-aws-console-link {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-aws-recheck {
  border: 1px solid rgba(251, 146, 60, 0.55);
  background: rgba(124, 45, 18, 0.35);
  color: #fdba74;
}

.btn-aws-recheck:hover:not(:disabled) {
  background: rgba(234, 88, 12, 0.45);
  border-color: #fb923c;
  color: #fff7ed;
}

.btn-aws-recheck:focus-visible {
  outline: 2px solid #fb923c;
  outline-offset: 2px;
}

.aws-smtp-delete-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.aws-smtp-delete-btn:hover {
  background: rgba(185, 28, 28, 0.55);
  color: #fff;
}

.aws-smtp-delete-btn:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.aws-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.aws-live-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
  animation: aws-live-pulse 1.8s ease-in-out infinite;
}

@keyframes aws-live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.88);
  }
}

.aws-live-badge--live {
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.45);
  border-color: rgba(52, 211, 153, 0.45);
}

.aws-live-badge--dead {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.4);
  border-color: rgba(248, 113, 113, 0.45);
}

.aws-live-badge--partial {
  color: #fdba74;
  background: rgba(124, 45, 18, 0.4);
  border-color: rgba(251, 146, 60, 0.45);
}

.aws-live-badge--checking {
  color: #fcd34d;
  background: rgba(113, 63, 18, 0.45);
  border-color: rgba(251, 191, 36, 0.4);
  animation: aws-live-pulse 1.1s ease-in-out infinite;
}

.aws-live-badge--redem {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.55);
  border-color: rgba(251, 191, 36, 0.65);
  animation: aws-live-pulse 0.85s ease-in-out infinite;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@keyframes aws-live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.aws-smtp-credential-card.is-rechecking {
  outline: 1px solid rgba(251, 191, 36, 0.35);
  outline-offset: 0;
}

.aws-live-summary,
.aws-live-inline {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.aws-saved-key-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.aws-saved-key-text {
  min-width: 0;
}

.aws-import-count {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fdba74;
}

.aws-import-table-wrap {
  margin-top: 4px;
}

.aws-col-check {
  width: 2.25rem;
  text-align: center;
}

.aws-import-detail-btn,
.aws-import-smtp-btn {
  margin-left: 6px;
  vertical-align: middle;
}

.aws-import-smtp-btn {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.aws-results-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-aws-create-panel {
  border-color: rgba(251, 146, 60, 0.55);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.35), rgba(251, 191, 36, 0.22));
  color: #fed7aa;
}

.btn-aws-create-panel:hover {
  border-color: rgba(251, 146, 60, 0.85);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.55), rgba(251, 191, 36, 0.35));
  color: #ffedd5;
}

a.btn-aws-console-link,
button.btn-aws-console-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
  cursor: pointer;
  font: inherit;
}

a.btn-aws-console-link:hover,
button.btn-aws-console-link:hover {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(14, 165, 233, 0.22);
  color: #e0f2fe;
  text-decoration: none;
}

a.btn-aws-console-link:focus-visible,
button.btn-aws-console-link:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 2px;
}

a.btn-aws-console-link--iam,
button.btn-aws-console-link--iam {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
}

a.btn-aws-console-link--iam:hover,
button.btn-aws-console-link--iam:hover {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(139, 92, 246, 0.26);
  color: #ede9fe;
}

a.btn-aws-console-link--iam:focus-visible,
button.btn-aws-console-link--iam:focus-visible {
  outline-color: rgba(167, 139, 250, 0.7);
}

.aws-panel-users-table code.aws-panel-users-slug {
  font-size: 12px;
  color: #94a3b8;
}

.aws-panel-key-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: rgba(249, 115, 22, 0.15);
}

.aws-panel-path-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.aws-create-panel-modal .form-field {
  margin-bottom: 14px;
}

.aws-create-panel-modal .form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-primary-soft {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(6, 78, 59, 0.35);
  color: #a7f3d0;
}

.btn-primary-soft:hover {
  background: rgba(6, 95, 70, 0.5);
  border-color: rgba(52, 211, 153, 0.65);
}

.btn-ghost-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: transparent;
  color: #fca5a5;
}

.btn-ghost-danger:hover {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.55);
}

.aws-mes-aws-card {
  border: 1px solid rgba(129, 140, 248, 0.35);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(52, 211, 153, 0.12), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(129, 140, 248, 0.18), transparent 50%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.45);
  overflow: hidden;
}

.aws-mes-aws-header {
  align-items: flex-start;
  gap: 12px;
}

.aws-mes-aws-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.aws-mes-aws-icon {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(129, 140, 248, 0.45));
}

.aws-mes-aws-tagline {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.aws-mes-aws-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aws-mes-aws-dl-all {
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.aws-mes-aws-add-key {
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12), 0 8px 20px rgba(6, 78, 59, 0.25);
}

.aws-saved-key-label {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 999px;
  vertical-align: middle;
}

.aws-add-key-modal .field-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
}

.aws-mes-aws-section {
  padding: 4px 0 0;
}

.aws-mes-aws-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.aws-mes-aws-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e2e8f0;
}

.aws-mes-aws-divider {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
}

.aws-mes-aws-section-smtp .aws-mes-aws-section-title {
  color: #ddd6fe;
}

.aws-saved-keys-card {
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.22), rgba(15, 23, 42, 0.96));
}

.aws-saved-keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aws-saved-keys-intro {
  margin: 0 0 12px;
}

.aws-saved-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aws-saved-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(2, 6, 23, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aws-saved-key-row:hover {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.15);
}

.aws-saved-key-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.aws-saved-key-avatar {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.9;
}

.aws-saved-key-code {
  font-size: 13px;
}

.aws-saved-key-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.aws-saved-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Native <button> defaults to font-weight 400 — match AWS row action links */
.aws-saved-key-actions :is(button, a).btn-sm {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aws-saved-smtps-card {
  border: 1px solid rgba(129, 140, 248, 0.32);
  background: linear-gradient(160deg, rgba(49, 46, 129, 0.22), rgba(15, 23, 42, 0.96));
}

.aws-saved-smtps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aws-smtp-empty-state {
  text-align: center;
  padding: 28px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.35);
}

.aws-smtp-empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.85;
}

.aws-smtp-empty-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: #e2e8f0;
}

.aws-smtp-empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  margin-inline: auto;
  line-height: 1.45;
}

.aws-saved-smtp-entry {
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.55);
  padding: 0;
  overflow: hidden;
}

.aws-saved-smtp-summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(49, 46, 129, 0.25), rgba(15, 23, 42, 0.2));
}

.aws-saved-smtp-summary::-webkit-details-marker {
  display: none;
}

.aws-saved-smtp-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #a5b4fc;
  border-bottom: 2px solid #a5b4fc;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.aws-saved-smtp-entry[open] .aws-saved-smtp-chevron {
  transform: rotate(45deg);
  margin-top: 2px;
}

.aws-saved-smtp-avatar {
  font-size: 1.15rem;
  line-height: 1;
}

.aws-saved-smtp-summary-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.aws-saved-smtp-akia {
  font-size: 13px;
}

.aws-saved-smtp-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.aws-saved-smtp-body {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.aws-smtp-credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.aws-smtp-credential-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(165deg, rgba(30, 27, 75, 0.5), rgba(15, 23, 42, 0.92));
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 18px rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

.aws-smtp-credential-card.is-rechecking {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.aws-smtp-credential-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px 10px;
  background: linear-gradient(90deg, rgba(49, 46, 129, 0.35), rgba(15, 23, 42, 0.15));
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.aws-smtp-credential-top .aws-smtp-delete-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.aws-smtp-region-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(99, 102, 241, 0.38));
  border: 1px solid rgba(125, 211, 252, 0.4);
  color: #f0f9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.2;
}

.aws-smtp-credential-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(2, 6, 23, 0.25);
}

.aws-smtp-credential-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.aws-smtp-credential-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(49, 46, 129, 0.35), rgba(15, 23, 42, 0.15));
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.aws-smtp-credential-head .aws-smtp-credential-chips {
  flex: 1 1 100%;
}

.aws-smtp-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 100%;
  min-width: 0;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.aws-smtp-send-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e2e8f0;
  white-space: nowrap;
}

.aws-smtp-send-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aws-smtp-send-hint {
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.aws-send-toggle {
  position: relative;
  flex-shrink: 0;
  width: 58px;
  height: 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #64748b;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.aws-send-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.aws-send-toggle-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  line-height: 1;
}

.aws-send-toggle.is-on {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}

.aws-send-toggle.is-on::after {
  transform: translateX(30px);
}

.aws-send-toggle.is-on .aws-send-toggle-label {
  left: 8px;
}

.aws-send-toggle.is-off {
  background: linear-gradient(180deg, #94a3b8, #64748b);
}

.aws-send-toggle.is-off .aws-send-toggle-label {
  right: 7px;
}

.aws-send-toggle.is-unknown {
  background: linear-gradient(180deg, #64748b, #475569);
}

.aws-send-toggle.is-unknown .aws-send-toggle-label {
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

.aws-send-toggle.is-busy {
  opacity: 0.72;
  cursor: wait;
}

.aws-send-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.aws-send-toggle:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.65);
  outline-offset: 2px;
}

.aws-smtp-credential-live {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.aws-smtp-live-summary {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.aws-smtp-credential-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.aws-smtp-credential-actions .btn-aws-recheck {
  flex: 1 1 auto;
  min-height: 36px;
}

.aws-smtp-card-copy {
  flex: 1 1 auto;
  min-height: 36px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(49, 46, 129, 0.35);
  color: #e0e7ff;
  font-weight: 600;
}

.aws-smtp-card-copy:hover {
  background: rgba(79, 70, 229, 0.45);
  border-color: rgba(165, 180, 252, 0.55);
  color: #fff;
}

.aws-smtp-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.aws-smtp-chip-ok {
  background: rgba(6, 78, 59, 0.5);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.aws-smtp-chip-ok-light {
  background: rgba(20, 83, 45, 0.35);
  border-color: rgba(74, 222, 128, 0.35);
  color: #bbf7d0;
}

.aws-smtp-chip-quota {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #bae6fd;
  background: rgba(12, 74, 110, 0.35);
  border-color: rgba(56, 189, 248, 0.35);
}

.aws-smtp-chip-muted {
  color: #94a3b8;
}

.aws-smtp-credential-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.aws-smtp-field-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.aws-smtp-field-row-pass {
  grid-template-columns: 72px 1fr auto auto;
}

.aws-smtp-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.aws-smtp-field-value {
  font-size: 11px;
  word-break: break-all;
  color: #f1f5f9;
}

.aws-smtp-pass-value[data-revealed="1"] {
  color: #fde68a;
}

.aws-smtp-icon-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aws-smtp-icon-btn:hover {
  border-color: rgba(167, 139, 250, 0.5);
  color: #e9d5ff;
  background: rgba(49, 46, 129, 0.45);
}

.aws-saved-smtp-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.aws-saved-smtp-detail {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
}

.aws-saved-smtp-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.aws-saved-smtp-dl {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
}

.aws-saved-smtp-dl dt {
  color: var(--text-muted);
  font-weight: 500;
}

.aws-saved-smtp-dl dd {
  margin: 0 0 4px;
}

@media (max-width: 520px) {
  .aws-smtp-field-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label label"
      "value copy"
      "reveal reveal";
  }

  .aws-smtp-field-row-pass {
    grid-template-columns: 1fr auto auto;
  }

  .aws-smtp-field-label {
    grid-column: 1 / -1;
  }
}

.aws-topo-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: linear-gradient(160deg, rgba(12, 74, 110, 0.28), rgba(15, 23, 42, 0.96));
}

.aws-topo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.aws-topo-intro {
  margin: 0 0 12px;
}

.aws-topo-pre {
  margin: 0;
  max-height: min(55vh, 520px);
  overflow: auto;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.72);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

/* Récap SMTP SES live (modal) */
.aws-smtp-recap-modal {
  width: min(920px, 96vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.12), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #020617 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.aws-smtp-recap-modal .modal-body {
  overflow: auto;
  max-height: min(68vh, 640px);
  padding-top: 8px;
}

.aws-iam-users-overlay {
  padding: 12px 14px;
  align-items: stretch;
}

.aws-iam-users-modal {
  width: min(1480px, 98vw);
  max-width: 98vw;
  min-height: min(88vh, 920px);
  max-height: min(96vh, 980px);
  display: flex;
  flex-direction: column;
  margin: auto;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background:
    radial-gradient(ellipse 75% 45% at 8% 0%, rgba(139, 92, 246, 0.28), transparent 55%),
    radial-gradient(ellipse 55% 35% at 92% 8%, rgba(99, 102, 241, 0.15), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #020617 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.aws-iam-users-modal-header {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
}

.aws-iam-users-modal-title-wrap h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
}

.aws-iam-users-modal-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #c4b5fd;
}

.aws-iam-users-modal-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 18px 22px 22px;
}

.aws-iam-users-modal-footer {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.aws-iam-users-recap-chips {
  margin-bottom: 14px;
}

.aws-iam-users-hint {
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.aws-iam-users-modal .aws-recap-chip--iam {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(91, 33, 182, 0.22);
  color: #ddd6fe;
}

.aws-iam-users-table-wrap {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: min(62vh, 640px);
  background: rgba(2, 6, 23, 0.35);
}

.aws-iam-users-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
  border-collapse: collapse;
}

.aws-iam-users-table th,
.aws-iam-users-table td {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: middle;
  color: #e2e8f0;
}

.aws-iam-users-table th {
  background: rgba(91, 33, 182, 0.28);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.aws-iam-users-table tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.aws-iam-users-table tr:hover td {
  background: rgba(139, 92, 246, 0.06);
}

.aws-iam-users-table .iam-col-user {
  width: 16%;
  min-width: 128px;
}

.aws-iam-users-table .iam-user-name {
  font-weight: 500;
  color: #f1f5f9;
}

.aws-iam-users-table .iam-col-arn {
  width: 34%;
  min-width: 280px;
}

.aws-iam-users-table .iam-arn-code {
  display: inline;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.aws-iam-users-table .iam-col-date {
  width: 12%;
  min-width: 108px;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}

.aws-iam-users-table .iam-col-last {
  width: 14%;
  min-width: 120px;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}

.aws-iam-users-table .iam-col-status {
  width: 14%;
  min-width: 96px;
  white-space: nowrap;
  font-size: 13px;
  color: #a5b4fc;
}

.aws-iam-users-table .iam-col-actions {
  width: 10%;
  min-width: 132px;
  text-align: right;
  white-space: nowrap;
}

.aws-iam-caller-info-btn,
.aws-iam-user-info-btn {
  font-size: 12px;
  padding: 6px 12px;
}

.aws-iam-user-detail-hint {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 12px;
}

.aws-iam-caller-info-subsection--keys,
.aws-iam-caller-info-subsection--mfa {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
}

.aws-iam-user-access-keys-list,
.aws-iam-user-mfa-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.55;
}

.aws-iam-user-access-keys-list code,
.aws-iam-user-mfa-list code {
  font-size: 12px;
}

.aws-iam-caller-info-panel {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(91, 33, 182, 0.18);
}

.aws-iam-caller-info-panel.hidden {
  display: none;
}

.aws-iam-caller-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #ede9fe;
}

.aws-iam-caller-info-fields {
  margin-top: 10px;
}

.aws-iam-caller-info-section {
  margin-top: 14px;
}

.aws-iam-caller-info-section--aws .aws-iam-caller-info-section-title {
  color: #c4b5fd;
}

.aws-iam-caller-info-section--panel {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.1);
}

.aws-iam-caller-info-section--panel .aws-iam-caller-info-section-title {
  color: #86efac;
}

.aws-iam-caller-info-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.aws-iam-caller-info-section--panel .panel-my-creds-fields {
  margin-top: 8px;
}

.aws-iam-panel-creds-loading {
  margin-bottom: 0;
  color: #a7f3d0;
  font-size: 13px;
}

.aws-iam-caller-info-subsection--panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.42);
  background: rgba(6, 78, 59, 0.28);
}

.aws-iam-caller-info-subtitle {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6ee7b7;
}

.aws-iam-panel-creds-hint {
  margin-bottom: 6px;
  color: #a7f3d0;
}

.aws-iam-caller-info-loading {
  margin-top: 8px;
  color: #c4b5fd;
}

.aws-iam-users-table tr.is-caller td {
  background: rgba(139, 92, 246, 0.12);
}

.aws-iam-users-table .iam-caller-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.55;
  vertical-align: middle;
  color: #ede9fe;
  border: 1px solid rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.35);
}

.panel-my-creds-fields {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-my-creds-warn {
  color: #fca5a5;
}

.aws-iam-users-error {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.5;
}

.btn-aws-console-link--ec2 {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.aws-ec2-instances-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.aws-ec2-footer-spacer {
  flex: 1 1 auto;
}

.aws-ec2-footer-connect-btn:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}

.aws-ec2-footer-key-btn:not(:disabled) {
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.aws-ec2-rdp-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: #a7f3d0;
  opacity: 0.92;
}

.aws-ec2-instances-table .iam-col-actions {
  width: 44px;
  text-align: center;
}

.aws-ec2-instances-modal-header {
  flex-wrap: wrap;
}

.aws-ec2-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.aws-ec2-create-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.aws-ec2-create-profile-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(15, 23, 42, 0.75);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aws-ec2-create-profile-card:has(input:checked) {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.12);
}

.aws-ec2-create-profile-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aws-ec2-create-profile-title {
  font-weight: 600;
  font-size: 15px;
  color: #f8fafc;
}

.aws-ec2-create-profile-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #c4b5fd;
}

.aws-ec2-create-iam-hint {
  margin-top: 8px;
  font-size: 12px;
}

.aws-ec2-create-wizard-step.hidden {
  display: none;
}

.aws-ec2-create-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.aws-ec2-create-size-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  background: rgba(15, 23, 42, 0.78);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aws-ec2-create-size-card:has(input:checked) {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.12);
}

.aws-ec2-create-size-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aws-ec2-create-size-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.aws-ec2-create-size-type {
  font-weight: 600;
  font-size: 14px;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aws-ec2-create-size-tier {
  font-size: 11px;
  font-weight: 600;
  text-transform: lowercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.aws-ec2-create-size-tier--petit {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.45);
}

.aws-ec2-create-size-tier--moyen {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.45);
}

.aws-ec2-create-size-tier--gros {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.45);
}

.aws-ec2-create-size-hint {
  font-size: 12px;
  line-height: 1.4;
  color: #c4b5fd;
}

.aws-ec2-create-size-price {
  font-size: 11px;
  color: #94a3b8;
}

.aws-ec2-create-size-reco {
  font-size: 12px;
  margin-top: 4px;
}

.aws-ec2-info-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aws-ec2-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.55);
}

.aws-ec2-info-row label {
  flex: 1 1 120px;
  font-size: 13px;
  color: #a5b4fc;
  margin: 0;
}

.aws-ec2-info-row code,
.aws-ec2-info-row .aws-ec2-info-value {
  flex: 1 1 180px;
  font-size: 13px;
  word-break: break-all;
}

.aws-ec2-info-row .btn-sm {
  flex-shrink: 0;
}

.aws-ec2-info-pem-label {
  font-size: 14px;
  font-weight: 600;
  color: #c7d2fe;
  margin: 0;
}

.aws-ec2-info-pem-field {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  margin-top: 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  border: 2px solid rgba(129, 140, 248, 0.55);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.aws-ec2-info-pem-field:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.aws-ec2-info-pem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.aws-ec2-info-pem-hint {
  margin: 8px 0 0;
  font-size: 12px;
}

.aws-ec2-info-pass-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  grid-column: 1 / -1;
}

.aws-ec2-info-pass-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.aws-ec2-info-pass-display {
  flex: 1 1 100%;
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.45;
  color: #94a3b8;
  word-break: break-all;
}

.aws-ec2-info-pass-display--ready {
  font-size: 20px;
  font-weight: 700;
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
  letter-spacing: 0.02em;
}

.aws-ec2-info-pass-display--pending {
  color: #fcd34d;
  font-style: italic;
}

.aws-ec2-info-row--pass .aws-ec2-info-pass-field,
.aws-ec2-info-pass-block .aws-ec2-info-pass-field {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 16px;
  padding: 14px 16px;
  color: #94a3b8;
  -webkit-text-security: none;
  text-security: none;
}

.aws-ec2-info-pass-block > label {
  font-size: 14px;
  font-weight: 600;
  color: #a5b4fc;
  margin: 0;
}

.aws-ec2-info-pass-field--ready {
  font-size: 22px;
  font-weight: 700;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.45);
  letter-spacing: 0.02em;
}

.aws-ec2-info-pass-field--pending {
  color: #fcd34d !important;
  font-style: italic;
}

.aws-ec2-info-pass-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.aws-ec2-info-pass-status--error {
  color: #fca5a5;
}

.aws-ec2-info-pass-status--info {
  color: #93c5fd;
}

.aws-ec2-info-pass-status--success {
  color: #86efac;
}

.aws-ec2-info-pem-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(30, 27, 75, 0.35);
}

.aws-ec2-info-rows--rdp .aws-ec2-info-pass-block {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.55);
}

.aws-ec2-create-progress-modal--success .modal-header {
  border-bottom-color: rgba(34, 197, 94, 0.35);
}

.aws-ec2-create-progress-modal--success #awsEc2CreateProgressTitle {
  color: #86efac;
}

.aws-ec2-create-progress-modal--error #awsEc2CreateProgressTitle {
  color: #fca5a5;
}

.aws-ec2-create-progress-head {
  margin-bottom: 14px;
}

.aws-ec2-create-progress-pct-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.aws-ec2-create-progress-pct {
  font-size: 28px;
  font-weight: 700;
  color: #86efac;
  font-variant-numeric: tabular-nums;
}

.aws-ec2-create-progress-modal--error .aws-ec2-create-progress-pct {
  color: #fca5a5;
}

.aws-ec2-create-progress-status {
  flex: 1 1 auto;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.35;
}

.aws-ec2-create-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.aws-ec2-create-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.45s ease;
}

.aws-ec2-create-progress-modal--error .aws-ec2-create-progress-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.aws-ec2-create-progress-stages {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aws-ec2-create-progress-stage {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}

.aws-ec2-create-progress-stage::before {
  content: '○';
  flex-shrink: 0;
  width: 1.1em;
  text-align: center;
  color: #475569;
}

.aws-ec2-create-progress-stage--active {
  color: #e2e8f0;
  font-weight: 600;
}

.aws-ec2-create-progress-stage--active::before {
  content: '◉';
  color: #4ade80;
}

.aws-ec2-create-progress-stage--done {
  color: #86efac;
}

.aws-ec2-create-progress-stage--done::before {
  content: '✓';
  color: #22c55e;
}

.aws-ec2-create-progress-stage--fail {
  color: #fca5a5;
}

.aws-ec2-create-progress-stage--fail::before {
  content: '✕';
  color: #ef4444;
}

.aws-ec2-create-progress-timers strong {
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.aws-ec2-create-progress-feed {
  margin-top: 12px;
  max-height: 160px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.aws-ec2-create-progress-feed-line {
  margin: 0 0 4px;
  word-break: break-word;
}

.aws-ec2-create-progress-feed-line--ok {
  color: #86efac;
}

.aws-ec2-create-progress-feed-line--info {
  color: #94a3b8;
}

.aws-ec2-create-progress-feed-line--warn {
  color: #fcd34d;
}

.aws-ec2-create-progress-feed-line--err {
  color: #fca5a5;
}

.aws-ec2-create-refusal-slot {
  margin: 12px 0 10px;
}

.aws-ec2-create-refusal {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: linear-gradient(145deg, rgba(69, 10, 10, 0.72), rgba(30, 15, 20, 0.88));
  box-shadow: 0 6px 20px rgba(127, 29, 29, 0.25);
}

.aws-ec2-create-refusal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
  color: #fecaca;
  font-size: 14px;
}

.aws-ec2-create-refusal-copy {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.aws-ec2-create-refusal-row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 6px 10px;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.45;
}

.aws-ec2-create-refusal-k {
  color: #fca5a5;
  font-weight: 600;
}

.aws-ec2-create-refusal-v {
  color: #fee2e2;
  word-break: break-word;
}

.aws-ec2-create-refusal-v--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.aws-ec2-create-refusal-raw {
  margin-top: 10px;
  color: #fecaca;
  font-size: 12px;
}

.aws-ec2-create-refusal-raw summary {
  cursor: pointer;
  margin-bottom: 6px;
}

.aws-ec2-create-refusal-pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fee2e2;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.aws-ec2-create-refusal-parse {
  margin: 8px 0 0;
  font-size: 12px;
  color: #fca5a5;
}

.aws-ec2-plesk-links--magic {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(129, 140, 248, 0.35);
}

.aws-ec2-plesk-links--bb {
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.38);
  background: linear-gradient(145deg, rgba(30, 27, 75, 0.55), rgba(15, 23, 42, 0.72));
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
}

.aws-ec2-plesk-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 4px 0 12px;
}

.aws-ec2-plesk-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
}

.aws-ec2-profile-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  border-radius: 999px;
  border: 1px solid transparent;
}

.aws-ec2-profile-badge--windows {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(96, 165, 250, 0.45);
}

.aws-ec2-profile-badge--plesk {
  color: #ddd6fe;
  background: rgba(109, 40, 217, 0.32);
  border-color: rgba(167, 139, 250, 0.45);
}

.aws-ec2-profile-badge--vps {
  color: #a7f3d0;
  background: rgba(5, 150, 105, 0.28);
  border-color: rgba(52, 211, 153, 0.4);
}

.aws-ec2-plesk-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aws-ec2-plesk-links--compact {
  margin-top: 14px;
}

.aws-ec2-plesk-links--waiting {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.45);
}

.aws-ec2-plesk-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(30, 27, 75, 0.35);
}

.aws-ec2-plesk-link-label {
  flex: 1 1 200px;
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
}

.aws-ec2-plesk-link-url {
  flex: 1 1 220px;
  font-size: 12px;
  word-break: break-all;
  color: #38bdf8;
  text-decoration: none;
}

.aws-ec2-plesk-link-url:hover {
  text-decoration: underline;
}

.aws-ec2-plesk-links-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.aws-ec2-plesk-links-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.aws-ec2-plesk-autres-title {
  margin: 8px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.aws-ec2-plesk-links-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: disc;
}

.aws-ec2-plesk-links-li {
  margin: 0.35rem 0;
}

.aws-ec2-plesk-link-row--bullet {
  margin-left: -0.25rem;
}

.aws-ec2-plesk-links-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.aws-ec2-plesk-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: aws-ec2-plesk-pulse 1.4s ease-in-out infinite;
}

@keyframes aws-ec2-plesk-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.aws-ec2-region-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 148px;
}

.aws-ec2-region-cell .aws-ec2-region-code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aws-ec2-metrics-btn {
  padding: 2px 8px;
  line-height: 1.2;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(30, 58, 138, 0.35);
}

.aws-ec2-conn-log {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.aws-ec2-conn-log-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

.aws-ec2-conn-log-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
}

.aws-ec2-conn-log-list time {
  color: #94a3b8;
  font-size: 12px;
}

.aws-ec2-metrics-state {
  margin-bottom: 16px;
}

.aws-ec2-metrics-dl {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 6px 12px;
  margin: 8px 0 0;
  font-size: 13px;
}

.aws-ec2-metrics-dl dt {
  color: #a5b4fc;
  margin: 0;
}

.aws-ec2-metrics-dl dd {
  margin: 0;
  color: #f1f5f9;
  word-break: break-word;
}

.aws-ec2-metrics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin: 8px 0 10px;
  font-size: 13px;
}

.aws-ec2-metrics-legend-in {
  color: #6ee7b7;
}

.aws-ec2-metrics-legend-out {
  color: #93c5fd;
}

.aws-ec2-metrics-canvas {
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: block;
}

.aws-ec2-metrics-error {
  color: #fca5a5;
  margin-top: 10px;
}

.aws-iam-users-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c4b5fd;
  font-size: 14px;
}

.aws-recap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  animation: awsRecapPulseIn 0.45s ease-out;
}

.aws-recap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  font-size: 12px;
  color: #cbd5e1;
}

.aws-recap-chip strong {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.aws-recap-chip--quota {
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.15);
}

.aws-recap-chip--smtp {
  border-color: rgba(129, 140, 248, 0.6);
  color: #a5b4fc;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.2);
}

.aws-recap-chip--sf {
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

.aws-recap-chip--key {
  font-family: ui-monospace, Consolas, monospace;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

.aws-recap-section {
  margin: 0 0 18px;
}

.aws-recap-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.aws-recap-empty {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.aws-recap-table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.aws-recap-table td,
.aws-recap-table th {
  white-space: nowrap;
}

.aws-recap-quota {
  color: #34d399;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aws-recap-row--ok {
  background: rgba(16, 185, 129, 0.08);
}

.aws-recap-smtp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.aws-recap-smtp-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: linear-gradient(160deg, rgba(49, 46, 129, 0.35), rgba(15, 23, 42, 0.95));
  animation: awsRecapCardIn 0.4s ease-out both;
}

.aws-recap-smtp-card:nth-child(2) { animation-delay: 0.05s; }
.aws-recap-smtp-card:nth-child(3) { animation-delay: 0.1s; }
.aws-recap-smtp-card:nth-child(4) { animation-delay: 0.15s; }

.aws-recap-smtp-card--best {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.12);
}

.aws-recap-smtp-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.aws-recap-smtp-label {
  font-size: 12px;
  font-weight: 600;
  color: #a5b4fc;
}

.aws-recap-smtp-card--best .aws-recap-smtp-label {
  color: #6ee7b7;
}

.aws-recap-smtp-card dl {
  margin: 0;
  display: grid;
  gap: 6px;
}

.aws-recap-smtp-card dl > div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 6px;
  align-items: baseline;
}

.aws-recap-smtp-card dt {
  margin: 0;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.aws-recap-smtp-card dd {
  margin: 0;
  font-size: 12px;
  color: #e2e8f0;
  word-break: break-all;
}

.aws-recap-pass {
  color: #fbbf24 !important;
}

.aws-recap-sendfrom {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  font-size: 13px;
}

.aws-recap-details {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  background: rgba(2, 6, 23, 0.45);
}

.aws-recap-details summary {
  cursor: pointer;
  color: #94a3b8;
  font-size: 13px;
  user-select: none;
}

.aws-recap-pre {
  margin-top: 10px;
  max-height: 220px;
}

.aws-recap-ask {
  font-size: 15px;
  line-height: 1.45;
  color: #e2e8f0;
}

.aws-recap-transport-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.aws-recap-transport-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
  cursor: pointer;
  color: #e2e8f0;
  font-size: 13px;
}

.aws-recap-transport-option:has(input:checked) {
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(67, 56, 202, 0.22);
}

.aws-live-skip-hint {
  color: #fbbf24;
}

.aws-live-send-intro {
  margin: 0 0 12px;
  font-size: 14px;
  color: #e2e8f0;
}

.aws-live-send-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.aws-live-stat {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.aws-live-stat strong {
  font-size: 15px;
  margin-right: 4px;
}

.aws-live-stat--ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.aws-live-stat--fail {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.aws-live-stat--skip {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.aws-live-stat--total {
  color: #94a3b8;
}

.aws-live-send-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  margin-bottom: 12px;
}

.aws-live-send-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.35s ease;
}

.aws-live-send-current {
  margin: 0 0 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.aws-live-send-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.aws-live-send-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  animation: awsRecapCardIn 0.25s ease;
}

.aws-live-send-line span {
  font-weight: 700;
  min-width: 36px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.aws-live-send-line--ok span {
  color: #4ade80;
}

.aws-live-send-line--fail span {
  color: #f87171;
}

.aws-live-send-line--muted {
  color: #64748b;
  font-style: italic;
}

.aws-live-send-done {
  margin: 12px 0 0;
  font-size: 13px;
  color: #94a3b8;
}

@keyframes awsRecapPulseIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes awsRecapCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .aws-page--polished {
    gap: 0.875rem;
  }

  .aws-page--polished > .card {
    padding: 14px;
  }

  .aws-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .aws-mes-aws-header {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-mes-aws-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-saved-keys-toolbar,
  .aws-mes-aws-header-actions {
    width: 100%;
  }

  .aws-saved-keys-toolbar .btn-sm,
  .aws-mes-aws-header-actions .btn-sm {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .aws-saved-key-row {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-saved-key-actions {
    flex-direction: column;
    width: 100%;
  }

  .aws-saved-key-actions .btn-sm {
    width: 100%;
    min-height: 44px;
  }

  .aws-smtp-credentials-grid {
    grid-template-columns: 1fr;
  }

  .aws-smtp-credential-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-smtp-card-copy,
  .aws-smtp-credential-actions .btn-aws-recheck {
    width: 100%;
    min-height: 44px;
    flex: none;
  }

  .aws-import-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-import-actions .btn-sm,
  .aws-import-actions .btn-aws-primary {
    width: 100%;
    min-height: 44px;
  }

  .aws-topo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-topo-actions .btn-sm {
    width: 100%;
    min-height: 44px;
  }

  .aws-results-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aws-results-header-actions .btn-sm {
    width: 100%;
    min-height: 44px;
  }

  .aws-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .aws-import-table-wrap,
  .aws-regions-table {
    min-width: 520px;
  }
}

@media (max-width: 480px) {
  .aws-page--polished > .card {
    padding: 12px;
    border-radius: 12px;
  }

  .aws-hero-pill {
    font-size: 11px;
  }

  .aws-smtp-field-row {
    grid-template-columns: 1fr auto auto;
  }

  .aws-saved-smtp-footer {
    flex-direction: column;
  }

  .aws-saved-smtp-footer .btn-sm {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 720px) {
  .aws-summary-score {
    font-size: 1.65rem;
  }

  .aws-secret-row {
    flex-direction: column;
  }

  .aws-topo-pre {
    max-height: 45vh;
    font-size: 11px;
  }
}

/* ===== AWS Add domaine (v141 polish — dual-AKIA) ===== */
.awsdomaine-page.aws-page--polished > .card {
  border-radius: 14px;
}

.awsdomaine-page.aws-page--polished > .card:nth-child(1) { animation-delay: 0.02s; }
.awsdomaine-page.aws-page--polished > .awsdomaine-form-card { animation-delay: 0.06s; }

.awsdomaine-hero-card {
  border: 1px solid rgba(52, 211, 153, 0.38);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.38), rgba(15, 23, 42, 0.94));
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.4);
}

.awsdomaine-hero-glow {
  background: radial-gradient(ellipse at 15% 0%, rgba(52, 211, 153, 0.28), transparent 55%),
    radial-gradient(ellipse at 95% 15%, rgba(251, 191, 36, 0.18), transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(56, 189, 248, 0.08), transparent 45%);
}

.awsdomaine-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 12px;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.awsdomaine-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  min-width: min-content;
}

.awsdomaine-form-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(52, 211, 153, 0.08), transparent 50%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
}

.awsdomaine-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.awsdomaine-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.awsdomaine-action-bar {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.awsdomaine-action-bar .btn-primary {
  min-height: 44px;
}

.awsdomaine-action-bar .btn-sm {
  min-height: 44px;
}

.awsdomaine-tab {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.awsdomaine-tab:hover {
  border-color: rgba(52, 211, 153, 0.45);
  color: #f8fafc;
}

.awsdomaine-tab.active {
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(251, 191, 36, 0.14));
  color: #ecfdf5;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.22), 0 6px 18px rgba(6, 78, 59, 0.25);
}

.awsdomaine-tab:focus-visible {
  outline: 2px solid #6ee7b7;
  outline-offset: 2px;
}

.awsdomaine-creds-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  margin-bottom: 8px;
}

.awsdomaine-textarea {
  min-height: 88px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}

.awsdomaine-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.awsdomaine-check input {
  margin-top: 3px;
}

.awsdomaine-check code {
  font-size: 11px;
  color: #a7f3d0;
}

.awsdomaine-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.awsdomaine-block {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.35), rgba(2, 6, 23, 0.65));
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease;
}

.awsdomaine-block:hover {
  border-color: rgba(52, 211, 153, 0.28);
}

.awsdomaine-page .aws-progress-card {
  border-color: rgba(52, 211, 153, 0.32);
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.2), rgba(15, 23, 42, 0.96));
}

.awsdomaine-page .aws-summary-card {
  border-color: rgba(52, 211, 153, 0.28);
}

.awsdomaine-page .aws-results-card {
  border-color: rgba(56, 189, 248, 0.28);
}

.awsdomaine-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.awsdomaine-block-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  word-break: break-all;
}

.awsdomaine-rec {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.awsdomaine-rec:first-of-type {
  border-top: none;
  padding-top: 0;
}

.awsdomaine-rec-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.awsdomaine-rec-type--cname {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}

.awsdomaine-rec-meta {
  min-width: 0;
}

.awsdomaine-rec-name,
.awsdomaine-rec-value {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.awsdomaine-rec-name {
  color: #e2e8f0;
  font-weight: 600;
}

.awsdomaine-rec-value {
  color: #94a3b8;
  margin-top: 2px;
}

.awsdomaine-rec-label {
  margin: 4px 0 0;
  font-size: 11px;
  color: #64748b;
}

.awsdomaine-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.awsdomaine-email-row:first-child {
  border-top: none;
  padding-top: 0;
}

.awsdomaine-email-addr {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  color: #e2e8f0;
  word-break: break-all;
}

.awsdomaine-paste-group {
  margin-bottom: 12px;
}

.awsdomaine-flow-steps {
  margin: 0 0 16px;
  padding: 14px 14px 14px 14px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.18), rgba(2, 6, 23, 0.55));
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
  list-style: none;
  counter-reset: awsdomaine-step;
}

.awsdomaine-flow-steps li {
  position: relative;
  margin: 6px 0;
  padding-left: 2.25rem;
}

.awsdomaine-email-preview-card {
  margin-top: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(160deg, rgba(8, 47, 73, 0.35), rgba(2, 6, 23, 0.65));
}

.awsdomaine-email-preview-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.awsdomaine-email-preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
}

.awsdomaine-email-preview-addr {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  color: #e0f2fe;
  word-break: break-all;
}

.awsdomaine-email-preview-src {
  font-size: 12px;
  color: #94a3b8;
}

.awsdomaine-email-preview-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.awsdomaine-email-preview-pick {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}

.awsdomaine-email-preview-pick input[type="checkbox"] {
  margin-top: 0.45rem;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.awsdomaine-email-preview-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.awsdomaine-rep-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.awsdomaine-rep-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.awsdomaine-rep--good {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 101, 52, 0.25);
}

.awsdomaine-rep--elite {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.55), rgba(22, 101, 52, 0.35));
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.15);
}

.awsdomaine-rep--mid {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(120, 53, 15, 0.25);
}

.awsdomaine-rep--low {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(127, 29, 29, 0.25);
}

.awsdomaine-rep-chip {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.awsdomaine-rep-tips {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

.awsdomaine-flow-steps li::before {
  counter-increment: awsdomaine-step;
  content: counter(awsdomaine-step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.55);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.awsdomaine-engine-meta {
  margin: 0 0 10px;
  color: #94a3b8;
}

.awsdomaine-manual-emails {
  margin-top: 8px;
}

.awsdomaine-subhead {
  margin: 1.1rem 0 0.75rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(2, 6, 23, 0.48);
}

.awsdomaine-source-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.35);
}

.awsdomaine-source-mode .awsdomaine-check {
  flex: 1 1 220px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.45);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.awsdomaine-source-mode .awsdomaine-check:hover {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.15);
}

.awsdomaine-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.55rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.42);
}

.awsdomaine-file-row .btn-sm {
  min-height: 44px;
}

.awsdomaine-file-row .aws-input[type="file"] {
  flex: 1 1 12rem;
  padding: 0.4rem 0.55rem;
}

.awsdomaine-akia-count {
  margin: 0 0 0.45rem;
  font-size: 13px;
  font-weight: 600;
  color: #a7f3d0;
}

.awsdomaine-domain-list {
  margin: 0.35rem 0 0;
  padding-left: 1.35rem;
  columns: 2;
  gap: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .awsdomaine-domain-list {
    columns: 1;
  }
}

@media (max-width: 900px) {
  .awsdomaine-creds-grid {
    grid-template-columns: 1fr;
  }

  .awsdomaine-rec {
    grid-template-columns: 64px 1fr;
  }

  .awsdomaine-rec .btn-sm {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .awsdomaine-page.aws-page--polished > .card {
    padding: 14px;
  }

  .awsdomaine-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .awsdomaine-tabs-wrap {
    margin-bottom: 10px;
  }

  .awsdomaine-tab {
    flex: 1 1 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  .awsdomaine-source-mode {
    flex-direction: column;
  }

  .awsdomaine-source-mode .awsdomaine-check {
    flex: 1 1 auto;
    width: 100%;
  }

  .awsdomaine-file-row {
    flex-direction: column;
    align-items: stretch;
  }

  .awsdomaine-file-row .aws-input[type="file"],
  .awsdomaine-file-row .btn-sm {
    width: 100%;
  }

  .awsdomaine-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .awsdomaine-action-bar .btn-primary,
  .awsdomaine-action-bar .btn-sm {
    width: 100%;
  }

  .awsdomaine-page .aws-results-header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .awsdomaine-page .aws-results-header-actions .btn-sm {
    width: 100%;
    min-height: 44px;
  }

  .awsdomaine-subhead {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .awsdomaine-page.aws-page--polished > .card {
    padding: 12px;
    border-radius: 12px;
  }

  .awsdomaine-tabs {
    flex-direction: column;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
  }

  .awsdomaine-tab {
    width: 100%;
    border-radius: 10px;
    white-space: normal;
    text-align: center;
  }

  .awsdomaine-flow-steps {
    font-size: 12px;
  }

  .awsdomaine-rec .btn-sm {
    width: 100%;
  }
}

/* ===== Mobile polish (v119) — drawer, touch, no overflow ===== */
@media (max-width: 768px) {
  .app {
    display: block;
    min-height: 100dvh;
  }

  .sidebar-footer {
    padding-bottom: max(12px, var(--safe-bottom));
  }

  .btn-logout {
    min-height: var(--touch-min);
  }

  .upload-grid {
    grid-template-columns: 1fr !important;
  }

  .mailtest-fields-grid,
  .mailtest-presets-grid,
  .mailtest-smtp-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .mailtest-field--wide {
    grid-column: auto;
  }

  .bulksend-log {
    max-height: min(40vh, 280px);
  }

  .aws-topo-pre {
    -webkit-overflow-scrolling: touch;
  }

  .page.active {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Avoid nested scroll traps: let page scroll; keep logs/tables as intentional scrollers */
  .main {
    overflow: visible;
  }

  .toast-container,
  #toastContainer {
    right: max(12px, var(--safe-right));
    left: auto;
    bottom: max(12px, var(--safe-bottom));
    max-width: calc(100vw - 24px);
  }
}

/* Sidebar section labels */
.sidebar-nav-label {
  margin: 14px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav-label:first-child {
  margin-top: 4px;
}

/* IMG BASE 64 tool */
.imgbase64-body {
  padding: 0 20px 20px;
}

.imgbase64-pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.imgbase64-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.imgbase64-pick-btn {
  min-height: var(--touch-min);
}

.imgbase64-file-name {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

.imgbase64-preview-wrap {
  margin-bottom: 16px;
}

.imgbase64-preview {
  display: block;
  max-width: min(100%, 420px);
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.imgbase64-output {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.imgbase64-actions {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.imgbase64-output-group {
  max-width: 100%;
}

.panel-file-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.42);
}

.panel-file-picker-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.panel-file-picker-btn {
  margin: 0;
  cursor: pointer;
  min-height: var(--touch-min);
}

.panel-file-picker-name {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  flex: 1 1 12rem;
}

.imgbase64-preview-frame {
  display: inline-block;
  max-width: min(100%, 420px);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.imgbase64-preview-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 6px;
}

.imgbase64-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.rdpplesk-log-console {
  max-height: min(52vh, 520px);
  overflow: auto;
  font-family: ui-monospace, Consolas, 'Cascadia Mono', monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b1220;
  color: #cbd5e1;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

/* --- Teste full id (SES) v2 --- */
.ses-fullid-page {
  --ses-success-bg: rgba(34, 197, 94, 0.16);
  --ses-success-fg: #86efac;
  --ses-warn-bg: rgba(245, 158, 11, 0.16);
  --ses-warn-fg: #fcd34d;
  --ses-error-bg: rgba(239, 68, 68, 0.18);
  --ses-error-fg: #fca5a5;
  --ses-info-bg: rgba(59, 130, 246, 0.18);
  --ses-info-fg: #93c5fd;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 100%;
}

.ses-fullid-hero .aws-hero-intro {
  max-width: 52rem;
}

.ses-fullid-form-header {
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.ses-fullid-form-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1 1 12rem;
}

.ses-fullid-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1rem;
  padding: 6px;
  border-radius: 14px;
  background: rgba(6, 8, 12, 0.45);
  border: 1px solid var(--inox-edge-soft, rgba(148, 163, 184, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ses-fullid-mode-tabs--inox {
  max-width: 100%;
}

.ses-fullid-mode-tab {
  flex: 1 1 8rem;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: rgba(199, 210, 254, 0.78);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ses-fullid-mode-tab:hover,
.ses-fullid-mode-tab:focus-visible {
  color: rgba(226, 232, 240, 0.95);
  border-color: rgba(129, 140, 248, 0.35);
  outline: none;
}

.ses-fullid-mode-tab.is-active {
  color: #eef2ff;
  border-color: rgba(129, 140, 248, 0.45);
  background: linear-gradient(
    158deg,
    rgba(67, 56, 202, 0.22) 0%,
    rgba(8, 10, 16, 0.82) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.18);
}

.ses-fullid-mode-panel.hidden {
  display: none !important;
}

.ses-fullid-import-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin: 0 0 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  background: linear-gradient(
    158deg,
    rgba(67, 56, 202, 0.1) 0%,
    rgba(8, 10, 16, 0.55) 100%
  );
}

.ses-fullid-import-hint {
  flex: 1 1 14rem;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.aws-settings-import-hint {
  flex: 1 1 100%;
  margin: 0.35rem 0 0;
  font-size: 12px;
}

.ses-fullid-smtp-import-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin: 0 0 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: linear-gradient(
    158deg,
    rgba(14, 116, 144, 0.12) 0%,
    rgba(8, 10, 16, 0.55) 100%
  );
}

.ses-fullid-smtp-import-hint {
  flex: 1 1 14rem;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.ses-fullid-smtp-picker {
  position: relative;
  margin: 0 0 1rem;
}

.ses-fullid-smtp-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: linear-gradient(
    158deg,
    rgba(67, 56, 202, 0.12) 0%,
    rgba(8, 10, 16, 0.78) 100%
  );
  color: rgba(226, 232, 240, 0.95);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ses-fullid-smtp-picker-trigger:hover,
.ses-fullid-smtp-picker-trigger:focus-visible {
  border-color: rgba(34, 211, 238, 0.4);
  outline: none;
}

.ses-fullid-smtp-picker-trigger[aria-expanded="true"] {
  border-color: rgba(34, 211, 238, 0.45);
}

.ses-fullid-smtp-picker-trigger-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ses-fullid-smtp-picker-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.75);
}

.ses-fullid-smtp-picker-summary {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
}

.ses-fullid-smtp-picker-chevron {
  flex-shrink: 0;
  font-size: 14px;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.ses-fullid-smtp-picker-trigger[aria-expanded="true"] .ses-fullid-smtp-picker-chevron {
  transform: rotate(180deg);
}

.ses-fullid-smtp-picker-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(70vh, 420px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.32);
  background: rgba(8, 10, 16, 0.97);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 8px;
}

.ses-fullid-smtp-picker-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  margin-bottom: 6px;
}

.ses-fullid-smtp-picker-clear-all {
  font-size: 11px;
}

.ses-fullid-smtp-picker-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
  padding: 6px 8px 4px;
}

.ses-fullid-smtp-picker-empty {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.95);
  padding: 10px 8px 6px;
  line-height: 1.45;
}

.ses-fullid-smtp-picker-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 4px;
}

.ses-fullid-smtp-picker-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.35);
  color: rgba(226, 232, 240, 0.95);
  text-align: left;
  cursor: pointer;
}

.ses-fullid-smtp-picker-pick:hover,
.ses-fullid-smtp-picker-pick:focus-visible {
  border-color: rgba(129, 140, 248, 0.35);
  outline: none;
}

.ses-fullid-smtp-picker-pick.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(
    158deg,
    rgba(67, 56, 202, 0.2) 0%,
    rgba(8, 10, 16, 0.85) 100%
  );
}

.ses-fullid-smtp-picker-pick-title {
  font-size: 13px;
  font-weight: 700;
}

.ses-fullid-smtp-picker-pick-meta {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(148, 163, 184, 0.95);
  word-break: break-word;
}

.ses-fullid-smtp-picker-delete {
  flex-shrink: 0;
  align-self: center;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  cursor: pointer;
}

.ses-fullid-smtp-picker-delete:hover,
.ses-fullid-smtp-picker-delete:focus-visible {
  background: rgba(127, 29, 29, 0.35);
  outline: none;
}

@media (max-width: 640px) {
  #page-sestestfullid.ses-fullid-page {
    overflow-x: clip;
    max-width: 100%;
  }

  #page-sestestfullid .card,
  #page-sestestfullid .ses-fullid-mode-panel {
    overflow: visible;
  }

  #page-sestestfullid .ses-fullid-mode-tabs,
  #page-sestestfullid .ses-fullid-mode-tabs--inox {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  #page-sestestfullid .ses-fullid-mode-tab {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    font-size: 12px;
    padding: 10px 10px;
  }

  #page-sestestfullid .ses-fullid-smtp-import-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  #page-sestestfullid .ses-fullid-smtp-import-bar .ses-fullid-touch-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #page-sestestfullid .ses-fullid-smtp-import-hint {
    flex: 1 1 100%;
    font-size: 13px;
  }

  #page-sestestfullid .ses-fullid-smtp-picker-trigger {
    min-height: 48px;
    padding: 12px 14px;
  }

  #page-sestestfullid .ses-fullid-smtp-picker-panel:not(.hidden) {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    max-height: min(72vh, 520px);
    z-index: 120;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  }

  #page-sestestfullid .ses-fullid-smtp-picker-row {
    flex-direction: column;
    gap: 8px;
  }

  #page-sestestfullid .ses-fullid-smtp-picker-pick {
    min-height: 48px;
    width: 100%;
  }

  #page-sestestfullid .ses-fullid-smtp-picker-delete,
  #page-sestestfullid .ses-fullid-smtp-picker-clear-all {
    align-self: stretch;
    width: 100%;
    min-height: 44px;
  }

  #page-sestestfullid .ses-fullid-smtp-test-mode {
    flex-direction: column;
    align-items: stretch;
  }

  #page-sestestfullid .ses-fullid-smtp-test-mode-opt {
    flex: 1 1 100%;
    min-height: 48px;
  }

  #page-sestestfullid .ses-fullid-actions-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  #page-sestestfullid .ses-fullid-actions-buttons .btn-primary,
  #page-sestestfullid .ses-fullid-actions-buttons .btn-secondary,
  #page-sestestfullid .ses-fullid-actions-buttons .ses-fullid-touch-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #page-sestestfullid .ses-fullid-form .form-row {
    flex-direction: column;
  }

  #page-sestestfullid .ses-fullid-form .form-group {
    flex: 1 1 100%;
    min-width: 0;
  }
}

.ses-fullid-smtp-test-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 0.85rem;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  background: rgba(6, 8, 12, 0.45);
}

.ses-fullid-smtp-test-mode-opt {
  flex: 1 1 11rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
  color: rgba(199, 210, 254, 0.88);
  cursor: pointer;
}

.ses-fullid-smtp-test-mode-opt:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(67, 56, 202, 0.16);
  color: #eef2ff;
}

.ses-fullid-smtp-test-mode-opt input {
  flex-shrink: 0;
  accent-color: #22d3ee;
}

.ses-fullid-smtp-batch-list {
  margin: 10px 0 0;
  padding-left: 1.1rem;
  font-size: 12px;
  line-height: 1.5;
}

.ses-fullid-smtp-batch-ok {
  color: #bbf7d0;
}

.ses-fullid-smtp-batch-fail {
  color: #fecaca;
}

.ses-fullid-smtp-batch-live {
  margin: 0;
}

.ses-fullid-smtp-batch-live-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.ses-fullid-smtp-batch-live-sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(199, 210, 254, 0.9);
}

.ses-fullid-smtp-batch-recap-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ses-fullid-smtp-batch-recap-title {
  margin: 0;
}

.ses-fullid-smtp-batch-recap-hint {
  margin: 0;
}

.ses-fullid-smtp-batch-copy {
  align-self: flex-start;
}

.ses-fullid-smtp-batch-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 480px);
  overflow: auto;
  padding-right: 2px;
}

.ses-fullid-smtp-batch-row {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(6, 8, 12, 0.45);
  overflow: hidden;
}

.ses-fullid-smtp-batch-row.is-ok {
  border-color: rgba(34, 197, 94, 0.28);
}

.ses-fullid-smtp-batch-row.is-fail {
  border-color: rgba(239, 68, 68, 0.32);
}

.ses-fullid-smtp-batch-row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 650;
}

.ses-fullid-smtp-batch-row summary::-webkit-details-marker {
  display: none;
}

.ses-fullid-smtp-batch-row-status {
  flex-shrink: 0;
  min-width: 3.2rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.ses-fullid-smtp-batch-row.is-ok .ses-fullid-smtp-batch-row-status {
  background: rgba(22, 101, 52, 0.35);
  color: #bbf7d0;
}

.ses-fullid-smtp-batch-row.is-fail .ses-fullid-smtp-batch-row-status {
  background: rgba(127, 29, 29, 0.4);
  color: #fecaca;
}

.ses-fullid-smtp-batch-row-title {
  flex: 1 1 12rem;
  min-width: 0;
  word-break: break-word;
}

.ses-fullid-smtp-batch-row-time {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

.ses-fullid-smtp-batch-dl {
  display: grid;
  gap: 6px 12px;
  margin: 0;
  padding: 0 12px 12px;
  font-size: 12px;
}

.ses-fullid-smtp-batch-dl--compact {
  padding-top: 0;
}

.ses-fullid-smtp-batch-dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 9.5rem) 1fr;
  gap: 8px;
  align-items: baseline;
}

.ses-fullid-smtp-batch-dl dt {
  margin: 0;
  font-weight: 650;
  color: rgba(199, 210, 254, 0.78);
}

.ses-fullid-smtp-batch-dl dd {
  margin: 0;
  word-break: break-word;
}

.ses-fullid-smtp-batch-row-error {
  margin: 0 12px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
}

.ses-fullid-smtp-test-mode-hint {
  margin: -4px 0 0.85rem;
  font-size: 12px;
  line-height: 1.45;
}

.ses-fullid-smtp-intro {
  margin: 0 0 0.85rem;
}

.ses-fullid-smtp-result {
  margin-top: 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 10, 16, 0.55);
}

.ses-fullid-smtp-result.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 101, 52, 0.14);
  color: #bbf7d0;
}

.ses-fullid-smtp-result.is-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.18);
  color: #fecaca;
}

.ses-fullid-smtp-result.is-pending {
  border-color: rgba(129, 140, 248, 0.35);
  color: rgba(199, 210, 254, 0.92);
}

@media (max-width: 640px) {
  .ses-fullid-mode-tab {
    flex: 1 1 calc(50% - 4px);
    font-size: 12px;
    padding: 10px 8px;
  }
}

.ses-fullid-saved-key-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md, 10px);
  border: 1px solid color-mix(in srgb, var(--accent-purple, #a78bfa) 35%, transparent);
  background: color-mix(in srgb, var(--accent-purple, #a78bfa) 12%, var(--card-bg, #1a1d24));
}

.ses-fullid-saved-key-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.9;
}

.ses-fullid-saved-key-label {
  flex: 1 1 12rem;
  font-size: 13px;
  color: var(--text-secondary, #c4c8d0);
}

.ses-fullid-saved-key-label code {
  font-size: 12px;
  color: var(--accent-purple, #c4b5fd);
}

.ses-fullid-saved-key-alt {
  flex-shrink: 0;
  border-color: color-mix(in srgb, var(--accent-purple, #a78bfa) 45%, transparent);
  color: var(--accent-purple, #c4b5fd);
}

.ses-fullid-saved-key-alt:hover {
  background: color-mix(in srgb, var(--accent-purple, #a78bfa) 18%, transparent);
}

.ses-fullid-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

.ses-fullid-check-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  justify-content: flex-end;
}

.ses-fullid-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem 0;
}

.ses-fullid-checkbox input {
  margin-top: 0.2rem;
  min-width: 1rem;
  min-height: 1rem;
}

.ses-fullid-actions {
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.ses-fullid-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.ses-fullid-from-local-wrap {
  margin-left: auto;
  min-width: min(100%, 14rem);
  max-width: 18rem;
}

.ses-fullid-touch-btn {
  min-height: var(--touch-min);
  padding-left: 1rem;
  padding-right: 1rem;
}

.ses-fullid-progress-card {
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.ses-fullid-progress-card.is-active {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
}

.ses-fullid-progress-card.is-sticky {
  position: sticky;
  top: calc(var(--topbar-height) + 6px);
  z-index: 25;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
}

.ses-fullid-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ses-fullid-progress-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ses-fullid-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: ses-fullid-live 1.6s ease-out infinite;
  opacity: 0;
}

.ses-fullid-progress-card.is-active .ses-fullid-live-dot {
  opacity: 1;
}

.ses-fullid-progress-label {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-hover);
}

.ses-fullid-progress-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.ses-fullid-ring-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
}

.ses-fullid-ring-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ses-fullid-ring-bg {
  stroke: rgba(99, 102, 241, 0.18);
}

.ses-fullid-ring-fg {
  stroke: url(#sesFullIdRingGrad);
  stroke: #22d3ee;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.35s ease;
}

.ses-fullid-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.ses-fullid-progress-track {
  flex: 1 1 200px;
  min-width: 0;
}

.ses-fullid-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  overflow: hidden;
  margin: 0.35rem 0 0.65rem;
}

.ses-fullid-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.ses-fullid-current {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  word-break: break-word;
}

.ses-fullid-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.ses-fullid-stat {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--bg-primary), color-mix(in srgb, var(--bg-card) 80%, transparent));
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ses-fullid-stat:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.ses-fullid-stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ses-fullid-stat-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.ses-fullid-stat--ok .ses-fullid-stat-value {
  color: var(--success);
}

.ses-fullid-stat--fail .ses-fullid-stat-value {
  color: var(--error);
}

.ses-fullid-stat--skip .ses-fullid-stat-value {
  color: var(--warning);
}

.ses-fullid-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ses-fullid-results-sub {
  margin: 0.25rem 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.ses-fullid-results-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  font-variant-numeric: tabular-nums;
}

.ses-fullid-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.ses-fullid-search-wrap {
  position: relative;
  width: 100%;
}

.ses-fullid-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.ses-fullid-search-input {
  width: 100%;
  padding-left: 2.1rem;
  min-height: var(--touch-min);
}

.ses-fullid-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.ses-fullid-toolbar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ses-fullid-filter-select {
  min-height: 40px;
  font-size: 13px;
  flex: 1 1 8rem;
  max-width: 100%;
}

.ses-fullid-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.25rem 0 0.5rem;
}

.ses-fullid-skeleton-row {
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(34, 211, 238, 0.12) 50%,
    rgba(99, 102, 241, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: ses-fullid-shimmer 1.2s ease-in-out infinite;
}

.ses-fullid-skeleton-row--short {
  width: 62%;
}

.ses-fullid-empty {
  text-align: center;
  padding: 2rem 1.25rem 2.25rem;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--border) 85%, var(--accent));
  background: color-mix(in srgb, var(--bg-primary) 70%, transparent);
}

.ses-fullid-empty-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.65rem;
  opacity: 0.85;
}

.ses-fullid-empty-title {
  margin: 0 0 0.4rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.ses-fullid-empty-text {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.ses-fullid-table-wrap {
  max-height: min(58vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ses-fullid-results-table {
  width: 100%;
}

.ses-fullid-results-table code {
  font-size: 11px;
  word-break: break-all;
}

.ses-fullid-cell-identity code {
  font-size: 12px;
}

.ses-fullid-mid-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 220px;
}

.ses-fullid-mid {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  line-height: 1.35;
}

.ses-fullid-mid-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.ses-fullid-copy-btn {
  flex: 0 0 auto;
  min-width: var(--touch-min);
  min-height: 36px;
  padding: 0.25rem 0.5rem;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ses-fullid-copy-btn:hover,
.ses-fullid-copy-btn:focus-visible {
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-hover));
}

.ses-fullid-status {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ses-fullid-status--pending {
  background: rgba(107, 114, 137, 0.25);
  color: var(--text-secondary);
}

.ses-fullid-status--sending {
  background: var(--ses-info-bg);
  color: var(--ses-info-fg);
  animation: ses-fullid-pulse 1.2s ease-in-out infinite;
}

.ses-fullid-status--ok {
  background: var(--ses-success-bg);
  color: var(--ses-success-fg);
}

.ses-fullid-status--failed {
  background: var(--ses-error-bg);
  color: var(--ses-error-fg);
}

.ses-fullid-status--skipped {
  background: var(--ses-warn-bg);
  color: var(--ses-warn-fg);
}

.ses-fullid-verif--ok {
  color: var(--success);
  font-weight: 500;
  font-size: 12px;
}

.ses-fullid-verif--no {
  color: var(--warning);
  font-size: 12px;
}

.ses-fullid-row--sending {
  background: rgba(59, 130, 246, 0.06);
}

.ses-fullid-detail {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 240px;
  word-break: break-word;
}

.ses-fullid-mobile-list {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(62vh, 680px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0 0.25rem;
}

.ses-fullid-result-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: var(--bg-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ses-fullid-result-card--sending {
  border-color: color-mix(in srgb, var(--info) 35%, var(--border));
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.ses-fullid-result-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.ses-fullid-result-card-idx {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.ses-fullid-result-card-identity {
  margin: 0 0 0.45rem;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.ses-fullid-result-card-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.65rem;
  font-size: 12px;
  margin: 0;
}

.ses-fullid-result-card-meta dt {
  color: var(--text-muted);
  font-weight: 500;
}

.ses-fullid-result-card-meta dd {
  margin: 0;
  color: var(--text-secondary);
  word-break: break-word;
}

.ses-fullid-result-card-detail {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.ses-fullid-result-card-mid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

@keyframes ses-fullid-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@keyframes ses-fullid-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes ses-fullid-live {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (max-width: 768px) {
  .ses-fullid-progress-card.is-sticky {
    top: calc(var(--topbar-height) + 2px);
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .ses-fullid-ring-wrap {
    width: 72px;
    height: 72px;
  }

  .ses-fullid-table-wrap {
    display: none !important;
  }

  .ses-fullid-mobile-list:not(.hidden) {
    display: flex;
  }

  .ses-fullid-toolbar-filters {
    width: 100%;
  }

  .ses-fullid-filter-select {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

@media (min-width: 769px) {
  .ses-fullid-toolbar {
    flex-direction: row;
    align-items: center;
  }

  .ses-fullid-search-wrap {
    flex: 1 1 240px;
  }

  .ses-fullid-toolbar-filters {
    flex: 0 1 auto;
  }

  .ses-fullid-mobile-list {
    display: none !important;
  }
}

/* === Envoyer un e-mail — inox / liquide v205 (Tynox panel) === */
:root {
  --mail-ease: cubic-bezier(0.33, 1, 0.38, 1);
  --mail-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --inox-edge: rgba(186, 198, 218, 0.32);
  --inox-edge-soft: rgba(148, 163, 184, 0.18);
  --inox-panel: linear-gradient(
    158deg,
    rgba(38, 42, 54, 0.98) 0%,
    rgba(12, 14, 20, 0.99) 44%,
    rgba(26, 30, 42, 0.97) 100%
  );
  --inox-panel-deep: linear-gradient(
    165deg,
    rgba(22, 26, 36, 0.95) 0%,
    rgba(8, 10, 16, 0.98) 100%
  );
  --inox-sheen: linear-gradient(
    108deg,
    transparent 0%,
    rgba(255, 255, 255, 0.09) 42%,
    rgba(255, 255, 255, 0.02) 58%,
    transparent 100%
  );
  --inox-accent: rgba(203, 213, 225, 0.92);
  --inox-glow: rgba(148, 163, 184, 0.22);
}

.content-area {
  scroll-behavior: smooth;
}

#page-sendmail.sendmail-page {
  animation: sendmail-inox-enter 0.52s var(--mail-ease-out) both;
}

@keyframes sendmail-inox-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sendmail-page-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1180px;
}

.sendmail-hero-card.mail-inox-hero,
.sendmail-workspace-card.mail-inox-card {
  position: relative;
  overflow: hidden;
  background: var(--inox-panel);
  border: 1px solid var(--inox-edge);
  box-shadow:
    0 14px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    border-color 0.32s var(--mail-ease),
    box-shadow 0.32s var(--mail-ease);
}

.sendmail-workspace-card.mail-inox-card {
  background: var(--inox-panel-deep);
}

.mail-inox-shine::after,
.sendmail-hero-card.mail-inox-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--inox-sheen);
  pointer-events: none;
  opacity: 0.9;
}

.sendmail-hero-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  height: 120%;
  background: radial-gradient(ellipse at center, var(--inox-glow) 0%, transparent 68%);
  pointer-events: none;
  filter: blur(2px);
}

.sendmail-hero-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sendmail-hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sendmail-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sendmail-hero-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--inox-accent);
  border: 1px solid var(--inox-edge-soft);
  background: rgba(15, 18, 26, 0.55);
  backdrop-filter: blur(8px);
}

.sendmail-page .sendmail-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  max-width: 72ch;
  line-height: 1.55;
}

.sendmail-stepper--inox {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  padding-top: 4px;
}

#page-sendmail .sendmail-step-pill {
  border-color: var(--inox-edge-soft);
  background: rgba(15, 18, 26, 0.65);
  color: rgba(203, 213, 225, 0.75);
  transition:
    border-color 0.26s var(--mail-ease),
    background 0.26s var(--mail-ease),
    color 0.26s var(--mail-ease),
    transform 0.2s var(--mail-ease),
    box-shadow 0.26s var(--mail-ease);
}

#page-sendmail .sendmail-step-pill.active {
  border-color: rgba(203, 213, 225, 0.45);
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.55), rgba(30, 41, 59, 0.75));
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#page-sendmail .sendmail-step-pill.done {
  border-color: rgba(134, 239, 172, 0.35);
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.18);
}

#page-sendmail .sendmail-step-panel {
  animation: sendmail-step-in 0.38s var(--mail-ease-out) both;
}

@keyframes sendmail-step-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#page-sendmail .sendmail-bank-chip {
  transition:
    border-color 0.24s var(--mail-ease),
    background 0.24s var(--mail-ease),
    transform 0.2s var(--mail-ease),
    box-shadow 0.24s var(--mail-ease);
}

#page-sendmail .sendmail-bank-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

#page-sendmail .sendmail-bank-chip.active {
  outline: none;
  border-color: rgba(203, 213, 225, 0.5);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#page-sendmail .sendmail-region-btn {
  transition:
    border-color 0.22s var(--mail-ease),
    background 0.22s var(--mail-ease),
    transform 0.18s var(--mail-ease);
}

#page-sendmail .sendmail-region-btn.active {
  border-color: rgba(203, 213, 225, 0.45);
  background: rgba(51, 65, 85, 0.45);
}

#page-sendmail .sendmail-preset-bar {
  border-color: var(--inox-edge-soft);
  background: rgba(8, 10, 16, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#page-sendmail .sendmail-preset-btn {
  transition:
    border-color 0.22s var(--mail-ease),
    background 0.22s var(--mail-ease),
    transform 0.18s var(--mail-ease),
    color 0.22s var(--mail-ease);
}

#page-sendmail .sendmail-preset-btn.active {
  border-color: rgba(203, 213, 225, 0.45);
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.55), rgba(30, 41, 59, 0.75));
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#page-sendmail .sendmail-preset-autosave-hint {
  color: rgba(203, 213, 225, 0.72);
}

#page-sendmail .sendmail-subject-cycle-pill {
  border-color: var(--inox-edge-soft);
  background: rgba(8, 10, 16, 0.72);
}

#page-sendmail .sendmail-subject-cycle-btn,
#page-sendmail .sendmail-subject-cycle-seg {
  transition:
    border-color 0.22s var(--mail-ease),
    background 0.22s var(--mail-ease),
    transform 0.18s var(--mail-ease),
    color 0.22s var(--mail-ease);
}

#page-sendmail .sendmail-subject-cycle-seg.active {
  border-color: rgba(203, 213, 225, 0.35);
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.55), rgba(30, 41, 59, 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#page-sendmail .sendmail-subject-input.sendmail-subject-input--pulse {
  animation: sendmail-subject-pulse-inox 0.58s var(--mail-ease);
}

@keyframes sendmail-subject-pulse-inox {
  0% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    border-color: var(--inox-edge-soft);
  }
  40% {
    box-shadow:
      0 0 0 3px rgba(148, 163, 184, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(203, 213, 225, 0.5);
    background: rgba(15, 23, 42, 0.85);
  }
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    border-color: var(--inox-edge-soft);
  }
}

#page-sendmail input:not([type="checkbox"]):not([type="radio"]),
#page-sendmail select,
#page-sendmail textarea,
#page-sendmail .data-search-input {
  background: rgba(8, 10, 16, 0.72);
  border-color: var(--inox-edge-soft);
  transition:
    border-color 0.24s var(--mail-ease),
    box-shadow 0.24s var(--mail-ease),
    background-color 0.24s var(--mail-ease);
}

#page-sendmail input:not([type="checkbox"]):not([type="radio"]):focus,
#page-sendmail select:focus,
#page-sendmail textarea:focus,
#page-sendmail .data-search-input:focus {
  border-color: rgba(203, 213, 225, 0.45);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
  outline: none;
}

#page-sendmail .btn-primary {
  background: linear-gradient(135deg, #64748b 0%, #334155 50%, #475569 100%);
  border: 1px solid rgba(203, 213, 225, 0.38);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.2s var(--mail-ease), box-shadow 0.24s var(--mail-ease), filter 0.2s;
}

#page-sendmail .btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

#page-sendmail .btn-sm {
  transition: border-color 0.22s var(--mail-ease), background 0.22s var(--mail-ease), transform 0.18s var(--mail-ease);
}

#page-sendmail .sendmail-embed-wrap {
  border-color: var(--inox-edge);
  background: rgba(6, 8, 12, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  min-height: min(72vh, 560px);
  transition: border-color 0.28s var(--mail-ease), box-shadow 0.28s var(--mail-ease);
}

#page-sendmail .sendmail-embed-wrap:focus-within {
  border-color: rgba(203, 213, 225, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(148, 163, 184, 0.12);
}

#page-sendmail .sendmail-embed-loading {
  background: linear-gradient(
    110deg,
    rgba(15, 18, 26, 0.95) 0%,
    rgba(30, 36, 48, 0.9) 50%,
    rgba(15, 18, 26, 0.95) 100%
  );
  background-size: 200% 100%;
  animation: sendmail-shimmer 1.4s ease-in-out infinite;
}

@keyframes sendmail-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

#page-sendmail .sendmail-projects-section {
  border-top-color: var(--inox-edge-soft);
}

#page-sendmail .sendmail-final-actions {
  padding-top: 8px;
  border-top: 1px solid var(--inox-edge-soft);
}

/* Sendmail — Destinataire premium inox v223 */
#page-sendmail .sendmail-step-panel--destinataire {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-sendmail .sendmail-selected-project--inox {
  position: relative;
  margin: 0;
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-transform: none;
  color: #f8fafc;
  background: linear-gradient(
    135deg,
    rgba(67, 56, 202, 0.24) 0%,
    rgba(15, 23, 42, 0.82) 52%,
    rgba(30, 27, 75, 0.35) 100%
  );
  border: 1px solid rgba(129, 140, 248, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

#page-sendmail .sendmail-selected-project--inox::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.95), rgba(99, 102, 241, 0.45));
}

#page-sendmail .sendmail-selected-project--inox:empty {
  display: none;
}

#page-sendmail .sendmail-preset-bar--premium {
  position: relative;
  margin-bottom: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(
    158deg,
    rgba(32, 34, 48, 0.94) 0%,
    rgba(8, 10, 16, 0.9) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 24px rgba(0, 0, 0, 0.22);
}

#page-sendmail .sendmail-preset-bar--premium::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    108deg,
    transparent 0%,
    rgba(167, 139, 250, 0.06) 48%,
    transparent 100%
  );
  pointer-events: none;
}

#page-sendmail .sendmail-preset-label--soft {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.78);
  display: flex;
  align-items: center;
  gap: 8px;
}

#page-sendmail .sendmail-preset-label--soft::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.85), transparent);
}

#page-sendmail .sendmail-preset-row {
  position: relative;
  z-index: 1;
}

#page-sendmail .sendmail-preset-btn--premium.sendmail-preset-btn--static {
  padding: 10px 20px 10px 16px;
  min-height: 42px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ede9fe;
  border: 1px solid rgba(167, 139, 250, 0.42);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.42) 0%,
    rgba(67, 56, 202, 0.28) 48%,
    rgba(30, 27, 75, 0.55) 100%
  );
  box-shadow:
    0 4px 22px rgba(67, 56, 202, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: none;
  gap: 8px;
}

#page-sendmail .sendmail-preset-btn--premium.sendmail-preset-btn--static::before {
  content: "✦";
  font-size: 10px;
  opacity: 0.85;
  color: rgba(233, 213, 255, 0.95);
}

#page-sendmail .sendmail-dest-fields {
  gap: 14px;
  padding: 18px 18px 8px;
  border-radius: 16px;
  background: linear-gradient(
    165deg,
    rgba(10, 12, 18, 0.72) 0%,
    rgba(6, 8, 12, 0.88) 100%
  );
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#page-sendmail .sendmail-dest-fields .form-group label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(203, 213, 225, 0.88);
}

#page-sendmail .sendmail-dest-fields .modal-hint {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.88);
  line-height: 1.5;
}

#page-sendmail .sendmail-recipient-lookup-group {
  padding: 14px 14px 12px;
  margin: 0;
  border-radius: 13px;
  background: linear-gradient(
    145deg,
    rgba(51, 65, 85, 0.2) 0%,
    rgba(8, 10, 16, 0.55) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#page-sendmail .sendmail-recipient-lookup-hint {
  margin-top: 4px;
}

#page-sendmail .sendmail-recipient-lookup .data-search-bar {
  border-radius: 12px;
  background: rgba(6, 8, 12, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.24s var(--mail-ease),
    box-shadow 0.24s var(--mail-ease);
}

#page-sendmail .sendmail-recipient-lookup .data-search-bar:focus-within {
  border-color: rgba(167, 139, 250, 0.38);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#page-sendmail .sendmail-recipient-lookup .data-search-input {
  border: none;
  background: transparent;
  border-radius: 12px;
}

#page-sendmail .sendmail-recipient-lookup .data-search-input:focus {
  box-shadow: none;
}

#page-sendmail .sendmail-subject-head {
  gap: 10px 14px;
}

#page-sendmail .sendmail-subject-slot-label {
  color: rgba(196, 181, 253, 0.72);
}

#page-sendmail .sendmail-subject-cycle-pill {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 12px rgba(0, 0, 0, 0.2);
}

#page-sendmail .sendmail-step-actions--dest {
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.5);
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#page-sendmail .sendmail-step-back-btn {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.92);
}

#page-sendmail .sendmail-step-back-btn:hover:not(:disabled) {
  border-color: rgba(203, 213, 225, 0.35);
  background: rgba(30, 41, 59, 0.65);
}

#page-sendmail .sendmail-reset-row--dest {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

#page-sendmail .sendmail-reset-row--dest .sendmail-reset-btn {
  width: 100%;
  border-radius: 12px;
  font-size: 12px;
  opacity: 0.92;
}

#page-sendmail .sendmail-stepper--inox {
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(6, 8, 12, 0.45);
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#page-sendmail .sendmail-step-pill.done {
  background: linear-gradient(
    135deg,
    rgba(22, 101, 52, 0.22),
    rgba(8, 10, 16, 0.65)
  );
}

#page-sendmail .sendmail-editor-quicksend--inox,
#page-emailpreenvoi .sendmail-editor-quicksend--inox {
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: linear-gradient(
    158deg,
    rgba(67, 56, 202, 0.14) 0%,
    rgba(8, 10, 16, 0.78) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 24px rgba(0, 0, 0, 0.2);
  margin-bottom: 14px;
}

#page-sendmail .sendmail-editor-quicksend--inox .sendmail-editor-quicksend-lead,
#page-emailpreenvoi .sendmail-editor-quicksend--inox .sendmail-editor-quicksend-lead {
  color: rgba(199, 210, 254, 0.88);
  letter-spacing: 0.02em;
}

#page-sendmail .sendmail-embed-header--inox {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(
    158deg,
    rgba(22, 26, 36, 0.88) 0%,
    rgba(8, 10, 16, 0.92) 100%
  );
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#page-sendmail .sendmail-embed-header--inox .sendmail-embed-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.95);
}

@media (max-width: 720px) {
  .sendmail-page-shell {
    gap: 14px;
  }

  .sendmail-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Sendmail inox flow — mobile polish v222 */
@media (max-width: 640px) {
  #page-sendmail.sendmail-page {
    overflow-x: clip;
    max-width: 100%;
  }

  #page-sendmail .sendmail-page-shell {
    gap: 12px;
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  #page-sendmail .sendmail-hero-header.card-header {
    padding: 14px 14px 12px;
  }

  #page-sendmail .bank-tools-intro.sendmail-intro,
  #page-sendmail .sendmail-page .sendmail-intro {
    padding: 0 14px 12px;
    font-size: 13px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #page-sendmail .sendmail-stepper,
  #page-sendmail .sendmail-stepper--inox {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 0;
    padding: 0 14px 14px;
  }

  #page-sendmail .sendmail-step-pill {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 14px;
    font-size: 13px;
  }

  #page-sendmail .sendmail-step-pill.active {
    transform: none;
  }

  #page-sendmail .sendmail-body {
    padding: 0 14px calc(16px + env(safe-area-inset-bottom));
  }

  #page-sendmail .bank-tools-grid.sendmail-bank-grid,
  #page-sendmail .bank-tools-grid.sendmail-project-grid {
    padding-left: 0;
    padding-right: 0;
    gap: 10px;
  }

  #page-sendmail .sendmail-preset-bar {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  #page-sendmail .sendmail-preset-bar--premium {
    padding: 14px;
    margin-bottom: 0;
  }

  #page-sendmail .sendmail-stepper--inox {
    padding: 6px;
    margin: 0 14px 14px;
  }

  #page-sendmail .sendmail-dest-fields {
    padding: 14px 14px 6px;
    border-radius: 14px;
  }

  #page-sendmail .sendmail-selected-project--inox {
    padding: 12px 14px 12px 16px;
    font-size: 14px;
  }

  #page-sendmail .sendmail-step-actions--dest {
    padding: 12px;
  }

  #page-sendmail .sendmail-recipient-lookup-group {
    padding: 12px;
  }

  #page-sendmail .sendmail-preset-row {
    gap: 6px;
  }

  #page-sendmail .sendmail-preset-btn,
  #page-sendmail .sendmail-preset-btn--static {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  #page-sendmail .sendmail-subject-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #page-sendmail .sendmail-subject-cycler {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  #page-sendmail .sendmail-subject-cycle-pill {
    flex-shrink: 0;
  }

  #page-sendmail .sendmail-subject-cycle-btn,
  #page-sendmail .sendmail-subject-cycle-seg {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #page-sendmail .sendmail-region-row {
    gap: 8px;
  }

  #page-sendmail .sendmail-region-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    justify-content: center;
  }

  #page-sendmail .sendmail-editor-quicksend {
    padding: 12px;
    margin-bottom: 12px;
  }

  #page-sendmail .sendmail-editor-quicksend-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #page-sendmail .sendmail-editor-quicksend-to {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  #page-sendmail .sendmail-editor-quicksend-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  #page-sendmail .sendmail-subject-head--quicksend,
  #page-emailpreenvoi .sendmail-subject-head--quicksend {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #page-sendmail .sendmail-subject-cycler--compact,
  #page-emailpreenvoi .sendmail-subject-cycler--compact {
    width: 100%;
    justify-content: flex-start;
  }

  #page-sendmail .sendmail-editor-quicksend-meta,
  #page-emailpreenvoi .sendmail-editor-quicksend-meta {
    flex-direction: column;
    align-items: stretch;
  }

  #page-sendmail .sendmail-editor-quicksend-smtp,
  #page-sendmail .sendmail-editor-quicksend-sender,
  #page-emailpreenvoi .sendmail-editor-quicksend-smtp,
  #page-emailpreenvoi .sendmail-editor-quicksend-sender {
    flex: 1 1 auto;
    width: 100%;
  }

  #page-emailpreenvoi .sendmail-editor-quicksend {
    padding: 12px;
    margin-bottom: 12px;
  }

  #page-emailpreenvoi .sendmail-editor-quicksend-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #page-emailpreenvoi .sendmail-editor-quicksend-to {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  #page-emailpreenvoi .sendmail-editor-quicksend-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  #page-emailpreenvoi .mail-projet-prefill {
    margin-left: 14px;
    margin-right: 14px;
    padding: 12px;
  }

  #page-emailpreenvoi .mail-projet-prefill-head {
    flex-direction: column;
    align-items: stretch;
  }

  #page-emailpreenvoi .mail-projet-prefill-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #page-emailpreenvoi .mail-projet-prefill-cards {
    grid-template-columns: 1fr;
  }

  #page-sendmail .sendmail-embed-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #page-sendmail .sendmail-embed-header .btn-sm {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #page-sendmail .sendmail-embed-header .sendmail-embed-title {
    width: 100%;
    text-align: center;
    font-size: 14px;
  }

  #page-sendmail .sendmail-embed-wrap {
    min-height: min(62vh, 520px);
    border-radius: 10px;
  }

  #page-sendmail .sendmail-embed {
    min-height: min(58vh, 480px);
  }

  #page-sendmail .sendmail-embed-wrap--rdv {
    min-height: min(64vh, 540px);
  }

  #page-sendmail .sendmail-embed-wrap--rdv .sendmail-embed {
    min-height: min(60vh, 500px);
  }

  #page-sendmail .sendmail-draft-date-bar {
    padding: 10px 12px;
  }

  #page-sendmail .sendmail-draft-date-row {
    flex-direction: column;
    align-items: stretch;
  }

  #page-sendmail .sendmail-draft-date-row input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  #page-sendmail .sendmail-step-actions,
  #page-sendmail .sendmail-final-actions,
  #page-sendmail .sendmail-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #page-sendmail .sendmail-step-actions .btn-sm,
  #page-sendmail .sendmail-step-actions .btn-primary,
  #page-sendmail .sendmail-final-actions .btn-sm,
  #page-sendmail .sendmail-final-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #page-sendmail .sendmail-reset-row {
    margin-top: 12px;
    padding-top: 10px;
  }

  #page-sendmail .sendmail-reset-btn {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #page-sendmail input:not([type="checkbox"]):not([type="radio"]),
  #page-sendmail select,
  #page-sendmail textarea,
  #page-sendmail .data-search-input {
    min-height: 44px;
    font-size: 16px;
  }

  #page-sendmail .sendmail-recipient-lookup .data-search-bar {
    min-height: 44px;
  }

  #page-sendmail .modal-hint,
  #page-sendmail .sendmail-bank-hint,
  #page-sendmail .sendmail-html-status {
    font-size: 12px;
    line-height: 1.45;
  }
}

@media (max-width: 480px) {
  #page-sendmail .bank-tools-intro.sendmail-intro,
  #page-sendmail .sendmail-intro {
    display: none;
  }

  #page-sendmail .sendmail-hero-title-wrap h2 {
    font-size: 15px;
  }

  #page-sendmail .sendmail-hero-pill {
    font-size: 10px;
    padding: 5px 10px;
  }

  #page-sendmail .sendmail-step-pill {
    font-size: 12px;
  }

  #page-sendmail .sendmail-editor-quicksend-lead {
    font-size: 11px;
    line-height: 1.45;
  }

  #page-sendmail .sendmail-embed-wrap {
    min-height: min(56vh, 420px);
  }

  #page-sendmail .sendmail-embed {
    min-height: min(52vh, 380px);
  }

  #page-sendmail .sendmail-embed-wrap--rdv .sendmail-embed {
    min-height: min(54vh, 400px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-sendmail.sendmail-page,
  #page-sendmail .sendmail-step-panel,
  #page-sendmail .sendmail-embed-loading {
    animation: none;
  }

  #page-sendmail .sendmail-bank-chip:hover,
  #page-sendmail .btn-primary:hover:not(:disabled),
  #page-sendmail .sendmail-step-pill.active {
    transform: none;
  }
}


.nav-group-label {
  margin: 14px 12px 6px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.72);
  user-select: none;
}

.nav-item--nested {
  padding-left: 2.35rem;
  font-size: 0.92rem;
  opacity: 0.92;
}

.nav-item--nested .nav-icon {
  font-size: 1rem;
}

/* Connecte Phone — hub bb */
.connecte-phone-page--simple .connecte-phone-live-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.connecte-phone-hero--compact .aws-hero-intro {
  margin-bottom: 0;
}

.pr-bb-https-ws-hint {
  color: #fbbf24;
  border-left: 3px solid rgba(251, 191, 36, 0.55);
  padding-left: 0.65rem;
  margin-top: 0.35rem;
}

.pr-bb-use-panel-relay-btn {
  margin-left: 0.5rem;
  margin-top: 0.35rem;
  vertical-align: middle;
}

.connecte-phone-shared-config-hint {
  margin: -0.35rem 0 0.75rem;
  padding: 0 0.15rem;
  font-size: 13px;
}

.phone-remote-bb-form .card-header,
.connecte-phone-live-stack .aws-form-card > .card-header {
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.connecte-phone-sync-pill {
  font-size: 11px;
}

.pr-bb-relay-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.pr-bb-relay-status--green {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(6, 78, 59, 0.22);
}

.pr-bb-relay-status--orange {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(124, 45, 18, 0.2);
}

.pr-bb-relay-status--red {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.18);
}

.relay-status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85);
}

.relay-status-dot--green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.65);
}

.relay-status-dot--orange {
  background: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.55);
}

.relay-status-dot--red {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.45);
}

.relay-status-ping {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary, #cbd5e1);
}

.connecte-phone-advanced {
  margin: 0.35rem 0 0.75rem;
  font-size: 13px;
  color: var(--text-muted);
}

.connecte-phone-advanced summary {
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary, #cbd5e1);
}

.connecte-phone-setup-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  text-align: center;
}

.connecte-phone-setup-toggle {
  background: none;
  border: none;
  color: #7dd3fc;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.35rem 0.5rem;
}

.connecte-phone-setup-toggle:hover {
  color: #bae6fd;
}

.connecte-phone-setup-panel {
  margin-top: 1rem;
  text-align: left;
}

.connecte-phone-setup-panel[hidden] {
  display: none !important;
}

.connecte-phone-grid--setup {
  margin-top: 0.5rem;
}

.connecte-phone-card--apk-branding {
  border-color: rgba(167, 139, 250, 0.35);
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.07), rgba(8, 10, 16, 0.55));
}

.cp-bb-apk-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.cp-bb-apk-icon-preview {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(15, 23, 42, 0.6);
}

.cp-bb-apk-icon-file {
  max-width: 100%;
  font-size: 12px;
  color: var(--text-secondary, #cbd5e1);
}

.connecte-phone-apk-branding-steps {
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.cp-bb-setup-btn-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cp-bb-setup-btn-inner .pr-bb-toolbar-icon-svg {
  flex-shrink: 0;
}

.connecte-phone-card--apk-branding .cp-bb-apk-branding-dl-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1.2;
}

.connecte-phone-card--apk-branding .cp-bb-apk-branding-dl-btn[aria-disabled='true'] {
  pointer-events: none;
  cursor: not-allowed;
}

.cp-bb-device-new-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.connecte-phone-page .connecte-phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.connecte-phone-card--doc {
  border-color: rgba(56, 189, 248, 0.12);
}

.connecte-phone-card--live {
  grid-column: 1 / -1;
}

.connecte-phone-card--apk-download {
  grid-column: 1 / -1;
  border-color: rgba(74, 222, 128, 0.38);
  background: linear-gradient(145deg, rgba(74, 222, 128, 0.08), rgba(8, 10, 16, 0.55));
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.06);
}

.connecte-phone-apk-dl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0.35rem 0 0.5rem;
}

.connecte-phone-apk-dl-btn {
  font-weight: 700;
  padding: 0.55rem 1.1rem;
}

.connecte-phone-apk-dl-btn--pending {
  opacity: 0.88;
}

.connecte-phone-apk-url-hint {
  margin: 0;
  font-size: 12px;
}

.connecte-phone-apk-ready {
  color: var(--success, #6ee7b7);
  margin-top: 0.25rem;
}

.connecte-phone-apk-missing {
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px dashed rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.06);
}

.connecte-phone-apk-missing[hidden] {
  display: none !important;
}

.connecte-phone-apk-ready[hidden] {
  display: none !important;
}

.connecte-phone-card--devices {
  grid-column: 1 / -1;
  border-color: rgba(74, 222, 128, 0.18);
}

.cp-bb-device-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cp-bb-device-list--compact {
  margin: 0 0 0.25rem;
}

.cp-bb-device-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background: rgba(8, 10, 16, 0.5);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cp-bb-device-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.cp-bb-device-item--selected {
  border-color: rgba(74, 222, 128, 0.45);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.2);
}

.cp-bb-device-item--new {
  animation: cp-bb-device-pulse 1.2s ease-in-out 3;
  border-color: rgba(250, 204, 21, 0.55);
}

@keyframes cp-bb-device-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0);
  }
}

.cp-bb-device-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  flex: 1 1 12rem;
  min-width: 0;
}

.cp-bb-device-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.cp-bb-device-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #f1f5f9);
}

.cp-bb-device-rename-btn {
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(8, 10, 16, 0.35);
  color: var(--text-muted, #94a3b8);
  border-radius: 8px;
  padding: 0.15rem 0.45rem;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.cp-bb-device-rename-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text-primary, #f1f5f9);
}

.cp-bb-device-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.cp-bb-device-remove-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #f87171;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.cp-bb-device-remove-btn:hover,
.cp-bb-device-remove-btn:focus-visible {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  outline: none;
}

.cp-bb-device-rename-input {
  max-width: 11rem;
  min-width: 7rem;
  padding: 0.25rem 0.45rem;
  font-size: 13px;
}

.cp-bb-device-selected-tag {
  font-size: 11px;
  font-weight: 600;
  color: #86efac;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.12);
}

.cp-bb-device-item--selected .cp-bb-device-selected-tag {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.cp-bb-device-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 12px;
  color: var(--text-muted);
}

.cp-bb-device-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.cp-bb-device-pill--on {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
}

.cp-bb-device-pill--off {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.cp-bb-device-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
}

.connecte-phone-pre {
  font-size: 12px;
  margin: 0.5rem 0;
  max-height: 6rem;
  overflow: auto;
}

.connecte-phone-steps {
  margin: 0.35rem 0 0.75rem 1.15rem;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.connecte-phone-steps--plain {
  list-style: disc;
}

.connecte-phone-lead {
  margin-bottom: 0.35rem;
}

.connecte-phone-path {
  margin-top: 0.65rem;
  font-size: 12px;
}

.connecte-phone-copy-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.5rem 0 0.75rem;
}

.connecte-phone-copy-list--paths {
  margin-top: 0.85rem;
}

.connecte-phone-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(8, 10, 16, 0.45);
}

.connecte-phone-copy-text {
  flex: 1 1 12rem;
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
  color: rgba(226, 232, 240, 0.88);
}

.connecte-phone-copy-btn {
  flex-shrink: 0;
  min-height: 36px;
}

.connecte-phone-back {
  margin: -0.25rem 0 0.75rem 1.25rem;
  font-size: 13px;
}

.connecte-phone-back a {
  color: var(--inox-accent, #38bdf8);
  text-decoration: none;
}

.connecte-phone-back a:hover {
  text-decoration: underline;
}

/* EMAIL PRE ENVOI — inox / liquide v222 */
#page-emailpreenvoi.email-preenvoi-page {
  animation: sendmail-inox-enter 0.52s var(--mail-ease-out) both;
}

.email-preenvoi-workspace-card.mail-inox-card {
  padding: 0;
}

.email-preenvoi-workspace-card .email-preenvoi-body {
  padding: 18px 20px 22px;
}

.email-preenvoi-workspace-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--inox-edge-soft);
  background: rgba(8, 10, 16, 0.35);
}

.email-preenvoi-workspace-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--inox-accent);
}

.email-preenvoi-workspace-hint {
  margin: 0;
  max-width: 58ch;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.72);
}

.email-preenvoi-count-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  color: #e0f2fe;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(129, 140, 248, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#page-emailpreenvoi .email-preenvoi-stepper .sendmail-step-pill {
  border-color: var(--inox-edge-soft);
  background: rgba(15, 18, 26, 0.65);
  color: rgba(203, 213, 225, 0.75);
}

#page-emailpreenvoi .email-preenvoi-stepper .sendmail-step-pill.active {
  border-color: rgba(34, 211, 238, 0.4);
  color: #ecfeff;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(129, 140, 248, 0.18));
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#page-emailpreenvoi .email-preenvoi-stepper .sendmail-step-pill.done {
  border-color: rgba(134, 239, 172, 0.35);
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.18);
}

.email-preenvoi-toolbar-btn {
  min-height: 36px;
}

#page-emailpreenvoi .email-preenvoi-item {
  position: relative;
  overflow: hidden;
  background: rgba(15, 18, 26, 0.58);
  border: 1px solid var(--inox-edge-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.26s var(--mail-ease),
    background 0.26s var(--mail-ease),
    transform 0.2s var(--mail-ease),
    box-shadow 0.26s var(--mail-ease);
}

#page-emailpreenvoi .email-preenvoi-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--inox-sheen);
  opacity: 0.35;
  pointer-events: none;
}

#page-emailpreenvoi .email-preenvoi-item:hover {
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#page-emailpreenvoi .email-preenvoi-item-main,
#page-emailpreenvoi .email-preenvoi-item-actions {
  position: relative;
  z-index: 1;
}

.email-preenvoi-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px 16px 12px;
}

.email-preenvoi-empty-wrap.hidden {
  display: none;
}

.email-preenvoi-empty-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--inox-edge-soft);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.email-preenvoi-empty-icon {
  font-size: 28px;
  line-height: 1;
}

.email-preenvoi-empty-hint {
  margin: 0;
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.72);
}

.nav-icon--preenvoi svg, .nav-icon--emailpreenvoi svg {
  filter: drop-shadow(0 2px 6px rgba(34, 211, 238, 0.25));
}

@media (max-width: 720px) {
  .email-preenvoi-workspace-head {
    flex-direction: column;
    align-items: stretch;
  }

  .email-preenvoi-count-pill {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-emailpreenvoi.email-preenvoi-page,
  #page-emailpreenvoi .email-preenvoi-item:hover {
    animation: none;
    transform: none;
  }
}

/* Generateur Letter v237 */
#page-generateurletter.letter-gen-page {
  animation: sendmail-inox-enter 0.52s var(--mail-ease-out) both;
}

.letter-gen-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.letter-gen-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.letter-gen-category-btn {
  flex: 1 1 220px;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--inox-edge-soft, rgba(255, 255, 255, 0.12));
  background: rgba(15, 18, 26, 0.45);
  color: var(--text-primary, #e8eaed);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.letter-gen-category-btn:hover {
  border-color: rgba(148, 163, 184, 0.45);
}

.letter-gen-category-btn.active {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
  background: rgba(96, 165, 250, 0.1);
}

.letter-gen-category-btn.active[data-letter-category="banque"] {
  border-color: rgba(196, 18, 48, 0.7);
  box-shadow: 0 0 0 1px rgba(196, 18, 48, 0.28);
  background: rgba(196, 18, 48, 0.1);
}

.letter-gen-category-btn.active[data-letter-category="livraison"] {
  border-color: rgba(255, 204, 0, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.35);
  background: rgba(255, 204, 0, 0.12);
}

.letter-gen-category-btn.active[data-letter-category="streaming"] {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
  background: rgba(96, 165, 250, 0.1);
}

.letter-gen-category-btn.active[data-letter-category="teste_inbox"] {
  border-color: rgba(0, 51, 160, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 51, 160, 0.35);
  background: rgba(0, 51, 160, 0.12);
}

.letter-gen-step-panel.letter-gen-panel-hidden {
  display: none !important;
}

.letter-gen-teste-inbox-panel {
  margin: 8px 0 16px;
}

.letter-gen-teste-cta-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 12px 8px;
}

.letter-gen-teste-btn {
  min-width: 160px;
  padding: 16px 48px;
  border: none;
  border-radius: 6px;
  background: #0033a0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 51, 160, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.letter-gen-teste-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 51, 160, 0.45);
}

.letter-gen-teste-hint {
  text-align: center;
  margin: 0;
}

.letter-gen-netflix-variant-row {
  margin-bottom: 14px;
}

.letter-gen-netflix-variant-btn.active[data-netflix-variant="noir"] {
  border-color: rgba(229, 9, 20, 0.75);
  box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.35);
  background: rgba(229, 9, 20, 0.12);
}

.letter-gen-netflix-variant-btn.active[data-netflix-variant="blanc"] {
  border-color: rgba(234, 237, 237, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.letter-gen-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.letter-gen-project-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--inox-edge-soft, rgba(255, 255, 255, 0.12));
  background: rgba(15, 18, 26, 0.45);
  color: var(--text-primary, #e8eaed);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.letter-gen-project-btn:hover {
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
}

.letter-gen-project-btn.active {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
}

.letter-gen-project-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.letter-gen-project-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.letter-gen-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.letter-gen-type-btn.active {
  border-color: var(--letter-gen-type-accent, rgba(99, 102, 241, 0.55));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--letter-gen-type-accent, #6366f1) 40%, transparent);
  background: color-mix(in srgb, var(--letter-gen-type-accent, #6366f1) 14%, transparent);
}

.letter-gen-type-row[data-letter-category="livraison"] .letter-gen-type-btn.active {
  border-width: 2px;
}

.letter-gen-form-grid,
.letter-gen-quicksend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.letter-gen-formule-wrap,
.letter-gen-url-wrap {
  grid-column: 1 / -1;
}

.letter-gen-preview-wrap {
  border: 1px solid var(--inox-edge-soft, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  background: #eaeded;
  min-height: 420px;
}

.letter-gen-preview-iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #eaeded;
}

.letter-gen-actions {
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .letter-gen-form-grid,
  .letter-gen-quicksend-grid {
    grid-template-columns: 1fr;
  }

  .letter-gen-preview-wrap,
  .letter-gen-preview-iframe {
    min-height: 320px;
  }
}

.letter-gen-stepper {
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.letter-gen-step-panel {
  padding-top: 4px;
}

.letter-gen-example-card,
.letter-gen-revise-card,
.letter-gen-translate-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--inox-edge-soft, rgba(255, 255, 255, 0.1));
  background: rgba(15, 18, 26, 0.35);
}

.letter-gen-example-paste,
.letter-gen-revise-input {
  width: 100%;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.letter-gen-example-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.letter-gen-translate-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.letter-gen-lang-select {
  min-width: 0;
}

.letter-gen-revise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.letter-gen-optional-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--inox-accent, rgba(203, 213, 225, 0.85));
  margin-left: 6px;
}

@media (max-width: 900px) {
  .letter-gen-translate-row {
    grid-template-columns: 1fr;
  }
}

/* Phone Remote BB — client WebSocket panel */
.phone-remote-bb-page .phone-remote-bb-viewer-card {
  overflow: hidden;
}

.phone-remote-bb-viewer-card > .card-header.phone-remote-bb-viewer-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.phone-remote-bb-viewer-header .aws-panel-title {
  justify-self: start;
  margin: 0;
}

.phone-remote-bb-viewer-header .pr-bb-viewer-header-status {
  justify-self: center;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.phone-remote-bb-viewer-header .pr-bb-relay-status {
  flex-shrink: 0;
}

.pr-bb-viewonly-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  white-space: nowrap;
}

.pr-bb-viewonly-badge[hidden] {
  display: none !important;
}

.phone-remote-bb-viewer-header .pr-bb-viewer-header-actions {
  justify-self: end;
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}

.phone-remote-bb-viewer-header .pr-bb-viewer-header-actions .aws-panel-hint {
  text-align: right;
  margin: 0;
}

.pr-bb-viewer-clone-launch-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.pr-bb-viewer-clone-launch-btn--active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}

.phone-remote-bb-clone-card--focus {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .phone-remote-bb-viewer-header .pr-bb-viewer-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .phone-remote-bb-viewer-header .pr-bb-viewer-header-actions .aws-panel-hint {
    text-align: left;
  }
}

.phone-remote-bb-stage {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  background: #1a1d23;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.55rem;
  min-height: 0;
}

.phone-remote-bb-rail {
  flex: 0 0 14px;
  width: 14px;
  align-self: stretch;
  background: #121212;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-remote-bb-rail--left {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.phone-remote-bb-paste-rail {
  flex: 0 0 auto;
  width: min(152px, 30vw);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem;
  background: #121212;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.phone-remote-bb-paste-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  line-height: 1.2;
}

.phone-remote-bb-paste-field {
  flex: 1 1 auto;
  min-height: 5.5rem;
  max-height: min(52vh, 420px);
  resize: vertical;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.4rem 0.45rem;
}

.phone-remote-bb-paste-send {
  flex: 0 0 auto;
  width: 100%;
}

.phone-remote-bb-rail--right {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.phone-remote-bb-between {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.25rem;
}

.phone-remote-bb-latency {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  max-width: 108px;
  padding: 0.45rem 0.4rem 0.35rem;
  background: #12151c;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.phone-remote-bb-latency-kicker {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.72);
  line-height: 1.1;
}

.phone-remote-bb-latency-ms {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
}

.phone-remote-bb-latency-ms--green {
  color: #4ade80;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.phone-remote-bb-latency-ms--orange {
  color: #fb923c;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.28);
}

.phone-remote-bb-latency-ms--red {
  color: #f87171;
}

.phone-remote-bb-latency-ms--muted {
  color: rgba(148, 163, 184, 0.65);
}

.phone-remote-bb-latency-spark {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(10, 12, 16, 0.85);
}

.phone-remote-bb-dpad {
  display: grid;
  grid-template-columns: 36px 36px 36px;
  grid-template-rows: 36px 36px 36px;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.phone-remote-bb-dpad-center {
  display: block;
  background: #161a21;
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin: -1px;
}

.phone-remote-bb-dir-btn--up {
  grid-column: 2;
  grid-row: 1;
}

.phone-remote-bb-dir-btn--left {
  grid-column: 1;
  grid-row: 2;
}

.phone-remote-bb-dir-btn--right {
  grid-column: 3;
  grid-row: 2;
}

.phone-remote-bb-dir-btn--down {
  grid-column: 2;
  grid-row: 3;
}

.phone-remote-bb-dpad .phone-remote-bb-dir-btn {
  width: 36px;
  height: 36px;
  border-radius: 0;
  border: none;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
  font-size: 13px;
  line-height: 1;
}

.phone-remote-bb-kb-toggle {
  appearance: none;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #1e2229;
  color: #e2e8f0;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.phone-remote-bb-kb-toggle:hover:not(:disabled),
.phone-remote-bb-kb-toggle[aria-expanded='true'] {
  background: #2a3140;
  border-color: rgba(56, 189, 248, 0.45);
}

.phone-remote-bb-kb-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.phone-remote-bb-dir-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #1e2229;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.phone-remote-bb-dir-btn:hover:not(:disabled) {
  background: #2a3140;
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
}

.phone-remote-bb-dir-btn:active:not(:disabled) {
  transform: scale(0.94);
  background: #0f141c;
}

.phone-remote-bb-dir-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.phone-remote-bb-dir-btn--pulse {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.phone-remote-bb-canvas-wrap {
  position: relative;
  background: #0a0a0c;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.12);
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.phone-remote-bb-vk {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 4;
  padding: 0.35rem 0.4rem 0.4rem;
  border-radius: 10px;
  background: rgba(15, 18, 24, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  isolation: isolate;
}

.phone-remote-bb-vk-buffer {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.25rem;
  font-size: 11px;
  line-height: 1.25;
  padding: 0.28rem 0.35rem;
  min-height: 1.65rem;
}

#prBbVk > .phone-remote-bb-vk-row {
  display: none !important;
}

.phone-remote-bb-vk[hidden] {
  display: none !important;
}

.phone-remote-bb-vk-rows {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.25rem;
}

.phone-remote-bb-vk-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18rem;
}

.phone-remote-bb-vk-rows button,
.phone-remote-bb-vk-actions button,
.phone-remote-bb-vk-key {
  appearance: none;
  min-width: 1.55rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  background: #252932;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
}

.phone-remote-bb-vk-rows button:hover:not(:disabled),
.phone-remote-bb-vk-actions button:hover:not(:disabled),
.phone-remote-bb-vk-key:hover:not(:disabled) {
  background: #323945;
  border-color: rgba(56, 189, 248, 0.4);
}

.phone-remote-bb-vk-rows button:disabled,
.phone-remote-bb-vk-actions button:disabled,
.phone-remote-bb-vk-key:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.phone-remote-bb-vk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
}

.phone-remote-bb-vk-key--wide {
  flex: 1 1 40%;
  min-width: 4rem;
}

.phone-remote-bb-vk-key--hide {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 520px) {
  .phone-remote-bb-stage {
    flex-wrap: wrap;
    justify-content: center;
  }

  .phone-remote-bb-between {
    flex-direction: row;
    flex: 1 1 100%;
    justify-content: center;
    order: 2;
  }

  .phone-remote-bb-rail,
  .phone-remote-bb-paste-rail {
    display: none;
  }

  .phone-remote-bb-canvas-wrap {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-live-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-canvas-wrap {
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    align-self: center;
  }

  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-canvas {
    display: block;
    width: 360px;
    max-width: min(100%, 360px);
    height: auto;
    min-height: 0;
    max-height: min(56vh, 640px);
    aspect-ratio: 360 / 640;
    opacity: 1;
    visibility: visible;
    position: relative;
    z-index: 1;
  }

  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-live-frame-hint {
    z-index: 2;
  }

  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-mobile-touchpad-wrap {
    flex: 0 0 auto;
    width: 100%;
    z-index: 0;
    position: relative;
  }
}

/* Pavé tactile — mobile BB uniquement (desktop inchangé) */
.phone-remote-bb-mobile-touchpad-wrap {
  display: none;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding: 0.55rem 0.6rem 0.65rem;
  background: #1a1d23;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
}

@media (max-width: 768px) {
  .phone-remote-bb-page.pr-bb-touchpad-eligible .phone-remote-bb-mobile-touchpad-wrap:not([hidden]) {
    display: flex;
  }
}

@media (min-width: 769px) {
  .phone-remote-bb-mobile-touchpad-wrap,
  .phone-remote-bb-mobile-cursor {
    display: none !important;
  }
}

.phone-remote-bb-mobile-touchpad-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.phone-remote-bb-mobile-touchpad-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.phone-remote-bb-mobile-touchpad-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(148, 163, 184, 0.72);
}

.phone-remote-bb-mobile-touchpad-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.phone-remote-bb-mobile-touchpad {
  position: relative;
  flex: 1 1 auto;
  min-height: 112px;
  max-height: 140px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.07), transparent 55%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 14px
    ),
    #12151c;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: crosshair;
}

.phone-remote-bb-mobile-touchpad:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.phone-remote-bb-mobile-touchpad--disabled {
  opacity: 0.42;
  pointer-events: none;
  cursor: not-allowed;
}

.phone-remote-bb-mobile-touchpad-finger {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.35);
  border: 2px solid rgba(125, 211, 252, 0.95);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.phone-remote-bb-mobile-touchpad-finger--visible {
  opacity: 1;
}

.phone-remote-bb-mobile-touchpad-tap {
  flex: 0 0 auto;
  align-self: center;
  min-width: 3.25rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.phone-remote-bb-mobile-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.95);
  background: rgba(251, 191, 36, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 3;
}

.phone-remote-bb-mobile-cursor[hidden] {
  display: none !important;
}

.phone-remote-bb-stage--view-only .phone-remote-bb-mobile-touchpad-wrap {
  opacity: 0.72;
}

.phone-remote-bb-canvas {
  display: block;
  width: 360px;
  max-width: min(100%, 360px);
  height: auto;
  min-height: 0;
  max-height: min(72vh, 640px);
  aspect-ratio: 360 / 640;
  flex-shrink: 0;
  cursor: crosshair;
  touch-action: none;
  border-radius: 8px;
}

.phone-remote-bb-canvas.phone-remote-bb-canvas--view-only {
  cursor: not-allowed;
  opacity: 1;
  visibility: visible;
}

.phone-remote-bb-stage--view-only .phone-remote-bb-canvas-wrap {
  opacity: 1;
}

.phone-remote-bb-viewonly-btn--active {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
}

.phone-remote-bb-stage--view-only .phone-remote-bb-paste-rail,
.phone-remote-bb-stage--view-only .phone-remote-bb-between {
  opacity: 0.72;
}

.phone-remote-bb-toolbar {
  flex-wrap: wrap;
  gap: 0.45rem;
}

.phone-remote-bb-toolbar .pr-bb-toolbar-btn,
.phone-remote-bb-toolbar .btn-primary,
.phone-remote-bb-toolbar .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pr-bb-toolbar-label {
  line-height: 1.2;
  font-weight: inherit;
}

.phone-remote-bb-toolbar #prBbConnectBtn.btn-ghost-danger {
  background: rgba(127, 29, 29, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: #ef4444;
}

.phone-remote-bb-toolbar #prBbConnectBtn.btn-ghost-danger:hover:not(:disabled) {
  background: rgba(153, 27, 27, 0.5);
  border-color: rgba(248, 113, 113, 0.85);
  color: #f87171;
}

.phone-remote-bb-toolbar #prBbConnectBtn.btn-ghost-danger .pr-bb-toolbar-icon {
  opacity: 1;
}

.pr-bb-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.82;
}

.phone-remote-bb-toolbar .btn-primary .pr-bb-toolbar-icon {
  opacity: 0.92;
}

.pr-bb-toolbar-icon-svg {
  display: block;
}

.phone-remote-bb-check-row {
  display: flex;
  align-items: flex-end;
}

.phone-remote-bb-check-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 44px;
}

.bank-tool-btn--bb-remote {
  border-color: rgba(56, 189, 248, 0.35);
}

#prBbStatus[data-kind='ok'] {
  color: var(--success, #34d399);
}

#prBbStatus[data-kind='warn'] {
  color: var(--warning, #fbbf24);
}

#prBbStatus[data-kind='error'] {
  color: var(--error, #f87171);
}

.aws-hero-pill.aws-hero-pill--ok {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.aws-hero-pill.aws-hero-pill--warn {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fcd34d;
}

/* Mode clone — double écran (Écran Clone + Écran Live) */
.phone-remote-bb-clone-card {
  margin-top: 0.75rem;
}

.phone-remote-bb-clone-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.phone-remote-bb-clone-search {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 280px;
}

.phone-remote-bb-clone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(58vh, 560px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
}

.phone-remote-bb-clone-list:empty::after {
  content: 'Aucune app — clique Scanner les apps';
  display: block;
  padding: 0.75rem 1rem;
  font-size: 13px;
  color: var(--text-muted);
}

.phone-remote-bb-clone-list-item {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 13px;
}

.phone-remote-bb-clone-list-item:hover {
  background: rgba(56, 189, 248, 0.08);
}

.phone-remote-bb-clone-list-item--selected {
  background: rgba(56, 189, 248, 0.18);
  border-left: 3px solid rgba(56, 189, 248, 0.75);
}

.phone-remote-bb-clone-list-item small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 0.15rem;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-viewer-header {
  display: none;
}

.phone-remote-bb-viewer-card--clone-active {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.phone-remote-bb-clone-pane {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #0f1218;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 0.55rem 0.65rem 0.65rem;
}

.phone-remote-bb-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.phone-remote-bb-pane-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
}

.phone-remote-bb-pane-meta {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  flex: 1 1 auto;
}

.phone-remote-bb-pane-meta--watch {
  color: #fcd34d;
}

.phone-remote-bb-clone-viewport {
  position: relative;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-remote-bb-clone-viewport--no-stream {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  background: rgba(56, 189, 248, 0.06);
  border: 1px dashed rgba(56, 189, 248, 0.28);
}

.phone-remote-bb-clone-viewport--no-stream .phone-remote-bb-clone-canvas {
  display: none;
}

.phone-remote-bb-clone-viewport--no-stream .phone-remote-bb-clone-overlay-hint {
  position: static;
  background: none;
  padding: 0;
  text-align: center;
  line-height: 1.45;
}

.phone-remote-bb-clone-viewport--has-stream {
  min-height: min(32vh, 320px);
}

.phone-remote-bb-clone-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(32vh, 320px);
  object-fit: contain;
  background: #050608;
}

.phone-remote-bb-clone-overlay-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.85);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.phone-remote-bb-clone-overlay-hint--warn {
  color: #fecaca;
  background: linear-gradient(transparent, rgba(127, 29, 29, 0.88));
}

.phone-remote-bb-clone-overlay-hint--ok {
  color: #bbf7d0;
  background: linear-gradient(transparent, rgba(20, 83, 45, 0.85));
}

.phone-remote-bb-live-wrap {
  display: block;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-live-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-pane-head--live {
  display: flex !important;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-stage {
  min-height: auto;
  align-items: flex-start;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-paste-rail {
  align-self: flex-start;
  max-height: 640px;
}

.phone-remote-bb-live-frame-hint {
  position: absolute;
  inset: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #e2e8f0;
  background: rgba(8, 10, 14, 0.84);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  z-index: 3;
  pointer-events: none;
  border-radius: 10px;
}

.phone-remote-bb-live-frame-hint[hidden] {
  display: none !important;
}

.phone-remote-bb-live-frame-hint--cover {
  inset: 0.5rem;
}

.phone-remote-bb-live-frame-hint--banner {
  inset: auto 0.5rem 0.5rem 0.5rem;
  top: auto;
  align-items: flex-end;
  justify-content: center;
  max-height: 42%;
  background: linear-gradient(transparent, rgba(8, 10, 14, 0.92));
  font-size: 0.85rem;
  z-index: 2;
  pointer-events: none;
}

.phone-remote-bb-live-frame-hint--error {
  color: #fecaca;
  background: rgba(69, 10, 10, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.45);
  font-size: 1rem;
  font-weight: 700;
  white-space: pre-line;
}

.phone-remote-bb-capture-diag {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.phone-remote-bb-capture-diag[data-state='ok'] {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.phone-remote-bb-capture-diag[data-state='fail'] {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.phone-remote-bb-capture-diag[data-state='wait'] {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.phone-remote-bb-capture-diag[hidden] {
  display: none !important;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-canvas-wrap {
  flex: 0 0 auto;
  min-height: 0;
  width: auto;
  align-self: flex-start;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-canvas {
  width: 360px;
  max-width: min(100%, 360px);
  height: auto;
  max-height: 640px;
  aspect-ratio: 360 / 640;
}

.phone-remote-bb-viewer-card--clone-active .phone-remote-bb-between {
  align-self: flex-start;
}

