/*
 * Ad-Matrix components: the shared shell and building blocks, styled only with am-tokens.css.
 *
 * Load order on every page (creative/base.html does this): am-tokens.css, am-components.css, then the page family's
 * CSS (public: am-site.css, client: creative-client.css, operator: creative-delivery.css), then {% block head %}.
 *
 * Two kinds of selectors:
 *   .am-*            Canonical components. Safe on every page, including operator pages.
 *   generic names    .button, .card, .notice, .badge, .eyebrow, .lead, .page-head, .empty-state, form fields and
 *                    tables keep their existing class names on public and client pages (body.am-public,
 *                    body.am-client). Operator pages opt in with the .am-* names, so nothing here leaks into
 *                    operator CSS that has not asked for it.
 *
 * Contents
 *   1. Base             5. Footer              9. Forms             13. Empty states
 *   2. Layout           6. Buttons            10. Badges, chips     14. Focus card (one-task pages)
 *   3. Preview strip    7. Page heads, type   11. Notices          15. Motion, print
 *   4. Header           8. Cards, panels      12. Tables
 */

/* 1. Base -------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.am-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--am-bg);
  color: var(--am-ink);
  font-family: var(--am-font-body);
  font-size: var(--am-text-m);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:where(.am-public, .am-client) :where(h1, h2, h3, h4) { margin: 0; color: var(--am-ink); }
:where(.am-public, .am-client) :where(h1, h2) {
  font-family: var(--am-font-display); font-weight: 400; font-feature-settings: normal; text-wrap: balance;
}
:where(.am-public, .am-client) h1 { font-size: var(--am-display-m); line-height: 1.02; letter-spacing: -.01em; }
:where(.am-public, .am-client) h2 { font-size: var(--am-display-s); line-height: 1.1; letter-spacing: -.005em; }
:where(.am-public, .am-client) h3 { font-size: var(--am-text-l); font-weight: 600; line-height: 1.35; }
:where(.am-public, .am-client) h4 { font-size: var(--am-text-m); font-weight: 600; }
:where(.am-public, .am-client) p { margin: 0 0 var(--am-space-3); text-wrap: pretty; }
:where(.am-public, .am-client) p:last-child { margin-bottom: 0; }
:where(.am-public, .am-client) :where(strong, b) { font-weight: 600; }
:where(.am-public, .am-client) a { color: var(--am-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(.am-public, .am-client) a:hover { text-decoration-thickness: 2px; }
:where(.am-public, .am-client) img { display: block; max-width: 100%; height: auto; }
:where(.am-public, .am-client) svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.am-body [hidden] { display: none !important; }
.am-body :focus-visible { outline: 3px solid var(--am-accent); outline-offset: 2px; border-radius: 4px; }
.am-body ::selection { background: var(--am-accent-soft); }

.am-skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: var(--am-radius-pill);
  background: var(--am-ink); color: var(--am-surface); font-weight: 600; text-decoration: none;
}
.am-skip-link:focus { top: 12px; }
.am-visually-hidden, :where(.am-public, .am-client) .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.am-muted, :where(.am-public, .am-client) .muted { color: var(--am-muted); }
.am-small, :where(.am-public, .am-client) .small { font-size: var(--am-text-s); line-height: 1.5; }
:where(.am-public, .am-client) .break { overflow-wrap: anywhere; }
:where(.am-public, .am-client) .nowrap { white-space: nowrap; }
:where(.am-public, .am-client) .preserve-lines { white-space: pre-line; }
:where(.am-public, .am-client) .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 2. Layout ------------------------------------------------------------------------------------------ */
.am-shell {
  width: 100%;
  max-width: calc(var(--am-shell) + 2 * var(--am-gutter));
  margin: 0 auto;
  padding-left: var(--am-gutter);
  padding-right: var(--am-gutter);
}
.am-shell-narrow { max-width: calc(760px + 2 * var(--am-gutter)); }
.am-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--am-shell) + 2 * var(--am-gutter));
  margin: 0 auto;
  padding: var(--am-space-7) var(--am-gutter) var(--am-space-9);
}
/* Full-bleed pages (the landing page) lay out their own bands, each with an .am-shell inside. */
.am-main.am-main--bleed { max-width: none; padding: 0; }
.am-main > .notice.flash, .am-main > .am-notice { margin-bottom: var(--am-space-6); }

