/* AgenTack UI. One stylesheet for every page: inlined on the sites server, served as
   /ui.css on the API server. No external fonts, images or imports: depth comes from
   gradients here and from inline SVG in the markup. */

/* Design tokens: light, warm ivory paper. Text pairs meet WCAG AA (4.5:1); borders and
   focus rings 3:1. The hero and terminal tokens are dark in both modes. */
:root {
  color-scheme: light dark;
  --bg: #fbf6ec;
  --surface: #fffdf9;
  --text: #1d1930;
  --muted: #5c5568;
  --border: #e8dfcf;
  --border-strong: #8a7f6d;
  --link: #0b6a70;
  --accent: #c2410c;
  --accent-hover: #a3360a;
  --on-accent: #ffffff;
  --danger: #b42318;
  --on-danger: #ffffff;
  --success: #18703c;
  --code-bg: #f4ede0;
  --focus: #5b3fd0;
  --badge-bg: #efe9ff;
  --badge-text: #4a2fb5;
  --get-bg: #e0f3ef;
  --get-text: #0a5d5a;
  --post-bg: #fde7da;
  --post-text: #9a3412;
  --put-bg: #ece8fd;
  --put-text: #4b33b8;
  --delete-bg: #fde4e2;
  --delete-text: #a3161a;
  --info-bg: #eaf4f2;
  --info-border: #b9dcd6;
  --danger-bg: #fdeceb;
  --danger-border: #f2b8b2;
  --hero-base: #0d0b1e;
  --hero-ink: #fbf6ec;
  --hero-muted: #ebe5f4;
  --term-bg: #0b0a16;
  --term-text: #ece7f6;
  --term-muted: #a59fbd;
  --term-ok: #6fe3b4;
  --term-prompt: #ff9a6b;
  --term-caret: #ffb38a;
  --art-glow: #fde7da;
  --wash-a: rgba(194, 65, 12, 0.07);
  --wash-b: rgba(11, 106, 112, 0.07);
  --shadow-sm: 0 1px 2px rgba(41, 28, 10, 0.06), 0 6px 16px -8px rgba(41, 28, 10, 0.12);
  --shadow-md: 0 2px 6px rgba(41, 28, 10, 0.06), 0 22px 44px -20px rgba(41, 28, 10, 0.3);
  --shadow-lg: 0 12px 30px -18px rgba(29, 25, 48, 0.35), 0 40px 90px -40px rgba(29, 25, 48, 0.6);
  --glow: 0 0 0 6px rgba(91, 63, 208, 0.07), 0 24px 60px -28px rgba(194, 65, 12, 0.4), 0 30px 70px -30px rgba(11, 106, 112, 0.45);
  --radius: 14px;
  --radius-lg: 26px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Design tokens: dark, midnight ink. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e1c;
    --surface: #181629;
    --text: #f4efe6;
    --muted: #b5aec6;
    --border: #2c2942;
    --border-strong: #7d7794;
    --link: #6fd8d2;
    --accent: #ff8b5c;
    --accent-hover: #ffa47f;
    --on-accent: #1c0f0a;
    --danger: #ff8a7a;
    --on-danger: #1d0b0b;
    --success: #62d39b;
    --code-bg: #1d1b30;
    --focus: #a996ff;
    --badge-bg: #2a2350;
    --badge-text: #cfc4ff;
    --get-bg: #0f3533;
    --get-text: #8ce6dc;
    --post-bg: #3d1d10;
    --post-text: #ffb38f;
    --put-bg: #28214d;
    --put-text: #c9bcff;
    --delete-bg: #3d1517;
    --delete-text: #ff9e94;
    --info-bg: #142a2b;
    --info-border: #24504f;
    --danger-bg: #33151a;
    --danger-border: #6b2a2f;
    --art-glow: #221d42;
    --wash-a: rgba(124, 92, 255, 0.14);
    --wash-b: rgba(20, 184, 166, 0.1);
    --shadow-sm: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 24px 48px -20px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
    --glow: 0 0 0 6px rgba(169, 150, 255, 0.08), 0 24px 60px -24px rgba(124, 92, 255, 0.55), 0 30px 80px -30px rgba(20, 184, 166, 0.4);
  }
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(60rem 32rem at 0% -8rem, var(--wash-a), transparent 70%) no-repeat,
    radial-gradient(54rem 30rem at 100% 0%, var(--wash-b), transparent 70%) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.site-header,
main,
.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

main {
  padding-bottom: 4rem;
}

/* The one footer on AgenTack's own pages (never on users' sites): labeled groups of links
   in columns that fill the width on wide screens and stack on phones, then the copyright
   line. Colours come from the page's tokens, so it is light on people's pages and dark on
   agent pages. */
.site-footer {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.footer-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1.5rem 2rem;
}

.footer-label {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-weight: 700;
}

.footer-links {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  padding: 0.2rem 0;
}

