/* Lead creation uses the same dialog frame and controls as Sara input. */
.lead-create-dialog {
  width: min(var(--lead-create-width, 680px), calc(100vw - 32px));
  max-width: none;
}
.lead-create-dialog[data-step="manual"] { --lead-create-width: 1040px; }
.lead-create-dialog:is([data-step="preview"], [data-step="details"]) { --lead-create-width: 860px; }
.lead-create-dialog .ai-input-head { padding: 18px 24px; }
.lead-create-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lead-create-heading p, .lead-create-heading h2 span { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.lead-create-heading h2 { white-space: normal; }
.lead-create-heading > .lead-create-star { width: 24px; height: 24px; }
.lead-create-dialog .ai-input-close svg, .lead-create-back svg { width: 16px; height: 16px; }
.lead-create-back, .lead-create-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--body);
}
.lead-create-back:hover, .lead-create-icon-button:hover { border-color: var(--blue); color: var(--blue-deep); }
.lead-create-icon-button svg { fill: none; stroke: currentColor; stroke-width: 1.7; width: 15px; height: 15px; }
.lead-create-body { padding: 22px 24px; }
.lead-create-form { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.lead-create-footer { padding: 14px 24px; justify-content: space-between; }
.lead-create-footer > span { color: var(--muted); font-size: 12px; }
.lead-create-footer > div { display: flex; gap: 10px; flex: none; }
.lead-create-footer .button { min-height: 36px; }
.lead-create-dialog :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.lead-create-dialog h2:focus, .lead-create-dialog h3:focus { outline: none; }
.lead-create-star { width: 15px; height: 15px; flex: none; object-fit: contain; }
.lead-create-dialog .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lead-create-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-create-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 224px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
  line-height: 1.6;
  text-align: start;
}
.lead-create-method:hover, .lead-create-method:focus-visible { border-color: var(--blue); }
.lead-create-method strong { font-size: 16px; color: var(--ink); }
.lead-create-method-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}
.lead-create-method .lead-create-tags { margin-top: auto; }
.lead-create-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-create-tags > span { padding: 3px 8px; border-radius: 999px; background: var(--subtle); color: var(--body); font-size: 12px; line-height: 1.35; }
.lead-create-note, .lead-create-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.lead-create-choices + .lead-create-note { margin-top: 16px; }