/* 3. Preview strip: tells everyone that this host is not taking real payments or serving real clients. ---- */
.am-env {
  background: var(--am-warning-soft);
  color: var(--am-ink);
  border-bottom: 1px solid var(--am-warning-line);
  font-size: 12.5px;
  line-height: 1.45;
}
.am-env .am-shell { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 7px; padding-bottom: 7px; }
.am-env b { font-weight: 650; color: var(--am-warning); letter-spacing: .02em; }

/* 4. Header ------------------------------------------------------------------------------------------ */
/* Selectors carry two classes so operator stylesheets that style bare header, nav, a, label, select and button
   elements cannot reach into the shell. */
.am-header.am-header {
  display: block;
  position: relative;
  z-index: 20;
  margin: 0;
  padding: 0;
  background: var(--am-header-bg);
  color: var(--am-header-ink);
  border-bottom: 1px solid var(--am-header-line);
  font-family: var(--am-font-body);
}
.am-header.is-sticky { position: sticky; top: 0; }
.am-header.is-sticky::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--am-header-bg); opacity: .94;
}
@supports (backdrop-filter: blur(8px)) {
  .am-header.is-sticky { background: transparent; backdrop-filter: blur(10px); }
}
.am-header .am-header-inner {
  display: flex;
  align-items: center;
  gap: var(--am-space-5);
  min-height: 72px;
}
.am-header ul, .am-header li { margin: 0; padding: 0; list-style: none; }
.am-header form { margin: 0; }

.am-header .am-brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--am-header-ink); text-decoration: none;
  border: 0; padding: 0;
}
.am-header .am-brand-mark {
  display: block; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--am-mark);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .22);
}
.am-header .am-brand-text { display: grid; line-height: 1.05; }
.am-header .am-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--am-header-ink); white-space: nowrap; }
.am-header .am-brand-tag {
  margin-top: 3px;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--am-muted); white-space: nowrap;
}

.am-header .am-header-inner > nav {
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: var(--am-space-1);
  flex: 1 1 auto; min-width: 0;
  margin: 0; padding: 0; font-size: 14.5px;
}
.am-header .am-nav-link,
.am-header .am-more > summary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--am-radius-pill);
  background: transparent;
  color: var(--am-ink-2);
  font: inherit; font-size: 14.5px; font-weight: 500; line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.am-header .am-nav-link:hover,
.am-header .am-more > summary:hover { background: var(--am-surface-2); color: var(--am-ink); }
.am-header .am-nav-link[aria-current="page"],
.am-header .am-more.is-current > summary {
  background: var(--am-surface); color: var(--am-ink);
  box-shadow: inset 0 0 0 1px var(--am-line);
}
.am-header .am-nav-extra { display: none; }

