/* Tally portal styles. Backspin Labs brand. No inline styles anywhere: the CSP forbids them. */

:root {
  --paper: #f4f0e8;
  --card: #ece7dd;
  --raised: #faf7f1;
  --ink: #1b1815;
  --ink-soft: #3a352f;
  --ink-faint: #6f685e;
  --muted: #5f584f;            /* faint text that still passes AA on --card */
  --accent: #d8542a;
  --accent-ink: #b0431f;       /* accent used as text on paper (AA) */
  --accent-wash: #f6dfd3;
  --on-accent: #ffffff;
  --line: #d9d2c5;
  --line-soft: #e4ded3;
  --green: #33a959;
  --yellow: #edc70d;
  --red: #e13d33;
  --red-ink: #a8261e;
  --red-wash: #f8dcd8;
  --green-ink: #1f7a3c;
  --green-wash: #dcefdf;
  --code-bg: #1b1815;
  --code-ink: #f4f0e8;
  --shadow: 0 1px 2px rgba(27, 24, 21, .06), 0 8px 24px -12px rgba(27, 24, 21, .18);
  --shadow-lg: 0 2px 4px rgba(27, 24, 21, .05), 0 24px 48px -20px rgba(27, 24, 21, .28);
  --radius: 14px;
  --radius-sm: 9px;
  --font-head: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 16px;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --card: #211d17;
    --raised: #2a251e;
    --ink: #f0ebe1;
    --ink-soft: #cfc7b9;
    --ink-faint: #9a9184;
    --muted: #a59c8f;
    --accent: #f0724a;
    --accent-ink: #f0845f;
    --accent-wash: #3a2219;
    --on-accent: #16140f;
    --line: #3a342b;
    --line-soft: #2e2921;
    --red-ink: #ff7b72;
    --red-wash: #3a1917;
    --green-ink: #6fd18d;
    --green-wash: #15301d;
    --code-bg: #0e0d0a;
    --code-ink: #f0ebe1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.2vw + 1rem, 3.6rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 1.6vw + 1rem, 2.25rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 700; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

img, svg { max-width: 100%; display: block; }

code, kbd, .mono { font-family: var(--font-mono); font-size: .9em; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.wrap-narrow { max-width: 760px; }
.wrap-tiny { max-width: 480px; }

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.wordmark img { width: 28px; height: 28px; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1; }
.wordmark-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.wordmark-by {
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 3px;
}
.wordmark:hover { text-decoration: none; }

.app-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.app-nav a, .nav-button {
  display: inline-block;
  padding: .45rem .75rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  line-height: 1.2;
}
.app-nav a:hover, .nav-button:hover { background: var(--card); color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-who {
  display: none;
  text-align: right;
  line-height: 1.2;
}
.header-who strong { display: block; font-size: .85rem; }
.header-who span { font-size: .78rem; color: var(--ink-faint); }

.nav-button {
  background: none;
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}

.inline-form { display: inline; margin: 0; }

@media (min-width: 1000px) {
  .header-who { display: block; }
}
@media (max-width: 879px) {
  .app-nav { order: 3; width: 100%; margin: 0 -.5rem; }
  .app-nav a { padding: .4rem .6rem; font-size: .9rem; }
}

.public-nav { display: flex; align-items: center; gap: 8px; }
.public-nav .link-quiet { display: none; }
@media (min-width: 560px) { .public-nav .link-quiet { display: inline-block; } }

.link-quiet {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
  padding: .45rem .6rem;
  border-radius: 8px;
}
.link-quiet:hover { color: var(--ink); background: var(--card); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 72px;
  padding: 36px 0 44px;
  color: var(--ink-faint);
  font-size: .9rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  align-items: center;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.footer-links a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-note {
  margin-top: 18px;
  font-size: .8rem;
  max-width: 70ch;
  color: var(--ink-faint);
}
.footer-brand { color: var(--ink-soft); }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: .65rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn-ghost:hover { --btn-bd: var(--ink-faint); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--red-ink); --btn-bd: color-mix(in srgb, var(--red) 55%, transparent); }
.btn-danger:hover { --btn-bg: var(--red-wash); }
.btn-danger-solid { --btn-bg: var(--red); --btn-fg: #fff; }
.btn-lg { min-height: 52px; padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: .4rem .85rem; font-size: .9rem; }
.btn-block { width: 100%; }

.btn.is-confirming {
  --btn-bg: var(--red);
  --btn-fg: #fff;
  --btn-bd: var(--red);
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .label {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
}
.field .hint { font-size: .85rem; color: var(--muted); }

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:hover, select:hover { border-color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
input[disabled], select[disabled] { opacity: .65; cursor: not-allowed; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.code-input {
  font-family: var(--font-mono);
  font-size: 1.6rem !important;
  letter-spacing: .5em;
  text-align: center;
  padding-left: 1rem !important;
  min-height: 60px !important;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.35;
}
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.check small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: 2px; }

.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-invite { grid-template-columns: 1.4fr 1fr .8fr; }
}

.checks { border: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 4px 0 20px; }

/* ---------- Alerts ---------- */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--raised);
  margin-bottom: 20px;
  font-weight: 600;
}
.alert::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: .45em;
  border-radius: 50%;
  background: var(--ink-faint);
}
.alert-ok { background: var(--green-wash); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green-ink); }
.alert-ok::before { background: var(--green); }
.alert-error { background: var(--red-wash); border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red-ink); }
.alert-error::before { background: var(--red); }
.alert-info { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.alert-info::before { background: var(--accent); }
.alert p { margin: 0; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert .alert-body p + p, .alert .alert-body p + form { margin-top: 8px; }
.alert-detail { font-weight: 400; font-size: .9rem; }

.flash-wrap { padding-top: 20px; }
.flash-wrap .alert { margin-bottom: 0; }

/* ---------- Cards and layout ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--line-soft);
}
@media (min-width: 720px) { .card { padding: 28px; } }
.card-raised { background: var(--raised); box-shadow: var(--shadow); border-color: var(--line-soft); }
.card h2 { font-size: 1.3rem; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); margin-top: 4px; font-size: .95rem; }

.stack > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 28px; }

.page-head { padding: 40px 0 24px; }
.page-head h1 { font-size: clamp(1.8rem, 2vw + 1rem, 2.5rem); margin-bottom: 6px; }
.page-head p { color: var(--ink-soft); max-width: 62ch; font-size: 1.05rem; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 10px;
}

.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

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

/* ---------- Status pieces ---------- */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
  vertical-align: middle;
}
.dot-green { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 26%, transparent); }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
  padding: .3rem .7rem .3rem .6rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
  vertical-align: middle;
}
.badge-accent { background: var(--accent-wash); border-color: transparent; color: var(--accent-ink); }
.badge-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge-ok { background: var(--green-wash); color: var(--green-ink); border-color: transparent; }
.badge-err { background: var(--red-wash); color: var(--red-ink); border-color: transparent; }

