:root {
  --ink: #17211f;
  --muted: #61716c;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #d9ded7;
  --primary: #176b5c;
  --primary-dark: #0f4c42;
  --accent: #d68435;
  --soft-green: #eaf4ef;
  --soft-amber: #fff1df;
  --soft-blue: #edf5f8;
  --danger: #a73f38;
  --shadow: 0 20px 45px rgba(33, 42, 39, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 750;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--primary-dark);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.button-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding: clamp(38px, 6vw, 86px) clamp(18px, 4vw, 54px) 42px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: 5.2rem;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 3.15rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.hero-lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.16rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.email-visual {
  min-width: 0;
}

.mail-window {
  overflow: hidden;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mail-toolbar {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.mail-toolbar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #e25d48;
}

.mail-toolbar span:nth-child(2) {
  background: #e8b340;
}

.mail-toolbar span:nth-child(3) {
  background: #4c9d73;
}

.mail-body {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 4vw, 42px);
}

.mail-body h2 {
  margin: 0;
  font-size: 2.6rem;
}

.mail-body p {
  margin: 0;
  color: var(--muted);
}

.mail-pill,
.mail-cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.mail-pill {
  padding: 7px 10px;
  background: var(--soft-amber);
  color: #8e521e;
}

.mail-cta {
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
}

.mail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mail-metrics strong {
  min-height: 58px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.signal-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 clamp(18px, 4vw, 54px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.signal-band div {
  min-height: 110px;
  padding: 24px;
  background: var(--surface);
}

.signal-band strong,
.signal-band span {
  display: block;
}

.signal-band span {
  margin-top: 8px;
  color: var(--muted);
}

.app-section,
.models-section,
.leads-section,
.process-section {
  scroll-margin-top: 96px;
  padding: clamp(54px, 8vw, 96px) clamp(18px, 4vw, 54px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  gap: 24px;
  align-items: start;
}

.builder-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(33, 42, 39, 0.08);
}

.builder-panel {
  display: grid;
  gap: 0;
}

fieldset {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

fieldset:last-child {
  border-bottom: 0;
}

legend {
  padding: 0 0 12px;
  font-weight: 850;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd7d2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px;
}

::placeholder {
  color: #9aa5a0;
  font-style: italic;
  font-weight: 400;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.field-hint strong {
  color: var(--ink);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.field-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--soft-green);
  color: var(--primary-dark);
}

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

.var-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
}

.var-chip[data-scope="campanha"] {
  background: var(--soft-blue);
}

.var-chip:hover,
.var-chip:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.14);
}

.preview-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: 24px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preview-toolbar .eyebrow {
  margin-bottom: 4px;
}

.preview-toolbar h3 {
  margin: 0;
  font-size: 1.35rem;
}

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

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.subject-box {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--soft-blue);
}

.subject-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subject-box strong {
  overflow-wrap: anywhere;
}

.subject-box small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.vars-report {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vars-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.vars-pills,
.vars-warnings {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vars-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.var-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.84rem;
}

.var-pill[data-scope="campanha"] {
  background: var(--soft-blue);
}

.var-pill span {
  color: var(--muted);
}

.vars-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.vars-warnings {
  display: grid;
  gap: 6px;
}

.vars-warnings li {
  padding: 8px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--soft-amber);
  color: #6b3f12;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f5f0;
}

.tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.tab-badge[data-level="warning"] {
  background: var(--soft-amber);
  color: #6b3f12;
}

.tab-badge[data-level="error"] {
  background: var(--danger);
  color: #fff;
}

.tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(33, 42, 39, 0.08);
}

.tab-view {
  display: none;
}

.tab-view.is-active {
  display: block;
}

#checksView {
  max-height: min(70vh, 640px);
  min-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.checks-summary {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-weight: 800;
}

.checks-summary[data-level="warning"] {
  border-left-color: var(--accent);
  background: var(--soft-amber);
  color: #6b3f12;
}

.checks-summary[data-level="error"] {
  border-left-color: var(--danger);
  background: #fbeceb;
  color: #7a2a25;
}

.check-heading {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.check-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: #fff;
}

.check-item[data-severity="error"] {
  border-left-color: var(--danger);
}

.check-item[data-severity="warning"] {
  border-left-color: var(--accent);
}

.check-item[data-severity="info"] {
  border-left-color: #6a98b0;
}

.check-item[data-severity="ok"] {
  border-left-color: var(--primary);
}

