:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #1f2523;
  --muted: #62706a;
  --line: #dfe6df;
  --line-strong: #c9d3ca;
  --green: #2f7a5b;
  --green-dark: #21563f;
  --blue: #2a638d;
  --purple: #6f3bb2;
  --coral: #b95c51;
  --amber: #a87422;
  --shadow: 0 18px 55px rgba(31, 37, 35, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

body.has-launch-gate {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.launch-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(238, 247, 241, 0.96), rgba(244, 246, 243, 0.98)),
    var(--bg);
  padding: 34px;
}

.launch-gate[hidden] {
  display: none;
}

.launch-gate-shell {
  display: grid;
  width: min(1060px, 100%);
  min-height: min(640px, calc(100vh - 68px));
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  overflow: hidden;
  border: 1px solid #d7e2d8;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(31, 37, 35, 0.16);
}

.launch-brand-panel,
.launch-login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
}

.launch-brand-panel {
  align-items: flex-start;
  gap: 14px;
  background: #f6faf7;
  border-right: 1px solid #dce7dd;
}

.launch-logo {
  width: min(100%, 440px);
  height: auto;
}

.launch-kicker {
  margin: -6px 0 0 10ch;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.launch-brand-panel h1 {
  max-width: 15ch;
  margin: 30px 0 0;
  color: #1f2b25;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.launch-brand-panel p:not(.launch-kicker) {
  max-width: 46ch;
  margin: 0;
  color: #48554e;
  font-size: 15px;
  font-weight: 650;
}

.launch-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.launch-status-stack span,
.launch-status-stack button {
  border: 1px solid #cfddd2;
  border-radius: 999px;
  background: #ffffff;
  color: #435047;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

.launch-status-stack button {
  cursor: pointer;
  font: inherit;
}

.launch-status-stack button:hover {
  border-color: #b9cdbc;
  background: #f4faf5;
}

.launch-status-stack span.is-ready,
.launch-status-stack button.is-ready {
  border-color: rgba(47, 122, 91, 0.28);
  background: #edf8f0;
  color: var(--green-dark);
}

.launch-gate.is-splash .launch-gate-shell {
  width: min(620px, 100%);
  min-height: min(460px, calc(100vh - 68px));
  grid-template-columns: 1fr;
}

.launch-gate.is-splash .launch-brand-panel {
  align-items: center;
  border-right: 0;
  text-align: center;
}

.launch-gate.is-splash .launch-login-panel,
.launch-gate.is-splash .launch-status-stack {
  display: none;
}

.launch-login-panel {
  display: grid;
  align-items: center;
  gap: 18px;
  position: relative;
}

.launch-step {
  grid-area: 1 / 1;
  display: grid;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.launch-step.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.launch-step-copy {
  display: grid;
  gap: 6px;
}

.launch-step-copy .eyebrow {
  margin: 0;
}

.launch-step-copy h2 {
  margin: 0;
  color: #1f2b25;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.launch-connected-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid rgba(47, 122, 91, 0.22);
  border-radius: 999px;
  background: #edf8f0;
  color: var(--green-dark);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 850;
  width: fit-content;
}

button.launch-connected-email {
  cursor: pointer;
  font: inherit;
}

button.launch-connected-email:hover {
  border-color: rgba(47, 122, 91, 0.42);
  background: #e4f4e8;
}

.launch-login-panel .field-label {
  display: grid;
  gap: 7px;
}

.launch-login-panel input {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: var(--ink);
  padding: 10px 12px;
}

.launch-actions {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.launch-actions .button {
  width: 100%;
}

.launch-enter-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.google-login-button {
  min-height: 52px;
  border-color: #d5ddd7;
  background: #ffffff;
  color: #1f2523;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(31, 37, 35, 0.08);
}

.google-login-button:hover {
  border-color: #b8c9bd;
  background: #f8fbf8;
}

.google-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.google-mark svg {
  width: 22px;
  height: 22px;
  stroke: none;
}

.launch-helper {
  min-height: 42px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.launch-oauth-setup {
  display: grid;
  gap: 11px;
  border: 1px solid #d8e3da;
  border-radius: var(--radius);
  background: #f8fbf8;
  padding: 12px;
}

.launch-oauth-setup[hidden] {
  display: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
  padding: 24px 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
  flex: 0 0 auto;
}

.brand-subtitle {
  display: block;
  white-space: nowrap;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  margin-left: 9ch;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #3b4540;
  padding: 11px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: #cddbd0;
  background: #eef6ef;
  color: var(--green-dark);
}

.nav-item.has-unpopulated-draft {
  color: #9a332a;
  font-weight: 800;
}

.nav-item.has-unpopulated-draft:hover,
.nav-item.has-unpopulated-draft.is-active {
  border-color: #e2b8b2;
  background: #fff3f1;
  color: #9a332a;
}

.icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
}

.connection-block {
  display: grid;
  gap: 8px;
}

.setup-tabs {
  margin-top: -16px;
}

.connection-block h2 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
}

.connection-row strong {
  color: #7b3d35;
  font-size: 12px;
}

.connection-row.is-ready strong {
  color: var(--green-dark);
}

.connection-row.is-ready .status-dot {
  background: var(--green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--coral);
}

.sidebar-footer {
  margin-top: auto;
}

.security-chip,
.check-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d4d9d2;
  border-radius: 999px;
  background: #ffffff;
  color: #435047;
  padding: 7px 11px;
  font-size: 13px;
  white-space: nowrap;
}

.security-chip svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 22px;
  max-width: 1240px;
}

.topbar-title {
  display: grid;
  gap: 4px;
}

.topbar-title .eyebrow {
  margin: 0;
}

.desktop-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(201, 211, 202, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  padding: 4px;
  box-shadow: 0 8px 22px rgba(31, 37, 35, 0.08);
}

.desktop-window-controls[hidden] {
  display: none;
}

.desktop-window-controls button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3b4540;
  padding: 0;
}

.desktop-window-controls button:hover {
  background: #eef6ef;
  color: var(--green-dark);
}

