/* One-shot wizard — file builder + send (session wizard) */

#home-screen.home-screen--oneshot-wide .home-inner {
  max-width: min(1280px, calc(100vw - 40px));
}

#home-step-launch.home-step-launch--oneshot {
  min-height: 0;
  overflow: hidden;
}

#home-step-launch.home-step-launch--oneshot .home-wizard-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#home-step-launch.home-step-launch--oneshot .home-wizard-progress {
  margin-bottom: 4px;
}

/* Étape envoi : la page entière défile (plus de viewport verrouillé) */
#home-screen.home-screen--oneshot-wide:has(#home-step-launch.home-step-launch--oneshot-send) {
  overflow-y: auto !important;
  overflow-x: hidden;
  padding-bottom: 28px;
}

#home-screen.home-screen--oneshot-wide:has(#home-step-launch.home-step-launch--oneshot-send) .home-inner {
  max-height: none;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send,
#home-step-launch.home-step-launch--oneshot.home-step-launch--oneshot-send {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send .home-wizard-body {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send .home-wizard-pane--oneshot-send.active {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send #launch-oneshot-send {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send .osw-send {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

#home-step-launch.home-step-launch--oneshot-send .osw-send-body {
  overflow: visible;
  flex: 0 0 auto;
  min-height: 280px;
  align-items: stretch;
}

#home-step-launch.home-step-launch--oneshot-send .osw-send-table-wrap {
  max-height: none;
  overflow: hidden;
}

#home-step-launch.home-step-launch--oneshot-send .osw-send-table-wrap--scroll {
  max-height: min(420px, 55vh);
  overflow: auto;
}

#home-step-launch.home-step-launch--oneshot-send .osw-hook-drawer {
  overflow: visible;
  min-height: 320px;
  height: auto;
}

#home-step-launch.home-step-launch--oneshot-send .osw-hook-drawer-body {
  overflow: visible;
  flex: 0 0 auto;
}

#home-step-launch.home-step-launch--oneshot-send .osw-hook-editor {
  position: static;
  flex: 0 0 auto;
  min-height: 0;
}

#home-step-launch.home-step-launch--oneshot-send .osw-hook-editor .osw-hook-input {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  min-height: 240px;
  max-height: none;
  overflow-y: auto;
  resize: vertical;
}

#launch-wizard-presets-wrap.is-hidden-oneshot {
  display: none !important;
}

.home-wizard-pane--oneshot-builder.active,
.home-wizard-pane--oneshot-send.active {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
}

