/*
  Onboarding — shares the marketing site's identity.
  Grey means handled. Orange means you: it marks the step that is yours, the
  selected plan, and the button that moves you forward. Nothing else.
*/

:root {
  --ground: #d9dcd4;
  --sheet: #eef0ea;
  --ink: #171a16;
  --body: #2b2f2a;
  --muted: #5f655c;
  --rule: #b4b9ad;
  --rule-soft: #c6cabf;
  --attention: #e8531f;
  --attention-ink: #fff7f3;
  --danger: #a8261c;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --col: min(880px, 100% - 2 * clamp(20px, 5vw, 56px));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--ground);
  color: var(--body);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--attention); outline-offset: 3px; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--sheet); padding: 0.05em 0.35em; border-radius: 3px; }

/* ---------- header ---------- */

.top {
  width: var(--col);
  margin: 0 auto;
  padding: 26px 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.signin-toggle {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.signin-toggle:hover { color: var(--ink); }

.signin {
  width: var(--col);
  margin: 18px auto 0;
  padding: 18px 20px;
  background: var(--sheet);
  border-radius: 6px;
}
.signin label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.signin .row { display: flex; flex-wrap: wrap; gap: 10px; }
.signin input { flex: 1 1 240px; }

/* ---------- flow ---------- */

.flow {
  width: var(--col);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) 0 72px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 28px;
}
.bar { flex: 1; max-width: 260px; height: 3px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); transition: width 300ms ease; }

h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}
h1:focus { outline: none; }

h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0 0 32px;
  max-width: 58ch;
  font-size: 1.15rem;
  color: var(--muted);
}

p { margin: 0; }

/* ---------- fields ---------- */

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}
.field > span { font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 5px;
  transition: border-color 120ms ease;
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 28px; }
.chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 12px;
  background: transparent;
  color: var(--body);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

.error {
  color: var(--danger);
  font-weight: 500;
  margin: -8px 0 18px;
}
.hint { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }
.fine { color: var(--muted); font-size: 0.88rem; margin-top: 28px; max-width: 60ch; }
.fine a { text-decoration-color: var(--rule); text-underline-offset: 3px; }

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 8px;
}