.desktop-window-controls button:last-child:hover {
  background: #fff1ef;
  color: #9a332a;
}

.desktop-window-controls svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 730;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  font-weight: 700;
}

.button:hover,
.icon-button:hover {
  border-color: #abc4b0;
  background: #f5faf6;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.button.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: buttonSpin 0.7s linear infinite;
}

.button.is-busy .button-spinner {
  display: inline-block;
}

.button.is-busy .search-icon {
  display: none;
}

@keyframes buttonSpin {
  to {
    transform: rotate(360deg);
  }
}

.button.ghost {
  color: #33413b;
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.panel-primary-action {
  min-height: 46px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 850;
}

.result-actions .panel-primary-action,
.lead-finder-actions .panel-primary-action {
  min-width: 184px;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.tab-panel {
  max-width: 1240px;
  margin: 0 auto;
}

.filter-grid,
.workspace-grid,
.style-grid,
.new-leads-grid {
  display: grid;
  gap: 16px;
}

.auth-panel {
  margin-bottom: 16px;
}

.setup-section-heading {
  margin: 22px 0 10px;
}

.setup-section-heading h2 {
  margin: 0;
  color: #26352d;
  font-size: 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(230px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.auth-grid label {
  display: grid;
  gap: 7px;
  color: #3d4842;
  font-size: 13px;
  font-weight: 700;
}

.sender-profile-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.sender-profile-link-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
}

.profile-link-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.42fr) auto;
  gap: 10px;
  align-items: end;
}

.profile-link-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.profile-link-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #3a473f;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 820;
}

.profile-link-checks input {
  width: auto;
  accent-color: var(--green);
}

.sender-profile-roles-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
}

.setup-state {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #dcc7c3;
  border-radius: 999px;
  background: #fff3f1;
  color: #7b3d35;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.setup-state.is-ready {
  border-color: #c6d7ca;
  background: #edf7ef;
  color: var(--green-dark);
}

.setup-state.is-warning {
  border-color: #ecc58b;
  background: #fff3df;
  color: #8a520f;
}

.gmail-fallback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.gmail-fallback-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gpt-setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.gpt-setup-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gpt-setup-row strong {
  color: #2f3b35;
  font-size: 13px;
}

.gpt-setup-row span {
  color: var(--muted);
  font-size: 13px;
}

.gpt-setup-row code {
  border: 1px solid #d6ded7;
  border-radius: 6px;
  background: #ffffff;
  color: #244f3d;
  padding: 1px 5px;
}

.mailout-safety-grid {
  align-items: end;
}

.mode-switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-switch {
  position: relative;
  display: inline-flex;
  width: 68px;
  height: 34px;
  flex: 0 0 auto;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  width: 100%;
  border: 1px solid #c8d4ca;
  border-radius: 999px;
  background: #eaf5ec;
  transition: background 160ms ease, border-color 160ms ease;
}

.mode-switch span::after {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.mode-switch input:checked + span {
  border-color: #e8b36b;
  background: #fff0d7;
}

.mode-switch input:checked + span::after {
  transform: translateX(34px);
  background: var(--amber);
}

.wide-check {
  grid-column: 1 / -1;
}

.gmail-connect-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.connected-account-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.connected-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: #34413a;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
}

.connected-account-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.connected-account-row strong {
  color: var(--green-dark);
  font-size: 11px;
  text-transform: uppercase;
}

.connected-account-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.disconnect-account-button {
  font-size: 12px;
}

.account-filter-panel {
  grid-column: 1 / -1;
}

.inline-warning {
  margin: 8px 0 0;
  color: #8a4037;
  font-size: 12px;
  font-weight: 800;
}

.oauth-help {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.oauth-help summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #2f3b35;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 10px 12px;
}

.oauth-help summary::-webkit-details-marker {
  display: none;
}

.oauth-help summary svg {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.oauth-help[open] summary svg {
  transform: rotate(180deg);
}

.oauth-help ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 16px 12px 32px;
  color: #4f5d57;
  font-size: 13px;
}

.oauth-help p {
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px 12px;
}

.oauth-help code {
  border: 1px solid #d6ded7;
  border-radius: 6px;
  background: #ffffff;
  color: #244f3d;
  padding: 1px 5px;
}

.auth-panel.is-pulsing {
  animation: setupPulse 900ms ease-in-out 2;
}

@keyframes setupPulse {
  0%,
  100% {
    border-color: var(--line);
    box-shadow: var(--shadow);
  }

  45% {
    border-color: #63a878;
    box-shadow:
      0 0 0 4px rgba(47, 122, 91, 0.16),
      0 18px 55px rgba(31, 37, 35, 0.12);
  }
}

.filter-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  margin-bottom: 16px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.36fr);
}

.workspace-grid.results-only {
  grid-template-columns: minmax(0, 1fr);
}

.style-grid {
  grid-template-columns: minmax(290px, 0.75fr) minmax(320px, 1fr);
}

.draft-page-grid {
  display: grid;
  gap: 16px;
}

.draft-lead-selector {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  align-items: end;
  gap: 7px;
  padding: 12px;
  color: #3d4842;
  font-size: 13px;
  font-weight: 800;
}

.draft-lead-select-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.draft-preview-lead-selector {
  grid-template-columns: auto minmax(280px, 460px) minmax(360px, 1fr);
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 0 2px;
}

.draft-preview-lead-selector .draft-lead-nav {
  justify-content: flex-start;
}

.draft-preview-lead-selector .draft-output-options {
  width: 100%;
  grid-template-columns: repeat(2, minmax(144px, 1fr));
  justify-content: flex-start;
}