#launch-oneshot-builder,
#launch-oneshot-send {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.osw-builder,
.osw-send {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.osw-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.osw-sub {
  margin: 6px 0 0;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.osw-builder-head,
.osw-send-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.osw-builder-titles {
  min-width: 200px;
  flex: 1;
}

.osw-source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: min(420px, 100%);
}

.osw-tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.osw-tab:hover {
  border-color: var(--orange, #f97316);
}

.osw-tab.active {
  border-color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 12%, var(--bg-card));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange, #f97316) 35%, transparent);
}

.osw-tab-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.osw-tab-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.osw-source-explain {
  margin: 0;
  flex-shrink: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-elevated, rgba(127, 127, 127, 0.1));
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.osw-source-explain strong {
  color: var(--text);
}

.osw-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.osw-catalog,
.osw-basket {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.osw-filters {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.osw-search-bar {
  display: flex;
  gap: 10px;
}

.osw-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.osw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
  min-width: 150px;
}

.osw-field-hint {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.osw-field-hint--warn {
  color: #9a6700;
}

.osw-input {
  border: 1px solid var(--border);
  background: var(--bg, transparent);
  color: inherit;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.98rem;
  width: 100%;
}

.osw-input--grow {
  flex: 1;
}

.osw-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

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

.osw-btn--primary {
  background: var(--orange, #f97316);
  color: #fff;
}

.osw-btn--secondary {
  background: transparent;
  border-color: var(--border);
  color: inherit;
}

.osw-btn--ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 4px;
}

.osw-results,
.osw-basket-list,
.osw-send-table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.osw-results {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osw-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
}

.osw-card:hover {
  background: var(--bg-elevated, rgba(127, 127, 127, 0.08));
}

.osw-card.is-in {
  opacity: 0.72;
  background: color-mix(in srgb, var(--orange, #f97316) 6%, transparent);
}

.osw-card-body {
  flex: 1;
  min-width: 0;
}

.osw-card-name {
  font-weight: 700;
  font-size: 1.02rem;
}

.osw-card-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osw-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.osw-tag {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-elevated, rgba(127, 127, 127, 0.12));
  color: var(--text-secondary);
}

.osw-tag--warn {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.osw-add-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.osw-add-btn:hover:not(:disabled) {
  border-color: var(--orange, #f97316);
  color: var(--orange, #f97316);
}

.osw-add-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.osw-basket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.osw-basket-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.osw-basket-caption {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.osw-basket-count {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--orange, #f97316);
  color: #fff;
  border-radius: 999px;
  min-width: 34px;
  text-align: center;
  padding: 5px 10px;
  font-size: 0.95rem;
}

.osw-basket-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.osw-basket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  background: var(--bg-elevated, rgba(127, 127, 127, 0.07));
}

.osw-basket-item strong {
  display: block;
  font-size: 0.95rem;
}

.osw-basket-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.osw-basket-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.osw-icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.osw-clear {
  margin: 4px 16px 14px;
  align-self: flex-start;
  flex-shrink: 0;
}

.osw-empty {
  padding: 40px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Chargement vue envoi — animation + chronomètre */
.osw-send--loading {
  gap: 18px;
  max-width: min(920px, 100%);
  margin: 0 auto;
  width: 100%;
  padding: 8px 0 24px;
}

.osw-load-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(
      120% 160% at 0% 0%,
      color-mix(in srgb, var(--orange, #f97316) 14%, transparent),
      transparent 55%
    ),
    var(--bg-card);
}

.osw-load-orb {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.osw-load-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--orange, #f97316) 35%, transparent);
  border-top-color: var(--orange, #f97316);
  animation: osw-orb-spin 0.85s linear infinite;
}

.osw-load-orb-ring--2 {
  inset: 8px;
  border-width: 2px;
  border-top-color: color-mix(in srgb, var(--orange, #f97316) 70%, white);
  border-right-color: transparent;
  animation-duration: 1.25s;
  animation-direction: reverse;
}

.osw-load-orb-core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    color-mix(in srgb, var(--orange, #f97316) 85%, white),
    var(--orange, #f97316)
  );
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange, #f97316) 45%, transparent);
  animation: osw-orb-pulse 1.4s ease-in-out infinite;
}

.osw-load-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.osw-load-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange, #f97316);
}

.osw-load-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.osw-load-skel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
}

.osw-load-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--border) 35%, transparent);
  animation: osw-skel-wave 1.35s ease-in-out infinite;
}

.osw-load-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--border) 80%, transparent) 0%,
    color-mix(in srgb, var(--orange, #f97316) 18%, var(--border)) 50%,
    color-mix(in srgb, var(--border) 80%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: osw-skel-shimmer 1.2s ease-in-out infinite;
}

.osw-load-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.osw-load-line,
.osw-load-pill {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--border) 70%, transparent) 0%,
    color-mix(in srgb, var(--orange, #f97316) 16%, var(--border)) 50%,
    color-mix(in srgb, var(--border) 70%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: osw-skel-shimmer 1.2s ease-in-out infinite;
}

.osw-load-line--lg {
  width: 72%;
  height: 12px;
}

.osw-load-line--sm {
  width: 48%;
  animation-delay: 0.12s;
}

.osw-load-line--mail {
  width: 88%;
  animation-delay: 0.08s;
}

.osw-load-pill {
  width: 100%;
  height: 22px;
  animation-delay: 0.18s;
}

@keyframes osw-orb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes osw-orb-pulse {
  0%,
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange, #f97316) 40%, transparent);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--orange, #f97316) 0%, transparent);
  }
}

@keyframes osw-skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes osw-skel-wave {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .osw-load-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .osw-load-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .osw-load-line--mail,
  .osw-load-pill {
    display: none;
  }
}

.osw-send-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.osw-send-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.osw-send-settings-grid > .osw-field {
  min-width: 0;
  flex: none;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
}

.osw-send-settings-grid > .osw-field:first-child {
  padding-left: 0;
}

.osw-send-settings-grid > .osw-field:last-child {
  padding-right: 0;
  border-right: none;
}

.osw-send-settings-grid .osw-input {
  min-height: 46px;
  box-sizing: border-box;
}

.osw-send-settings .osw-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Aperçu prévisionnel de l’e-mail */
.osw-mail-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
  flex-shrink: 0;
}

.osw-mail-preview--empty {
  border-style: dashed;
  background: color-mix(in srgb, var(--bg-surface) 80%, transparent);
}

.osw-mail-preview-empty {
  padding: 18px 16px;
  text-align: left;
}

.osw-mail-preview-empty strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.osw-mail-preview-empty p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.osw-mail-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 65%, transparent);
}

.osw-mail-preview.is-collapsed .osw-mail-preview-head {
  border-bottom: none;
}

.osw-mail-preview-kicker {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.osw-mail-preview-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.osw-mail-preview-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.osw-mail-preview-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.osw-mail-preview-who .osw-input {
  min-width: 160px;
  max-width: 220px;
  min-height: 34px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.osw-btn--sm {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.osw-mail-preview-frame {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.osw-mail-preview-headers {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.osw-mail-preview-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.osw-mail-preview-row:last-child {
  border-bottom: none;
}

.osw-mail-preview-row > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.osw-mail-preview-row > strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.osw-mail-preview-row--meta > em {
  font-style: normal;
  font-size: 0.84rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.osw-mail-preview-hint {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

.osw-mail-preview-hint--danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border-bottom-color: rgba(239, 68, 68, 0.28);
}

.osw-toolbar-meta--warn {
  color: #ef4444;
  font-weight: 600;
}

.osw-mail-preview-body {
  padding: 16px 18px;
  max-height: min(360px, 42vh);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: #fff;
}

.osw-mail-preview-body a {
  color: var(--orange, #f97316);
  text-decoration: underline;
}

.osw-mail-preview-empty-body {
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .osw-mail-preview-head {
    flex-direction: column;
  }

  .osw-mail-preview-tools {
    width: 100%;
    justify-content: space-between;
  }

  .osw-mail-preview-who {
    flex: 1;
    min-width: 0;
  }

  .osw-mail-preview-who .osw-input {
    flex: 1;
    max-width: none;
  }
}

.osw-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.osw-tag-chip {
  border: 1px solid var(--border);
  background: var(--bg, transparent);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.osw-tag-chip:hover {
  border-color: var(--orange, #f97316);
  color: var(--text);
}

.osw-tag-chip.active {
  border-color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 14%, var(--bg-card));
  color: var(--text);
}

.osw-followup-control,
.osw-followup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, transparent);
}

.osw-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 10px;
}

.osw-check--inline {
  padding-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.osw-days-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
}

.osw-days-wrap.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.osw-input--days {
  width: 56px;
  height: 32px;
  text-align: center;
  padding: 4px 6px;
  flex: 0 0 auto;
  min-width: 0;
  border-radius: 8px;
}

.osw-send-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.osw-warn {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.osw-send-table-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 0;
  background: var(--bg-card);
  overflow: hidden;
}

.osw-send-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.osw-send-list .osw-send-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.osw-send-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.osw-send-table th,
.osw-send-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.osw-send-table tbody tr:last-child td {
  border-bottom: none;
}

.osw-send-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-card);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.osw-send-table--dense th,
.osw-send-table--dense td {
  padding: 8px 12px;
}

.osw-contacts-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: -1px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--border));
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.osw-send-list:has(.osw-contacts-toggle) .osw-send-table-wrap {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.osw-contacts-toggle:hover {
  background: color-mix(in srgb, var(--orange, #f97316) 10%, var(--bg-card));
  color: inherit;
}

.osw-hook-cell {
  max-width: 320px;
  color: var(--text-secondary);
}

.osw-send--progress,
.osw-send--done {
  max-width: min(1100px, 100%);
  margin: 0 auto;
  width: 100%;
  overflow: auto;
  padding: 6px 0 16px;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.osw-send--done {
  align-items: stretch;
}

/* Vague terminée : un seul Retour (dock), pas le lien haut */
#home-step-launch.home-step-launch--oneshot-done > .home-back {
  display: none;
}

#home-step-launch.home-step-launch--oneshot-sending > .home-back {
  display: none;
}

.osw-done-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
  flex-shrink: 0;
}

.osw-done-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange, #f97316);
}

.osw-done-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 84px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.osw-done-score-value {
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.osw-done-score-label {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.osw-done-score.is-good .osw-done-score-value { color: #059669; }
.osw-done-score.is-mid .osw-done-score-value { color: var(--orange, #f97316); }
.osw-done-score.is-low .osw-done-score-value { color: #dc2626; }

.osw-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0;
  flex-shrink: 0;
}

.osw-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.osw-stat-value {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.osw-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.osw-stat--ok .osw-stat-value { color: #059669; }
.osw-stat--err .osw-stat-value { color: #dc2626; }
.osw-stat--accent .osw-stat-value { color: var(--orange, #f97316); }

.osw-progress-track {
  height: 12px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.osw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-hover, #ea580c) 100%);
  transition: width 0.25s ease;
}

.osw-done-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex-shrink: 0;
}

.osw-done-meta-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.osw-done-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.osw-done-meta-item strong {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.osw-done-reasons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.osw-done-reasons-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-muted);
}

.osw-reason-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, rgba(127, 127, 127, 0.08));
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.osw-done-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  flex-shrink: 0;
}

.osw-done-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.osw-done-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.osw-done-tab span {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-elevated, rgba(127, 127, 127, 0.12));
  font-size: 0.78rem;
}

.osw-done-tab.active {
  color: var(--text);
  border-bottom-color: var(--orange, #f97316);
}

.osw-done-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--orange, #f97316) 6%, transparent);
}

.osw-done-table-wrap {
  max-height: min(38vh, 380px);
  overflow: auto;
}

.osw-done-detail-cell {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.35;
}

.osw-done-status-cell {
  width: 1%;
  white-space: nowrap;
}

.osw-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.osw-pill--ok {
  color: #047857;
  background: rgba(5, 150, 105, 0.12);
}

.osw-pill--err {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
}

.osw-pill--mute {
  color: var(--text-muted);
  background: var(--bg-elevated, rgba(127, 127, 127, 0.12));
}

.osw-done-actions {
  display: none; /* actions dans le dock wizard */
}

.osw-done-followup {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--orange, #f97316) 35%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--orange, #f97316) 8%, var(--bg-card));
  flex-shrink: 0;
}

.osw-done-followup-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.osw-done-followup-copy strong {
  font-size: 0.95rem;
  font-weight: 650;
}

.osw-done-followup-copy span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.osw-done-followup-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.osw-done-action-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.osw-row-action {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated, rgba(127, 127, 127, 0.08));
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.osw-row-action:hover {
  border-color: var(--orange, #f97316);
  color: var(--orange, #f97316);
}

.osw-guard-row.is-locked {
  opacity: 0.92;
}

.osw-guard-row.is-locked .osw-guard-row-main {
  cursor: default;
}

.osw-guard-row.is-locked input[type="checkbox"]:disabled {
  opacity: 1;
  cursor: default;
}

@media (max-width: 720px) {
  .osw-done-followup {
    flex-direction: column;
  }

  .osw-done-followup-btns {
    width: 100%;
    justify-content: stretch;
  }

  .osw-done-followup-btns .osw-btn {
    flex: 1 1 auto;
  }
}

.osw-sector-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
  background: var(--bg-card, #fff);
  color: inherit;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.osw-sector-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.osw-sector-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
}

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

.osw-sector-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.osw-sector-head p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.osw-sector-close {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
}

.osw-sector-msg {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.osw-sector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.osw-sector-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Garde-fous (étape envoi) */
.osw-guardrails {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
  flex-shrink: 0;
}

.osw-guardrails-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.osw-guardrails-toggle:hover {
  background: color-mix(in srgb, var(--orange, #f97316) 5%, transparent);
}

.osw-guardrails-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.osw-guardrails-toggle-label strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.osw-guardrails-toggle-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.osw-guardrails-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.osw-guardrails-body {
  border-top: 1px solid var(--border);
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osw-guardrails-intro {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.osw-guard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.osw-guard-row:hover {
  border-color: var(--border);
  background: var(--bg-elevated, rgba(127, 127, 127, 0.06));
}

.osw-guard-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.osw-guard-row-main input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.osw-guard-row-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.osw-guard-row-copy strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.osw-guard-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.osw-guard-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.osw-guard-num.is-disabled {
  opacity: 0.45;
}

.osw-guard-num .osw-input--days {
  width: 4.2rem;
}

.osw-progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.osw-progress-current {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.osw-live-feed {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 14px 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.osw-live-feed h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.osw-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(36vh, 360px);
  overflow: auto;
}

.osw-live-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-elevated, rgba(127, 127, 127, 0.06));
}

.osw-live-status {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.osw-live-item--ok .osw-live-status { color: #059669; }
.osw-live-item--err .osw-live-status { color: #dc2626; }
.osw-live-item--mute .osw-live-status { color: var(--text-muted); }

.osw-live-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.osw-live-body strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.osw-live-body span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.osw-live-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .osw-send-settings-grid {
    grid-template-columns: 1fr;
  }
  .osw-send-settings-grid > .osw-field {
    padding: 12px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .osw-send-settings-grid > .osw-field:first-child {
    padding-top: 0;
  }
  .osw-send-settings-grid > .osw-field:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
  .osw-done-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .osw-progress-stats,
  .osw-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .osw-done-meta {
    grid-template-columns: 1fr;
  }
}

/* Sélecteur de listes (étape 2 one-shot) */
.osw-picker {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}

.osw-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.osw-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.osw-list-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  border-radius: 16px;
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.osw-list-card:hover {
  border-color: var(--orange, #f97316);
}

.osw-list-card.active {
  border-color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 12%, var(--bg-card));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange, #f97316) 35%, transparent);
}

.osw-list-card-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.osw-list-card-count {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.osw-list-card--create {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--orange, #f97316) 45%, var(--border));
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--orange, #f97316) 10%, var(--bg-card)) 0%,
      var(--bg-card) 55%
    );
  min-height: 108px;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.osw-list-card--create:hover {
  border-color: var(--orange, #f97316);
  border-style: dashed;
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--orange, #f97316) 16%, var(--bg-card)) 0%,
      var(--bg-card) 60%
    );
  box-shadow: 0 8px 24px color-mix(in srgb, var(--orange, #f97316) 14%, transparent);
  transform: translateY(-1px);
}

.osw-list-card-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 12px;
  color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 14%, transparent);
}

.osw-list-card--create .osw-list-card-name {
  color: var(--orange, #f97316);
}

.osw-list-card--create .osw-list-card-count {
  font-weight: 500;
  color: var(--text-muted);
}

.osw-picker-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 920px) {
  .osw-builder-grid {
    grid-template-columns: 1fr;
  }

  .osw-basket {
    max-height: 34vh;
  }

  .osw-source-tabs {
    width: 100%;
    min-width: 0;
  }
}

/* Étape envoi : Retour + Envoyer alignés dans le dock */
#home-step-launch.home-step-launch--oneshot-send .home-wizard-nav--dock {
  justify-content: stretch;
}

#home-step-launch.home-step-launch--oneshot-send .home-wizard-nav--dock .home-btn-secondary,
#home-step-launch.home-step-launch--oneshot-send .home-wizard-nav--dock .home-btn-primary {
  flex: 1 1 0;
  min-width: 0;
}

.osw-toolbar-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.osw-recipients {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 2px;
}

.osw-recipient {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osw-recipient-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.osw-recipient-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.osw-recipient-who strong {
  font-size: 0.98rem;
}

.osw-recipient-who span,
.osw-recipient-mail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.osw-news-hint {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--orange, #f97316) 8%, transparent);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.osw-news-hint span {
  font-weight: 700;
  color: var(--orange, #f97316);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  margin-right: 6px;
}

.osw-style-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.osw-style-chip {
  border: 1px solid var(--border);
  background: var(--bg, transparent);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.osw-style-chip.active {
  border-color: var(--orange, #f97316);
  color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 12%, transparent);
}

.osw-hook-input {
  width: 100%;
  resize: none;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, transparent);
  color: inherit;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  font-family: inherit;
  box-sizing: border-box;
}

.osw-hook-input:focus {
  outline: none;
  border-color: var(--orange, #f97316);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange, #f97316) 18%, transparent);
}

.osw-btn--block {
  width: 100%;
  justify-content: center;
}

/* Envoi — tableau dense + tiroir d’édition */
.osw-send-body {
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.osw-send--with-drawer .osw-send-table-wrap {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
}

.osw-send--with-drawer .osw-send-list {
  flex: 1 1 58%;
  min-width: 0;
  align-self: stretch;
}

.osw-send--with-drawer .osw-hook-drawer {
  flex: 0 0 min(400px, 44%);
  align-self: stretch;
}

.osw-send-table--dense {
  font-size: 0.88rem;
  table-layout: fixed;
  width: 100%;
}

.osw-send-table--dense th,
.osw-send-table--dense td {
  padding: 8px 12px;
  vertical-align: middle;
}

.osw-send-table--dense th:nth-child(1),
.osw-send-table--dense td.osw-col-contact {
  width: 38%;
}

.osw-send-table--dense th:nth-child(2),
.osw-send-table--dense td.osw-col-mail {
  width: 24%;
}

.osw-send-table--dense th:nth-child(3),
.osw-send-table--dense td.osw-col-hook {
  width: 38%;
}

.osw-send-table--dense.osw-send-table--auto th:nth-child(1),
.osw-send-table--dense.osw-send-table--auto td.osw-col-contact {
  width: 30%;
}

.osw-send-table--dense.osw-send-table--auto th:nth-child(2),
.osw-send-table--dense.osw-send-table--auto td.osw-col-mail {
  width: 22%;
}

.osw-send-table--dense.osw-send-table--auto th:nth-child(3),
.osw-send-table--dense.osw-send-table--auto td.osw-col-tmpl {
  width: 18%;
}

.osw-send-table--dense.osw-send-table--auto th:nth-child(4),
.osw-send-table--dense.osw-send-table--auto td.osw-col-hook {
  width: 30%;
}

.osw-tmpl-chip {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--orange, #f97316) 35%, var(--border));
  background: color-mix(in srgb, var(--orange, #f97316) 8%, transparent);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.osw-tmpl-miss {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9a6700;
  white-space: nowrap;
}

.osw-send-table--dense tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.osw-send-table--dense tbody tr:hover {
  background: color-mix(in srgb, var(--orange, #f97316) 7%, transparent);
}

.osw-send-table--dense tbody tr.is-editing {
  background: color-mix(in srgb, var(--orange, #f97316) 12%, transparent);
}

.osw-row-name {
  font-weight: 650;
  line-height: 1.25;
}

.osw-row-meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: none;
}

.osw-row-mail {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.osw-hook-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.osw-row-hook {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: none;
}

.osw-hook-gen-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--bg-card, #fff);
  color: var(--orange, #f97316);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
}

.osw-hook-gen-btn:hover:not(:disabled) {
  border-color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 10%, transparent);
}

.osw-hook-gen-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.osw-muted {
  color: var(--text-muted);
}

.osw-bulk-styles {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.osw-bulk-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.osw-hook-drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.osw-hook-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.osw-hook-drawer-kicker {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange, #f97316);
}

.osw-hook-drawer-who {
  min-width: 0;
}

.osw-hook-drawer-who strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

.osw-hook-drawer-who span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.osw-hook-drawer-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.osw-hook-drawer-close:hover {
  border-color: var(--orange, #f97316);
  color: var(--text);
}

.osw-hook-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px;
}

.osw-angle-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
}

.osw-angle-btn {
  border: 1px solid var(--border);
  background: var(--bg, transparent);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.osw-angle-btn:hover {
  border-color: var(--orange, #f97316);
  color: var(--text);
}

.osw-angle-btn.is-active {
  border-color: var(--orange, #f97316);
  color: var(--orange, #f97316);
  background: color-mix(in srgb, var(--orange, #f97316) 12%, transparent);
}

.osw-hook-editor {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
}

.osw-hook-editor .osw-hook-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, #fff);
  color: inherit;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  font-family: inherit;
  box-sizing: border-box;
  overflow: auto;
}

.osw-hook-editor .osw-hook-input:focus {
  outline: none;
  border-color: var(--orange, #f97316);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange, #f97316) 18%, transparent);
}

.osw-hook-editor .osw-hook-input[readonly] {
  opacity: 0.7;
}

.osw-hook-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
}

.osw-drawer-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

@media (max-width: 900px) {
  .osw-send-body {
    flex-direction: column;
  }
  .osw-send--with-drawer .osw-hook-drawer {
    flex: 0 0 auto;
    min-height: 320px;
    max-height: 55vh;
  }
  .osw-row-mail {
    max-width: 100%;
  }
}