/* ---------- Dashboard ---------- */

.dash-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .dash-grid { grid-template-columns: 5fr 7fr; }
  .dash-grid .span-all { grid-column: 1 / -1; }
}

.connect-hero { text-align: left; }
.connect-hero .btn { margin-top: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.stat {
  background: var(--raised);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  min-width: 0;
}
.stat-num {
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 4px; }

.copybox {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 6px 0 4px;
}
.copybox code {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: .92rem;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.copybox .copy-btn {
  flex: none;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: var(--code-ink);
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  padding: 0 18px;
  cursor: pointer;
  min-width: 84px;
}
.copybox .copy-btn:hover { background: rgba(255, 255, 255, .14); }
.copybox .copy-btn.is-copied { background: var(--green); color: #0d2414; }

.howto { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 640px) { .howto { grid-template-columns: 1fr 1fr; } }
.howto-col {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.howto-col h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1rem; }
.howto-col ol { margin: 0; padding-left: 1.2rem; font-size: .93rem; color: var(--ink-soft); }
.howto-col li { margin: 4px 0; padding-left: 2px; }
.howto-col li::marker { color: var(--accent-ink); font-weight: 700; }
.howto-col strong { color: var(--ink); }
.howto-note { font-size: .85rem; color: var(--muted); margin-top: 10px; }

.ai-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 800;
  font-family: var(--font-head);
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Tables ---------- */

.table-wrap { width: 100%; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.table th {
  text-align: left;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.cell-status { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.cell-err { color: var(--red-ink); font-size: .85rem; margin-top: 4px; overflow-wrap: anywhere; font-weight: 400; }
.args {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-soft);
  background: var(--raised);
  border: 1px solid var(--line-soft);
  padding: 2px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 100%;
}

/* Stack tables into labelled rows on small screens */
@media (max-width: 719px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td {
    border: 0;
    padding: 3px 0 !important;
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 10px;
    text-align: left !important;
    white-space: normal !important;
  }
  .table-stack td::before {
    content: attr(data-label);
    font-size: .75rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    padding-top: .2em;
  }
  .table-stack td.td-primary { grid-template-columns: 1fr; font-size: 1rem; padding-bottom: 6px !important; }
  .table-stack td.td-primary::before { display: none; }
}

/* ---------- Empty states ---------- */

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-soft);
}
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 46ch; margin-left: auto; margin-right: auto; color: var(--muted); }
.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin: 0 auto 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--accent-ink);
  font-size: 1.3rem;
}