.footer-copy {
  margin: 1.75rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font: 600 1.25rem/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo {
  flex: none;
}

.logo-bg {
  fill: var(--accent);
}

.logo-fg {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 0.9375rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font: 700 0.8125rem/1.3 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

code,
pre {
  font-family: var(--mono);
}

code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Buttons. Danger is an outline until it is the "yes" of a confirmation. */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px var(--accent);
}

.button:hover,
button:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button.secondary,
button.secondary {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.button.secondary:hover,
button.secondary:not(:disabled):hover {
  border-color: var(--text);
  background: var(--code-bg);
}

.button.danger,
button.danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
  box-shadow: none;
}

.button.danger:hover,
button.danger:not(:disabled):hover {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.card,
.step,
.stat {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  margin: 0 0 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input[type="password"],
input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 3rem;
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

input[type="file"] {
  display: block;
  max-width: 100%;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font: inherit;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.25rem 0 0.5rem;
}

.check-row input[type="checkbox"] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-row label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 2.5rem;
  margin-right: 0.75rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

details {
  margin: 0 0 0.75rem;
}

summary {
  cursor: pointer;
  color: var(--muted);
}

details ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* Hero: a deep aurora of radial gradients on two drifting layers. Its text stays AA even
   where every blob overlaps. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.5rem, 5vw, 3.75rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #1a1540, var(--hero-base) 55%, #08070f);
  color: var(--hero-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-lg);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40%;
  pointer-events: none;
}

.hero::before {
  background:
    radial-gradient(36% 40% at 30% 38%, rgba(20, 184, 166, 0.36), transparent 70%),
    radial-gradient(34% 38% at 70% 62%, rgba(124, 92, 255, 0.32), transparent 70%);
}

.hero::after {
  background:
    radial-gradient(30% 34% at 62% 30%, rgba(255, 122, 69, 0.26), transparent 70%),
    radial-gradient(28% 30% at 34% 70%, rgba(236, 72, 153, 0.18), transparent 70%);
}

.hero-copy {
  min-width: 0;
  max-width: 46rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 1.3rem + 4.6vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hero .eyebrow,
.hero-lead {
  color: var(--hero-muted);
}

.hero-lead {
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3rem);
}

.hero a:not(.button) {
  color: var(--hero-ink);
}

.hero code {
  background: rgba(8, 6, 20, 0.45);
}

.hero :focus-visible {
  outline-color: var(--hero-ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.button.ghost {
  border-color: rgba(251, 246, 236, 0.5);
  background: rgba(8, 6, 20, 0.3);
  color: var(--hero-ink);
  box-shadow: none;
}

.button.ghost:hover {
  border-color: var(--hero-ink);
  background: rgba(8, 6, 20, 0.55);
}

.hero-compact {
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.hero-compact h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
}

@media (max-width: 40rem) {
  .hero {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    border-radius: 0;
  }
}

/* Terminal card. In the motion section a cover (::after) steps right across each .t-line,
   its left edge the caret. Without motion every line is simply shown. */
.term {
  min-width: 0;
  max-width: 54rem;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--term-bg);
  color: var(--term-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 30px 60px -24px rgba(0, 0, 0, 0.75);
}

.term-bar {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.term-bar::before {
  content: "";
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #ff7a59;
  box-shadow: 1.15rem 0 #ffc46b, 2.3rem 0 #4fd1a5;
}

.term pre {
  margin: 0;
  padding: 1.1rem 1.2rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.8125rem;
  line-height: 1.75;
}

.term figcaption {
  padding: 0 1.2rem 1.1rem;
  color: var(--term-muted);
  font-size: 0.875rem;
}

.t-line,
.t-out,
.t-wait {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.t-line {
  overflow: hidden;
}

.t-cmd::before {
  content: "$ ";
  content: "$ " / "";
  color: var(--term-prompt);
}

.t-out {
  color: var(--term-muted);
}

.t-ok {
  color: var(--term-ok);
  font-weight: 700;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.2em;
  vertical-align: text-bottom;
  background: var(--term-caret);
}

.section,
.duo {
  margin: 0 0 clamp(2.5rem, 6vw, 3.5rem);
}

.section {
  max-width: 56rem;
}

.section > h2:first-child,
.duo h2 {
  margin-top: 0;
}

.section > p {
  max-width: 42rem;
}

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
}

.duo > .card,
.section.card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.duo > .card {
  min-width: 0;
  margin: 0;
}

/* Publish, Serve, Update. */
.how {
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 1.5rem;
  counter-increment: step;
}

.step::after {
  content: counter(step, decimal-leading-zero);
  content: counter(step, decimal-leading-zero) / "";
  position: absolute;
  top: 1.3rem;
  right: 1.4rem;
  color: var(--border-strong);
  font: italic 1.5rem/1 var(--serif);
}

.step h3,
.publish-card h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1.375rem;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
}

/* Endpoint table with method pills. */
.table-wrap {
  margin: 0 0 1rem;
  overflow-x: auto;
}

th,
td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.endpoints {
  width: 100%;
  font-size: 0.9375rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.endpoints th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.endpoints tr:last-child td {
  border-bottom: 0;
}

/* Method and path stay whole on narrow screens; .table-wrap scrolls instead. */
.endpoints td:nth-child(-n + 2),
.endpoints td:nth-child(-n + 2) code {
  white-space: nowrap;
  overflow-wrap: normal;
}

.method {
  display: inline-block;
  min-width: 4.5em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.method-get,
.step:nth-child(2) .tile-icon {
  background: var(--get-bg);
  color: var(--get-text);
}

.method-post,
.step:nth-child(1) .tile-icon,
.publish-card .tile-icon {
  background: var(--post-bg);
  color: var(--post-text);
}

.method-put,
.method-patch,
.tile-icon {
  background: var(--put-bg);
  color: var(--put-text);
}

.method-delete {
  background: var(--delete-bg);
  color: var(--delete-text);
}

@media (max-width: 30rem) {
  .endpoints {
    font-size: 0.875rem;
  }

  .endpoints th,
  .endpoints td {
    padding: 0.6rem 0.35rem;
  }

  .endpoints td:nth-child(2) code {
    padding: 0;
    background: none;
  }

  .method {
    min-width: 0;
  }
}

/* Limits as stat tiles, extensions as chips. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.stat-value {
  display: block;
  color: var(--post-text);
  font: 600 clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem)/1.05 var(--serif);
  letter-spacing: -0.02em;
}

.stat:nth-child(2) .stat-value {
  color: var(--get-text);
}

.stat:nth-child(3) .stat-value {
  color: var(--put-text);
}

.stat:nth-child(4) .stat-value {
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chips code {
  display: inline-block;
  padding: 0.25em 0.75em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

/* The free trial's rules (sites home "Try it free", API page). */
.trial-rules {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.trial-rules h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.trial-rules ul:not(.chips) {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.trial-rules li {
  margin-bottom: 0.35rem;
}

.chips.chips-inline {
  display: inline-flex;
  margin: 0.25rem 0 0;
  vertical-align: middle;
}

/* Error pages: one illustration that floats, one sentence, one way home. */
.oops {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  text-align: center;
}

.oops-art {
  width: min(100%, 22rem);
  margin: 0 auto 0.5rem;
}

.oops-code {
  margin: 0 0 0.25rem;
  padding-left: 0.3em;
  color: var(--accent);
  font: italic 600 1.125rem/1 var(--serif);
  letter-spacing: 0.3em;
}

.oops h1 {
  margin-top: 0;
}

.oops p {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.oops-lead {
  font-size: 1.1875rem;
}

.oops .button {
  margin-top: 0.75rem;
}

.art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.art-glow {
  fill: var(--art-glow);
}

.art-paper,
.art-fold {
  fill: var(--surface);
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.art-fold {
  fill: var(--badge-bg);
}

.art-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-trail {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1 9;
}

.art-ink,
.art-shadow {
  fill: var(--text);
}

.art-warm {
  fill: var(--accent);
}

.art-cool {
  fill: var(--link);
}

.art-shadow {
  fill-opacity: 0.1;
}

/* Dashboard. */
.signin-card {
  max-width: 30rem;
  margin: 0 auto 2rem;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #14b8a6, #7c5cff 50%, #ff7a45) border-box;
  box-shadow: var(--glow);
}

.signin-card h2 {
  margin: 1rem 0 0.35rem;
}

.signin-card button,
.signin-card .guest-button {
  width: 100%;
  margin-top: 0.5rem;
}

.signin-card .guest-button {
  display: block;
  text-align: center;
}

.signin-card details {
  margin: 1.25rem 0 0;
}

.signin-card form > p:first-child {
  margin-top: 0.75rem;
}

/* "Keep my sites": the popup that emails a link to confirm the address. */
.keep-dialog {
  width: calc(100% - 2rem);
  max-width: 28rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.keep-dialog::backdrop {
  background: rgba(15, 20, 35, 0.55);
}

.keep-dialog h2 {
  margin-top: 0;
}

.keep-dialog input[type="email"] {
  width: 100%;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.toolbar h2 {
  flex: 1 1 12rem;
  margin: 0;
}

.publish-card {
  margin: 0 0 1.5rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--wash-a), var(--wash-b)), var(--surface);
  box-shadow: none;
}

/* The dashboard's Site name field and Rename form (README "Site names", "Renaming"). */
.name-row {
  max-width: 32rem;
  margin: 0.25rem 0 0.75rem;
}

.rename-form {
  flex: 1 1 100%;
  margin: 0.5rem 0 0;
}

.name-row .hint,
.name-row .status,
.rename-form .hint,
.rename-form .status {
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.name-row .suggestion,
.rename-form .suggestion {
  min-height: 0;
  margin-left: 0.25rem;
  padding: 0.2rem 0.7rem;
}

.site-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-list > li {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

.site-list > .card:hover,
.site-list > .card:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.site-list h3 {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.badge {
  display: block;
  width: fit-content;
  margin: 0.4rem 0 0.5rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.site-list .actions {
  margin-top: auto;
  padding-top: 1rem;
}

.actions .button,
.actions button {
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.9375rem;
}

/* The inline "are you sure?" that replaces a row's buttons. */
.site-list .actions:has(> .meta) {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-bg);
}

.actions:has(> .meta) > .meta,
.actions > details {
  flex: 1 1 100%;
}

.actions:has(> .meta) > .meta {
  color: var(--text);
  font-weight: 600;
}

.actions:has(> .meta) button.danger {
  background: var(--danger);
  color: var(--on-danger);
}

/* "Try it free" on the sites home page. */
.trial .tile-icon {
  margin-bottom: 0.75rem;
}

.trial-widget:not(:empty) {
  margin: 0 0 0.75rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.copy-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.copy-row button {
  flex: none;
  min-height: 3rem;
}

.trial-timer {
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trial-label {
  margin: 1rem 0 0.4rem;
  font-weight: 600;
}

.trial-result pre {
  white-space: pre;
}

.keep {
  max-width: none;
}

.keep-warning {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-bg);
}

#keep-row button {
  margin-left: 0.5rem;
}

/* Calm banners for the live regions. */
.status {
  min-height: 1.55em;
  margin: 1rem 0;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

.status:not(:empty),
.error:not(:empty) {
  padding: 0.75rem 1rem;
  border: 1px solid var(--info-border);
  border-radius: 12px;
  background: var(--info-bg);
}

.error:not(:empty) {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.error:empty,
.status:empty {
  margin: 0;
  min-height: 0;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 2rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--text);
  font: 600 1.375rem/1.2 var(--serif);
}

.empty .art {
  width: 7rem;
}

[hidden] {
  display: none !important;
}

/* Motion. Everything that moves is declared here, so reduced motion turns it all off. */
@keyframes drift {
  from {
    transform: translate3d(-4%, -3%, 0) rotate(-6deg) scale(1);
  }
  to {
    transform: translate3d(5%, 4%, 0) rotate(8deg) scale(1.12);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 21;
  }
}

@keyframes type {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes caret-on {
  from,
  to {
    border-left-color: var(--term-caret);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes float {
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

@keyframes breathe {
  50% {
    opacity: 0.5;
    transform: scaleX(0.8);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero::before,
  .hero::after {
    will-change: transform;
    animation: drift 28s ease-in-out infinite alternate;
  }

  .hero::after {
    animation: drift 37s ease-in-out infinite alternate-reverse;
  }

  .hero-copy > *,
  .term {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero-copy > :nth-child(4),
  .term {
    animation-delay: 0.24s;
  }

  .logo-fg {
    stroke-dasharray: 20 40;
    animation: draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s backwards;
  }

  .t-line::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 2px solid transparent;
    background: var(--term-bg);
    transform: translateX(101%);
    animation: type 1s steps(44) 0.7s both, caret-on 1s step-end 0.7s;
  }

  .t-cmd::after {
    left: 2ch;
  }

  .t-line:nth-child(2)::after {
    animation-duration: 1.1s;
    animation-delay: 1.85s;
    animation-timing-function: steps(50), step-end;
  }

  .t-line:nth-child(3)::after {
    animation-duration: 0.85s;
    animation-delay: 3.1s;
    animation-timing-function: steps(38), step-end;
  }

  .t-line:nth-child(4)::after {
    animation-duration: 1.5s;
    animation-delay: 4.1s;
    animation-timing-function: steps(68), step-end;
  }

  .t-out,
  .t-wait {
    animation: rise 0.45s ease-out 5.9s backwards;
  }

  .t-wait {
    animation-delay: 6.3s;
  }

  .caret {
    animation: blink 1.1s step-end 6.3s 8;
  }

  .float {
    transform-box: fill-box;
    transform-origin: center;
    animation: float 6s ease-in-out infinite;
  }

  .art-shadow {
    transform-box: fill-box;
    transform-origin: center;
    animation: breathe 6s ease-in-out infinite;
  }

  .button,
  button,
  .site-list > .card,
  .step {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
  }

  .button:active,
  button:not(:disabled):active {
    transform: translateY(1px);
  }

  .site-list > .card:hover,
  .step:hover {
    transform: translateY(-3px);
  }

  /* The home page chat demo: a 7 s round, one duration for all so they stay in step. The
     requests take turns over four rounds (28 s), 1 2 1 3 as DEMO_ORDER in pages.py: each
     switch falls in the fade between two rounds. */
  .demo-chat {
    animation: demo-cycle 7s linear infinite;
  }

  .demo-v1 {
    animation: demo-show-1 28s step-end infinite;
  }

  .demo-v2 {
    animation: demo-show-2 28s step-end infinite;
  }

  .demo-v3 {
    animation: demo-show-3 28s step-end infinite;
  }

  .demo-line::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 2px solid var(--ag-navy);
    background: #dff1f1;
    animation: demo-type-1 7s linear infinite;
  }

  .demo-line + .demo-line::after {
    animation-name: demo-type-2;
  }

  .demo-line + .demo-line + .demo-line::after {
    animation-name: demo-type-3;
  }

  .demo-agent {
    animation: demo-reply 7s ease-out infinite;
  }

  .demo-link {
    animation: demo-link 7s ease-out infinite;
  }

  .demo-preview {
    transform-origin: 0 0;
    animation: demo-preview 7s ease-out infinite;
  }

  @keyframes demo-cycle {
    0% { opacity: 0; }
    2%, 91% { opacity: 1; }
    97%, 100% { opacity: 0; }
  }

  @keyframes demo-show-1 {
    0% { visibility: visible; }
    25% { visibility: hidden; }
    50% { visibility: visible; }
    75%, 100% { visibility: hidden; }
  }

  @keyframes demo-show-2 {
    0% { visibility: hidden; }
    25% { visibility: visible; }
    50%, 100% { visibility: hidden; }
  }

  @keyframes demo-show-3 {
    0% { visibility: hidden; }
    75%, 100% { visibility: visible; }
  }

  @keyframes demo-type-1 {
    0%, 2% { transform: none; animation-timing-function: steps(24, end); }
    11% { transform: translateX(101%); border-left-color: var(--ag-navy); }
    11.1%, 100% { transform: translateX(101%); border-left-color: transparent; }
  }

  @keyframes demo-type-2 {
    0%, 12% { transform: none; border-left-color: transparent; }
    12.1% { transform: none; border-left-color: var(--ag-navy); animation-timing-function: steps(26, end); }
    21% { transform: translateX(101%); border-left-color: var(--ag-navy); }
    21.1%, 100% { transform: translateX(101%); border-left-color: transparent; }
  }

  @keyframes demo-type-3 {
    0%, 22% { transform: none; border-left-color: transparent; }
    22.1% { transform: none; border-left-color: var(--ag-navy); animation-timing-function: steps(29, end); }
    31% { transform: translateX(101%); border-left-color: var(--ag-navy); }
    31.1%, 100% { transform: translateX(101%); border-left-color: transparent; }
  }

  @keyframes demo-reply {
    0%, 33% { opacity: 0; transform: translateY(6px); }
    38%, 100% { opacity: 1; transform: none; }
  }

  @keyframes demo-link {
    0%, 46% { opacity: 0; transform: translateY(4px); }
    51%, 100% { opacity: 1; transform: none; }
  }

  @keyframes demo-preview {
    0%, 60% { opacity: 0; transform: scale(0.94); }
    67%, 100% { opacity: 1; transform: none; }
  }
}

@media (forced-colors: active) {
  .t-line::after {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* /admin: read-only stats. Charts are inline SVG; colours come from the tokens. */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.admin-head h1 {
  margin: 0;
}

.admin h2 {
  margin: 2rem 0 0.75rem;
}

.admin h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.admin .stat-value {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  overflow-wrap: anywhere;
}

.admin-login {
  max-width: 28rem;
  margin: 3rem auto;
}

.admin-chart {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
}

.chart-bar {
  fill: var(--accent);
}

.chart-bar-alt {
  fill: var(--link);
}

.chart-label,
.chart-value {
  fill: var(--muted);
  font: 12px var(--font);
}

.chart-value {
  fill: var(--text);
  font-weight: 600;
}

.legend {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0 0.25rem 0 0.5rem;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend-main {
  background: var(--accent);
}

.legend-alt {
  background: var(--link);
}

/* /admin lists: section nav, GET filter forms, tables, detail facts and state badges. */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.admin-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.admin-filters input,
.admin-filters select {
  width: auto;
  min-width: 10rem;
}

.admin-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  background: var(--surface);
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.6rem;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table time {
  white-space: nowrap;
}

.admin-table .hint {
  display: block;
  margin: 0;
  font-size: 0.75rem;
}

.admin-pager {
  color: var(--muted);
  font-size: 0.875rem;
}

.admin-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0 0 1.5rem;
}

.admin-facts dt {
  color: var(--muted);
}

.admin-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-badge-warn {
  background: var(--danger-bg);
  color: var(--danger);
}

.admin-badge-ok {
  background: var(--info-bg);
  color: var(--success);
}

/* /admin actions: the Danger zone on detail pages and the confirmation form. */
.admin-danger {
  margin: 2rem 0 0;
  border-color: var(--danger-border);
}

.admin-danger h2 {
  margin-top: 0;
}

.admin-danger form {
  margin: 0;
}

.admin-confirm {
  max-width: 28rem;
}

.admin-confirm input[type="password"] {
  width: 100%;
}

/* API host home page: the AgenTack brand. Light only, scoped to body.ag-home so the other
   pages keep their own look. The glow is pure radial-gradients; the prompt box is shown
   disabled (the builder is not live yet). Text pairs meet WCAG AA on --ag-bg and white. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ag-home {
  color-scheme: light;
  --ag-navy: #1b2f4e;
  --ag-teal: #1fa2a6;
  --ag-teal-ink: #0d6e72;
  --ag-cyan: #7fe6ea;
  --ag-bg: #f4f8f8;
  --ag-muted: #4a5a70;
  --bg: var(--ag-bg);
  --surface: #ffffff;
  --text: var(--ag-navy);
  --muted: var(--ag-muted);
  --border: #d9e4e6;
  --border-strong: #7d8fa3;
  --link: var(--ag-teal-ink);
  --accent: var(--ag-navy);
  --accent-hover: #0f1e35;
  --on-accent: #ffffff;
  --code-bg: #e6eff0;
  --focus: var(--ag-teal-ink);
  --badge-bg: #dff4f4;
  --badge-text: var(--ag-teal-ink);
  --info-bg: #e8f5f5;
  --info-border: #b6dedf;
  --hero-ink: #ffffff;
  --hero-muted: #dbe7f0;
  --serif: var(--font);
  background: var(--ag-bg);
  color: var(--ag-navy);
  font-family: var(--font);
}

.ag-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem var(--gutter);
}

.ag-logo {
  display: inline-flex;
  margin-right: auto;
}

.ag-logo img {
  display: block;
  width: auto;
  height: 2.25rem;
}

.ag-nav {
  display: flex;
  gap: 1.25rem;
}

.ag-nav a {
  color: var(--ag-navy);
  font-weight: 500;
  text-decoration: none;
}

.ag-nav a:hover {
  text-decoration: underline;
}

.ag-cta {
  display: flex;
  gap: 0.5rem;
}

.ag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--ag-navy);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.ag-pill-outline {
  background: transparent;
  color: var(--ag-navy);
}

.ag-pill-outline:hover {
  background: #ffffff;
}

.ag-pill-navy {
  background: var(--ag-navy);
  color: #ffffff;
}

.ag-pill-navy:hover {
  background: #0f1e35;
}

/* The first screen: headline and ways to start, then the chat demo; side by side from
   56rem. On a phone the buttons come before the demo, so they show without scrolling. */
.ag-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  margin: 0 calc(-1 * var(--gutter)) clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.25rem, 6vw, 5rem) var(--gutter) clamp(2.5rem, 7vw, 4.5rem);
  overflow-x: clip;
}

@media (min-width: 56rem) {
  .ag-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

.hero-main {
  min-width: 0;
}

.hero-main .eyebrow {
  margin-bottom: 0.6rem;
  color: var(--ag-teal-ink);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-cta .hero-btn {
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.55rem 1.35rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
}

.hero-cta .hero-btn img {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
}

.hero-cta .ag-pill-outline {
  background: rgba(255, 255, 255, 0.7);
}

.hero-cta .ag-pill-outline:hover {
  border-color: var(--ag-navy);
  background: #ffffff;
  color: var(--ag-navy);
}

.hero-more {
  margin: 0.75rem 0 0;
}

.ag-glow {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 50% 82%, rgba(27, 47, 78, 0.4), transparent 70%),
    radial-gradient(38% 42% at 28% 72%, rgba(31, 162, 166, 0.55), transparent 70%),
    radial-gradient(40% 44% at 74% 70%, rgba(127, 230, 234, 0.75), transparent 70%),
    radial-gradient(65% 40% at 50% 55%, rgba(127, 230, 234, 0.3), transparent 75%);
  filter: blur(28px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 80%, transparent);
}

.ag-hero h1 {
  max-width: 18ch;
  margin: 0 0 1rem;
  color: var(--ag-navy);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.ag-sub {
  max-width: 36rem;
  margin: 0 0 1.75rem;
  color: var(--ag-muted);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3rem);
}

.ag-home .how,
.ag-home .section {
  scroll-margin-top: 1rem;
}

.ag-home .step,
.ag-home .section.card,
.ag-home .faq-item {
  border-color: var(--border);
  background: #ffffff;
}

.ag-home .tile-icon {
  background: #dff4f4;
  color: var(--ag-teal-ink);
}

.ag-example {
  display: grid;
  gap: 1.75rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: 24px;
  background: linear-gradient(160deg, #22406a, var(--ag-navy) 60%, #12213a);
  color: #ffffff;
}

.ag-example h2,
.ag-example a:not(.button) {
  color: #ffffff;
}

.ag-example .eyebrow {
  color: var(--ag-cyan);
}

.ag-example .hero-lead {
  color: var(--hero-muted);
}

.ag-example .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.ag-example .button {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--ag-navy);
}

.ag-example .button.ghost {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #ffffff;
}

.ag-example :focus-visible {
  outline-color: var(--ag-cyan);
}

.ag-home .site-footer a {
  color: var(--ag-muted);
}

/* Phones: one row, the logo on the left and the links on the right. Under 25rem Connect
   (and GitHub) step aside; Dashboard and Start free stay. */
@media (max-width: 30rem) {
  .ag-header {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .ag-logo img {
    height: 1.9rem;
  }

  .ag-nav {
    gap: 0.75rem;
  }

  .ag-cta {
    flex: none;
    gap: 0.35rem;
  }

  .ag-pill {
    min-height: 2.25rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

@media (max-width: 25rem) {
  .ag-nav {
    display: none;
  }
}

/* The dashboard for people (/login and /dashboard): the light AgenTack look of the home
   page (.ag-home), plus the few colours the dark dashboard sets for itself. */
.ag-app {
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --danger-border: #f2b8b2;
  --on-danger: #ffffff;
  --success: #18703c;
  --wash-a: rgba(31, 162, 166, 0.06);
  --wash-b: rgba(27, 47, 78, 0.04);
  --shadow-sm: 0 1px 2px rgba(27, 47, 78, 0.06), 0 6px 16px -8px rgba(27, 47, 78, 0.12);
  --shadow-md: 0 2px 6px rgba(27, 47, 78, 0.06), 0 22px 44px -20px rgba(27, 47, 78, 0.25);
  --shadow-lg: 0 12px 30px -18px rgba(27, 47, 78, 0.25), 0 40px 90px -40px rgba(27, 47, 78, 0.35);
  --glow: 0 2px 6px rgba(27, 47, 78, 0.06), 0 24px 60px -24px rgba(27, 47, 78, 0.35);
}

.ag-app-hero {
  padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.ag-app-hero h1 {
  margin: 0 0 0.6rem;
  color: var(--ag-navy);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.ag-app-hero .ag-sub {
  margin: 0 auto;
}

.ag-app .signin-card {
  border: 1px solid #e1eaec;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--glow);
}

.ag-app .signin-card h2 {
  margin-top: 0;
}

.ag-app .email-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ag-app .soon-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--ag-teal-ink);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

.ag-app .card,
.ag-app .site-list > li {
  border-color: var(--border);
  background: #ffffff;
}

.ag-app .publish-card {
  border-color: var(--border-strong);
}

@media (forced-colors: active) {
  .ag-glow {
    display: none;
  }
}

/* Home page hero pieces: the connect buttons (also in the popup) and the facts line. The
   chat demo below is HTML + CSS only and changes only opacity and transform, so nothing
   moves around it. Its base styles are the first request's finished frame: the loop is
   added only for people who allow motion. */
.clients {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.client-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid #c9d6d8;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ag-navy);
  font-weight: 600;
  text-decoration: none;
}

.client-btn:hover {
  border-color: var(--ag-navy);
  text-decoration: none;
}

.client-btn img {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
}

.client-more {
  color: var(--ag-teal-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.demo-fact {
  margin: 0.6rem 0 0;
  color: var(--ag-muted);
  font-size: 0.875rem;
}

.demo-fallback {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
}

@supports selector(:popover-open) {
  .demo-fallback {
    display: none;
  }
}

/* The chat. */
.demo {
  margin: 0;
  min-width: 0;
}

.demo-chat {
  display: grid;
  gap: 0.85rem;
  padding: clamp(0.9rem, 3vw, 1.25rem);
  border: 1px solid #e1eaec;
  border-radius: 18px;
  background: #f7fafa;
  font-size: 0.9375rem;
}

.demo figcaption {
  margin-top: 0.75rem;
  color: var(--ag-muted);
  font-size: 0.875rem;
}

.demo-msg {
  display: grid;
  gap: 0.3rem;
  max-width: 92%;
}

.demo-you {
  justify-self: end;
  justify-items: end;
}

.demo-who {
  color: var(--ag-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.demo-bubble {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  overflow: hidden;
}

.demo-you .demo-bubble {
  border-bottom-right-radius: 4px;
  background: #dff1f1;
  color: var(--ag-navy);
}

/* The demo's requests and preview texts take turns in one grid cell (see demo-show-1/2/3),
   so nothing changes size between rounds. Still (reduced motion): the first one only. */
.demo-swap {
  display: grid;
}

.demo-swap > .demo-v {
  grid-area: 1 / 1;
}

.demo-v2,
.demo-v3 {
  visibility: hidden;
}

.demo-line {
  position: relative;
  display: block;
  width: fit-content;
  white-space: nowrap;
}

.demo-agent .demo-bubble {
  display: grid;
  gap: 0.45rem;
  border: 1px solid #e1eaec;
  border-bottom-left-radius: 4px;
  background: #ffffff;
}

.demo-reply,
.demo-tool,
.demo-link {
  margin: 0;
}

.demo-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: start;
  padding: 0.15rem 0.55rem;
  border: 1px solid #c9d6d8;
  border-radius: 999px;
  background: #f4f8f8;
  color: var(--ag-navy);
  font: 500 0.8125rem/1.4 var(--mono);
}

.demo-tool img {
  display: block;
  width: 14px;
  height: 14px;
}

.demo-link {
  color: var(--ag-teal-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.demo-ok {
  color: #18703c;
}

.demo-url {
  font: 500 0.8125rem/1.4 var(--mono);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.demo-preview {
  display: grid;
  gap: 0.4rem;
  justify-self: start;
  width: min(15rem, 80%);
  margin-left: 0.25rem;
  padding: 0 0 0.85rem;
  overflow: hidden;
  border: 1px solid #e1eaec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px -16px rgba(27, 47, 78, 0.45);
}

.demo-preview > :not(.demo-preview-bar) {
  margin: 0 0.85rem;
}

.demo-preview-bar {
  display: block;
  height: 0.5rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(90deg, var(--ag-navy), var(--ag-teal));
}

.demo-preview-title {
  color: var(--ag-navy);
  font-size: 1rem;
  font-weight: 800;
}

.demo-preview-text {
  display: block;
  height: 0.4rem;
  border-radius: 999px;
  background: #e1eaec;
}

.demo-preview-text.demo-short {
  width: 60%;
}

.demo-preview-btn {
  justify-self: start;
  justify-items: start;
  margin-top: 0.2rem;
}

/* The pill is on each text, so a short one ("RSVP") is not as wide as the longest. */
.demo-preview-btn > .demo-v {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--ag-teal-ink);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

@media (forced-colors: active) {
  .demo-line::after {
    content: none;
  }
}

/* "Try it in your browser": the popup (popover attribute; the browser centres it, and Esc
   or a click outside closes it). Without popover support it stays hidden and the plain
   "Upload your files" link under the button is shown instead. */
.start-choice {
  width: min(44rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: clamp(1.1rem, 4vw, 1.75rem);
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ag-navy);
  box-shadow: 0 30px 80px -30px rgba(15, 30, 53, 0.6);
}

.start-choice::backdrop {
  background: rgba(27, 47, 78, 0.45);
}

@supports not selector(:popover-open) {
  .start-choice {
    display: none;
  }
}

.start-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.start-head h3 {
  margin: 0;
  font-size: 1.3rem;
}

.start-choice > p {
  margin: 0.4rem 0 1.25rem;
  color: var(--ag-muted);
}

.start-choice .start-close {
  flex: none;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid #c9d6d8;
  background: #ffffff;
  color: var(--ag-navy);
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: none;
}

.start-choice .start-close:hover {
  border-color: var(--ag-navy);
  background: #f4f8f8;
}

.start-cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .start-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.start-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fbfb;
}

.start-card h4 {
  margin: 0;
  font-size: 1.0625rem;
}

.start-card p {
  margin: 0;
  color: var(--ag-muted);
  font-size: 0.9375rem;
}

.start-card .button {
  margin-top: auto;
}

.start-card .clients {
  margin-top: auto;
}

/* /connect: the steps to add AgenTack to a chat app. */
.connect-card {
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 24px;
  box-shadow: var(--glow);
  scroll-margin-top: 1rem;
}

.connect-card h2 {
  margin-top: 0;
}

.connect-app {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.connect-app img {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
}

.connect-steps {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  padding-left: 1.4rem;
}

.connect-steps li::marker {
  color: var(--ag-teal-ink);
  font-weight: 700;
}

.connect-url {
  margin: 0.5rem 0 0;
}

/* The address on its own line, selected whole with one click or tap. */
.connect-url code {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

/* Only for people arriving from a guest site's "Keep this site" (/dashboard#keep-help):
   hidden on every other visit. :target is set when the page loads and stays when
   dashboard.js later moves the address to /login (replaceState doesn't change it). */
.keep-help {
  display: none;
}

.keep-help:target {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: var(--info-bg);
  outline: 2px solid var(--ag-teal-ink);
}

.connect-dev {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--ag-muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* Home page: "Coming soon", above the FAQ. The box beside the text is only a picture
   (aria-hidden, nothing focusable): a dashed outline around an example request. */
.ag-home .soon-band {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  max-width: 72rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #ffffff;
}

@media (min-width: 48rem) {
  .ag-home .soon-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.soon-copy h2 {
  margin: 0.6rem 0 0.5rem;
}

.soon-copy p {
  margin: 0;
  color: var(--ag-muted);
}

.soon-copy p + p {
  margin-top: 0.85rem;
}

.soon-copy .soon-badge {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--ag-teal-ink);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.soon-link {
  color: var(--ag-teal-ink);
  font-weight: 600;
}

.soon-box {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  min-height: 7.5rem;
  padding: 1.1rem 1.25rem;
  border: 2px dashed #b9c8cb;
  border-radius: 18px;
  background: #f7fafa;
}

.soon-quote {
  margin: 0;
  color: #5d6b7e;
  font-size: 1.0625rem;
  font-style: italic;
}

.soon-label {
  align-self: end;
  padding: 0.1rem 0.55rem;
  border: 1px solid #c9d6d8;
  border-radius: 999px;
  color: var(--ag-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

/* About, Privacy Policy and Terms of Service: one readable column under the light hero. */
.legal {
  max-width: 46rem;
  margin: 0 auto;
}

.legal h2 {
  margin: 2.25rem 0 0.6rem;
  color: var(--ag-navy, var(--text));
  font-size: 1.3rem;
  line-height: 1.25;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li + li {
  margin-top: 0.5rem;
}

.legal-note {
  padding: 0.75rem 1rem;
  border: 1px solid var(--info-border);
  border-radius: 12px;
  background: var(--info-bg);
}

.legal-updated {
  margin-top: 0.75rem;
}

.legal-links {
  margin-top: 2.5rem;
}

/* "Meet the founder" on /about: the photo beside the text, above it on phones. The photo's
   box is fixed (and its width and height attributes match), so nothing moves as it loads. */
.founder {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid #e1eaec;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.founder-photo {
  flex: none;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ag-bg);
}

.founder-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.founder-text p {
  margin: 0 0 0.75rem;
}

.founder-text > :last-child {
  margin-bottom: 0;
}

.founder .founder-name {
  margin: 0;
  color: var(--ag-navy);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.founder .founder-role {
  margin: 0.15rem 0 0.85rem;
  color: var(--ag-teal-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.legal .founder-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.legal .founder-links li + li {
  margin-top: 0;
}

@media (max-width: 600px) {
  .founder {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  .founder-photo {
    width: 128px;
    height: 128px;
  }

  .founder-text {
    width: 100%;
  }

  .founder .founder-name,
  .founder .founder-role {
    text-align: center;
  }

  .legal .founder-links {
    justify-content: center;
  }
}

/* The "I agree" box on the forms that make an account, and its own message line. */
.terms-row {
  margin-top: 0.75rem;
}

.terms-row label {
  font-weight: 400;
}

.terms-error:not(:empty) {
  margin: 0.25rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
}

/* One line under "Try as a guest" and on the agent pages about the Terms. */
.guest-terms,
.agree-line {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* The people's guides (/personal-website, /cv-portfolio, /publish-ai-website): the legal
   pages' column, with numbered steps and prompts to copy. */
.legal ol {
  padding-left: 1.25rem;
}

.guide-steps li + li {
  margin-top: 0.5rem;
}

.prompt {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--link);
  border-radius: 0 12px 12px 0;
  background: var(--code-bg);
  font-style: italic;
}

/* Links to the guides on the home page, /connect and the guides themselves. */
.guide-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.guide-list a {
  font-weight: 600;
}

.guide-list .hint {
  display: block;
}

.connect-ideas {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

/* On the home page the guides are cards in a row, like How it works above them. */
.guides .guide-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.guides .guide-list li {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.connect-ideas h2 {
  font-size: 1.3rem;
}

/* The people's pages at the bare sites domain (app/ui/site_domain.py): a landing page in the
   light AgenTack look, scoped to .ag-sites so the product's pages don't change. A wide hero
   beside a browser window drawn in CSS, numbered steps, cards and a closing band; every grid
   stacks on phones. Light only, like .ag-home; no images beyond inline SVG icons. */
.ag-sites main {
  max-width: 76rem;
  padding-bottom: 3rem;
}

.ag-sites :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ag-sites code {
  overflow-wrap: anywhere;
}

.sd-hero {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 7vw, 5.5rem) 0 clamp(2.5rem, 7vw, 5rem);
}

@media (min-width: 56rem) {
  .sd-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

.sd-hero-text {
  min-width: 0;
}

.sd-eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--ag-teal-ink);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sd-hero h1 {
  max-width: 20ch;
  margin: 0 0 1.25rem;
  color: var(--ag-navy);
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.9rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.sd-lead {
  max-width: 38rem;
  margin: 0 0 2rem;
  color: var(--ag-muted);
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.55;
}

.sd-lead strong {
  color: var(--ag-navy);
  overflow-wrap: anywhere;
}

.sd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--ag-navy);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.sd-btn-primary {
  background: var(--ag-navy);
  color: #ffffff;
}

.sd-btn-primary:hover {
  border-color: #0f1e35;
  background: #0f1e35;
}

.sd-btn-ghost {
  background: #ffffff;
  color: var(--ag-navy);
}

.sd-btn-ghost:hover {
  background: var(--badge-bg);
}

.sd-note {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: var(--ag-muted);
  font-size: 0.9375rem;
}

/* The browser window: an address bar with the example address, a page sketched in blocks. */
.sd-window {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 0 0 10px rgba(127, 230, 234, 0.25), var(--shadow-lg);
  overflow: hidden;
}

.sd-window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--ag-bg);
}

.sd-dots {
  display: flex;
  flex: none;
  gap: 0.35rem;
}

.sd-dots i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--border-strong);
  opacity: 0.45;
}

.sd-url {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ag-navy);
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-window-page {
  display: grid;
  gap: 0.75rem;
  padding: 1.75rem 1.5rem 2rem;
}

.sd-line {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: #e3ecee;
}

.sd-line-title {
  width: 60%;
  height: 1.4rem;
  background: var(--ag-navy);
  opacity: 0.85;
}

.sd-line-short {
  width: 70%;
}

.sd-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.sd-tiles i {
  height: 4.5rem;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--ag-cyan), var(--ag-teal));
  opacity: 0.55;
}

.sd-tiles i + i {
  opacity: 0.35;
}

.sd-window-live {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--ag-navy);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.sd-live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #6fe3b4;
}

/* Sections, steps and cards. */
.sd-section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  scroll-margin-top: 1rem;
}

.sd-section > h2,
.sd-closing h2 {
  margin: 0 0 0.5rem;
  color: var(--ag-navy);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sd-section-lead {
  max-width: 40rem;
  margin: 0 0 2rem;
  color: var(--ag-muted);
  font-size: 1.0625rem;
}

.sd-steps,
.sd-cards {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Three steps: one row from tablet width up, one column on phones. */
.sd-steps {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 44rem) {
  .sd-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sd-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

/* Six guides: three to a row on wide screens, so no card is left alone on a row. */
@media (min-width: 56rem) {
  .sd-cards-guides {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The honest limits: one card across the whole row, its points side by side when they fit. */
.sd-cards .sd-card-limits {
  grid-column: 1 / -1;
  background: var(--info-bg);
  border-color: var(--info-border);
  box-shadow: none;
}

.sd-card-limits ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.5rem 2rem;
}

.sd-card-limits li + li {
  margin-top: 0;
}

.sd-step,
.sd-card,
.sd-faq-item {
  position: relative;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.sd-step h3,
.sd-card h3,
.sd-faq-item h3 {
  margin: 0 0 0.4rem;
  color: var(--ag-navy);
  font-size: 1.125rem;
  line-height: 1.3;
}

.sd-step p,
.sd-card p,
.sd-faq-item p {
  margin: 0;
  color: var(--ag-muted);
}

.sd-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ag-muted);
}

.sd-card li + li {
  margin-top: 0.4rem;
}

.sd-step-n {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--ag-navy);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 800;
}

.sd-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--badge-bg);
  color: var(--ag-teal-ink);
}

/* A guide card is one link: its heading's link covers the card, so the whole card clicks. */
.sd-card-link h3 a {
  color: var(--ag-navy);
  text-decoration: none;
}

.sd-card-link h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
}

.sd-card-link h3 a::before {
  content: "→ ";
  color: var(--ag-teal-ink);
}

.sd-card-link:hover {
  border-color: var(--ag-teal-ink);
}

.sd-card-link:hover h3 a {
  text-decoration: underline;
}

.sd-card-link:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sd-card-link h3 a:focus-visible {
  outline: none;
}

.sd-faq {
  max-width: 52rem;
}

.sd-faq-item + .sd-faq-item {
  margin-top: 0.75rem;
}

/* The closing band: navy, white text, the same two buttons inverted. */
.sd-closing {
  margin: clamp(3rem, 7vw, 5rem) 0 0;
  padding: clamp(2rem, 6vw, 3.5rem);
  border-radius: 28px;
  background: linear-gradient(150deg, #22406a, var(--ag-navy) 60%, #12213a);
  color: #ffffff;
  text-align: center;
}

.sd-closing h2 {
  color: #ffffff;
}

.sd-closing p {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  color: var(--hero-muted);
  font-size: 1.0625rem;
}

.sd-closing .sd-actions {
  justify-content: center;
}

.sd-closing .sd-btn-primary {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--ag-navy);
}

.sd-closing .sd-btn-primary:hover {
  background: var(--ag-cyan);
  border-color: var(--ag-cyan);
}

.sd-closing .sd-btn-ghost {
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #ffffff;
}

.sd-closing .sd-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sd-closing .sd-closing-dev {
  margin: 1.75rem auto 0;
  font-size: 0.9375rem;
}

.sd-closing a:not(.sd-btn) {
  color: #ffffff;
}

.sd-closing :focus-visible {
  outline-color: var(--ag-cyan);
}

/* The guides: a shorter hero with a breadcrumb, then the guide's column with its sections as
   cards, the questions and the closing band. */
.sd-hero-guide {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

.sd-hero-guide .sd-hero-text {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
}

.sd-hero-guide h1 {
  max-width: 24ch;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
}

.sd-hero-guide .sd-lead {
  margin-bottom: 0;
}

.sd-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--ag-muted);
  font-size: 0.9375rem;
}

.sd-crumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--border-strong);
}

.sd-guide {
  max-width: 50rem;
}

.sd-guide > section:not(.sd-faq) {
  margin-top: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.sd-guide > section:not(.sd-faq) > h2 {
  margin-top: 0;
}

.sd-guide pre {
  max-width: 100%;
  overflow-x: auto;
}

.sd-guide .sd-faq {
  padding-top: 2.5rem;
}

.sd-guide .sd-faq > h2 {
  font-size: 1.6rem;
}

/* Header: the two page links step aside on phones; Dashboard and Start free stay. */
@media (max-width: 40rem) {
  .ag-sites .ag-nav {
    display: none;
  }
}

@media (max-width: 30rem) {
  .sd-actions .sd-btn {
    flex: 1 1 100%;
  }

  .sd-window-page {
    padding: 1.25rem 1rem 1.5rem;
  }

  .sd-tiles i {
    height: 3rem;
  }
}

@media (forced-colors: active) {
  .sd-step-n,
  .sd-window-live,
  .sd-closing {
    border: 1px solid CanvasText;
  }
}

/* /pricing: the account levels as cards inside the guides' column (.legal sets list padding
   and spacing for its own lists; the cards undo it). */
.legal .sd-cards {
  padding: 0;
}

.legal .sd-cards > li + li {
  margin-top: 0;
}

/* Three account levels side by side on wide screens: the grid steps out of the text column,
   centred on it, so no card is left alone on a row. */
@media (min-width: 44rem) {
  .sd-cards-pricing {
    position: relative;
    left: 50%;
    width: min(66rem, calc(100vw - 2 * var(--gutter)));
    transform: translateX(-50%);
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.sd-cards-pricing .sd-card h3 {
  margin-bottom: 0.25rem;
}

.sd-price {
  margin: 0 0 0.75rem;
  color: var(--ag-teal-ink, var(--link));
  font-size: 1.25rem;
  font-weight: 800;
}

/* Build with AI (/build): the chat with its progress feed, question cards and summary on
   the left, the preview on the right; stacked on phones, the preview below and collapsible. */
.build-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 64rem) {
  .build-studio.has-preview {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .build-preview {
    position: sticky;
    top: 1rem;
  }

  /* Side by side there is room for both: the preview can't be collapsed. */
  .build-preview-toggle {
    display: none;
  }

  .build-preview-body[hidden] {
    display: block;
  }
}
.build-notes {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.build-log {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.build-log > li {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.build-log > li.from-you {
  margin-left: clamp(0rem, 10vw, 4rem);
  border-color: var(--border-strong);
}

.build-log > li.from-builder {
  margin-right: clamp(0rem, 10vw, 4rem);
}

.build-log > li.is-problem {
  border-style: dashed;
}

/* One short line per progress event: quieter than the messages. */
.build-log > li.from-progress {
  margin: 0 0 0.35rem;
  padding: 0.1rem 0 0.1rem 0.75rem;
  border: 0;
  border-left: 3px solid var(--border);
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.build-log > li.from-progress ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  white-space: normal;
}

.build-log > li.build-question-item,
.build-log > li.build-summary {
  white-space: normal;
}

.build-questions fieldset {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.build-questions legend {
  padding: 0 0.25rem;
  font-weight: 700;
}

.build-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: baseline;
  margin: 0.4rem 0;
}

.build-option > .hint,
.build-option > input[type="text"] {
  grid-column: 2;
}

.build-recommended {
  color: var(--success);
  font-weight: 600;
}

.build-question-item.is-answered {
  opacity: 0.7;
}

.build-made-up {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
}

.build-made-up h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.build-made-up ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.build-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.build-suggestions > p {
  flex-basis: 100%;
  margin: 0;
}

.build-photos {
  margin: 0.75rem 0;
}

.build-photo-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.build-photo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.build-photo img {
  width: 4rem;
  height: 4rem;
  border-radius: 6px;
  object-fit: cover;
}

.build-photo-name {
  flex: 1 1 10rem;
}

.build-preview {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.build-preview-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.build-preview-head h2 {
  margin: 0;
}

.build-preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 0.5rem;
}

.build-widths {
  display: inline-flex;
  gap: 0.25rem;
}

.build-widths button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}

.build-page-label {
  margin: 0;
}

.build-frame-box {
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.build-frame-box.is-phone {
  max-width: 390px;
}

.build-frame-box iframe {
  display: block;
  width: 100%;
  height: min(75vh, 48rem);
  border: 0;
}

.build-form {
  max-width: 44rem;
}

.build-history {
  margin-top: 2rem;
}

.build-chats {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  overflow-wrap: anywhere;
}

.build-chats > li {
  margin: 0 0 0.4rem;
}