.lead-create-split { display: grid; grid-template-columns: minmax(0, 41.4%) minmax(0, 1fr); gap: 24px; align-items: start; }
.lead-create-sara {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.lead-create-sara-title, .lead-create-form-head, .lead-create-form-head span { display: flex; align-items: center; gap: 8px; }
.lead-create-sara-title { margin: 0; font-size: 14px; }
.lead-create-sara-title .lead-create-star { width: 18px; height: 18px; }
.lead-create-sara-title + .lead-create-help { margin-top: 4px; }
.lead-create-label, .lead-create-group { display: block; margin: 12px 0 6px; color: var(--body); font-size: 12px; font-weight: 600; }
.lead-create-form .ai-input-body > .lead-create-label:first-child { margin-top: 0; }
.lead-create-templates { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-create-template {
  min-height: 28px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--body);
  font-size: 12px;
}
.lead-create-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lead-create-modes button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.lead-create-modes button svg { width: 18px; height: 18px; }
.lead-create-templates button:hover, .lead-create-modes button:hover { border-color: var(--blue); }
.lead-create-templates button[aria-pressed="true"], .lead-create-modes button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 600;
}
.lead-create-sara textarea { min-height: 174px; font-size: 13px; line-height: 1.55; }
.lead-create-sara :is(.ai-input-drop, .ai-input-voice) { margin: 12px 0 0; padding: 12px 8px; }
.lead-create-sara :is(.ai-input-drop, .ai-input-voice) div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lead-create-sara :is(.ai-input-drop, .ai-input-voice) .button { min-height: 34px; padding: 0 9px; font-size: 11px; }
.lead-create-files { margin: 8px 0 0; }
.lead-create-file { gap: 8px; padding: 8px; background: var(--surface); }
.lead-create-file > img { width: 38px; height: 48px; object-fit: contain; }
.lead-create-file strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.lead-create-file small { font-size: 11px; }
.lead-create-file-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--blue-soft); color: var(--blue-deep); }
.lead-create-sara .lead-create-organize { display: flex; justify-content: center; gap: 6px; width: 100%; margin-top: 11px; min-height: 38px; }
.lead-create-status, .lead-create-error { margin: 5px 0 0; color: var(--body); font-size: 12px; line-height: 1.5; }
.lead-create-status.is-error, .lead-create-error { color: #a11d28; }
.lead-create-form-head { justify-content: space-between; margin-bottom: 10px; }
.lead-create-form-head h3 { margin: 0; font-size: 15px; }
.lead-create-form-head span, .lead-create-contact-group legend > span:not(.lead-create-required) { color: var(--muted); font-size: 12px; }
.lead-create-group { margin: 0 0 6px; color: var(--muted); }
.lead-create-grid + .lead-create-group { margin-top: 16px; }
.lead-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: start; }
.lead-create-grid .lead-create-wide { grid-column: 1 / -1; }
.lead-create-field label, :is(.lead-create-contact-group, .lead-create-budget) legend {
  display: block;
  padding: 0;
  margin: 0 0 4px;
  color: var(--body);
  font-size: 12px;
}
.lead-create-required { color: #bd2936; }
.lead-create-control { position: relative; min-width: 0; }
.lead-create-control > .lead-create-star { display: none; position: absolute; inset-inline-end: 9px; top: 10px; pointer-events: none; }
.lead-create-control:has(select) > .lead-create-star { inset-inline-end: 24px; }
.lead-create-control.is-sara > .lead-create-star { display: block; }
.lead-create-dialog :is(.lead-create-control input, .lead-create-control select, .lead-create-control textarea, .lead-create-contact > select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}
.lead-create-dialog .lead-create-control textarea { min-height: 52px; }
.lead-create-control.is-sara :is(input, select, textarea) { padding-inline-end: 29px; border-color: #b7cffd; background: #f4f8ff; }
.lead-create-control.is-sara select { padding-inline-end: 42px; }
.lead-create-control :is(input,select,textarea)[aria-invalid="true"] { border-color: #ba4b54; }
.lead-create-contact { display: grid; grid-template-columns: minmax(96px, .65fr) minmax(0, 2fr) auto; gap: 0 6px; align-items: start; }
.lead-create-contact + .lead-create-contact { margin-top: 6px; }
.lead-create-contact .lead-create-error { grid-column: 2 / -1; }
.lead-create-contact .lead-create-icon-button { align-self: center; }
.lead-create-contact-group, .lead-create-budget { margin: 0; padding: 0; border: 0; min-width: 0; }
.lead-create-budget > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lead-create-budget .lead-create-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lead-create-contact-group .text-button { display: inline-flex; padding: 0; margin-top: 5px; font-size: 12px; color: var(--blue-deep); }

.lead-create-duplicate, .lead-create-review {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #f7cd9b;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.55;
}
.lead-create-duplicate { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; }
.lead-create-duplicate > div { display: flex; flex-wrap: wrap; column-gap: 8px; }
.lead-create-duplicate .text-button { padding: 1px 2px; color: var(--blue-deep); }
.lead-create-okm-input { display: flex; align-items: stretch; gap: 10px; }
.lead-create-okm-number {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 16px;
}
.lead-create-okm-number span { flex: none; }
.lead-create-okm-number input { flex: 1; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: var(--ink); font: inherit; }
.lead-create-okm-input .button { min-height: 44px; padding: 0 18px; }
.lead-create-will { margin-top: 18px; padding: 13px 15px; border: 1px dashed var(--line); border-radius: 10px; }
.lead-create-will h3 { margin: 0 0 9px; color: var(--body); font-size: 13px; }
.lead-create-will dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin: 0; font-size: 12px; }
.lead-create-will dl div { display: grid; grid-template-columns: minmax(67px, .55fr) 1fr; gap: 6px; color: var(--body); }
.lead-create-will dd { margin: 0; color: var(--muted); }
.lead-create-customer {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.lead-create-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; background: #e0e7ff; color: #3730a3; font-weight: 700; }
.lead-create-customer h3 { margin: 0 0 5px; font-size: 16px; }
.lead-create-customer h3 span { margin-inline-start: 4px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.lead-create-customer-name { min-width: 0; }
.lead-create-read { margin-inline-start: auto; color: var(--muted); font-size: 12px; text-align: end; }
.lead-create-section-title { margin: 0 0 8px; font-size: 13px; }
.lead-create-success { color: #06694c; }
.lead-create-review-color { color: #854013; }
.lead-create-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.55; }
.lead-create-table :is(th, td) { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.lead-create-table th { font-weight: 600; }
.lead-create-table thead th { padding-top: 0; color: var(--muted); }
.lead-create-table tbody th { width: 24%; color: var(--ink); }
.lead-create-table td { color: var(--body); }
.lead-create-table td.lead-create-success { color: #06694c; }
.lead-create-table td.lead-create-review-color { color: #854013; }
.lead-create-table td:last-child { white-space: nowrap; }
.lead-create-table [data-result="empty"] > * { background: var(--canvas); color: var(--muted); }
.lead-create-review { margin: 15px 0 0; padding: 11px 13px; }
.lead-create-review h3 { margin: 0 0 5px; font-size: 13px; }
.lead-create-review ol { margin: 0; padding-inline-start: 18px; }
.lead-create-prompt {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
  border-top: 1px solid #f7cd9b;
  background: var(--amber-soft);
  color: #7c2d12;
  font-size: 13px;
}
.lead-create-prompt p { margin: 0; }
.lead-create-prompt > div { display: flex; flex-wrap: wrap; gap: 8px; }

.lead-create-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 9px 13px;
  border: 1px solid #a9dec7;
  border-radius: 8px;
  background: #effaf4;
  color: #07563e;
  font-size: 13px;
  line-height: 1.45;
}
.lead-create-banner strong { margin-inline-end: 6px; }
.lead-create-banner > div { flex: 1; }
.lead-create-banner .text-button { flex: none; padding: 0; color: var(--blue-deep); }
.lead-create-banner .lead-create-icon-button { border-color: transparent; background: transparent; color: inherit; }

@media (max-width: 760px) {
  .lead-create-split, .lead-create-choices { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lead-create-method { min-height: auto; padding: 12px 14px; }
  .lead-create-method-icon { width: 32px; height: 32px; }
  .lead-create-customer { flex-wrap: wrap; gap: 9px; }
  .lead-create-customer-name { flex: 1; }
  .lead-create-read { flex-basis: 100%; margin-inline-start: 49px; text-align: start; }
  .lead-create-read br { display: none; }
  .lead-create-read span { margin-inline-start: 6px; }
  .lead-create-table :is(th,td) { padding-inline: 5px; }
}
@media (max-width: 600px) {
  .lead-create-dialog { width: calc(100vw - 20px); }
  .lead-create-dialog .ai-input-head, .lead-create-body { padding: 14px 15px; }
  .lead-create-footer, .lead-create-prompt { padding: 10px 15px; }
  .lead-create-footer { flex-wrap: wrap; justify-content: flex-end; }
  .lead-create-footer > span:not(:empty) { width: 100%; }
  .lead-create-will dl { grid-template-columns: minmax(0, 1fr); }
  .lead-create-banner { flex-wrap: wrap; }
  .lead-create-banner > div { flex-basis: 100%; }
  .lead-create-banner .lead-create-icon-button { margin-inline-start: auto; }
}
@media (max-width: 360px) {
  .lead-create-grid { grid-template-columns: minmax(0, 1fr); }
  .lead-create-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-production-lead-create] .lead-create-primary-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 7px;
  font-size: 12px;
  color: var(--body);
}

[data-production-lead-create] [data-create-duplicates] li + li { margin-top: 8px; }
[data-production-lead-create] [data-create-duplicates] li p { margin: 2px 0; }