.check-tag {
  flex: none;
  min-width: 46px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.check-item[data-severity="error"] .check-tag {
  background: var(--danger);
  color: #fff;
}

.check-item[data-severity="warning"] .check-tag {
  background: var(--soft-amber);
  color: #6b3f12;
}

.check-item[data-severity="info"] .check-tag {
  background: var(--soft-blue);
  color: #2d5266;
}

.check-body {
  min-width: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.check-body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.check-group {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.checks-ok {
  margin-top: 18px;
}

.checks-ok summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.manual-checklist {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.manual-checklist summary {
  cursor: pointer;
  font-weight: 800;
}

.manual-checklist summary span {
  color: var(--muted);
  font-weight: 700;
}

.manual-checklist .field-hint {
  margin-top: 10px;
}

#manualList {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.manual-item p {
  margin: 4px 0 0 28px;
  color: var(--muted);
  font-size: 0.84rem;
}

.checks-disclaimer {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

#emailPreview {
  width: 100%;
  height: min(70vh, 640px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f3;
}

#htmlOutput,
#textOutput {
  height: min(70vh, 640px);
  min-height: 420px;
  border-color: var(--line);
  background: #101816;
  color: #dce7df;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
}

.status-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-message.is-success {
  color: var(--primary-dark);
}

.status-message.is-error {
  color: var(--danger);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.model-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.model-card h4 {
  margin: 12px 0 8px;
  font-size: 1.1rem;
}

.model-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.model-card .button {
  margin-top: auto;
}

.model-tags {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.model-card .model-subject {
  margin-bottom: 18px;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.model-subject strong {
  color: var(--ink);
}

.library-group {
  margin: 34px 0 14px;
  font-size: 1.15rem;
}

.library-group:first-child {
  margin-top: 0;
}

.template-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary-dark);
}

.template-banner[hidden] {
  display: none;
}

.template-banner p {
  margin: 0;
  font-weight: 700;
}

.template-banner-actions {
  display: flex;
  flex: none;
  gap: 14px;
}

.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: underline;
}

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

.leads-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.leads-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.leads-card .field-hint {
  margin: 0;
}

.dropzone {
  justify-items: start;
  border-style: dashed;
  border-width: 2px;
}

.dropzone p {
  margin: 0;
}

.dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--soft-green);
}

.leads-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.leads-status.is-success {
  color: var(--primary-dark);
}

.leads-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.leads-workspace {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}

.leads-workspace[hidden] {
  display: none;
}

.leads-warning {
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: #fbeceb;
  color: #7a2a25;
  font-weight: 700;
}

.leads-warning[hidden] {
  display: none;
}

.leads-actions,
.leads-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.leads-toolbar label {
  min-width: 220px;
}

.table-scroll {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leads-table th,
.leads-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.leads-table thead th {
  position: sticky;
  top: 0;
  background: #f4f5f0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.leads-table tbody th {
  font-weight: 700;
}

.leads-table td select {
  min-height: 36px;
  min-width: 160px;
}

.mapping-samples {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.leads-preview tbody tr[data-kind="excluded"] {
  background: #fbeceb;
}

.leads-preview tbody tr[data-kind="flagged"] {
  background: var(--soft-amber);
}

.leads-preview td {
  white-space: nowrap;
}

.leads-preview td.cell-status {
  min-width: 240px;
  font-weight: 700;
  white-space: normal;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.stat-tile {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 850;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-list {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.84rem;
  list-style: none;
}

.segment-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary-dark);
}

.segment-count {
  font-size: 2rem;
  font-weight: 850;
  line-height: 1.1;
}

.segment-text {
  font-weight: 700;
}

.segment-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.segment-block {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.segment-block h4 {
  margin: 0;
  font-size: 0.95rem;
}

.segment-block input[type="search"] {
  min-height: 38px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-list:empty {
  display: none;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
}

.chip:hover,
.chip:focus-visible {
  background: var(--primary-dark);
}

.facet-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.facet-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  text-align: left;
}

.facet-button:hover,
.facet-button:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.14);
}

.facet-label {
  overflow-wrap: anywhere;
}

.facet-count {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.facet-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.score-signals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.score-row {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.score-row .field-hint {
  margin: 0;
}

.score-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.score-points {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.score-weight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2ch;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.score-weight input[type="range"] {
  min-height: 0;
  padding: 0;
  accent-color: var(--primary);
}

.score-weight-value {
  color: var(--ink);
  font-weight: 800;
}

.score-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.score-choices .check-row input {
  min-height: 0;
}

.score-echo:empty {
  display: none;
}

.score-range {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.score-table td.cell-score {
  font-size: 1.1rem;
  font-weight: 850;
}

.score-table tbody tr {
  box-shadow: inset 4px 0 0 var(--line);
}

.score-table tbody tr[data-band="alta"] {
  box-shadow: inset 4px 0 0 var(--primary);
}

.score-table tbody tr[data-band="media"] {
  box-shadow: inset 4px 0 0 var(--accent);
}

.score-table tbody tr[data-band="baixa"] {
  box-shadow: inset 4px 0 0 var(--danger);
}

.score-table td.cell-reasons {
  min-width: 300px;
  font-size: 0.82rem;
  white-space: normal;
}

.reason {
  display: block;
  color: var(--muted);
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.batch-block {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.batch-block h4 {
  margin: 0;
  font-size: 0.95rem;
}

.batch-block .field-hint {
  margin: 0;
}

.field-hint.is-problem {
  color: var(--danger);
  font-weight: 700;
}

.batch-audience {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary-dark);
}

.batch-count {
  font-size: 1.8rem;
  font-weight: 850;
  line-height: 1.1;
}

.batch-dropped {
  color: var(--muted);
  font-size: 0.84rem;
}

.batch-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.batch-nav span {
  flex: 1 1 200px;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.batch-preview {
  width: 100%;
  height: min(60vh, 520px);
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f3;
}

.gate-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
}

.gate-ok {
  border-left-color: var(--primary) !important;
}

.gate-pending {
  border-left-color: var(--danger) !important;
  background: #fbeceb !important;
}

.gate-tag {
  flex: none;
  min-width: 46px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.gate-pending .gate-tag {
  background: var(--danger);
  color: #fff;
}

.leads-actions .button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.process-section {
  background: #f1efe8;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.process-list span {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer span:first-child {
  color: var(--ink);
  font-weight: 850;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 1060px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 4.1rem;
  }

  h2 {
    font-size: 2.7rem;
  }

  .preview-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .template-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .topbar > .button {
    width: 100%;
  }

  .signal-band,
  .model-grid,
  .process-list {
    grid-template-columns: 1fr;
  }

  .mail-metrics {
    grid-template-columns: 1fr;
  }

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

  .preview-toolbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

  h1 {
    font-size: 3.15rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .mail-body h2 {
    font-size: 2.15rem;
  }
}

@media (max-width: 460px) {
  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.95rem;
  }

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

  fieldset,
  .preview-panel,
  .model-card,
  .process-list li,
  .signal-band div {
    padding: 20px;
  }
}