/* "More": the operator's less-used pages, in a small menu. */
.am-header .am-more { position: relative; }
.am-header .am-more > summary { list-style: none; }
.am-header .am-more > summary::-webkit-details-marker { display: none; }
.am-header .am-more > summary svg { width: 14px; height: 14px; color: var(--am-muted); transition: transform .15s ease; }
.am-header .am-more[open] > summary svg { transform: rotate(180deg); }
.am-header .am-menu {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 30;
  display: grid; gap: 2px;
  min-width: 220px; padding: 6px;
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-m);
  box-shadow: var(--am-shadow-menu);
}
.am-header .am-menu a {
  display: grid; gap: 0;
  padding: 7px 12px;
  line-height: 1.3;
  border-radius: var(--am-radius-s);
  color: var(--am-ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.am-header .am-menu a small { font-size: 12px; font-weight: 400; color: var(--am-muted); }
.am-header .am-menu a:hover { background: var(--am-surface-2); }
.am-header .am-menu a[aria-current="page"] { background: var(--am-accent-soft); color: var(--am-accent); }

.am-header .am-actions { display: flex; align-items: center; gap: var(--am-space-3); flex: none; margin-left: auto; }
.am-header .am-signin {
  color: var(--am-ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 8px 6px;
}
.am-header .am-signin:hover { color: var(--am-ink); text-decoration: underline; text-underline-offset: 3px; }

/* The operator's client picker: the existing workspace switch, posting to /admin/generation-workspace. */
.am-header .am-switch { display: flex; align-items: center; gap: 8px; }
.am-header .am-switch label {
  display: block; margin: 0;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--am-muted); white-space: nowrap;
}
.am-header .am-switch select {
  width: auto; max-width: 220px; min-height: 36px; margin: 0;
  padding: 6px 34px 6px 12px;
  border: 1px solid var(--am-line-strong); border-radius: var(--am-radius-pill);
  background: var(--am-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2345424A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--am-ink); font: inherit; font-size: 13.5px; font-weight: 600;
  appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
.am-header .am-switch select:hover { border-color: var(--am-ink-2); }
/* With scripts on, choosing a client switches at once (am-shell.js), so the button is only for no-script use. */
.js .am-header .am-switch .am-switch-go { display: none; }

/* A client login with several workspaces (an agency) switches between them here. */
.am-header .account-switch { position: relative; }
.am-header .account-switch > summary {
  display: flex; align-items: center; gap: 8px;
  max-width: 260px; min-height: 40px; padding: 5px 10px 5px 14px;
  border: 1px solid var(--am-line); border-radius: var(--am-radius-pill); background: var(--am-surface);
  cursor: pointer; list-style: none;
}
.am-header .account-switch > summary::-webkit-details-marker { display: none; }
.am-header .account-switch > summary:hover { border-color: var(--am-line-strong); }
.am-header .account-switch[open] > summary { border-color: var(--am-accent-line); box-shadow: 0 0 0 3px var(--am-accent-soft); }
.am-header .account-switch-text { display: grid; min-width: 0; line-height: 1.15; }
.am-header .account-switch-label {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--am-muted);
}
.am-header .account-switch-current {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; color: var(--am-ink);
}
.am-header .account-switch-chevron { width: 16px; height: 16px; color: var(--am-muted); transition: transform .15s ease; }
.am-header .account-switch[open] .account-switch-chevron { transform: rotate(180deg); }
.am-header .account-switch-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: min(320px, calc(100vw - 2 * var(--am-gutter)));
  padding: 8px; border: 1px solid var(--am-line); border-radius: var(--am-radius-m);
  background: var(--am-surface); box-shadow: var(--am-shadow-menu);
}
.am-header .account-switch-title { margin: 4px 8px 6px; font-size: 12px; font-weight: 600; color: var(--am-muted); }
.am-header .account-switch-option {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px;
  margin: 0; padding: 8px 10px;
  border: 0; border-radius: var(--am-radius-s); background: none;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--am-ink); text-align: left; cursor: pointer;
}
.am-header .account-switch-option svg { width: 16px; height: 16px; }
.am-header .account-switch-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-header button.account-switch-option { padding-left: 34px; }
.am-header button.account-switch-option:hover { background: var(--am-surface-2); }
.am-header .account-switch-option.is-current { font-weight: 600; color: var(--am-accent); cursor: default; }
.am-header .account-name {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--am-muted);
}

/* Narrow laptops: the operator's picker gives up its label so the links keep their row. */
@media (max-width: 1100px) {
  .am-header .am-switch label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .am-header .am-switch select { max-width: 190px; }
  .am-header .am-header-inner { gap: var(--am-space-4); }
}

/* Phones and small tablets: brand and the one action on top, the links on a row (or two) below. */
@media (max-width: 960px) {
  .am-header .am-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav";
    gap: 6px 12px;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 8px;
  }
  .am-header .am-brand { grid-area: brand; }
  .am-header .am-actions { grid-area: actions; }
  /* The links wrap onto a second row rather than scroll, so every page stays in sight. */
  .am-header .am-header-inner > nav { grid-area: nav; flex-wrap: wrap; gap: 2px; margin: 0 -8px; padding: 2px 0; }
  .am-header .am-header-inner > nav:empty { display: none; }
  /* The operator's "More" pages join the row instead of opening a menu the row would clip. */
  .am-header .am-more { display: none; }
  .am-header .am-nav-extra { display: inline-flex; }
  /* Pickers get a full-width row of their own under the brand. */
  .am-header .am-header-inner:has(.am-switch, .account-switch) {
    grid-template-areas: "brand actions" "picker picker" "nav nav";
  }
  .am-header .am-actions:has(.am-switch, .account-switch) { display: contents; }
  .am-header .am-actions:has(.am-switch, .account-switch) > form:last-child { grid-area: actions; justify-self: end; }
  .am-header .am-switch, .am-header .account-switch { grid-area: picker; margin-top: 4px; }
  .am-header .am-switch select { flex: 1; max-width: none; }
  .am-header .account-switch > summary { max-width: none; border-radius: var(--am-radius-m); }
  .am-header .account-switch-text { flex: 1; }
  .am-header .account-switch-menu { left: 0; right: 0; width: auto; }
  .am-header .account-name { display: none; }
}
@media (max-width: 600px) {
  .am-header .am-brand-tag { display: none; }
  .am-header .am-nav-link { padding: 7px 11px; font-size: 14px; }
  /* The operator's eight links would take two rows here: they keep one row that scrolls sideways instead. */
  .am-header .am-header-inner > nav:has(.am-nav-extra) {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 8px;
  }
  .am-header .am-header-inner > nav:has(.am-nav-extra)::-webkit-scrollbar { display: none; }
  /* The picker's label shows again on its own row. */
  .am-header .am-switch label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
}
@media (max-width: 380px) {
  /* The smallest phones: Sign in moves to the footer so the brand and "Start your pilot" keep one row. */
  .am-header .am-signin { display: none; }
  .am-header .am-nav-link { padding: 7px 9px; font-size: 13.5px; }
}