.draft-lead-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.draft-lead-count {
  color: #2f3f36;
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.draft-lead-arrows {
  display: inline-flex;
  gap: 8px;
}

.draft-lead-arrow {
  width: 50px;
  min-height: 46px;
  border-color: #2f7a5b;
  background: #2f7a5b;
  color: #ffffff;
  padding: 9px;
}

.draft-lead-arrow:hover {
  border-color: #255f48;
  background: #255f48;
}

.draft-lead-arrow:disabled {
  border-color: #d5ddd7;
  background: #eef3ef;
  color: #92a096;
  cursor: not-allowed;
}

.draft-hero-panel {
  display: grid;
  gap: 14px;
}

.draft-hero-panel .draft-preview-heading {
  margin-top: 0;
}

.draft-version-control {
  display: grid;
  width: min(475px, 42vw);
  align-items: start;
  justify-content: flex-end;
  gap: 6px;
}

.draft-write-controls > .draft-version-control {
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  justify-content: stretch;
}

.draft-write-controls > .draft-version-control .draft-version-select-row {
  grid-column: span 3;
}

.draft-version-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.draft-version-control select,
.draft-version-control input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
}

.draft-version-select-row {
  grid-template-columns: 34px minmax(0, 1fr);
}

.draft-version-select-row select {
  border-color: #2f7a5b;
  background: #f3faf5;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.1);
  color: #1f513c;
  font-weight: 800;
}

.draft-version-new-button {
  width: 34px;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px;
}

.save-template-dialog {
  width: min(460px, 100%);
}

.save-template-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.draft-intro-dialog {
  width: min(480px, 100%);
  display: grid;
  grid-template-rows: minmax(92px, 1fr) auto auto;
  gap: 12px;
}

.draft-intro-dialog .send-confirm-summary {
  align-self: center;
  justify-self: center;
  max-width: 34ch;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.draft-intro-dialog .helper-bullet-list {
  max-width: 38ch;
  padding-left: 22px;
  text-align: left;
}

.draft-intro-dialog .helper-bullet-list li + li {
  margin-top: 8px;
}

.draft-intro-dialog .send-confirm-actions {
  justify-content: center;
  margin-top: 0;
}

.draft-intro-check {
  justify-self: end;
  min-height: 24px;
  gap: 5px;
  margin-top: 0;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.draft-intro-check input {
  width: 12px;
  height: 12px;
}

.draft-output-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(158px, 176px));
  align-items: stretch;
  justify-content: flex-end;
  gap: 7px;
}

.draft-output-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  max-width: none;
  min-height: 40px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #ffffff;
  color: #3a473f;
  padding: 7px 9px;
  cursor: pointer;
}

.draft-output-option.is-selected {
  border-color: #2f7a5b;
  background: #f3faf5;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.1);
}

.draft-output-option input {
  margin-top: 2px;
  accent-color: #2f7a5b;
}

.draft-output-option-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.draft-output-option-title {
  color: #2e3d35;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.draft-output-file {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #66736b;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.25;
}

.draft-output-file svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #2f7a5b;
}

.draft-output-file.is-missing svg {
  color: #a05b45;
}

.draft-output-filename {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-hero-output {
  min-height: clamp(420px, 48vh, 640px);
  margin-top: 0;
  background: #ffffff;
  font-size: 14px;
}

.draft-write-controls {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.form-grid.draft-control-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
}

.draft-control-grid label {
  min-width: 0;
}

.draft-tone-field,
.draft-angle-field {
  grid-column: span 3;
}

.draft-range-field {
  grid-column: span 3;
}

.draft-control-grid .draft-availability-field {
  grid-column: span 2;
  max-width: none;
  align-self: stretch;
}

.draft-output-options .draft-availability-field {
  max-width: none;
  align-self: auto;
}

.draft-control-grid input[type="range"] {
  min-height: 38px;
}

.draft-ai-button {
  width: min(240px, 100%);
}

.draft-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-self: start;
}

.refine-toggle-button[hidden] {
  display: none;
}

.draft-profile-link-field {
  margin-top: 14px;
}