/* ---------- Team ---------- */

.member-list { list-style: none; margin: 0; padding: 0; }
.member {
  display: grid;
  gap: 14px 20px;
  grid-template-columns: 1fr;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.member:first-child { padding-top: 0; }
.member:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 880px) {
  .member { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); align-items: center; }
}
.member-id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .95rem;
  text-transform: uppercase;
}
.member-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-email { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.member-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.member-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.member-controls form.member-update {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 0;
}
.member-controls select { width: auto; min-width: 120px; min-height: 38px; padding-top: .4rem; padding-bottom: .4rem; }
.member-controls .check { font-size: .92rem; }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Settings ---------- */

.consent-box {
  margin-top: 8px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--raised);
  border: 1px solid var(--line);
}
.consent-text {
  white-space: pre-line;
  font-size: .92rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 0 0 16px;
}
.danger {
  border: 1.5px solid color-mix(in srgb, var(--red) 45%, transparent);
  background: color-mix(in srgb, var(--red-wash) 55%, var(--card));
}
.danger h2 { color: var(--red-ink); }

/* ---------- Auth pages ---------- */

.auth {
  padding: 56px 0 24px;
}
@media (min-width: 720px) { .auth { padding-top: 88px; } }
.auth-card {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px 22px;
}
@media (min-width: 480px) { .auth-card { padding: 36px 36px 32px; } }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 8px; letter-spacing: -0.025em; }
.auth-card .lede { color: var(--ink-soft); margin-bottom: 24px; }
.auth-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: .9rem; color: var(--muted); }
.auth-foot form { display: inline; }
.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: .3rem .7rem;
  border-radius: 999px;
  margin-bottom: 18px;
}
.auth-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.consent-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}
.consent-tile {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  background: var(--ink);
  color: var(--paper);
  text-transform: uppercase;
}
.consent-tile img { width: 34px; height: 34px; }
.consent-tile-brand { background: var(--card); border: 1px solid var(--line); }
.consent-link { display: flex; gap: 5px; }
.consent-link span { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.consent-card h1 { text-align: center; }
.consent-card .lede { text-align: center; }
.consent-from { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.scope-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.scope-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: .95rem;
  color: var(--ink-soft);
}
.scope-list li strong { color: var(--ink); }
.tick, .cross {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 800;
  margin-top: 1px;
}
.tick { background: var(--green-wash); color: var(--green-ink); }
.cross { background: var(--red-wash); color: var(--red-ink); }
.consent-explain {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .95rem;
  margin-bottom: 20px;
  color: var(--ink-soft);
}
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Landing ---------- */

.hero {
  position: relative;
  padding: 56px 0 40px;
  overflow: hidden;
}
@media (min-width: 960px) { .hero { padding: 96px 0 72px; } }
.hero-grid { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; } }
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36ch; margin-bottom: 28px; }
@media (min-width: 720px) { .hero-lede { font-size: 1.25rem; } }
.hero-meta { margin-top: 18px; font-size: .88rem; color: var(--muted); }
.hero-meta sup a { text-decoration: none; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 700;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.hero-tag .dot { width: 8px; height: 8px; }

.chat {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 0;
}
.chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
}
.chat-bar .lights { display: flex; gap: 6px; margin-right: 6px; }
.chat-bar .lights span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.chat-bar .chat-tool {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-ink);
}
.chat-body { padding: 20px 18px 22px; display: grid; gap: 16px; }
@media (min-width: 480px) { .chat-body { padding: 24px 24px 26px; } }
.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: .97rem;
  line-height: 1.45;
}
.bubble-me {
  justify-self: end;
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 6px;
}
.bubble-ai {
  justify-self: start;
  max-width: 100%;
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
}
.bubble-ai p { margin-bottom: 10px; }
.bubble-ai strong { color: var(--ink); }
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border-radius: 999px;
  padding: .25rem .65rem;
  margin-bottom: 10px;
}
.tool-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: 4px 0 10px;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
}
.mini-table th, .mini-table td { padding: 8px 10px; text-align: left; }
.mini-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.mini-table td { border-top: 1px solid var(--line-soft); color: var(--ink); }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 420px) { .mini-table .hide-sm { display: none; } }
.chat-input {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 10px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .92rem;
}
.chat-input span:last-child {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-weight: 800;
}