/* 5. Footer ------------------------------------------------------------------------------------------ */
.am-footer.am-footer {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border-top: 1px solid var(--am-line);
  color: var(--am-muted);
  font-family: var(--am-font-body);
  font-size: var(--am-text-s);
  line-height: 1.5;
}
.am-footer .am-footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--am-space-3) var(--am-space-6);
  padding-top: var(--am-space-6);
  padding-bottom: calc(var(--am-space-6) + env(safe-area-inset-bottom, 0px));
}
.am-footer p { margin: 0; }
.am-footer .am-footer-brand { display: flex; align-items: center; gap: 10px; color: var(--am-ink-2); }
.am-footer .am-footer-brand i {
  display: block; width: 16px; height: 16px; border-radius: 5px; flex: none;
  background: var(--am-mark); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .22);
}
.am-footer nav { display: flex; flex-wrap: wrap; gap: var(--am-space-2) var(--am-space-5); margin: 0; }
.am-footer a { color: var(--am-ink-2); text-decoration: underline; text-decoration-color: var(--am-line-strong); text-underline-offset: 3px; }
.am-footer a:hover { color: var(--am-ink); text-decoration-color: currentColor; }
.am-footer .am-footer-legal { flex-basis: 100%; color: var(--am-muted); }

/* 6. Buttons ----------------------------------------------------------------------------------------- */
.am-button,
:where(.am-public, .am-client) :is(.button, button) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border: 1px solid var(--am-ink);
  border-radius: var(--am-radius-pill);
  background: var(--am-ink);
  color: var(--am-surface);
  font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.am-button:hover,
:where(.am-public, .am-client) :is(.button, button):hover {
  background: var(--am-ink-hover); border-color: var(--am-ink-hover); color: var(--am-surface); text-decoration: none;
}
.am-button:active,
:where(.am-public, .am-client) :is(.button, button):active { transform: translateY(1px); }
.am-button svg,
:where(.am-public, .am-client) :is(.button, button) svg { width: 18px; height: 18px; flex: none; }

.am-button.am-button--quiet,
:where(.am-public, .am-client) :is(.button.quiet, button.quiet, .button.secondary) {
  background: var(--am-surface); color: var(--am-ink); border-color: var(--am-line-strong);
}
.am-button.am-button--quiet:hover,
:where(.am-public, .am-client) :is(.button.quiet, button.quiet, .button.secondary):hover {
  background: var(--am-surface-2); border-color: var(--am-ink); color: var(--am-ink);
}
.am-button.am-button--ghost,
:where(.am-public, .am-client) :is(.button.ghost, button.ghost) {
  background: transparent; color: var(--am-ink-2); border-color: transparent; padding-left: 12px; padding-right: 12px;
}
.am-button.am-button--ghost:hover,
:where(.am-public, .am-client) :is(.button.ghost, button.ghost):hover {
  background: var(--am-surface-2); color: var(--am-ink); border-color: transparent;
}
.am-button.am-button--accent,
:where(.am-public, .am-client) .button.accent {
  background: var(--am-accent); border-color: var(--am-accent); color: var(--am-accent-ink);
}
.am-button.am-button--accent:hover,
:where(.am-public, .am-client) .button.accent:hover { filter: brightness(1.1); background: var(--am-accent); color: var(--am-accent-ink); }
.am-button.am-button--small,
:where(.am-public, .am-client) :is(.button.small, button.small, .button.compact, button.compact) {
  min-height: 36px; padding: 6px 14px; font-size: 13.5px;
}
.am-button.am-button--large,
:where(.am-public, .am-client) .button.large { min-height: 52px; padding: 13px 26px; font-size: 15.5px; }
.am-button.am-button--wide,
:where(.am-public, .am-client) :is(.button.wide, button.wide) { width: 100%; }
.am-button:disabled, .am-button[aria-disabled="true"],
:where(.am-public, .am-client) :is(button:disabled, .button[aria-disabled="true"]) {
  background: var(--am-surface-2); border-color: var(--am-line); color: var(--am-muted); cursor: not-allowed; transform: none;
}
/* The header's buttons, safe from operator stylesheets that style bare buttons. */
.am-header .am-button { margin: 0; }
.am-header .am-button.am-button--quiet { background: transparent; }
.am-header .am-button.am-button--quiet:hover { background: var(--am-surface-2); }

