:root {
  color-scheme: light;
  --canvas: #fbfaf8;
  --ink: #24211d;
  --muted: #6c665d;
  --line: #e9e4dd;
  --white: #fff;
  --accent: #a94020;
  --accent-light: #f8e9df;
  --red: #883d33;
  --radius: 16px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { flex: 0 0 auto; width: 19px; height: 19px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 4vw, 3.15rem); line-height: 1.03; letter-spacing: -.066em; }
h2 { font-size: 1.13rem; letter-spacing: -.025em; line-height: 1.4; }
h3 { font-size: .94rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 26px 15px 18px;
  background: #f5f2ed; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 9px; margin-bottom: 43px; font-weight: 750; letter-spacing: -.035em; }
.brand small, .workspace small { display: block; margin-top: 2px; font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.brand-mark {
  width: 36px; height: 36px; display: flex; align-items: end; justify-content: center;
  gap: 3px; padding-bottom: 9px; border-radius: 10px; color: white; background: var(--accent);
}
.brand-mark i { width: 4px; height: 7px; background: currentColor; border-radius: 1px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
nav { display: grid; gap: 5px; }
nav a {
  display: flex; gap: 11px; align-items: center; min-height: 43px; padding: 0 11px;
  color: #5d574f; font-size: .9375rem; font-weight: 600; border-radius: 9px;
}
nav a:hover { background: #ede8e0; }
nav a[aria-current] { background: #eadecF; color: #61311c; }
.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid #e6ded3; }
.workspace { display: flex; gap: 9px; align-items: center; padding: 5px 6px; font-size: .875rem; }
.profile {
  display: grid; place-items: center; flex: none; height: 35px; width: 35px;
  border-radius: 50%; color: #694526; background: #e9dac5; font-weight: 700; font-size: .78rem;
}
.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(20px, 3.1vw, 48px);
  height: 62px; border-bottom: 1px solid var(--line); background: #fcfbf9; font-size: .875rem; color: var(--muted);
}
#breadcrumb span { margin: 0 5px; color: #8a8074; }
#breadcrumb strong { color: var(--ink); font-weight: 650; }
.demo { display: inline-flex; gap: 7px; align-items: center; color: #625120; font-weight: 600; }
.demo span { background: #ad7824; width: 7px; height: 7px; border-radius: 50%; }
main { max-width: 1560px; margin: 0 auto; padding: 32px clamp(20px, 3.1vw, 48px) 48px; }
.day { margin-bottom: 9px; font-size: .875rem; color: var(--accent); font-weight: 650; }
.day::first-letter { text-transform: uppercase; }
.page-heading { display: flex; gap: 16px; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.page-heading p { color: var(--muted); margin-top: 10px; line-height: 1.45; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }

.button, select {
  display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  min-height: 39px; padding: 8px 12px; border: 1px solid #e5dfd6; border-radius: 8px;
  background: var(--white); color: var(--ink); font-size: .875rem; font-weight: 650; line-height: 1.2;
}
.button:hover, select:hover { background: #f7f3ee; border-color: #d9cfc2; }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); padding-inline: 14px; }
.button.primary:hover { background: #8e361b; border-color: #8e361b; }
.button:disabled { opacity: .55; cursor: default; }
.button.small { min-height: 34px; white-space: nowrap; }
select {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, #686258 50%), linear-gradient(135deg, #686258 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-repeat: no-repeat; background-size: 5px 5px;
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.metric { display: flex; flex-direction: column; padding: 15px 16px; min-height: 126px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; font-size: .875rem; font-weight: 620; }
.metric strong { margin-top: 5px; font-size: 2.12rem; letter-spacing: -.06em; line-height: 1.11; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: .8125rem; margin-top: 5px; }
.metric.featured { background: #3b2922; color: #fff8f2; border-color: #3b2922; }
.featured small { color: #e4c9bb; }
.tile-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #f6f2ed; color: #7d4f38; flex: none; }
.featured .tile-icon { color: #ffddcb; background: #5a3c2f; }
.overview-grid, .editor-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: start; gap: 12px; justify-content: space-between; padding: 16px 18px 0; }
.panel-heading p, .form-panel > p { color: var(--muted); margin-top: 4px; font-size: .875rem; }
.chart { display: flex; align-items: stretch; gap: clamp(3px, 1vw, 15px); padding: 13px 18px 13px; }
.chart-column { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: 66px 19px; gap: 6px; text-align: center; }
.chart-column small { color: var(--muted); font-size: .8125rem; }
.bar-slot { display: flex; align-items: end; justify-content: center; background: #f7f4ef; border-radius: 5px; }
.bar { width: 100%; height: var(--value); border-radius: 5px; background: #ba5937; border: 1px solid #a94e2e; }
.bar.zero { height: 2px; border: none; background: #ded3c6; }
.sequence-summary { padding-bottom: 15px; }
.sequence-detail { display: grid; gap: 3px; border: 1px solid #f0e9e1; background: #faf7f2; margin: 12px 18px 9px; padding: 9px 11px; border-radius: 8px; overflow-wrap: anywhere; }
.sequence-detail strong { font-size: .875rem; }
.sequence-detail span { color: var(--muted); font-size: .8125rem; }
.sequence-summary > .button { margin-left: 18px; min-height: 33px; }
.counter { margin-left: 4px; padding: 2px 7px; vertical-align: 1px; border-radius: 12px; background: #f1ebe3; color: #63564b; font-size: .8rem; font-weight: 650; }
.table-wrap { overflow-x: auto; margin-top: 13px; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th { color: var(--muted); background: #f8f6f2; font-weight: 620; white-space: nowrap; }
th, td { border-top: 1px solid #eee9e2; padding: 9px 12px; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.person { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.person strong { display: block; font-weight: 650; }
.person small { color: var(--muted); font-size: .8125rem; }
.initials { flex: none; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; font-size: .75rem; font-weight: 750; }
.tone-0 { background: #f0e6f4; color: #644573; }
.tone-1 { background: #ece8d9; color: #615029; }
.tone-2 { background: #f7e7df; color: #824834; }
.tone-3 { background: #e5eee8; color: #365a46; }
.source { color: var(--muted); }
.action-cell { text-align: right; }
.status { display: inline-block; background: #f0ece8; color: #594e44; border-radius: 6px; padding: 4px 7px; font-size: .875rem; font-weight: 620; white-space: nowrap; }
.status-new { background: #f4efde; color: #674d13; }
.status-approved, .status-sent { background: #e9eef8; color: #364b79; }
.status-replied { background: #f0e8f5; color: #69437a; }
.status-positive, .status-booked { background: #e7f1e9; color: #2f6244; }
.status-bounced, .status-blocked { background: #f8e9e5; color: #883d33; }
.empty { padding: 24px 18px; color: var(--muted); }
.filters { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.search { position: relative; display: flex; align-items: center; width: min(100%, 345px); }
.search svg { position: absolute; left: 11px; color: var(--muted); }
.search input { padding-left: 35px; }
.form-panel { padding: 19px 20px; }
.form { display: grid; gap: 13px; justify-items: start; margin-top: 12px; }
.form label { display: grid; width: 100%; gap: 6px; font-size: .875rem; font-weight: 650; }
input, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #ddd5cb; border-radius: 8px; color: var(--ink); background: #fff; font-size: 1rem; }
textarea { resize: vertical; line-height: 1.45; }
.form-note { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.form-note:empty { display: none; }
.form-note[role="alert"] { color: var(--red); }
code { display: inline-block; padding: 1px 4px; border-radius: 3px; color: #644331; background: #f3ebe3; }
.email-preview { border: 1px solid var(--line); border-radius: 9px; margin: 12px 0; padding: 13px; background: #fbf9f5; overflow-wrap: anywhere; }
.email-preview p { white-space: pre-wrap; margin-top: 12px; line-height: 1.55; }
.summary-list { margin: 11px 0 0; }
.summary-list div, .history li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-list dd { margin: 0; font-weight: 700; }
.results-table td:not(:first-child), .results-table th:not(:first-child) { text-align: right; }

dialog { width: min(580px, calc(100% - 30px)); max-height: calc(100dvh - 35px); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); padding: 19px 22px; box-shadow: 0 16px 70px #36241d30; }
dialog::backdrop { background: #33291f70; }
.dialog-heading, .lead-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 1.45rem; }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; border: 0; border-radius: 8px; background: #f3eee8; color: var(--ink); }
.lead-meta { margin-top: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.lead-meta > div { min-width: 0; overflow-wrap: anywhere; }
.lead-meta small { display: block; color: var(--muted); font-size: .875rem; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.preview-block, .outcome-form, .history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.preview-block > .form-note { margin-top: 5px; }
.outcome-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.history ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: .875rem; }
.history time { color: var(--muted); }
.toast { position: fixed; bottom: 22px; right: 22px; max-width: calc(100vw - 44px); padding: 10px 14px; border-radius: 8px; background: #3b2922; color: #fff8f2; opacity: 0; pointer-events: none; z-index: 2; }
.toast.visible { opacity: 1; }

.actions, .wrap, .segment-list, .step-actions, .bulk-form, .pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.actions { justify-content: end; }
.inline-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); font-weight: 650; }
.segment-panel, .spaced { margin-block: 0 16px; }
.spaced { margin-top: 16px; }
.segment-list button[aria-pressed="true"] { color: #6d341e; background: var(--accent-light); border-color: #ddb8a6; }
.segment-list .counter { margin-left: 0; }
.filters { flex-wrap: wrap; }
.bulk-form { margin: 12px 18px 0; padding: 10px; background: #f8f5ef; border-radius: 8px; }
.bulk-form[hidden] { display: none; }
.select-cell { width: 42px; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 3px 0; accent-color: var(--accent); cursor: pointer; }
.discovery-fields { display: grid; grid-template-columns: .9fr 1.1fr 1.1fr .9fr; gap: 12px; width: 100%; }
.panel-note { margin: 12px 18px; }
.cell-note { display: block; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; margin-top: 3px; }
.pager { justify-content: end; padding: 12px 18px; color: var(--muted); font-size: .875rem; }
.campaign-layout, .library-layout { display: grid; align-items: start; gap: 14px; }
.campaign-layout { grid-template-columns: minmax(150px, .65fr) minmax(270px, 1.45fr) minmax(215px, 1fr); }
.library-layout { grid-template-columns: minmax(175px, .7fr) minmax(260px, 2fr); }
.entity-list { padding: 7px; }
.entity { display: grid; gap: 4px; text-align: left; padding: 10px 9px; width: 100%; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); overflow-wrap: anywhere; }
.entity small { font-size: .8125rem; color: var(--muted); }
button.entity:hover { background: #f7f3ec; }
.entity.active { border-color: #ead3c5; background: var(--accent-light); }
#campaign-steps { width: 100%; }
.step { min-inline-size: 0; display: grid; gap: 10px; margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.step:last-child { margin-bottom: 0; }
.step legend { padding-inline: 4px; font-size: .875rem; font-weight: 700; }
.step .inline-label { display: flex; flex-wrap: wrap; align-items: center; width: auto; }
.step input[type="number"] { width: 95px; }
.campaign-preview select { width: 100%; min-width: 0; }
.campaign-preview .preview-block { border-top: 0; padding-top: 0; }
.preview-block > .inline-label { margin-top: 10px; }
.sequence-reference { margin-top: 11px; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 177px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-layout { grid-template-columns: minmax(150px, .65fr) minmax(0, 1.5fr); }
  .campaign-preview { grid-column: 2; }
  .discovery-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 14px 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-bottom: 10px; padding: 0; }
  .brand small { display: none; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  nav a { justify-content: center; gap: 4px; padding: 4px; font-size: .875rem; min-height: 40px; }
  nav a svg { display: none; }
  .sidebar-bottom { display: none; }
  .topbar { height: 42px; }
  main { padding-top: 23px; }
  .overview-grid, .editor-grid { grid-template-columns: 1fr; }
  .campaign-layout, .library-layout { grid-template-columns: minmax(0, 1fr); }
  .campaign-preview { grid-column: auto; }
  .actions { justify-content: start; }
  .table-wrap { scrollbar-width: thin; }
}
@media (max-width: 480px) {
  .page-heading { align-items: start; flex-direction: column; margin-bottom: 21px; }
  .metric-grid { gap: 8px; }
  .metric { min-height: 112px; padding: 10px 11px; }
  .metric-top .tile-icon { display: none; }
  .filters { flex-direction: column; align-items: start; }
  .search { width: 100%; }
  .section-heading { flex-wrap: wrap; }
  .discovery-fields { grid-template-columns: minmax(0, 1fr); }
}

[hidden] {display:none!important}
.auth-panel {max-width:28rem;margin:14vh auto;padding:2rem;color:#202b29}
.auth-panel img {width:9rem;margin-bottom:2rem}
.auth-panel h1 {font-size:2rem}
.auth-panel p {line-height:1.55}
#sign-out {display:block;background:transparent;border:0;padding:4px 0;color:inherit;text-decoration:underline;cursor:pointer}