.section { padding: 64px 0; }
@media (min-width: 960px) { .section { padding: 96px 0; } }
.section-alt { background: var(--card); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .questions { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .questions { grid-template-columns: repeat(3, 1fr); } }
.q {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: 18px 18px 18px 6px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.q-text { font-family: var(--font-head); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; color: var(--ink); line-height: 1.3; }
.q-tag { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.step {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 18px;
}
.step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: .97rem; }
.step-time { display: inline-block; margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--muted); }

.trust { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .trust { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .trust { grid-template-columns: repeat(3, 1fr); } }
.trust-item {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
}
.trust-item h3 { display: flex; gap: 10px; align-items: center; font-size: 1.05rem; margin-bottom: 8px; }
.trust-item h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}
.trust-item p { color: var(--ink-soft); font-size: .95rem; }
.trust-lead {
  grid-column: 1 / -1;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
@media (min-width: 960px) { .trust-lead { grid-column: span 1; grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; } }
.trust-lead h3 { color: var(--paper); font-size: 1.4rem; }
.trust-lead p { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.trust-lead h3::before { display: none; }

.pricing {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  align-items: center;
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 32px 22px;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 860px) { .pricing { grid-template-columns: 1.3fr 1fr; padding: 48px; } }
.pricing h2 { margin-bottom: 12px; }
.pricing-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.pricing-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); }
.pricing-list li::before {
  content: "\2713";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-wash);
  color: var(--green-ink);
  font-size: .75rem;
  font-weight: 800;
  margin-top: 1px;
}
.pricing-cta {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}
.pricing-tier { font-family: var(--font-head); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; }
.pricing-cta p { color: var(--muted); font-size: .92rem; margin: 6px 0 18px; }
.pricing-cta .btn { width: 100%; }
.pricing-cta .btn + .btn { margin-top: 10px; }

.closer { text-align: center; }
.closer h2 { font-size: clamp(1.8rem, 2.5vw + 1rem, 2.8rem); }
.closer p { color: var(--ink-soft); font-size: 1.1rem; max-width: 46ch; margin: 0 auto 26px; }
.closer .btn-row { justify-content: center; }

/* ---------- Prose (legal) ---------- */

.prose { max-width: 68ch; font-size: 1.02rem; color: var(--ink-soft); }
.prose h1 { font-size: clamp(1.9rem, 2vw + 1rem, 2.6rem); color: var(--ink); }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.prose h3 { font-size: 1.12rem; margin-top: 1.6em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose strong { color: var(--ink); }
.prose a { overflow-wrap: anywhere; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 1.2em; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.draft-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: 28px;
}

/* ---------- Error page ---------- */

.error-page { text-align: center; padding: 88px 0 40px; }
.error-code {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-ink);
  margin-bottom: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.error-page p { color: var(--ink-soft); max-width: 50ch; margin: 0 auto 28px; font-size: 1.08rem; }
.error-page .btn-row { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