.am-link-arrow,
:where(.am-public, .am-client) .link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--am-ink); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.am-link-arrow:hover, :where(.am-public, .am-client) .link-arrow:hover { color: var(--am-accent); }
.am-link-arrow svg, :where(.am-public, .am-client) .link-arrow svg { width: 18px; height: 18px; }

/* 7. Page heads, type -------------------------------------------------------------------------------- */
.am-eyebrow,
:where(.am-public, .am-client) .eyebrow {
  margin: 0 0 var(--am-space-3);
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--am-muted);
  text-wrap: balance;
}
.am-lead,
:where(.am-public, .am-client) .lead {
  max-width: 640px;
  font-size: var(--am-text-l); line-height: 1.55; color: var(--am-ink-2);
  text-wrap: pretty;
}
.am-page-head,
:where(.am-public, .am-client) .page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--am-space-5) var(--am-space-7);
  margin-bottom: var(--am-space-7);
}
.am-page-head h1 + p, :where(.am-public, .am-client) .page-head h1 + p { margin-top: var(--am-space-4); }
.am-page-head-text, :where(.am-public, .am-client) .page-head-text { max-width: 760px; }
.am-page-head-actions, :where(.am-public, .am-client) .page-head-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--am-space-3);
}
.am-section-head,
:where(.am-public, .am-client) .section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--am-space-2) var(--am-space-5);
  margin-bottom: var(--am-space-5);
}
.am-section-head p, :where(.am-public, .am-client) .section-head p { margin: 0; color: var(--am-muted); }

/* 8. Cards, panels ----------------------------------------------------------------------------------- */
.am-card,
:where(.am-public, .am-client) :is(.card, .panel) {
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-l);
  padding: var(--am-space-6);
}
.am-card + .am-card, :where(.am-public, .am-client) :is(.card + .card, .panel + .panel) { margin-top: var(--am-space-5); }
.am-card > h2, :where(.am-public, .am-client) .card > h2 { margin-bottom: var(--am-space-3); }
.am-card--raised, :where(.am-public, .am-client) .card.raised { box-shadow: var(--am-shadow); }
.am-card--quiet { background: transparent; border-style: dashed; }
.am-well { background: var(--am-surface-2); border-radius: var(--am-radius-l); padding: var(--am-space-6); }
.am-kv,
:where(.am-public, .am-client) .kv {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14.5px;
}
.am-kv dt, :where(.am-public, .am-client) .kv dt { color: var(--am-muted); }
.am-kv dd, :where(.am-public, .am-client) .kv dd { margin: 0; min-width: 0; color: var(--am-ink); }

/* 9. Forms ------------------------------------------------------------------------------------------- */
.am-label,
:where(.am-public, .am-client) label {
  display: block; margin: 0 0 6px;
  font-size: 14px; font-weight: 600; color: var(--am-ink);
}
.am-input,
:where(.am-public, .am-client) :is(input[type="text"], input[type="email"], input[type="url"], input[type="password"],
  input[type="search"], input[type="number"], input[type="tel"], input:not([type]), select, textarea) {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--am-line-strong);
  border-radius: var(--am-radius-m);
  background: var(--am-surface);
  color: var(--am-ink);
  font: inherit; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