.button {
  display: inline-block;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  color: var(--attention-ink);
  background: var(--attention);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease;
}
.button:hover { background: #d4471a; }
.button:disabled { opacity: 0.6; cursor: wait; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.link:hover { text-decoration-color: var(--ink); }

/* ---------- compose + preview ---------- */

.compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
  margin-bottom: 20px;
}

.preview {
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: 18px 20px 16px;
  font-size: 0.97rem;
  position: sticky;
  top: 20px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.example-tag { color: var(--attention); font-weight: 500; }
.preview-meta { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 0.9rem; }
.preview-meta b { display: inline-block; width: 4.2em; color: var(--muted); font-weight: 500; }
.preview-body { padding: 16px 0 8px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.preview-foot { color: var(--muted); font-size: 0.8rem; text-decoration: underline; padding-top: 8px; }

/* ---------- what will happen ---------- */

.plan-of-action {
  list-style: none;
  margin: 0 0 12px;
  padding: 0 0 0 40px;
  counter-reset: act;
  position: relative;
}
.plan-of-action li {
  counter-increment: act;
  position: relative;
  padding: 0 0 26px;
}
.plan-of-action li::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}
.plan-of-action li:last-child::before { height: 14px; bottom: auto; }
.plan-of-action li::after {
  content: counter(act);
  position: absolute;
  left: -39px;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--ground);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}
.plan-of-action li.yours::after { background: var(--attention); border-color: var(--attention); color: var(--attention-ink); }
.plan-of-action li.yours h2 { color: var(--attention); }
.plan-of-action p { color: var(--muted); max-width: 60ch; }

/* ---------- plans ---------- */

.plans { display: grid; border-top: 1px solid var(--rule); margin-bottom: 8px; }

.plan {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "mark name price"
    "mark detail detail"
    "mark note note";
  column-gap: 16px;
  row-gap: 2px;
  padding: 18px 8px 18px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.plan input {
  grid-area: mark;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 5px 0 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  cursor: inherit;
}
.plan input:checked { border-color: var(--attention); background: radial-gradient(var(--attention) 45%, transparent 50%); }
.plan input:focus-visible { outline: 2px solid var(--attention); outline-offset: 3px; }
.plan-name { grid-area: name; font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.plan-price { grid-area: price; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-detail { grid-area: detail; color: var(--muted); font-size: 0.95rem; }
.plan-link { grid-area: note; justify-self: start; margin-top: 6px; color: var(--ink); font-weight: 600; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.plan-note { grid-area: note; margin-top: 6px; color: var(--muted); font-size: 0.88rem; }
.plan.unavailable { cursor: default; }
.plan.unavailable .plan-name, .plan.unavailable .plan-price { color: var(--muted); }
.plan.unavailable input { border-color: var(--rule); }

/* Payment method, shown only when there is more than one. */
.paywith {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 14px;
  margin: 18px 0 6px;
}
.paywith-label { flex: 0 0 100%; font-weight: 600; color: var(--ink); }
.payopt {
  flex: 1 1 220px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "mark name" "mark detail";
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
}
.payopt.selected { border-color: var(--ink); background: var(--sheet); }
.payopt input { grid-area: mark; appearance: none; width: 16px; height: 16px; margin: 4px 0 0; border: 2px solid var(--ink); border-radius: 50%; }
.payopt input:checked { border-color: var(--attention); background: radial-gradient(var(--attention) 45%, transparent 50%); }
.payopt b { grid-area: name; color: var(--ink); }
.payopt span { grid-area: detail; color: var(--muted); font-size: 0.88rem; }

/* PayPal renders its own button into this; keep it the width of ours. */
.paypal-buttons { min-width: 260px; max-width: 360px; flex: 1 1 260px; }

/* ---------- legal pages ---------- */

.prose { max-width: min(68ch, var(--col)); }
.prose h1 { margin-bottom: 8px; }
.prose h2 { margin: 36px 0 8px; font-size: 1.2rem; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
a.signin-toggle { text-decoration: underline; }

/* ---------- review screen ---------- */

.top-nav { display: flex; align-items: baseline; gap: 22px; color: var(--muted); }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top-nav a:hover { color: var(--ink); }
.top-nav .who { font-size: 0.9rem; }

.review { max-width: min(880px, var(--col)); }
.crumb { color: var(--muted); font-size: 0.93rem; margin-bottom: 14px; }
.crumb a { color: var(--muted); text-decoration-color: var(--rule); text-underline-offset: 3px; }

.review-summary {
  padding: 16px 0 18px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}
.review-summary p:first-child { color: var(--ink); font-weight: 500; }

.people { list-style: none; margin: 0; padding: 0; }
.person { padding: 18px 0 14px; border-bottom: 1px solid var(--rule); }
.person-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.person-who { display: grid; gap: 1px; min-width: 0; }
.person-who b { color: var(--ink); font-size: 1.05rem; }
.person-who span { color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.person-email { font-size: 0.88rem; }
.person-actions { display: flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.person-state { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.person.skipped .person-who b, .person.skipped .person-who span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.person.skipped .person-state { color: var(--muted); }
.person.skipped .message { opacity: 0.5; }

.message { margin-top: 10px; }
.message summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  padding: 10px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-radius: 5px;
  list-style: none;
}
.message summary::-webkit-details-marker { display: none; }
.message summary::before { content: "Subject: "; color: var(--muted); font-weight: 400; }
.message[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.message-body {
  padding: 16px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.message-foot { margin: 14px 0 0; color: var(--muted); font-size: 0.8rem; text-decoration: underline; }

.approve-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 22px;
  padding: 16px 18px;
  background: var(--ink);
  color: #d8dcd2;
  border-radius: 6px;
  box-shadow: 0 -12px 30px -20px rgba(23, 26, 22, 0.6);
}
.approve-bar b { color: #fff; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.approve-bar #approve-skipped { color: #9aa094; margin-left: 6px; }
.approve-bar .button:disabled { opacity: 0.5; cursor: not-allowed; }

.empty { padding: 28px 0; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 56ch; margin-bottom: 20px; }

@media (max-width: 640px) {
  .person-head { flex-direction: column; }
  .approve-bar { border-radius: 0; margin-left: calc(-1 * clamp(20px, 5vw, 56px)); margin-right: calc(-1 * clamp(20px, 5vw, 56px)); }
}

/* ---------- done ---------- */

.done .lead b { color: var(--ink); }

/* ---------- footer ---------- */

.foot {
  width: var(--col);
  margin: 0 auto;
  padding: 24px 0 44px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  color: var(--muted);
  font-size: 0.93rem;
}
.foot > span { color: var(--ink); font-weight: 700; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.foot a { color: var(--muted); text-decoration-color: var(--rule); text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .compose { grid-template-columns: 1fr; }
  .preview { position: static; }
  .plan { grid-template-columns: auto 1fr; grid-template-areas: "mark name" "mark price" "mark detail" "mark note"; }
  .foot nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bar i, .button, input, textarea { transition: none; }
}

/* ======================================================================
   Dashboard
   ====================================================================== */

.flow.wide { max-width: min(1040px, 100% - 2 * clamp(20px, 5vw, 56px)); }

.top-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.top-nav .who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.page-head .lead { margin: 6px 0 0; }
.lead.attention { color: var(--attention); font-weight: 500; }

/* Primary actions that are not "you're needed" are ink, never orange. */
.button.ink { background: var(--ink); color: #f4f5f1; }
.button.ink:hover { background: #2b2f2a; }
.button.quiet { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.button.quiet:hover { border-color: var(--ink); background: var(--sheet); }

.notice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 22px;
  background: var(--sheet);
  border-left: 4px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
}
.notice-close { margin-left: auto; background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.notice-close:hover { color: var(--ink); }

/* ---------- plan strip ---------- */

.plan-strip {
  display: grid;
  grid-template-columns: auto 1fr 1fr auto;
  align-items: center;
  gap: 16px clamp(20px, 4vw, 44px);
  padding: 14px 18px;
  margin-bottom: 30px;
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
}
.plan-strip-name { display: grid; gap: 1px; }
.plan-strip-name b { color: var(--ink); }
.plan-strip-name span { color: var(--muted); font-size: 0.88rem; }
.meter { display: grid; gap: 6px; min-width: 0; }
.meter-label { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-bar { height: 4px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ink); }
.plan-strip-link { color: var(--ink); font-weight: 600; text-decoration-color: var(--rule); text-underline-offset: 3px; white-space: nowrap; }

/* ---------- campaign rows ---------- */

.rows { list-style: none; margin: 0 0 48px; padding: 0; border-top: 2px solid var(--ink); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 28px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.row-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.row-date { color: var(--muted); font-size: 0.85rem; }
.row h2 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em; }
.row h2 a { color: var(--ink); text-decoration: none; }
.row h2 a:hover { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.row-detail { color: var(--muted); max-width: 64ch; }
.row-action { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

.state {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.state.quiet { color: var(--muted); }
.state.off { color: var(--muted); border-style: dashed; }
.state.live { color: var(--ink); }
.state.attention { color: var(--attention); }

.numbers { display: flex; gap: 26px; margin: 12px 0 0; }
.numbers div { display: grid; gap: 0; }
.numbers dt { font-size: 0.78rem; color: var(--muted); }
.numbers dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* A small dot that breathes while something is finding people. */
.working { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- empty state ---------- */

.empty-state {
  padding: 40px 0 48px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}
.empty-state h2 { font-size: 1.5rem; margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 56ch; margin-bottom: 22px; }

/* ---------- agents ---------- */

.section-head { max-width: 62ch; margin-bottom: 18px; }
.section-head h2 { font-size: 1.35rem; margin-bottom: 6px; }
.section-head p { color: var(--muted); }
.command {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--ink);
  color: #d8dcd2;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
}
.command code { font-family: inherit; background: none; padding: 0; color: inherit; }
.command #cmd-key { color: #f2c82e; }

.new-key { padding: 14px 16px; margin-bottom: 18px; background: var(--sheet); border-left: 4px solid var(--attention); border-radius: 4px; }
.new-key-warn { margin: 0 0 8px; color: var(--attention); font-weight: 600; font-size: 0.95rem; }
.new-key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.new-key-row code { flex: 1 1 320px; padding: 8px 10px; background: #fff; border: 1px solid var(--rule-soft); border-radius: 4px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.9rem; }

.key-form { margin-bottom: 18px; }
.key-form label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.row-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.row-inline input { flex: 1 1 260px; }

.keys { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.key { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.key > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.key b { color: var(--ink); }
.key .mono { font-family: var(--mono); font-size: 0.88rem; color: var(--muted); }
.key > div > span:last-child { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .plan-strip { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row-action { white-space: normal; }
  .numbers { flex-wrap: wrap; gap: 16px 22px; }
}

/* ---------- follow-up ---------- */

.follow-up-field .optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-left: 6px; }
.inline-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.93rem; }
.inline-select select { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 5px; background: var(--sheet); color: var(--ink); }
.message.follow-up { margin-top: 6px; }
.message.follow-up summary::before { content: "Follow-up: "; }
.person.replied .person-state { color: var(--ink); font-weight: 700; }
