:root {
  --paper: #f3ecdf;
  --card: #fffaf3;
  --ink: #1d1914;
  --muted: #5e564c;
  --line: #e4d8c6;
  --clay: #9a3e1d;
  --clay-soft: #f8ebe3;
  --green: #1c6844;
  --green-soft: #e5f3ea;
  --gold: #8a6430;
  --shadow: 0 16px 40px rgba(70, 46, 16, 0.08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.7), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 12px 0 80px; }
.top, .banner { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.03em; }
.brand span, .mark {
  width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: var(--serif);
}
nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
nav a { text-decoration: none; }
.banner {
  background: var(--ink);
  color: white;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(42px, 7vw, 76px); line-height: 0.96; }
h2 { font-size: 32px; }
.lede { max-width: 640px; color: var(--muted); font-size: 19px; }
.steps, .cards, .grid { display: grid; gap: 12px; }
.steps { grid-template-columns: repeat(4, 1fr); margin-top: 28px; }
.cards { grid-template-columns: repeat(3, 1fr); }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card { padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.card strong, .panel h2 { font-size: 22px; }
.muted { color: var(--muted); }
.panel { padding: 18px; }
.stack { display: grid; gap: 14px; }
.panel:not(.stack) > :is(.button, .ghost, .text-button) {
  display: flex;
  width: fit-content;
  margin-top: 14px;
}
#payment-settings[hidden] { display: none; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.profile-halves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 18px; }
.profile-halves .narrow { width: 100%; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 640; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 11px 12px;
  font-weight: 430;
}
input[type="time"],
input[type="datetime-local"] {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 11px 12px;
  font-family: var(--sans);
  font-weight: 430;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
input[type="time"]:focus,
input[type="time"]:focus-visible,
input[type="datetime-local"]:focus,
input[type="datetime-local"]:focus-visible {
  outline: auto;
}
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin-inline-start: 8px;
}
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.button, .ghost, .text-button {
  border-radius: 999px;
  padding: 11px 16px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: white;
}
.button[hidden], .ghost[hidden], .text-button[hidden] { display: none; }
.ghost, .text-button { background: transparent; color: var(--ink); border-color: var(--line); }
.text-button { padding: 8px 12px; background: var(--card); }
.button:disabled, .ghost:disabled { opacity: 0.55; cursor: not-allowed; }
.choice { text-align: left; width: 100%; }
.choice input { margin-top: 4px; }
.pill { display: inline-flex; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 650; background: #efe6d8; }
.pill.new { background: var(--clay-soft); color: var(--clay); }
.pill.in_progress { background: #f4edd8; color: var(--gold); }
.pill.done, .pill.active, .pill.trialing { background: var(--green-soft); color: var(--green); }
.secret, .url {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  background: #f7f1e6;
  border-radius: 12px;
  padding: 12px;
}
.field-row, .account, .plan-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.field-row { grid-template-columns: auto 1.4fr 140px auto auto; align-items: center; }
.field-row.is-dragging { opacity: 0.55; }
.field-row.is-over { background: var(--clay-soft); }
.field-actions { display: flex; align-items: center; gap: 4px; }
.field-handle, .field-nudge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  line-height: 0;
}
.field-handle { cursor: grab; }
.field-handle:active { cursor: grabbing; }
.field-handle svg, .field-nudge svg { display: block; width: 16px; height: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input:disabled { cursor: not-allowed; }
.check:has(input:disabled) { color: var(--muted); }
.submission { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photos img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; background: #efe6d8; }
.suggestions { display: grid; gap: 14px; margin-top: 12px; }
.answer { margin: 0 0 12px; }
.answer b { display: block; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.error { color: var(--clay); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; }
.narrow { width: min(520px, 100%); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.project-head { align-items: flex-end; gap: 16px; margin-bottom: 4px; flex-wrap: wrap; }
.project-title { flex: 1; min-width: min(420px, 100%); }
.project-title label { margin: 0; }
.project-save { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.project-save .muted { margin: 0; text-align: right; }
.project-close {
  width: 100%;
  margin-top: 28px;
  display: grid;
  gap: 12px;
  position: static;
}
.project-close .muted { margin: 0; }
.project-close .ghost { justify-self: start; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 16px;
}
.admin-tab {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 560;
}
.admin-tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.admin-tab:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}
@media (max-width: 860px) {
  .project-tabs {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    margin-right: -16px;
    padding: 0 16px 6px 0;
    scrollbar-width: none;
  }
  .project-tabs::-webkit-scrollbar { display: none; }
  .project-tabs .admin-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 10px 16px;
  }
}
.admin-panel { margin-top: 4px; overflow-x: auto; }
.admin-panel[hidden] { display: none; }
.pay-note {
  background: var(--clay-soft);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0;
}
.connect-mount { min-height: 72px; }
.pill.awaiting_payment { background: #f4edd8; color: var(--gold); }
#payouts-panel { scroll-margin-top: 18px; }
.admin-panel .panel + .panel { margin-top: 16px; }
.payments-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 14px;
  align-items: start;
}
.payments-ledger,
.payments-settings { min-width: 0; }
@media (max-width: 800px) {
  .payments-layout { grid-template-columns: minmax(0, 1fr); }
}
.admin-search { margin: 14px 0; align-items: end; }
.admin-search label { flex: 1 1 240px; }
.account-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.account-row {
  display: grid;
  gap: 1px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}
.account-row-name { font-weight: 650; font-size: 15px; }
.account-row-email, .account-row-status { color: var(--muted); font-size: 13px; line-height: 1.35; }
.account-row[aria-current="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.account-row[aria-current="true"] .account-row-email,
.account-row[aria-current="true"] .account-row-status { color: #e7dccb; }
.account-row:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}
.account-detail {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 4px 14px 8px;
}
.account-detail .account { border-top: 0; }
.account[hidden] { display: none; }
.table-wrap { overflow-x: auto; }
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.pager .text-button[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pager .text-button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
.pager-ellipsis { color: var(--muted); padding: 0 2px; }
form:has(.captcha) { display: grid; gap: 14px; }
.survey-step[hidden] { display: none; }
.survey-nav { display: flex; gap: 14px; align-items: center; }
.slider-field { display: flex; gap: 14px; align-items: center; }
.slider-field input[type="range"] { flex: 1; accent-color: var(--clay); }
.slider-readout { min-width: 3ch; font-variant-numeric: tabular-nums; }
.slider-bounds { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slider-bounds[hidden] { display: none; }
.captcha { display: grid; gap: 14px; }
.captcha-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.captcha img, .captcha-text {
  display: block;
  border-radius: 12px;
  background: #f7f1e6;
  border: 1px solid var(--line);
}
.captcha img { width: min(100%, 320px); height: auto; }
.captcha-text {
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.28em;
  font-size: 22px;
}

@media (max-width: 800px) {
  .profile-halves { grid-template-columns: 1fr; }
}
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  place-items: center;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.top.is-open .menu-toggle-bars { background: transparent; }
.top.is-open .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
.top.is-open .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  background: rgba(29, 25, 20, 0.45);
}
.nav-backdrop[hidden] { display: none; }
@media (max-width: 860px) {
  .steps, .cards, .split, .stats, .field-row, .account-layout { grid-template-columns: 1fr; }
  h1 { font-size: 46px; }
  .top { align-items: center; }
  .menu-toggle { display: grid; }
  body.nav-open { overflow: hidden; }
  .top nav {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 72px 18px 24px;
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: auto;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  .top.is-open nav { transform: translateX(0); }
  .top nav a,
  .top nav .muted {
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
  }
  .top nav form { margin: 8px 0 0; }
  .top nav .button,
  .top nav .ghost { width: 100%; }
}
body.embed { min-height: 0; }
body.embed .shell { width: min(640px, calc(100% - 24px)); padding-bottom: 24px; }
.qr { width: 220px; height: auto; background: white; border-radius: 12px; padding: 8px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 12px; list-style: none; }
@media (max-width: 860px) {
  .codes { grid-template-columns: 1fr; }
}
.flow-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-chip { cursor: grab; }
.flow-drop {
  display: grid;
  gap: 8px;
  min-height: 64px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}
.flow-drop.is-over { border-color: var(--clay); background: var(--clay-soft); }
.flow-empty { margin: 0; }
.flow-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.flow-card.is-dragging { opacity: 0.55; }
.flow-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.flow-handle {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--serif);
  font-size: 18px;
  cursor: grab;
}
.flow-condition { display: grid; grid-template-columns: 1.3fr 0.9fr 1fr; gap: 8px; align-items: end; }
.flow-limit { max-width: 160px; }
.flow-branch { display: grid; gap: 6px; }
.flow-branch > p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow-else > p {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 560;
  letter-spacing: -0.03em;
  text-transform: none;
}
.flow-else .flow-drop { min-height: 72px; }
.flow-else.is-attached .flow-drop,
.flow-else.is-over .flow-drop { border-color: var(--clay); background: var(--clay-soft); }
.flow-save-state { margin: 0; min-height: 1.4em; }
.flow-card textarea { min-height: 72px; }
@media (max-width: 860px) {
  .flow-condition { grid-template-columns: 1fr; }
}
.theme-scope {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.7), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
body.embed.theme-scope,
body.embed .theme-scope { min-height: 0; }
input[type="color"] {
  width: 72px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.form-logo {
  display: block;
  max-height: 72px;
  width: auto;
  object-fit: contain;
}
.projects-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 14px;
  align-items: start;
  margin-top: 18px;
}
.projects-column,
.agent-link { min-width: 0; }
@media (max-width: 800px) {
  .projects-layout { grid-template-columns: minmax(0, 1fr); }
}
.template-finder {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  max-width: 560px;
}
.template-finder input[type="search"] {
  width: 100%;
}
.template-picker { display: grid; gap: 22px; margin-top: 8px; }
.template-group { display: grid; gap: 10px; }
.template-group-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}
.template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.template-card.is-hidden,
.template-group.is-hidden,
.template-empty[hidden] { display: none; }
.template-empty { margin: 12px 0 0; }
.card :is(.between, .flow-card-head),
.panel :is(.between, .flow-card-head) { flex-wrap: wrap; }
.card :is(button, input[type="submit"], .button, .ghost, .text-button):not(.flow-handle, .field-handle, .field-nudge, .submission, .account-row, .admin-tab),
.panel :is(button, input[type="submit"], .button, .ghost, .text-button):not(.flow-handle, .field-handle, .field-nudge, .submission, .account-row, .admin-tab) {
  padding: 6px 10px;
  font-size: 14px;
  min-height: 32px;
  max-width: 100%;
  white-space: normal;
}
.photo-drop { display: grid; gap: 6px; position: relative; }
.photo-drop:not(.is-ready) .photo-drop-zone { display: none; }
.photo-drop.is-ready .photo-drop-zone {
  display: grid;
  gap: 8px;
  justify-items: start;
  width: 100%;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.photo-drop-zone.is-over { border-color: var(--clay); background: var(--clay-soft); }
.photo-drop-prompt {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.photo-drop-note { margin: 0; font-weight: 430; }
.photo-drop-message { margin: 0; justify-self: stretch; font-weight: 500; }
.photo-drop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: 100%;
  justify-self: stretch;
}
.photo-drop-list[hidden] { display: none; }
.photo-drop-file {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-weight: 430;
  cursor: default;
}
.photo-drop-file img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #efe6d8;
  flex: 0 0 auto;
}
.photo-drop-file span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.photo-drop.is-ready .photo-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.form-qr {
  width: 180px;
  height: 180px;
  padding: 8px;
  border-radius: 12px;
  background: #f7f1e6;
  border: 1px solid var(--line);
  justify-self: start;
}
.legal { display: grid; gap: 18px; max-width: 42rem; }
.legal p, .legal ul { margin: 0; }
.legal h1 { font-size: clamp(36px, 6vw, 56px); }
.legal section { display: grid; gap: 10px; }
.legal h2 { font-size: clamp(26px, 4vw, 32px); }
.legal ul { padding-left: 1.2rem; display: grid; gap: 6px; }
.legal h3 { font-size: 22px; }
.legal code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
.legal pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  background: #f7f1e6;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}
.desk-legal {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 14px;
}
.desk-legal a { text-decoration: none; }
.cookie-banner {
  position: fixed;
  z-index: 30;
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: min(720px, calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.cookie-banner p { margin: 0; flex: 1 1 16rem; min-width: 0; }
.cookie-banner form { margin: 0; }
.cookie-banner a { color: var(--muted); }
body.has-cookie-banner .shell { padding-bottom: 148px; }
#install-form { margin-top: 22px; }
.checks { list-style: none; margin: 0; padding: 0; }