:where(.am-public, .am-client) select, select.am-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2345424A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
:where(.am-public, .am-client) textarea, textarea.am-input { min-height: 110px; resize: vertical; line-height: 1.5; }
.am-input::placeholder, :where(.am-public, .am-client) :is(input, textarea)::placeholder { color: var(--am-muted); opacity: .8; }
.am-input:hover, :where(.am-public, .am-client) :is(input, select, textarea):hover { border-color: var(--am-ink-2); }
.am-input:focus-visible,
:where(.am-public, .am-client) :is(input, select, textarea):focus-visible {
  outline: none; border-color: var(--am-accent);
  box-shadow: 0 0 0 3px var(--am-accent-soft), 0 0 0 1px var(--am-accent);
}
:where(.am-public, .am-client) :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--am-accent); }
.am-field, :where(.am-public, .am-client) .field { margin-bottom: var(--am-space-4); }
.am-field-row, :where(.am-public, .am-client) .field-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--am-space-4);
}
.am-field-hint, :where(.am-public, .am-client) .field-hint { margin: 6px 0 0; font-size: 13px; color: var(--am-muted); }
:where(.am-public, .am-client) label .optional { font-weight: 400; color: var(--am-muted); }
.am-field-error, :where(.am-public, .am-client) .field-error {
  display: flex; gap: 6px; align-items: baseline;
  margin: 6px 0 0; color: var(--am-danger); font-size: 13.5px; font-weight: 500;
}
.am-field-error::before, :where(.am-public, .am-client) .field-error::before {
  content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px;
  border-radius: 50%; background: var(--am-danger); color: var(--am-surface);
  font-size: 11px; font-weight: 700; transform: translateY(2px);
}
:where(.am-public, .am-client) :is(.has-error input, input[aria-invalid="true"], textarea[aria-invalid="true"]),
.am-input[aria-invalid="true"] { border-color: var(--am-danger); box-shadow: 0 0 0 1px var(--am-danger); }
.am-form-actions, :where(.am-public, .am-client) .form-actions { display: grid; gap: var(--am-space-3); margin-top: var(--am-space-5); }
/* A password field's Show/Hide toggle (creative/_client-password.html) sits inside the field. */
:where(.am-public, .am-client) .password-field { position: relative; }
:where(.am-public, .am-client) .password-field input { padding-right: 76px; }
:where(.am-public, .am-client) .password-field .reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 34px; padding: 4px 12px;
  background: transparent; border: 0; border-radius: var(--am-radius-pill);
  color: var(--am-accent); font-size: 13px; font-weight: 600;
}
:where(.am-public, .am-client) .password-field .reveal:hover { background: var(--am-accent-soft); color: var(--am-accent); }
:where(.am-public, .am-client) .password-field .reveal:active { transform: translateY(-50%); }

/* 10. Badges, chips ---------------------------------------------------------------------------------- */
.am-badge,
:where(.am-public, .am-client) :is(.badge, .tag) {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: var(--am-radius-pill);
  background: var(--am-surface-2);
  color: var(--am-ink-2);
  font-size: 12px; font-weight: 600; line-height: 1.6; letter-spacing: .01em;
  white-space: nowrap; vertical-align: middle;
}
.am-badge--accent, :where(.am-public, .am-client) .tag-accent { background: var(--am-accent-soft); color: var(--am-accent); }
.am-badge--success, :where(.am-public, .am-client) .tag-success { background: var(--am-success-soft); color: var(--am-success); }
.am-badge--warning, :where(.am-public, .am-client) .tag-warn { background: var(--am-warning-soft); color: var(--am-warning); }
.am-badge--danger { background: var(--am-danger-soft); color: var(--am-danger); }
.am-badge--solid { background: var(--am-ink); color: var(--am-surface); }
.am-badge svg, :where(.am-public, .am-client) :is(.badge, .tag) svg { width: 13px; height: 13px; }
.am-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--am-radius-pill);
  background: var(--am-surface);
  box-shadow: inset 0 0 0 1px var(--am-line);
  color: var(--am-ink-2);
  font-size: 13px; font-weight: 600; line-height: 1.4;
}
.am-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.am-chip .am-dot { background: var(--am-success); box-shadow: 0 0 0 4px var(--am-success-soft); }

