/* TrafficResponder on the DownlineAI design system (white paper, one action colour, flat panels) in blue and orange, Bricolage Grotesque headings and Instrument Sans text.
   Both fonts are self-hosted (SIL OFL), copied from the DownlineAI repo. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* Blue and orange on DownlineAI's structure: navy takes the place of its charcoal (text, headings,
   secondary buttons), orange its coral (calls to action, accent words), blue marks links and where you are. */
:root {
  --brand: #ea580c;         /* orange: primary buttons, accent words in headlines */
  --brand-dark: #c2410c;
  --brand-soft: #fff1e7;    /* orange tint for chips */
  --link: #1d4ed8;          /* blue: links and active navigation */
  --link-soft: #eaf0ff;
  --ink: #0f1d3a;           /* navy: headings, text, secondary buttons */
  --text: #1b2740;
  --muted: #5b6579;
  --surface: #f3f6fb;       /* cool panels, table heads, hover */
  --panel: #ffffff;
  --line: #e3e8f1;
  --line-strong: #cfd7e4;
  --green: #17845c; --green-soft: #e8f5ef;
  --red: #c62828; --red-soft: #fdecec;
  --yellow: #a16207; --yellow-soft: #fdf6e3;
  --radius: 12px;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  /* names used by the builder and older views */
  --orange: var(--brand); --blue: var(--ink); --surface-2: var(--surface);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { background: #fff; }
body { margin: 0; color: var(--text); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { margin-top: 0; color: var(--ink); font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
h3, h4 { font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
h1 em, h2 em, .accent { font-style: normal; color: var(--brand); }
::selection { background: rgba(234, 88, 12, .18); }
a { color: var(--link); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 40px; }
.center { text-align: center; }
.small { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.warn { color: var(--brand); font-weight: 600; }

/* ---------- Public site ---------- */
.logo { display: inline-flex; align-items: center; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: -0.04em; }
.logo:hover { text-decoration: none; }
.logo img { display: none; }
.logo b { color: var(--brand); font-weight: 800; }
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.site-nav { display: flex; gap: 28px; flex: 1; font-size: 15px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a.active { color: var(--ink); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: 15px; }
.site-actions .link { color: var(--muted); }
.site-actions .link:hover { color: var(--ink); text-decoration: none; }
.site-head .menu-toggle { display: none; }
#content { min-height: 60vh; }
.page-section { padding: 80px 0; }
.page-section.alt { border-top: 1px solid var(--line); }
.page-head { padding: 72px 0 40px; }
.page-head h1 { margin: 0 0 18px; font-size: clamp(44px, 6vw, 80px); line-height: .98; }
.page-head .lead { max-width: 40rem; }
.eyebrow { display: block; margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--muted); }

/* Hero */
.hero { padding: 64px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.hero h1 { margin: 0 0 28px; font-size: clamp(50px, 6.1vw, 88px); line-height: .98; }
.hero .lead { margin: 0 0 32px; max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.hero-shot, .feature-shot { padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.hero-shot img, .feature-shot img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.trust span::before { content: "✓"; margin-right: 8px; color: var(--green); font-weight: 700; }

/* Sections and cards */
.center-head { max-width: 760px; margin: 0 0 48px; }
.center-head h2 { margin: 0 0 14px; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02; }
.center-head p { margin: 0; font-size: 18px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card, .panel, .box, .step, .stat, .plan, .campaign-card, .faq details, .message-box, .form-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card { display: block; padding: 24px; color: var(--text); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.card .icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 18px; font-weight: 700; }
.card.orange .icon { background: var(--link-soft); color: var(--link); }
a.card { transition: border-color .15s ease; }
a.card:hover { text-decoration: none; border-color: var(--line-strong); }
.feature-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; margin: 0 0 104px; }
.feature-row:last-child { margin-bottom: 0; }
.feature-row.reverse .feature-text { order: 2; }
.feature-text h2 { margin: 0 0 18px; font-size: clamp(32px, 3.8vw, 48px); line-height: 1.02; }
.feature-text p { color: var(--muted); font-size: 17px; }
.checks { margin: 20px 0; padding: 0; list-style: none; }
.checks li { margin-bottom: 14px; padding-left: 18px; border-left: 2px solid var(--brand); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 28px; background: var(--surface); border-color: transparent; }
.step h3 { margin: 0 0 8px; font-size: 20px; }
.step p { margin: 0; font-size: 15px; color: var(--muted); }
.step-num { display: block; margin-bottom: 18px; color: var(--brand); font-family: var(--display); font-weight: 800; font-size: 32px; letter-spacing: -0.03em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.stat > span { font-size: 13px; color: var(--muted); }
.stat.orange b { color: var(--brand); }
.cta-band { padding: 0 0 96px; }
.cta-band .wrap > * { position: relative; }
.cta-band .wrap { padding-top: 64px; padding-bottom: 64px; border-radius: 0; }
.cta-band .wrap { background: var(--surface); border-radius: 20px; max-width: calc(1320px - 80px); text-align: left; }
.cta-band h2 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 52px); }
.cta-band p { margin: 0 0 28px; color: var(--muted); font-size: 18px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: 20px; }
.plan { position: relative; display: flex; flex-direction: column; padding: 32px; }
.plan.featured { border: 2px solid var(--ink); }
.plan .ribbon { position: absolute; top: -12px; left: 24px; padding: 3px 9px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.plan h3 { margin: 0; font-size: 18px; }
.plan .price { margin: 14px 0 4px; font-family: var(--display); font-size: 56px; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -0.04em; }
.plan .price span { font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan .checks { flex: 1; }
.plan .btn { width: 100%; }
.plan form { margin: 0; }

/* Content pages */
.prose { max-width: 720px; font-size: 17px; line-height: 1.7; }
.prose h2 { margin: 44px 0 12px; font-size: 30px; }
.prose h3 { margin: 30px 0 8px; font-size: 21px; }
.prose li { margin-bottom: 6px; }
.faq { max-width: 860px; }
.faq details { margin-bottom: 10px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16px; color: var(--ink); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }
.faq dt { margin-top: 20px; font-weight: 600; color: var(--ink); }
.faq dd { margin: 6px 0 0; color: var(--muted); }
.price-table td.was { color: var(--muted); text-decoration: line-through; }
.price-table td.now { font-weight: 800; color: var(--ink); }
.legal { max-width: 800px; }
.legal h3 { margin-top: 28px; }
.disclaimer { padding: 16px 20px; border-radius: var(--radius); background: var(--surface); font-size: 14px; color: var(--muted); }

/* Footer */
.site-foot { margin-top: 64px; padding: 48px 0 36px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13px; }
.site-foot .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-foot h4 { margin: 0 0 12px; font-family: var(--body); color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.site-foot a { display: block; margin-bottom: 8px; color: var(--muted); }
.site-foot a:hover { color: var(--ink); text-decoration: none; }
.site-foot .logo { margin-bottom: 14px; }
.site-foot .fine { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 11.5px; }

/* ---------- Buttons: accent = primary action, charcoal = secondary, plain = quiet ---------- */
.btn, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink) !important;
  font: 600 15px/1 var(--body); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface); border-color: var(--line-strong); }
.btn-primary, input[type=submit] { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.btn-primary:hover, input[type=submit]:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-blue { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.btn-blue:hover { background: #1e3a8a; border-color: #1e3a8a; }
.btn-big { padding: 15px 26px; font-size: 16px; }
.btn-quiet { background: var(--panel); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; font-weight: 600; color: var(--ink); }
.btn-link:hover { text-decoration: none; background: var(--surface); }
button { font-family: var(--body); }

/* ---------- Inputs ---------- */
input:not([type=hidden]):not([type=radio]):not([type=checkbox]):not([type=submit]), select, textarea {
  max-width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink);
  font: 16px var(--body); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #8b95a8; }
input:focus, select:focus, textarea:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(234, 88, 12, .16) !important; }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; vertical-align: -3px; }
textarea { width: 100%; }
textarea.code { font: 13px/1.5 var(--mono); }
input.short, input.tiny { width: 110px; }
input.long, input.full { width: 100%; }
input.short-link { width: 100%; min-width: 240px; font: 13px var(--mono) !important; background: var(--surface) !important; }
input.short-dt { width: 210px; }
label { font-weight: 500; }

/* ---------- Tables ---------- */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
table.grid th { padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
table.grid td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: #f8fafd; }
table.grid tr.selected td { background: var(--brand-soft); }
table.grid td.q { width: 34%; font-weight: 600; color: var(--ink); }
table.grid td.sub { color: var(--muted); }
table.grid tr.total td { font-weight: 800; background: var(--surface); }
table.grid.compact { margin: 8px 0 0; font-size: 13px; }
table.grid.compact th, table.grid.compact td { padding: 6px 10px; }
table.grid tr.sources-row > td { padding: 4px 16px 12px; background: var(--surface); }
table.grid tr.sources-row summary { cursor: pointer; color: var(--muted); font-size: 13px; }
table.grid.trackers input.short-link { min-width: 0; }
table.grid.trackers td:first-child .small { word-break: break-all; }
table.form-grid input:not([type=radio]):not([type=checkbox]), table.form-grid textarea, table.form-grid select { width: 100%; }
table.form { border-collapse: collapse; width: 100%; }
table.form td { padding: 7px 6px; vertical-align: top; }
table.form td:first-child { width: 34%; padding-top: 17px; font-weight: 600; color: var(--ink); font-size: 14px; }
.form-page { display: grid; place-items: center; padding: 56px 16px; }
.form-box { width: 100%; max-width: 460px; overflow: hidden; }
.form-box > .form-box-head { padding: 28px 30px 4px; font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.05; }
.form-box > form, .form-box > div, .form-box > p { padding: 0 30px; }
.form-box > form { padding-bottom: 28px; }
.form-box > .error, .form-box > .notice { margin: 12px 30px; padding: 12px 16px; }
.form-box table.form td { display: block; width: 100%; padding: 5px 0; }
.form-box table.form td:first-child { padding-top: 10px; width: 100%; }
.form-box input:not([type=checkbox]):not([type=submit]) { width: 100%; }
.form-box input[type=submit] { width: 100%; padding: 13px; margin-top: 8px; }
.mini-form label, .inline-form { display: inline-flex; align-items: center; gap: 8px; }
.inline-form { flex-wrap: wrap; margin: 0; }
.linkbox input { width: 100%; }

/* ---------- Messages, pills ---------- */
.error, .notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; font-size: 14.5px; }
.error { background: var(--red-soft); color: var(--red); }
.notice { background: var(--green-soft); color: var(--green); }
.notice::before { content: "✓"; font-weight: 700; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 20px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 14.5px; }
.banner b { color: #fff; }
.banner .btn { margin-left: auto; }
.banner.blue { background: var(--surface); color: var(--ink); }
.banner.blue b { color: var(--ink); }
.badge, .pill { display: inline-flex; align-items: center; gap: .35rem; padding: 3px 9px; border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; }
.pill.trial, .badge { background: var(--brand-soft); color: var(--brand-dark); }
.pill.active, .pill.transferred { background: var(--green-soft); color: var(--green); }
.pill.past_due, .pill.held { background: var(--yellow-soft); color: var(--yellow); }
.pill.lapsed, .pill.new, .pill.void, .pill.reversed { background: var(--surface); color: var(--muted); }
.pill.suspended { background: var(--red-soft); color: var(--red); }
.message-box { max-width: 560px; margin: 72px auto; padding: 36px; text-align: center; }
.message-box h1 { font-size: 32px; }
.meter { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--link), var(--brand)); }

/* ---------- Back Office: left sidebar like DownlineAI's app ---------- */
body.office { background: #fff; }
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; flex: 0 0 236px; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; }
.sidebar .logo { padding: 2px 10px 20px; font-size: 21px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.side-group { margin: 18px 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.side-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: var(--link-soft); color: var(--link); font-weight: 600; }
.side-nav .ico { width: 16px; text-align: center; font-size: 13px; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.side-foot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.side-foot form { margin: 0; }
.side-foot button { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.side-foot button:hover { color: var(--ink); }
.office-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 36px 40px 0; }
.office-body { flex: 1; }
.office-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; }
.office-title h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.office-title .actions { margin-left: auto; display: flex; gap: 8px; }
.office-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding: 18px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.office-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.office-foot a { color: var(--muted); }
.office-foot a:hover { color: var(--ink); text-decoration: none; }
.panel, .box { margin-bottom: 20px; padding: 18px 20px; }
.panel-head, .box-head { margin: -18px -20px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.box-body p:first-child { margin-top: 0; }
.box-body.links a { display: block; padding: 4px 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.two-col .side-left { order: 2; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
h2.section { margin: 32px 0 14px; font-size: 21px; color: var(--ink); }
h2.section:first-child, .main > h2.section:first-child { margin-top: 0; }
.mgr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }
.mgr-title { color: var(--muted); font-size: 14px; }
.mgr-bar b { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.subtabs { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 26px; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.subtabs li a { display: block; padding: 10px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.subtabs li a:hover { text-decoration: none; color: var(--ink); }
.subtabs li.active a { border-bottom-color: var(--link); color: var(--ink); font-weight: 600; }
.campaign-card { padding: 18px 20px; }
.campaign-card-head { font-weight: 700; font-size: 17px; color: var(--ink); }
.campaign-card-stats { display: flex; gap: 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.editor-head { margin: 24px 0 10px; font-weight: 600; color: var(--ink); }
.preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.action-row form { margin: 0; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; padding: 14px 18px; border-radius: var(--radius); background: var(--red-soft); font-size: 14px; color: var(--red); }
.danger-zone .btn { margin-left: auto; color: var(--red) !important; border-color: #f5d0d0; }
.form-preview { padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; }
.admin-table td { font-size: 13px; }

/* HTML toolbar above letter and broadcast editors */
.html-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 10px 10px 0 0; }
.html-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.tb-btn { min-width: 30px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink); font: 13px var(--body); cursor: pointer; }
.tb-btn:hover { background: #fff; border-color: var(--line); color: var(--brand); }
.tb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-strong); }
.tb-tokens { margin-left: auto; padding: 5px 8px !important; font-size: 13px !important; }

/* Embedded capture form host page */
.capture-page { max-width: 560px; margin: 40px auto; }
.capture-head { margin-bottom: 14px; font-weight: 700; color: var(--ink); }

/* Landing page builder: starter gallery */
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 12px 0; }
.starter-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.starter-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234, 88, 12, .16); }
.starter-thumb { height: 190px; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.starter-thumb iframe { display: block; width: 1200px; height: 1000px; border: 0; transform: scale(.2); transform-origin: 0 0; pointer-events: none; }
.new-page-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Landing page builder: editor */
.builder-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 4px 0 16px; }
.builder-top h2 { margin: 0; font-size: 26px; }
.builder-stats { color: var(--muted); font-size: 13px; }
.builder-top .btn-link:last-child { margin-left: auto; }
.builder { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.builder-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.builder .panel { padding: 12px; margin: 0; }
.builder .panel-head { margin: -12px -12px 10px; padding: 10px 12px; font-size: 13px; }
.builder .panel label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.builder .panel input:not([type=radio]):not([type=checkbox]), .builder .panel select, .builder .panel textarea { width: 100%; padding: 7px 10px; font-size: 14px; }
.builder .panel details summary { cursor: pointer; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.theme-swatches { display: flex; gap: 7px; flex-direction: row; }
.theme-swatches label { margin: 0 !important; }
.theme-swatches input { position: absolute; opacity: 0; }
.swatch { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.theme-swatches input:checked + .swatch { box-shadow: 0 0 0 2px var(--ink); }
.sw-blue { background: #2563eb; } .sw-green { background: #16a34a; } .sw-red { background: #dc2626; } .sw-gold { background: #d97706; } .sw-purple { background: #7c3aed; } .sw-slate { background: #334155; }
.block-list { list-style: none; margin: 0 0 8px; padding: 0; }
.block-item { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; padding: 7px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.block-item.selected { border-color: var(--brand); background: var(--brand-soft); }
.block-item.dragging { opacity: .4; }
.block-item.drop-target { border-top: 3px solid var(--brand); }
.block-grip { color: #a3adc0; cursor: grab; letter-spacing: -2px; }
.block-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--ink); }
.block-name small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-tools button { padding: 1px 5px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.block-tools button:hover { color: var(--brand); }
.builder-save { display: flex; align-items: center; gap: 10px; }
.builder-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); }
.device-toggle button { padding: 5px 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; }
.device-toggle button:first-child { border-radius: 8px 0 0 8px; }
.device-toggle button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.device-toggle button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.preview-stage { height: 760px; overflow: hidden; }
.preview-stage iframe { display: block; border: 0; background: #fff; transform-origin: 0 0; }
.preview-stage.mobile { display: flex; justify-content: center; padding: 16px 0; }
.preview-stage.mobile iframe { width: 390px; height: 100%; border-radius: 22px; box-shadow: 0 10px 30px rgba(15, 29, 58, .18); }

/* Motion */
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .wrap > * { animation: fadeup .6s ease-out both; }
.hero .wrap > :nth-child(2) { animation-delay: .1s; }
@media (prefers-reduced-motion: reduce) { .hero .wrap > * { animation: none; } }

/* ---------- Responsive ---------- */
@media (min-width: 1536px) {
  .wrap { max-width: 1600px; }
  .cta-band .wrap { max-width: calc(1600px - 80px); }
  .hero h1 { font-size: 112px; }
}
@media (max-width: 1000px) {
  .hero .wrap, .feature-row { grid-template-columns: 1fr; gap: 40px; }
  .feature-row.reverse .feature-text { order: 0; }
  .site-foot .cols { grid-template-columns: 1fr 1fr; }
  .builder { grid-template-columns: 1fr; }
  .builder-side { position: static; max-height: none; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .wrap { padding: 0 20px; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 16px; padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line); }
  .site-head:has(.menu-toggle input:checked) .site-nav { display: flex; }
  .site-head .menu-toggle { display: inline-flex; margin-left: auto; }
  .site-actions .link { display: none; }
  .steps, .three-col, .plans { grid-template-columns: 1fr; }
  .app { flex-direction: column; }
  .sidebar { position: static; height: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-group { display: none; }
  .office-main { padding: 24px 20px 0; }
  .page-section { padding: 56px 0; }
  .cta-band .wrap { max-width: calc(100% - 40px); padding: 40px 24px; }
}

/* Marketing kit */
.kit-intro { max-width: 60rem; color: var(--muted); }
.kit-field { display: block; margin-bottom: 12px; font-weight: 600; }
.kit-field .linkbox { display: block; margin-top: 6px; font-weight: 400; }
.kit-rotation { display: grid; gap: 10px; }
.kit-pick { display: flex; align-items: center; gap: 12px; }
.kit-pick img, .kit-banner img { max-width: min(100%, 600px); height: auto; border-radius: 4px; }
.kit-table td { vertical-align: top; }
.kit-table textarea, .kit-table input { width: 100%; min-width: 220px; }
.kit-banners { display: grid; gap: 18px; }
.kit-banners-small { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kit-banner { display: grid; gap: 8px; justify-items: start; }
.kit-banner textarea { width: 100%; }
.kit-subjects { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; max-width: 40rem; }
.kit-subjects input { width: 100%; }
.promo-checks { margin: 0 0 28px; }
.promo-hero .eyebrow b { color: var(--ink); }
.promo-hero { padding: 40px 0 56px; }
.promo-hero h1 { font-size: clamp(42px, 4.6vw, 68px); margin-bottom: 20px; }
.promo-hero .lead { margin-bottom: 20px; }
.promo-checks li { margin-bottom: 10px; }
.plans-centered .center-head { margin: 0 auto 48px; text-align: center; }
.plans-centered .plans { grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: 28px; }
.promo-included { max-width: 1100px; margin: 64px auto 0; padding: 36px 40px; border-radius: 20px; background: var(--surface); }
.promo-included h3 { margin: 0 0 24px; font-size: 22px; text-align: center; }
.promo-included ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 36px; margin: 0; padding: 0; list-style: none; }
.promo-included li { font-size: 15px; color: var(--muted); }
.promo-included li b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16px; }
.promo-final { margin-top: 48px; text-align: center; }
@media (max-width: 860px) {
  .plans-centered .plans { grid-template-columns: minmax(0, 1fr); }
  .promo-included { padding: 28px 22px; }
  .promo-included ul { grid-template-columns: minmax(0, 1fr); }
}
/* Public affiliate page: earnings and questions side by side */
.earn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.earn-grid h2 { margin: 0 0 14px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; }
.earn-lead { margin: 0 0 24px; color: var(--muted); font-size: 17px; }
.earn-grid .faq { max-width: none; }
.earn-grid .disclaimer { margin: 0; }
@media (max-width: 900px) { .earn-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* Sponsor banner (Back Office) and Advertise */
.office-feature { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 20px; }
.office-feature img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.office-feature-label { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.banner-table img { max-width: 100%; height: auto; border-radius: 4px; }
.banner-actions form { margin: 0 0 6px; }
.banner-new { max-width: 820px; }
.banner-new input[type=url], .banner-new input[name=alt] { width: 100%; }
.banner-preview img { display: block; max-width: 100%; height: auto; margin: 4px 0 14px; border-radius: 6px; }
.banner-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 14px; padding: 0; border: 0; }
.banner-packs legend { margin-bottom: 8px; font-weight: 600; }
.banner-pack { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.banner-pack:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.banner-pack input { justify-self: start; }
.banner-pack span { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--ink); }
.banner-pack small { color: var(--muted); }
@media (max-width: 700px) { .banner-packs { grid-template-columns: minmax(0, 1fr); } }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.promo-preset-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.promo-preset-body img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; }
.promo-preset-body h3 { margin: 0 0 6px; font-size: 20px; }
@media (max-width: 700px) { .promo-preset-body { grid-template-columns: 1fr; } }
.share-panel { margin-top: 24px; }
.share-code { font-family: var(--mono); letter-spacing: .05em; color: var(--ink); }
.share-import { margin-top: 28px; }
.share-import .inline-form { display: flex; width: 100%; }
.share-import input[name=code] { flex: 1; min-width: 0; }
.share-preview { max-width: 1000px; margin: 0 auto; }
.share-preview h1 { margin: 0 0 12px; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 28px; }
.share-letters { padding-left: 20px; }
.share-letters li { margin-bottom: 6px; }
.share-letters .small { display: inline-block; min-width: 54px; }
@media (max-width: 800px) { .share-grid { grid-template-columns: 1fr; } .share-import input[name=code] { min-width: 0; width: 100%; } }

/* ---------- Layout fixes: phones and large screens ---------- */
.nav-phone, .phone-only, .side-toggle { display: none; }
/* Banners with a button sit in a row; plain-text banners flow as one sentence. */
.banner:not(:has(.btn)) { display: block; }
/* Back Office forms: a fixed label column and inputs of a readable width on wide screens. */
table.grid td.q { width: 200px; }
table.form-grid input:not([type=hidden]):not([type=radio]):not([type=checkbox]):not([type=submit]), table.form-grid textarea, table.form-grid select { max-width: 680px; }
.page-head-centered { text-align: center; }
.page-head-centered .lead { margin-left: auto; margin-right: auto; }
/* Wide screens: a larger product screenshot beside a headline sized to keep its lines. */
@media (min-width: 1536px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .hero h1 { font-size: 88px; }
}
.office-body table.form td:first-child { width: 200px; font-weight: 600; color: var(--ink); }
.office-body table.form input:not([type=hidden]):not([type=radio]):not([type=checkbox]):not([type=submit]), .office-body table.form textarea { max-width: 680px; }

@media (max-width: 820px) {
  .site-head .wrap { gap: 12px; }
  .site-actions { display: none; }
  .site-nav .nav-phone { display: block; }
  .site-nav .nav-phone:last-child { color: var(--brand); font-weight: 600; }

  /* Back Office: a slim top bar, the links open from Menu. */
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
  .sidebar .logo { padding: 0; margin-right: auto; }
  .side-toggle { display: inline-flex; }
  .side-nav, .side-foot { display: none; width: 100%; }
  .sidebar:has(.side-toggle input:checked) .side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding-top: 8px; }
  .sidebar:has(.side-toggle input:checked) .side-foot { display: flex; padding-bottom: 6px; }
  .side-nav a { padding: 10px 12px; }

  .stats { grid-template-columns: 1fr 1fr; }
  /* Wide tables scroll inside their own box instead of widening the page. */
  table.grid { display: block; overflow-x: auto; }
  table.form-grid, table.form-grid tbody, table.form-grid tr, table.form-grid td { display: block; width: 100%; }
  table.form-grid td.q { padding-bottom: 0; border-bottom: 0; }
  .office-body table.form, .office-body table.form tbody, .office-body table.form tr, .office-body table.form td { display: block; width: 100%; }
  .office-body table.form td:first-child { padding-bottom: 4px; }
  table.grid td.q { width: auto; }
  .kit-table textarea, .kit-table input { min-width: 200px; }

  /* The page builder needs a bigger screen. */
  .phone-only { display: block; }
  #page-form { display: none; }
  .builder-phone-note { margin-bottom: 20px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); }
  .builder-phone-note p { margin: 6px 0 0; }
}
.getting-started .panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.steps-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: gs; }
.steps-list li { counter-increment: gs; position: relative; padding-left: 32px; font-size: 14.5px; }
.steps-list li::before { content: counter(gs); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 22px; text-align: center; }
.steps-list li.done { color: var(--muted); text-decoration: line-through; }
.steps-list li.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.share-thumb { height: 240px; margin-bottom: 24px; box-shadow: 0 16px 36px -20px rgba(15, 29, 58, .35); }

/* Content pages (FAQ, About, Deliverability, articles, legal): readable text with a side card */
.content-grid { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 64px; justify-content: space-between; align-items: start; }
.content-grid .faq { max-width: none; }
.content-grid .prose { max-width: none; }
.aside-card { position: sticky; top: 96px; padding: 24px; border-radius: var(--radius); background: var(--surface); }
.aside-card h3 { margin: 0 0 6px; font-size: 18px; }
.aside-card p { margin: 0 0 14px; font-size: 15px; color: var(--muted); }
.aside-card hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.aside-card .btn { width: 100%; text-align: center; }
.value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 12px; }
.value-grid > div { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); }
.value-grid h3 { margin: 0 0 4px !important; font-size: 17px !important; }
.value-grid p { margin: 0; font-size: 15px; color: var(--muted); }
.prose .glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 24px; margin: 0 0 8px; }
.prose .glance li { margin-bottom: 8px; }
@media (max-width: 900px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .aside-card { position: static; }
  .value-grid { grid-template-columns: minmax(0, 1fr); }
}
.aside-stack { position: sticky; top: 96px; display: grid; gap: 16px; }
.aside-stack .aside-card { position: static; }
.aside-links nav { display: grid; gap: 2px; margin: 4px -10px 0; }
.aside-links a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14.5px; }
.aside-links a:hover, .aside-links a.here { background: var(--panel); color: var(--ink); text-decoration: none; }
.aside-links a.here { font-weight: 600; }
.page-head .eyebrow a { color: inherit; }
.card-more { display: inline-block; margin-top: 14px; color: var(--link); font-size: 14.5px; font-weight: 600; }
a.card:hover { border-color: var(--line-strong); text-decoration: none; }
.series { list-style: none; margin: 8px 0 20px; padding: 0; display: grid; gap: 8px; }
.series li { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--surface); }
.series-day { font-weight: 700; color: var(--brand); font-size: 14px; }
@media (max-width: 900px) { .aside-stack { position: static; } }

/* Jordan, the DownlineAI chat: its script pins the button 18px from the bottom, over our footer links. Lift the
   button, the message preview and the panel clear of the footer. */
body > button[aria-label^="Chat with"] { bottom: 80px !important; }
body > div[role="status"][style*="2147483000"] { bottom: 138px !important; }
body > div:has(> iframe[src^="https://downlineai.com/"]) { bottom: 150px !important; max-height: calc(100vh - 170px) !important; }
@media (max-width: 640px) {
  body > button[aria-label^="Chat with"] { bottom: 104px !important; }
  body > div[role="status"][style*="2147483000"] { bottom: 162px !important; }
  body > div:has(> iframe[src^="https://downlineai.com/"]) { bottom: 174px !important; max-height: calc(100vh - 194px) !important; }
}