.draft-profile-style-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(340px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.draft-resource-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(250px, 0.82fr) minmax(340px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.new-leads-grid {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
}

.draft-panel {
  grid-column: 1 / -1;
}

.profile-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sender-profile-summary {
  display: grid;
  gap: 10px;
}

.sender-profile-summary div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.sender-profile-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sender-profile-summary strong {
  min-width: 0;
  color: #24302b;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.sender-role-builder {
  margin-top: 14px;
}

.sender-role-builder .chip-input {
  background: #fbfcfa;
}

.helper-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.signature-panel {
  align-self: start;
}

.document-panel {
  align-self: start;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.document-status {
  margin: -4px 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 680;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.document-status.is-searching {
  border-color: #eadf9a;
  background: #fff8c9;
  color: #6e5c12;
}

.document-status.is-found {
  border-color: #b7d8bf;
  background: #e8f7eb;
  color: #28583a;
}

.signature-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.document-list {
  display: grid;
  gap: 10px;
  max-height: 310px;
  overflow: auto;
}

.signature-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 11px;
}

.signature-card.is-selected {
  border-color: #63a878;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.12);
}

.document-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 11px;
}

.document-card.is-selected {
  border-color: #7c6ac7;
  box-shadow: 0 0 0 3px rgba(124, 106, 199, 0.13);
}

.signature-card input {
  margin-top: 4px;
  accent-color: var(--green);
}

.document-card input {
  margin-top: 4px;
  accent-color: #6c58b7;
}

.signature-card-body {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.document-card-body {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.signature-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.document-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.signature-card-meta strong {
  color: #2b4638;
  overflow-wrap: anywhere;
}

.document-card-meta strong {
  color: #3b3464;
  overflow-wrap: anywhere;
}

.document-card p {
  display: -webkit-box;
  margin: 0;
  color: #445049;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.signature-preview {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
  color: #26322d;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.signature-preview img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cfd8d0;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.field-label,
.form-grid label,
.inline-fields label,
.range-grid label {
  display: grid;
  gap: 7px;
  color: #3d4842;
  font-size: 13px;
  font-weight: 700;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.field-label {
  margin: 12px 0 7px;
}

.chip-input {
  display: flex;
  min-height: 46px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 8px;
}

.chip-input.tall {
  min-height: 96px;
  align-content: start;
}

.chips {
  display: contents;
}

.chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid #c6d7ca;
  border-radius: 999px;
  background: #edf7ef;
  color: #244f3d;
  padding: 4px 8px 4px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.chip:active {
  cursor: grabbing;
}

.chip.is-dragging {
  opacity: 0.45;
}

.chip.is-drop-target {
  border-color: #2f7a5b;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.14);
}

.chip[data-tone="attachment"] {
  border-color: #d9caac;
  background: #fff7e5;
  color: #604618;
}

.chip[data-tone="warning"] {
  border-color: #e2b8b2;
  background: #fff3f1;
  color: #8a4037;
}

.chip button {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  padding: 0;
}

.chip button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.chip-input input {
  min-width: min(210px, 100%);
  flex: 1 1 160px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.chip-input:focus-within {
  border-color: #7eaa86;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.13);
}

.inline-fields,
.form-grid,
.range-grid {
  display: grid;
  gap: 12px;
}

.inline-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 6px;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.lead-finder-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
[contenteditable="true"]:focus {
  border-color: #7eaa86;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.13);
}

.score-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.score-board div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.score-board.compact-board {
  width: min(210px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.score-board.compact-board div {
  padding: 9px;
}

.score-board strong,
.score-board span {
  display: block;
}

.score-board strong {
  font-size: 24px;
  letter-spacing: 0;
}

.score-board.compact-board strong {
  font-size: 18px;
}

.score-board span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.new-lead-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.new-lead-enable-all-toggle {
  align-self: center;
  padding-right: 10px;
}

.new-lead-enable-all-toggle strong {
  font-size: 12px;
}

.lead-list,
.saved-list {
  display: grid;
  gap: 10px;
}

.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
}

.lead-row:hover {
  border-color: #bdd1c1;
  background: #fbfdfb;
}

.lead-row.is-expanded {
  border-color: #9fbea5;
}

.lead-row.is-new-contact {
  border-color: #e3bc62;
  background: #fff9e8;
}

.lead-row.is-new-contact:hover {
  border-color: #d3a33a;
  background: #fff6d9;
}

.lead-row.is-disregarded {
  border-color: #e3c4bf;
  background: #fff8f7;
}

.lead-group-actions {
  display: grid;
  align-self: start;
  gap: 8px;
}

.lead-row.is-moving-to-disregard {
  animation: leadMoveToDisregard var(--lead-move-duration, 260ms) ease forwards;
}

.lead-row.is-moving-from-disregard {
  animation: leadMoveFromDisregard var(--lead-move-duration, 260ms) ease forwards;
}

.lead-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.lead-meta,
.attachment-line,
.saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.lead-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
}

.lead-title strong {
  font-size: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef3f7;
  color: var(--blue);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.outgoing {
  background: #fff4df;
  color: var(--amber);
}

.badge.noncontact {
  background: #fff3f1;
  color: #8a4037;
}

.badge.recent-mailout {
  background: #ffdeda;
  color: #982d24;
}

.badge.review {
  background: #f4f0ff;
  color: #5c4b86;
}

.badge.contact {
  background: #edf7ef;
  color: var(--green-dark);
}

.badge.category-gpt {
  background: #cbeed6;
  color: #14572f;
  font-weight: 800;
}

.badge.category-fallback {
  background: #f0f5f1;
  color: #75877b;
  font-weight: 500;
}

.badge.new {
  background: #ffe8a3;
  color: #77510f;
}

.badge.importance {
  background: #eaf2ed;
  color: #2d614c;
}

.lead-subject {
  margin: 0 0 5px;
  color: #27302c;
  font-weight: 740;
}

.lead-snippet {
  margin: 0 0 9px;
  color: #52605a;
  font-size: 13px;
}

.open-hint {
  display: inline-flex;
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.lead-detail {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 12px;
}

.lead-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #34413a;
  font-size: 13px;
}

.lead-detail-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lead-detail pre {
  max-height: 340px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #26302b;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lead-group-detail {
  display: grid;
  gap: 12px;
}

.lead-group-message {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.lead-group-message .lead-detail-heading {
  margin-bottom: 0;
}

.lead-group-message pre {
  max-height: 260px;
}

.lead-thread-chain {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.lead-thread-chain-heading {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-thread-message {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe8df;
  border-radius: var(--radius);
  background: #f7fbf8;
  padding: 10px;
}

.lead-thread-message pre {
  max-height: 220px;
}

.disregarded-leads-panel {
  margin-top: 10px;
  border: 1px solid #e0c6c2;
  border-radius: var(--radius);
  background: #fff8f7;
  overflow: hidden;
}

.disregarded-leads-panel summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #7b3d35;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  padding: 10px 12px;
}

.disregarded-leads-panel summary::-webkit-details-marker {
  display: none;
}

.disregarded-leads-panel summary strong {
  display: inline-flex;
  min-width: 26px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0c6c2;
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
}

.disregarded-lead-list,
.disregarded-leads-list {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e0c6c2;
  padding: 10px;
}

@keyframes leadMoveToDisregard {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(34px);
  }
}

@keyframes leadMoveFromDisregard {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-34px);
  }
}

.attachment-line svg {
  width: 16px;
  height: 16px;
}

.source-line a {
  color: var(--green-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mailout-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1fr);
  gap: 18px;
}

.mailout-right-column {
  position: sticky;
  top: 18px;
  display: grid;
  max-height: calc(100vh - 36px);
  overflow: auto;
  gap: 12px;
  align-content: start;
  align-self: start;
}

.mailout-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mailout-enable-all-toggle {
  align-self: center;
  padding-right: 10px;
}

.mailout-enable-all-toggle strong {
  font-size: 12px;
}

.mailout-version-label {
  min-width: 190px;
}

.mailout-version-label select {
  max-width: 210px;
}

.mailout-list {
  display: grid;
  gap: 8px;
}

.mailout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: inherit;
  padding: 10px;
  text-align: left;
}

.mailout-row:hover,
.mailout-row.is-active {
  border-color: #a9cdb2;
  background: #f2faf4;
}

.mailout-row strong {
  font-size: 13px;
}

.mailout-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mailout-recipient-main {
  display: grid;
  min-width: 0;
  gap: 2px;
  cursor: pointer;
}

.mailout-recipient-toggle {
  align-self: center;
}

.mailout-sent-indicator {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border: 1px solid #b7d8bd;
  border-radius: 999px;
  background: #e7f5ea;
  color: var(--green-dark) !important;
  padding: 3px 7px;
  font-weight: 800;
}

.mailout-sent-indicator svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.mailout-draft {
  min-height: 300px;
  max-height: 360px;
  overflow: auto;
}

.batch-send-panel {
  display: grid;
  gap: 10px;
}

.batch-send-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.batch-send-button {
  display: grid;
  width: 96px;
  height: 72px;
  place-items: center;
  border: 1px solid #d88d35;
  border-radius: var(--radius);
  background: #d9781e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(169, 103, 34, 0.22);
}

.batch-send-button:hover {
  background: #bf6818;
}

.batch-send-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.batch-send-button svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}

.batch-send-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.batch-send-copy strong {
  font-size: 14px;
}

.batch-send-copy span {
  color: var(--muted);
  font-size: 13px;
}

.batch-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.batch-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ed;
}

.batch-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.batch-progress > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cancel-mailout-button {
  min-height: 30px;
  padding: 5px 9px;
}

.calendar-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.calendar-panel {
  overflow-x: auto;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.calendar-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-weekdays,
.calendar-month-grid {
  min-width: 720px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f4f8f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-weekdays span {
  padding: 9px 10px;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  grid-auto-rows: 156px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.calendar-day {
  display: grid;
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 8px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}

.calendar-day.is-outside {
  background: #f8faf7;
  color: #87938e;
}

.calendar-day-header {
  display: flex;
  position: relative;
  z-index: 2;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.calendar-day-number {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.calendar-day-count {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.is-today .calendar-day-number {
  background: var(--green);
  color: #ffffff;
}

.calendar-day.is-unavailable {
  background: #fff8f7;
}

.calendar-unavailable-mark {
  position: absolute;
  inset: 9px;
  z-index: 1;
  pointer-events: none;
}

.calendar-unavailable-mark span::before,
.calendar-unavailable-mark span::after {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 84%;
  height: 5px;
  border-radius: 999px;
  background: rgba(187, 54, 45, 0.35);
  content: "";
}

.calendar-unavailable-mark span::before {
  transform: rotate(42deg);
}

.calendar-unavailable-mark span::after {
  transform: rotate(-42deg);
}

.calendar-day-events {
  display: grid;
  position: relative;
  z-index: 2;
  align-content: start;
  gap: 4px;
  margin-top: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.calendar-pill {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 5px;
  border: 1px solid #bfd7c4;
  border-radius: 999px;
  background: #eaf4ec;
  color: var(--green-dark);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-pill:hover,
.calendar-pill.is-selected {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.calendar-pill span {
  flex: 0 0 auto;
  opacity: 0.78;
  font-size: 11px;
}

.calendar-grid-message {
  grid-column: 1 / -1;
}

.calendar-detail-panel {
  position: sticky;
  top: 18px;
}

.calendar-detail-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.calendar-detail-meta strong {
  color: var(--purple);
  font-size: 15px;
}

.calendar-email-preview {
  max-height: 640px;
  min-height: 420px;
  overflow: auto;
}

.new-lead-row .lead-main {
  cursor: default;
}

.new-lead-row .new-lead-company-name {
  color: #17201c;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.2;
}

.new-lead-row.is-saved-contact {
  border-color: #a9cdb2;
  background: #f2faf4;
}

.new-lead-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 9px;
}

.new-lead-tag-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid #c6d7ca;
  border-radius: 999px;
  background: #edf7ef;
  color: #244f3d;
  padding: 4px 7px 4px 10px;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.new-lead-tag-pill button {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.new-lead-tag-pill button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.new-lead-positioning,
.new-lead-outreach-angle {
  margin: 8px 0 0;
  color: #3f4d46;
  font-size: 13px;
  line-height: 1.45;
}

.new-lead-positioning {
  color: var(--muted);
}

.new-lead-outreach-angle {
  font-weight: 720;
}

.new-lead-actions {
  min-width: 118px;
}

.save-button {
  align-self: start;
  white-space: nowrap;
}

.save-button[disabled] {
  cursor: default;
  opacity: 0.62;
}

.save-toggle {
  display: inline-flex;
  align-self: start;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 9px 6px 6px;
  color: #5d3935;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.save-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.save-toggle-track {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--coral);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.save-toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  content: "";
  transition: transform 160ms ease;
}

.save-toggle input:checked + .save-toggle-track {
  background: var(--green);
}

.save-toggle input:checked + .save-toggle-track::after {
  transform: translateX(18px);
}

.save-toggle.is-saved {
  color: var(--green-dark);
}

.save-toggle.is-disabled {
  cursor: default;
  opacity: 0.62;
}

.contacts-panel {
  display: grid;
  gap: 16px;
  min-height: 420px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.contacts-heading-subtitle {
  margin: 4px 0 0;
}

.contacts-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.select-all-mailout-toggle {
  position: relative;
  display: inline-grid;
  width: 112px;
  min-height: 58px;
  grid-template-rows: auto auto;
  gap: 2px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #b8d6c0;
  border-radius: var(--radius);
  background: #f2faf4;
  color: #1f6b48;
  padding: 7px 8px 5px;
  font-size: 11px;
  font-weight: 900;
}

.select-all-mailout-toggle svg {
  position: static;
  width: 28px;
  height: 24px;
  opacity: 0.92;
  transform: none;
}

.select-all-mailout-toggle span {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.select-all-mailout-toggle.is-active {
  border-color: #2f7a5b;
  background: #2f7a5b;
  color: #ffffff;
}

.select-all-mailout-toggle.is-active svg {
  opacity: 1;
}

.contacts-tag-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 12px;
  margin: 0;
  border: 1px solid #cddfd3;
  border-radius: var(--radius);
  background: #eef7f1;
  overflow: hidden;
  padding: 12px;
}

.contacts-mailout-board {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(31, 37, 35, 0.04);
  padding: 14px;
}

.contacts-mailout-heading {
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.contacts-tag-column {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.contacts-tag-column strong,
.contacts-filter-heading strong {
  color: #344039;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contacts-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contacts-filter-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contacts-tag-pool,
.contacts-active-filters {
  display: flex;
  min-height: 34px;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.contacts-filter-dropzone {
  min-height: 46px;
  border: 1px dashed #bdd0c2;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 8px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.contacts-filter-dropzone.is-drag-over {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.12);
}

.contact-tag-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid #c6d7ca;
  border-radius: 999px;
  background: #edf7ef;
  color: #244f3d;
  padding: 4px 6px 4px 10px;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-tag-pill.is-draggable {
  cursor: grab;
}

.contact-tag-pill.is-draggable:active {
  cursor: grabbing;
}

.contact-tag-pill.is-draggable:focus-visible {
  outline: 2px solid rgba(47, 122, 91, 0.35);
  outline-offset: 2px;
}

.contact-tag-pill-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-tag-pill.is-active {
  border-color: #2f7a5b;
  background: #2f7a5b;
  color: #ffffff;
}

.contact-tag-pill.tone-new,
.contact-tag-pill.is-active.tone-new {
  border-color: #f0cc62;
  background: #ffe8a3;
  color: #77510f;
}

.contact-tag-pill.tone-review,
.contact-tag-pill.is-active.tone-review {
  border-color: #d8ccf2;
  background: #f4f0ff;
  color: #5c4b86;
}

.contact-tag-pill.tone-outgoing,
.contact-tag-pill.is-active.tone-outgoing {
  border-color: #efd49e;
  background: #fff4df;
  color: #8a5b16;
}

.contact-tag-pill.tone-contact,
.contact-tag-pill.is-active.tone-contact {
  border-color: #c6d7ca;
  background: #edf7ef;
  color: #244f3d;
}

.contact-tag-pill.tone-category-gpt,
.contact-tag-pill.is-active.tone-category-gpt {
  border-color: #9dd8ad;
  background: #cbeed6;
  color: #14572f;
  font-weight: 800;
}

.contact-tag-pill.tone-category-fallback,
.contact-tag-pill.is-active.tone-category-fallback {
  border-color: #d9e4dc;
  background: #f0f5f1;
  color: #75877b;
  font-weight: 500;
}

.contact-tag-pill.tone-noncontact,
.contact-tag-pill.is-active.tone-noncontact {
  border-color: #e2b8b2;
  background: #fff3f1;
  color: #8a4037;
}

.contact-tag-pill.tone-importance,
.contact-tag-pill.is-active.tone-importance {
  border-color: #c9d8ce;
  background: #eaf2ed;
  color: #2d614c;
}

.contact-tag-pill-remove {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  padding: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.contact-tag-pill-remove:hover {
  background: rgba(255, 255, 255, 0.18);
}

.contacts-tag-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.contacts-tag-panel input {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 7px 10px;
}

.contacts-filter-demo {
  position: absolute;
  inset: 12px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}

.contacts-tag-panel.is-filter-demo-playing .contacts-filter-demo {
  opacity: 1;
}

.contacts-filter-demo-input {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(270px, 42%);
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(47, 122, 91, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(37, 77, 56, 0.1);
  color: #244f3d;
  padding: 7px 10px;
  opacity: 0;
  font-size: 13px;
  font-weight: 760;
}

.contacts-filter-demo-text {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  border-right: 2px solid #2f7a5b;
  white-space: nowrap;
}

.contacts-filter-demo-cursor {
  position: absolute;
  top: 48px;
  left: 118px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #1e2f28;
  filter: drop-shadow(0 3px 5px rgba(24, 42, 32, 0.2));
  opacity: 0;
}

.contacts-filter-demo-cursor svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.contacts-filter-demo-cursor.is-visible {
  opacity: 0.86;
}

.contacts-filter-demo-ghost {
  border-style: dashed;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.contacts-filter-demo-ghost .contact-tag-pill-remove {
  opacity: 0.72;
}

.contacts-filter-demo-ghost.is-visible {
  opacity: 0.68;
}

.contacts-filter-demo-placeholder-hidden {
  display: none;
}

.contacts-filter-demo-available {
  order: 999;
}

.contacts-filter-demo-available.is-picked {
  opacity: 0;
  transform: scale(0.96);
}

.contacts-filter-demo-filter {
  background: #f3faf5;
}

.contacts-filter-demo-drag-pill {
  position: absolute;
  z-index: 7;
  box-shadow: 0 12px 28px rgba(37, 77, 56, 0.18);
}

.contacts-filter-dropzone.is-demo-drop-target {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 122, 91, 0.14);
}

.contacts-tag-panel.is-filter-demo-playing .contacts-filter-demo-input {
  animation: contactsDemoInput 4.2s linear 2;
}

.contacts-tag-panel.is-filter-demo-playing .contacts-filter-demo-text {
  animation: contactsDemoType 4.2s steps(16, end) 2;
}

@keyframes contactsDemoInput {
  0%,
  4% {
    opacity: 0;
  }
  7%,
  31% {
    opacity: 0.82;
  }
  38%,
  100% {
    opacity: 0;
  }
}

@keyframes contactsDemoType {
  0%,
  7% {
    max-width: 0;
  }
  31%,
  100% {
    max-width: 16ch;
  }
  34%,
  100% {
    border-right-color: transparent;
  }
}

.compact-select-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3d4842;
  font-size: 12px;
  font-weight: 800;
}

.compact-select-label select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 6px 32px 6px 10px;
  font-weight: 700;
}

.contacts-list {
  display: grid;
  gap: 16px;
}

.company-contact-group {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(31, 37, 35, 0.04);
}

.company-heading {
  display: grid;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.company-heading-main {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 14px;
  margin-left: 0;
  text-align: left;
}

.company-heading-meta {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 180px;
  text-align: left;
}

.company-heading h3 {
  margin: 0;
  min-width: 0;
}

.company-name-input {
  width: clamp(160px, 28vw, 34ch);
  min-width: 160px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--purple);
  padding: 2px 4px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
}

.company-name-input:hover,
.company-name-input:focus {
  border-color: #d8c9ec;
  outline: none;
  background: #faf7ff;
}

.company-website-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d6e3d8;
  border-radius: 999px;
  background: #f6fbf7;
  color: var(--green-dark);
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.company-website-link:hover {
  border-color: #b9d0bd;
  background: #eef7f0;
}

.company-relevance-score {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #b7dfc0;
  border-radius: 999px;
  background: #dff4e4;
  color: #1f6a3d;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 900;
}

.company-last-contact {
  position: relative;
  flex: 0 1 auto;
  color: var(--muted);
  cursor: help;
  font-size: 12px;
  font-weight: 740;
  overflow-wrap: anywhere;
}

.company-last-contact[data-email]:hover::after,
.company-last-contact[data-email]:focus::after {
  content: attr(data-email);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-width: min(320px, 70vw);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 42, 32, 0.16);
  color: var(--ink);
  padding: 7px 9px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.company-contact-status {
  align-self: center;
}

.company-contact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.company-contact-list .contact-card {
  flex: 0 1 calc((100% - 20px) / 3);
  min-width: 240px;
}

.saved-card {
  position: relative;
  display: grid;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
  cursor: pointer;
}

.saved-card:hover {
  border-color: #bdd1c1;
  background: #fbfdfb;
}

.saved-card.is-mailout-selected {
  border-color: #a9cdb2;
  background: #f2faf4;
}

.mailout-envelope-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(42%, 120px);
  height: auto;
  color: var(--green);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease;
}

.saved-card.is-mailout-selected .mailout-envelope-mark {
  opacity: 0.33;
}

.saved-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-card strong,
.saved-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.saved-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

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

.star-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #aeb8b1;
  padding: 0;
}

.star-button svg {
  width: 17px;
  height: 17px;
  fill: none;
}

.star-button.is-active {
  border-color: #ead08f;
  background: #fff7df;
  color: #a87422;
}

.star-button.is-active svg {
  fill: currentColor;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--coral);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.remove-contact-button {
  color: #8a6d68;
}

.saved-card > span,
.saved-card .saved-badges,
.saved-card .saved-meta {
  position: relative;
  z-index: 1;
}

.empty-state {
  border: 1px dashed #cbd8cc;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.empty-state.compact-empty {
  padding: 12px;
  text-align: left;
  font-size: 13px;
}

.searching-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.search-state-spinner {
  display: inline-block;
  color: var(--green);
}

.check-pill input {
  width: auto;
  accent-color: var(--green);
}

.filter-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.corpus-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.corpus-toolbar,
.corpus-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.corpus-toolbar {
  justify-content: space-between;
}

.corpus-toolbar strong,
.corpus-toolbar span {
  display: block;
}

.corpus-toolbar strong {
  font-size: 13px;
}

.corpus-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.style-source-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.style-build-list {
  display: grid;
  gap: 8px;
}

.style-sample-list {
  display: grid;
  gap: 8px;
}

.style-sample-list:empty {
  display: none;
}

.style-sample-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2b4638;
  font-size: 12px;
  font-weight: 800;
}

.style-sample-list-heading span {
  color: var(--muted);
  font-weight: 740;
}

.style-build-row,
.style-sample-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 9px 10px;
}

.style-build-row input,
.style-sample-row input {
  width: auto;
  accent-color: var(--green);
}

.style-build-row span,
.style-build-row strong,
.style-build-row small,
.style-sample-row span,
.style-sample-row strong,
.style-sample-row small {
  display: block;
  min-width: 0;
}

.style-build-row strong,
.style-sample-row strong {
  color: #2b4638;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.style-build-row small,
.style-sample-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.style-source-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.style-source-card strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.style-source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.style-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.range-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--green);
}

.email-output {
  min-height: 260px;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: #26302b;
  padding: 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich-email-output {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.48;
  white-space: normal;
}

.rich-email-output.is-disabled {
  cursor: default;
  opacity: 0.72;
}

.draft-kind {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.draft-recipient-line {
  text-transform: none;
}

.draft-recipient-line strong {
  color: var(--text);
}

.draft-subject {
  margin-bottom: 18px;
}

.draft-body {
  margin-bottom: 14px;
}

.profile-link-anchor {
  color: #1f6f51;
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.draft-signature {
  margin-top: 2px;
}

.draft-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e3e8e2;
}

.draft-attachment-card {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: min(240px, 100%);
  max-width: 320px;
  gap: 10px;
  border: 1px solid #d7ddd6;
  border-radius: 8px;
  background: #f8faf8;
  padding: 8px 10px;
}

.filetype-thumbnail {
  display: inline-grid;
  width: 38px;
  height: 44px;
  place-items: center;
  border: 1px solid #d8c1b4;
  border-radius: 6px;
  background: #fff7f2;
  color: #8c4a2f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.draft-attachment-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.draft-attachment-main strong,
.draft-attachment-main span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-attachment-main strong {
  color: #25352e;
  font-size: 12px;
  font-weight: 820;
}

.draft-attachment-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.mailout-draft .draft-attachment-preview {
  margin-top: 12px;
  padding-top: 10px;
}

.mailout-draft .draft-attachment-card {
  min-width: min(210px, 100%);
  max-width: 260px;
  padding: 7px 8px;
}

.mailout-draft .filetype-thumbnail {
  width: 32px;
  height: 38px;
  font-size: 9px;
}

.draft-signature img,
.rich-email-output img {
  max-width: 100%;
  height: auto;
}

.draft-decisions {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.draft-decisions ul {
  margin: 8px 0;
  padding-left: 18px;
}

.mailout-draft-controls {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.mailout-range-grid {
  margin-top: 0;
}

.draft-range-grid {
  margin-top: 14px;
}

.cover-letter-range-grid {
  margin-top: 12px;
  margin-bottom: 0;
}

.cover-letter-text {
  width: 100%;
  min-height: 260px;
  margin-top: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: #26302b;
  padding: 14px;
  font: inherit;
  line-height: 1.48;
}

.cover-letter-text:focus {
  border-color: #7c6ac7;
  outline: 3px solid rgba(124, 106, 199, 0.14);
}

.pdf-export-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.pdf-export-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdf-export-heading strong,
.pdf-export-heading span {
  display: block;
}

.pdf-export-heading strong {
  color: #29332e;
  font-size: 13px;
}

.pdf-export-heading span {
  color: var(--muted);
  font-size: 12px;
}

.pdf-file-list {
  display: grid;
  gap: 8px;
}

.pdf-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid #d9d6e8;
  border-radius: var(--radius);
  background: #ffffff;
  color: inherit;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.pdf-file-card:hover {
  border-color: #7c6ac7;
  background: #fbfaff;
}

.pdf-icon {
  display: inline-grid;
  width: 38px;
  height: 42px;
  place-items: center;
  border: 1px solid #e0a6a0;
  border-radius: 6px;
  background: #fff1ef;
  color: #a43d35;
  font-size: 10px;
  font-weight: 850;
}

.pdf-file-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pdf-file-main strong {
  color: #2f2b43;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.pdf-file-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.draft-preview-heading {
  margin-top: 14px;
}

.draft-save-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.draft-save-status.is-saving {
  color: var(--blue);
}

.draft-save-status.is-saved {
  color: var(--green-dark);
}

.draft-save-status.is-error {
  color: #9b473b;
}

.profile-output-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.gpt-send-panel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 12px;
}

.gpt-send-panel strong,
.gpt-send-panel span {
  display: block;
}

.gpt-send-panel strong {
  font-size: 13px;
}

.gpt-send-panel span {
  color: var(--muted);
  font-size: 12px;
}

.profile-output {
  max-height: 340px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #26302b;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  border: 1px solid #cddbcf;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 16px 45px rgba(31, 37, 35, 0.16);
  color: var(--ink);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.send-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(22, 29, 26, 0.42);
  padding: 22px;
}

.send-confirm-dialog {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(22, 29, 26, 0.22);
  padding: 18px;
}

.send-confirm-summary {
  margin: 0 0 12px;
  color: #3c4942;
  font-size: 14px;
}

.send-confirm-list {
  display: grid;
  max-height: 260px;
  gap: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.send-confirm-list span {
  border: 1px solid #d5e1d7;
  border-radius: 999px;
  background: #ffffff;
  color: #2f3b35;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.send-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.danger-send {
  border-color: #d9781e !important;
  background: #d9781e !important;
}

.danger-send:hover {
  border-color: #bf6818 !important;
  background: #bf6818 !important;
}

@media (max-width: 1040px) {
  .launch-gate {
    padding: 18px;
  }

  .launch-gate-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .launch-brand-panel {
    border-right: 0;
    border-bottom: 1px solid #dce7dd;
  }

  .launch-brand-panel h1 {
    max-width: 14ch;
    margin-top: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px;
  }

  .nav-tabs {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .connection-block {
    display: none;
  }

  .company-contact-list {
    justify-content: flex-start;
  }

  .company-contact-list .contact-card {
    flex-basis: calc((100% - 10px) / 2);
  }

  .sidebar-footer {
    margin-left: auto;
    margin-top: 0;
  }

  .filter-grid,
  .workspace-grid,
  .style-grid,
  .draft-lead-selector,
  .draft-control-grid,
  .draft-profile-style-grid,
  .draft-resource-grid,
  .new-leads-grid,
  .mailout-grid,
  .calendar-page-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .draft-hero-output {
    min-height: 360px;
  }

  .draft-lead-nav {
    justify-content: space-between;
  }

  .draft-preview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .draft-version-control {
    justify-content: flex-start;
    width: 100%;
  }

  .draft-version-control select,
  .draft-version-control input {
    width: 100%;
  }

  .draft-output-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: flex-start;
    width: 100%;
  }

  .draft-output-option {
    min-width: 0;
  }

  .profile-link-row {
    grid-template-columns: 1fr;
  }

  .form-grid.draft-control-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .draft-tone-field,
  .draft-angle-field {
    grid-column: span 3;
  }

  .draft-range-field,
  .draft-availability-field {
    grid-column: span 3;
  }

  .calendar-detail-panel {
    position: static;
  }

  .mailout-right-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .draft-panel {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .launch-gate {
    padding: 10px;
  }

  .launch-gate-shell {
    min-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .launch-brand-panel,
  .launch-login-panel {
    padding: 22px;
  }

  .launch-logo {
    width: min(100%, 320px);
  }

  .launch-brand-panel h1 {
    font-size: 34px;
  }

  .company-contact-list {
    justify-content: stretch;
  }

  .company-contact-list .contact-card {
    min-width: 0;
    flex-basis: 100%;
  }

  .mailout-row {
    grid-template-columns: 1fr;
  }

  .mailout-recipient-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .gpt-setup-row {
    align-items: stretch;
    flex-direction: column;
  }

  .main {
    padding: 18px 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .button {
    flex: 1 1 auto;
  }

  .inline-fields,
  .form-grid,
  .range-grid,
  .score-board,
  .contacts-tag-panel,
  .corpus-toolbar,
  .gpt-send-panel,
  .field-action-row {
    grid-template-columns: 1fr;
  }

  .form-grid.draft-control-grid {
    grid-template-columns: 1fr;
  }

  .draft-write-controls > .draft-version-control {
    grid-template-columns: 1fr;
  }

  .draft-write-controls > .draft-version-control .draft-version-select-row {
    grid-column: auto;
  }

  .draft-tone-field,
  .draft-angle-field,
  .draft-range-field,
  .draft-availability-field {
    grid-column: auto;
  }

  .corpus-toolbar,
  .gpt-send-panel,
  .panel-actions,
  .lead-finder-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gmail-fallback-row {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-row {
    grid-template-columns: 1fr;
  }

  .save-button,
  .save-toggle,
  .lead-group-actions {
    width: 100%;
  }

  .save-toggle {
    justify-content: space-between;
  }
}