/* 11. Notices ---------------------------------------------------------------------------------------- */
.am-notice,
:where(.am-public, .am-client) :is(.notice, .errors) {
  padding: 14px 18px;
  border-radius: var(--am-radius-m);
  background: var(--am-accent-soft);
  color: var(--am-ink);
  border: 1px solid var(--am-accent-line);
  font-size: 14.5px;
}
.am-notice--ok, :where(.am-public, .am-client) .notice.ok { background: var(--am-success-soft); border-color: var(--am-success-line); }
.am-notice--warn, :where(.am-public, .am-client) .notice.warn { background: var(--am-warning-soft); border-color: var(--am-warning-line); }
.am-notice--error,
:where(.am-public, .am-client) :is(.notice.error, .errors) {
  background: var(--am-danger-soft); border-color: var(--am-danger-line); color: var(--am-ink);
}
.am-notice a, :where(.am-public, .am-client) .notice a { color: inherit; font-weight: 600; }
:where(.am-public, .am-client) .notice.flash { display: flex; align-items: center; gap: 12px; font-weight: 500; }

/* 12. Tables ----------------------------------------------------------------------------------------- */
.am-table-wrap { overflow-x: auto; }
.am-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-l);
  overflow: hidden;
  font-size: 14.5px;
}
.am-table th, .am-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--am-line);
  text-align: left; vertical-align: top;
}
.am-table tr:last-child > td, .am-table tr:last-child > th { border-bottom: 0; }
.am-table thead th, .am-table th[scope="col"] {
  background: var(--am-bg);
  color: var(--am-muted);
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.am-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 13. Empty states ----------------------------------------------------------------------------------- */
.am-empty,
:where(.am-public, .am-client) .empty-state {
  padding: var(--am-space-8) var(--am-space-5);
  text-align: center;
  border: 1px dashed var(--am-line-strong);
  border-radius: var(--am-radius-l);
}
.am-empty h2, .am-empty h3,
:where(.am-public, .am-client) .empty-state :is(h2, h3) {
  margin: 0 0 var(--am-space-3);
  font-family: var(--am-font-display); font-weight: 400; font-size: 30px; line-height: 1.15;
}
.am-empty p, :where(.am-public, .am-client) .empty-state p {
  max-width: 520px; margin-left: auto; margin-right: auto; color: var(--am-ink-2);
}

/* 14. Focus card: one task on its own (sign in, set a password, an error) ---------------------------- */
.am-focus { display: grid; place-items: start center; padding-top: var(--am-space-5); }
.am-focus-card {
  width: 100%; max-width: 480px;
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-l);
  padding: var(--am-space-6);
  box-shadow: var(--am-shadow);
}
.am-focus-card.is-wide { max-width: 640px; }
.am-focus-card h1 {
  margin: 0 0 var(--am-space-3);
  font-family: var(--am-font-display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 46px); line-height: 1.04; letter-spacing: -.01em;
  color: var(--am-ink); text-wrap: balance;
}
.am-focus-card p { margin: 0 0 var(--am-space-3); }
.am-focus-card .error-actions { display: flex; flex-wrap: wrap; gap: var(--am-space-3); margin: var(--am-space-5) 0 0; }
.am-focus-card .lead { font-size: var(--am-text-m); }
.am-focus-card form { margin-top: var(--am-space-5); }
.am-focus-card .notice, .am-focus-card .am-notice { margin: var(--am-space-4) 0; }
.am-focus-after {
  display: grid; gap: 8px;
  margin-top: var(--am-space-5); padding-top: var(--am-space-5);
  border-top: 1px solid var(--am-line);
  font-size: 14px; color: var(--am-ink-2);
}
.am-focus-after p { margin: 0; }
/* Three outlines in Feed, Square and Story proportions: the product's mark on one-task pages. */
.am-frames { display: flex; align-items: flex-end; gap: 6px; margin-bottom: var(--am-space-5); }
.am-frames span { display: block; border: 1.5px solid var(--am-ink); border-radius: 4px; }
.am-frames .f45 { width: 24px; height: 30px; }
.am-frames .f11 { width: 30px; height: 30px; }
.am-frames .f916 { width: 17px; height: 30px; background: var(--am-mark); border-color: var(--am-accent); }

/* 15. Motion, print ---------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .am-body *, .am-body *::before, .am-body *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .am-header, .am-footer, .am-env, .am-skip-link { display: none !important; }
  .am-body { background: #fff; }
  .am-main { padding-top: 0; }
}
