/* The public forms: /contact/ and the six account pages.
 *
 * Why this file exists
 * --------------------
 * Every one of these seven templates styled itself with `style="..."`
 * attributes -- 40 of them on /contact/ alone -- and two shared stylesheets
 * had grown selectors that matched those attributes by substring
 * (`.page-account_login .main-content [style*="background"]`,
 * `.page-contact div[style*="background: var(--card-bg)"]`). The result was
 * a form whose appearance no file described: the login page's submit button
 * matched a *card* rule, so it rendered as an 18px-blurred glass panel with a
 * transparent background and a 38px drop shadow, which is why the primary
 * action on the sign-in page was indistinguishable from the two inputs above
 * it.
 *
 * Taking the inline styles out is what retires those selectors: an attribute
 * selector that matches a substring of `style` matches nothing once there is
 * no `style`. What is left needs a home, and this is it.
 *
 * Rules that have to beat a `` in page-unification.css or
 * theme-foundation.css carry `` themselves *and* a higher
 * specificity, so the win does not depend on document order. Those are marked
 * `[beats <sheet>]`. Everything else is plain.
 *
 * Both pages share one control vocabulary: `.am-form__label`,
 * `.am-form__input`, `.am-form__hint`, `.am-form__error`, `.am-form__submit`.
 * The validation state is the browser's own (`:user-invalid`), so the error
 * appears when the reader has finished with the field rather than while they
 * are still typing into it.
 *
 * The nine states
 * ---------------
 * A form system is only "one system" if every state of it is drawn once.
 * These are the nine, in the order the brief audits them, with the selector
 * that owns each:
 *
 *   default          `.am-form__input`
 *   hover            `:hover`
 *   focus            `:focus, :focus-visible` -- both, see the note there
 *   filled           `[placeholder]:not(:placeholder-shown)`
 *   disabled         `:disabled, [aria-disabled="true"]` -- dashed, not dim
 *   loading          `[aria-busy="true"]` on the button or the form
 *   success          `:user-valid` per field, `.am-form__alert--success`
 *   validation error `:user-invalid` per field, `.am-form__error`
 *   server error     `.am-form__alert--server`
 *
 * Two of those nine did not exist before this pass (loading, server error)
 * and two more were unnamed (filled, disabled), which is how a form system
 * ends up with a polished resting state and a scruffy working one.
 *
 * Nothing here shows a validation error before the reader has touched the
 * field. That is enforced in two places, and it has to be both: `:user-
 * invalid` for the client-side constraint, which by definition waits for the
 * reader to leave the field or submit, and an unbound Django form for the
 * server-side one, which has no errors to render on a first GET. A sheet
 * alone cannot promise this -- see markets/tests/test_form_system.py, which
 * loads the pages and checks.
 */

/* ===========================================================================
   Shared form controls
   ======================================================================== */

.am-form {
  /* The boundary of an empty field is the only thing that says a field is
     there, so WCAG 2.2 1.4.11 asks it for 3:1 against what it sits on. The
     shared `--c-line-strong` measures 1.56:1 on `--c-surface` in the dark
     theme and 1.54:1 in the light one -- fine for a hairline between rows of
     text, not enough for a control. Mixed 80/20 with the surface,
     `--c-text-faint` measures 3.85:1 dark and 3.47:1 light, which is a
     visible edge without turning every input into a box drawn in ink.
     The plain declaration above it is the fallback where color-mix is not
     understood. */
  --am-control-line: var(--c-line-strong);
  --am-control-line: color-mix(in srgb, var(--c-text-faint) 80%, var(--c-surface));
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 0;
}

.am-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 34rem) {
  .am-form__row { grid-template-columns: minmax(0, 1fr); }
}

.am-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

/* [beats page-unification.css `.main-content :is(label, .form-label,
   .input-label)` and its light-theme companion
   `[data-theme="light"] .main-content :is(label, …) { color: #363832 }`,
   which paints every label on the site one colour -- and in the light theme
   an olive grey that is in no palette this site defines. The margin answers a
   `form label { margin-bottom: 0.5rem }` further down the same file; the gap
   on `.am-form__field` already spaces these. */
.am-form .am-form__label {
  margin: 0;
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: var(--c-w-semi);
  line-height: 1.4;
}

.am-form__optional {
  color: var(--c-text-muted);
  font-weight: var(--c-w-normal);
}

.am-form__hint {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* [beats page-unification.css `:is(input, select, textarea, …)`, which puts a
   semi-transparent dark card colour behind every field on the site -- readable
   in the dark theme, a grey smear in the light one] */
.am-form .am-form__input {
  inline-size: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--am-control-line);
  border-radius: var(--c-r-control);
  background: var(--c-inset);
  color: var(--c-text);
  font-size: 0.94rem;
  line-height: 1.5;
  box-shadow: none;
  transition: border-color var(--c-dur-move) var(--c-ease), box-shadow var(--c-dur-move) var(--c-ease);
}

.am-form textarea.am-form__input {
  min-height: 9rem;
  resize: vertical;
}

.am-form .am-form__input::placeholder {
  color: var(--c-text-muted);
  opacity: 1;
}

.am-form .am-form__input:hover { border-color: var(--c-evidence); }

/* The shared focus ring covers a, button, input, select and summary but not
   textarea, so a keyboard user tabbing into the message box on /contact/ got
   nothing. Same ring, same offset, one more element.

   Both `:focus` and `:focus-visible` carry it, and that is deliberate twice
   over. `:focus` is the fallback for an engine that does not know the newer
   pseudo-class, and it is also the rule that keeps the ring for a *mouse*
   user: WCAG 2.4.7 asks that the focused control be visible, not that it be
   visible only when the browser guesses the reader arrived by keyboard. A
   text field that a pointer user has clicked into is focused, and on this
   form it says so. The common `:focus:not(:focus-visible) { outline: none }`
   pattern is the thing being avoided here, not the thing being written.

   `--c-evidence` against the field's own `--c-inset` ground: 6.62:1 dark
   (#42b9ff on #0c1922) and 5.79:1 light (#0a5f9e on #f0f4f9). AA for
   non-text contrast is 3:1, so the ring clears it in both themes with room,
   and the 2px offset puts a band of the surface between ring and border so
   the two are never read as one thick edge. */
.am-form .am-form__input:focus,
.am-form .am-form__input:focus-visible {
  outline: 2px solid var(--c-evidence);
  outline-offset: 2px;
  border-color: var(--c-evidence);
}

/* --- Filled -------------------------------------------------------------
   A field with something in it should not look like an empty one, and the
   difference has to survive both themes: the border steps up to the accent's
   quietest mix and the text goes to full strength.

   `[placeholder]` is load-bearing. `:placeholder-shown` can only ever match
   an element that *has* a placeholder, so on a field without one
   `:not(:placeholder-shown)` is true while the field is empty -- which would
   paint every untouched login box as filled. The attribute selector is what
   restricts the rule to fields where the pseudo-class can actually answer
   the question, and it is why the account templates carry a blank
   placeholder on the fields that want no prompt text. */
.am-form .am-form__input[placeholder]:not(:placeholder-shown) {
  border-color: var(--c-line-strong);
  color: var(--c-text);
}

/* --- Disabled -----------------------------------------------------------
   Never colour alone (brief §ACCESSIBILITY). A disabled control here is told
   by three things at once: a dashed edge, which is a shape and survives a
   greyscale print and forced-colors; the pointer; and only then the dimmer
   ink. `[aria-disabled="true"]` is included because a form that must stay
   submittable-but-inert (a button waiting on a round trip) uses that rather
   than the attribute, and the two must look the same. */
.am-form .am-form__input:disabled,
.am-form .am-form__input[aria-disabled="true"],
.am-form button.am-form__submit:disabled,
.am-form button.am-form__submit[aria-disabled="true"],
.am-auth .am-auth__mini:disabled {
  border-style: dashed;
  cursor: not-allowed;
}

.am-form .am-form__input:disabled,
.am-form .am-form__input[aria-disabled="true"] {
  border-color: var(--c-line-strong);
  background: var(--c-surface);
  color: var(--c-text-muted);
  -webkit-text-fill-color: var(--c-text-muted);
}

.am-form .am-form__input:disabled::placeholder {
  color: var(--c-text-faint);
}

/* The disabled primary action stops being the primary action: it drops to an
   outline, so it no longer competes with anything for the eye, and it cannot
   be mistaken for the live accent button at a glance. */
.am-form .am-form__actions button.am-form__submit:disabled,
.am-form .am-form__actions button.am-form__submit[aria-disabled="true"] {
  border-color: var(--c-line-strong);
  background-color: transparent;
  color: var(--c-text-muted);
  -webkit-text-fill-color: var(--c-text-muted);
  filter: none;
}

.am-form button.am-form__submit:disabled:hover,
.am-form button.am-form__submit[aria-disabled="true"]:hover { filter: none; }

/* --- Loading ------------------------------------------------------------
   A submit in flight. `aria-busy` is the carrier -- it is what a screen
   reader is told, and styling from it means there is no second source of
   truth to keep in step with the ARIA.

   The spinner is a state change, not decoration: it exists only while a
   round trip is open and it disappears when the answer arrives, which is
   exactly what the brief's motion rule permits. It spins `linear`, as a
   progress indicator should, and it is removed entirely under reduced
   motion, where the dimmed label and the not-allowed pointer still say the
   form is working. */
.am-form button.am-form__submit[aria-busy="true"],
.am-form[aria-busy="true"] button.am-form__submit {
  cursor: progress;
  filter: none;
}

.am-form button.am-form__submit[aria-busy="true"]::before,
.am-form[aria-busy="true"] button.am-form__submit::before {
  content: "";
  inline-size: 14px;
  block-size: 14px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: am-form-spin 700ms linear infinite;
}

@keyframes am-form-spin {
  to { transform: rotate(360deg); }
}

/* The label beside the spinner is the honest one: the template swaps the
   word, and this is only the geometry. */
.am-form__busy-label { display: none; }

.am-form button.am-form__submit[aria-busy="true"] .am-form__busy-label,
.am-form[aria-busy="true"] button.am-form__submit .am-form__busy-label {
  display: inline;
}

.am-form button.am-form__submit[aria-busy="true"] .am-form__idle-label,
.am-form[aria-busy="true"] button.am-form__submit .am-form__idle-label {
  display: none;
}

.am-form button.am-form__submit[aria-busy="true"] i,
.am-form button.am-form__submit[aria-busy="true"] svg,
.am-form[aria-busy="true"] button.am-form__submit i,
.am-form[aria-busy="true"] button.am-form__submit svg { display: none; }

/* --- Validation ---------------------------------------------------------
   `:user-invalid` waits for the reader to leave the field or submit the form;
   `:invalid` would mark every required field red before it has been typed
   into. The error text is the carrier -- the border tint only repeats it. */

.am-form__error {
  display: none;
  margin: 0;
  color: var(--c-down);
  font-size: 0.78rem;
  font-weight: var(--c-w-semi);
  line-height: 1.5;
}

.am-form .am-form__input:user-invalid {
  border-color: var(--c-down);
}

.am-form .am-form__input:user-invalid ~ .am-form__error { display: block; }

/* The same state, arrived at from the other direction: the server looked at
   a submitted value and rejected it. That is still an interaction -- the
   reader pressed the button -- so showing it on load is not showing an error
   before interaction, and the template only ever emits these on a bound
   form. `aria-invalid` is the carrier again, so the drawn state and the
   announced state have one source. */
.am-form .am-form__input[aria-invalid="true"] { border-color: var(--c-down); }

.am-form__error--server { display: block; }

.am-form .am-form__input:user-valid {
  border-color: color-mix(in srgb, var(--c-up) 55%, var(--c-line-strong));
}

/* --- The primary action -------------------------------------------------
   The accent, flat. Contrast of the label against it is 8.5:1 in the dark
   theme and 5.0:1 in the light one, both measured against the token values,
   because `--c-canvas` is the near-black in one theme and the near-white in
   the other.

   The geometry is here; the colour is thirty lines below, behind a longer
   selector, because a submit button is the single most contested element on
   this site. Six rules in three shared stylesheets paint it, and the last of
   them --

     html[data-theme="light"] body[class^="page-"] .main-content
       :is(button[type="submit"], …) { background-image: linear-gradient(…) }

   -- is five class-level components deep with `` on every
   declaration, which is why the light theme's primary button is a hardcoded
   navy-to-green gradient while the dark theme's is the accent. Same button,
   two different colours, depending on the theme. The `.am-form__actions`
   wrapper exists to give the override a fifth class of its own. */
/* 2026-09-18, the visual system pass.
   ----------------------------------
   The shape and the colour of this button are no longer described here. Every
   form submit on the site now carries `am-btn am-btn--primary am-btn--block`
   as well as `.am-form__submit`, and `.am-btn--primary` (static/css/am-system.css)
   is the one owner of what a primary action looks like: the dark pill that
   inverts against the ground, the same mechanic as the active segment.

   That is only safe because of the paragraph above: `.am-form__submit` is
   already in the `:not()` list of every site-wide submit-button rule
   (brand.css:581, page-unification.css:379/586/604/626,
   theme-foundation.css:654/670/1035/1343), and `.am-btn` is in canvas-bridge's
   own `button[class*="primary"]` exclusion -- so stripping the paint from this
   selector hands the button to the component layer rather than back to the six
   rules that used to fight over it. It was checked by rendering all six form
   pages, not by reading the cascade.

   What stays is the ink assertion. `-webkit-text-fill-color` is set by those
   shared sheets on a plain `button`, and it wins over `color` in WebKit
   regardless of which one is more specific, so the component's `color` needs
   this line to actually reach the glyph. `currentColor` means it follows
   whichever `.am-btn--*` kind the markup asked for. */
.am-form button.am-form__submit,
.am-auth a.am-form__submit {
  background-image: none;
  box-shadow: none;
  -webkit-text-fill-color: currentColor;
}

.am-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.am-form__actions > * { flex: 1 1 12rem; }

/* [beats theme-foundation.css's light-theme primary-button rule, five
   class-level components deep. Five of our own, and one more element, so the
   win does not depend on which file the browser reads last.] */
.am-form .am-form__actions button.am-form__submit,
:is(.am-auth, .am-keys) .am-auth__item-actions button.am-auth__mini {
  background-image: none;
  box-shadow: none;
  -webkit-text-fill-color: currentColor;
}

/* A destructive action is not a fourth button kind. It is the secondary pill
   with the one word that matters inked in the loss colour: a solid red slab
   was the loudest thing on the quietest page on the site, and "Yes, sign out"
   does not need to shout to be understood. */
.am-form .am-form__actions button.am-form__danger,
.am-auth .am-form button.am-form__danger {
  background-color: var(--c-inset);
  background-image: none;
  border-color: color-mix(in srgb, var(--c-down) 35%, var(--c-line));
  color: var(--c-down-ink);
  -webkit-text-fill-color: var(--c-down-ink);
}

.am-form .am-form__actions button.am-form__danger:hover,
.am-auth .am-form button.am-form__danger:hover {
  border-color: var(--c-down);
  background-color: color-mix(in srgb, var(--c-down) 8%, var(--c-inset));
}

:is(.am-auth, .am-keys) .am-auth__item-actions button.am-auth__mini {
  border: 1px solid var(--c-line);
  background-color: var(--c-inset);
  color: var(--c-text-secondary);
  -webkit-text-fill-color: var(--c-text-secondary);
}

:is(.am-auth, .am-keys) .am-auth__item-actions button.am-auth__mini:hover {
  border-color: var(--c-evidence);
  color: var(--c-evidence);
  -webkit-text-fill-color: var(--c-evidence);
}

:is(.am-auth, .am-keys) .am-auth__item-actions button.am-auth__mini--remove:hover {
  border-color: var(--c-down);
  color: var(--c-down);
  -webkit-text-fill-color: var(--c-down);
}

/* A secondary action never competes with the primary one for the eye. Its
   shape and colour are `.am-btn--secondary` now, for the same reason as the
   submit above; what is left is the ink assertion the shared sheets make
   necessary. */
:is(.am-auth, .am-contact, .am-keys) .am-form__ghost {
  background-image: none;
  box-shadow: none;
  -webkit-text-fill-color: currentColor;
}

/* --- Messages -----------------------------------------------------------
   Server-side errors and confirmations. One shape for all of them, told by a
   word and a border weight, not by colour alone.

   Three variants, and the distinction between the last two is the point the
   brief makes: a *validation* failure is the reader's turn -- something in
   the form needs changing and the fields say which -- while a *server*
   failure is not. "That password is wrong" and "we could not reach the
   service" ask for different next actions, and a page that paints them the
   same red box teaches the reader that the box means nothing.

     --success   the thing happened
     --error     the form needs changing; the fields carry the detail
     --server    the request was refused or could not be completed, and no
                 field on this form is at fault

   The word in `.am-form__alert-title` is what carries the state; the
   canonical `.c-status` in canvas-2026.css supplies the glyph and the colour
   for that word, so this file does not invent a second alert pill. (It also
   may not: markets.tests.test_canvas_design forbids a second stylesheet from
   writing rules for a `.c-*` class, which is exactly the discipline that
   stops a fourth status vocabulary appearing.) */

.am-form__alert {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--c-line-strong);
  border-inline-start: 3px solid var(--c-text-muted);
  border-radius: var(--c-r-control);
  background: var(--c-inset);
  color: var(--c-text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
}

.am-form__alert p { margin: 0.2rem 0; }
.am-form__alert p:first-child { margin-block-start: 0; }
.am-form__alert p:last-child { margin-block-end: 0; }

.am-form__alert--error {
  border-inline-start-color: var(--c-down);
  color: var(--c-text);
}

.am-form__alert--success {
  border-inline-start-color: var(--c-up);
  color: var(--c-text);
}

/* A server failure is not the reader's mistake, so it is not drawn in the
   same red as a field that needs correcting. Amber is this palette's
   "attention: a wait, a partial state, a caveat", which is what a refused or
   unreachable request is, and the word above it says which. */
.am-form__alert--server {
  border-inline-start-color: var(--c-attention);
  color: var(--c-text);
}

.am-form__alert-title {
  display: block;
  margin-block-end: 0.25rem;
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: var(--c-w-bold);
}

/* When the title is a canonical status element it brings its own glyph,
   colour and uppercase treatment; all this file owes it is the line break
   that the block layout needs. Matched by attribute rather than by class on
   purpose: this sheet must not write a rule whose selector *is* a canvas
   class (test_canvas_design pins that ownership), and it needs two classes
   of its own to beat the canonical `inline-flex` from the shell bundle. */
.am-auth .am-form__alert-title[class~="c-status"],
.am-contact .am-form__alert-title[class~="c-status"] {
  display: flex;
  margin-block-end: 0.35rem;
}

/* ===========================================================================
   The account pages: one card, centred, opaque
   ======================================================================== */

/* [beats theme-foundation.css `.page-account_login .main-content > .container
   > div`, which stretches this wrapper to the 1440px page width] */
.container > .am-auth {
  inline-size: 100%;
  max-inline-size: min(30rem, var(--layout-form-max));
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

/* The card is `.am-panel` now: white surface, hairline, `--c-r-feature`, the
   restrained card shadow. It had its own copy of four of those five
   declarations and had already drifted on the fifth (24px radius against the
   system's 28px, and no shadow at all), so a signed-out reader met a surface
   that belonged to no other page. This selector keeps only the padding, which
   an auth card wants a little more of than a dashboard panel. */
.am-auth__card {
  padding: clamp(1.5rem, 4vw, 2rem);
}

/* Start-aligned, not centred. The 2026 language is editorial -- a quiet
   kicker or mark, then a tight title, then a secondary lede, all hanging off
   the reading edge -- and a centred stack inside it reads as a different
   product's sign-in box. */
.am-auth__head {
  margin-block-end: 1.5rem;
  text-align: start;
}

.am-auth__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  margin-block-end: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--c-line) 70%, transparent);
  border-radius: var(--c-r-chip);
  background: var(--c-inset);
  color: var(--c-text-muted);
}

.am-auth__mark svg { inline-size: 20px; block-size: 20px; }
.am-auth__mark--positive { color: var(--c-up-ink); }

.am-auth__title {
  margin: 0 0 0.4rem;
  color: var(--c-text);
  font-size: 1.5rem;
  font-weight: var(--c-w-bold);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

[dir="rtl"] .am-auth__title { letter-spacing: 0; }

.am-auth__lede {
  margin: 0;
  color: var(--c-text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.am-auth__aside {
  margin: 0.6rem 0 0;
  color: var(--c-text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.am-auth__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-block: -0.15rem 0.35rem;
}

.am-auth__check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  color: var(--c-text-secondary);
  font-size: 0.84rem;
  cursor: pointer;
  user-select: none;
}

/* The remember-me box, drawn rather than borrowed.

   [beats page-unification.css `:is(input, …)`, whose 44px min-height and card
   fill turn a checkbox into a grey slab, and canvas-bridge.css's
   `input[type="checkbox"] { width: 24px }`]

   Left native it renders in the UA's *light* form palette regardless of the
   site theme -- the site switches on a `data-theme` attribute, which
   `color-scheme` never hears about -- so a dark page carried a pale grey
   square with no visible tick. Drawing it takes the theme with it, and the
   input stays a real checkbox: same element, same name, same keyboard. */
:is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  inline-size: 18px;
  block-size: 18px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--am-control-line, var(--c-line-strong));
  /* The one literal radius left in this file, and it is the scale's own
     carve-out for a hairline detail. The box is 18px square: the chip step
     (8px) is 44% of its width, which reads as a squircle rather than as a
     checkbox, and "every element has a large rounded radius" is exactly the
     template look the corners brief is written against. */
  border-radius: 4px;
  background: var(--c-inset);
  box-shadow: none;
  cursor: pointer;
}

:is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"]::before {
  content: "";
  inline-size: 10px;
  block-size: 10px;
  background: var(--c-evidence);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform var(--c-dur-state) var(--c-ease);
}

:is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"]:checked {
  border-color: var(--c-evidence);
}

:is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"]:checked::before {
  transform: scale(1);
}

:is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--c-evidence);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  :is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"]::before { transition: none; }
}

@media (forced-colors: active) {
  :is(.am-auth, .am-keys) .am-auth__check input[type="checkbox"] {
    appearance: auto;
    border: 0;
  }
}

.am-auth__link {
  color: var(--c-evidence);
  font-size: 0.84rem;
  font-weight: var(--c-w-semi);
  text-decoration: none;
}

.am-auth__link:hover { text-decoration: underline; }

.am-auth__foot {
  margin: 1.35rem 0 0;
  padding-block-start: 1.1rem;
  border-block-start: 1px solid var(--c-line);
  color: var(--c-text-secondary);
  font-size: 0.86rem;
  text-align: center;
}

.am-auth__foot a {
  color: var(--c-evidence);
  font-weight: var(--c-w-semi);
  text-decoration: none;
}

.am-auth__foot a:hover { text-decoration: underline; }

.am-auth__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* --- The email-address page --------------------------------------------- */

.container > .am-auth--wide { max-inline-size: var(--layout-form-max); }

.am-auth__card + .am-auth__card { margin-block-start: 1.25rem; }

.am-auth__list { list-style: none; margin: 0 0 1.25rem; padding: 0; }

.am-auth__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--c-line);
  border-radius: var(--c-r-control);
  background: var(--c-inset);
}

.am-auth__item + .am-auth__item { margin-block-start: 0.5rem; }

.am-auth__address {
  color: var(--c-text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.am-auth__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-block-start: 0.35rem;
}

/* Quiet by default, tinted only where the word is a verdict.  Three outlined
   colours side by side on one row was the badge overload the brief names: the
   address is the content, and "Primary" is not a reading about the market. */
.am-auth__tag {
  padding: 0.14rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--c-r-pill);
  background: color-mix(in srgb, var(--c-line) 55%, transparent);
  color: var(--c-text-secondary);
  font-size: var(--c-t-label);
  font-weight: var(--c-w-medium);
}

.am-auth__tag--primary {
  color: var(--c-text);
  font-weight: var(--c-w-semi);
}

.am-auth__tag--verified {
  background: color-mix(in srgb, var(--c-up) 13%, transparent);
  color: var(--c-up-ink);
}

.am-auth__tag--unverified {
  background: color-mix(in srgb, var(--c-attention) 15%, transparent);
  color: var(--c-attention);
}

.am-auth__item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.am-auth__item-actions form { display: inline; margin: 0; }

/* The row's own small action: the quiet inset pill, at the chip's height.
   It grows to the 44px floor on a phone, where it is the only thing on the
   row a finger has to find. */
:is(.am-auth, .am-keys) .am-auth__mini {
  min-height: 34px;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--c-line);
  border-radius: var(--c-r-pill);
  background: var(--c-inset);
  background-image: none;
  color: var(--c-text-secondary);
  -webkit-text-fill-color: var(--c-text-secondary);
  font-size: var(--c-t-meta);
  font-weight: var(--c-w-semi);
  cursor: pointer;
  box-shadow: none;
}

@media (max-width: 767px) {
  :is(.am-auth, .am-keys) .am-auth__mini { min-height: 44px; padding-inline: 1rem; }
}

:is(.am-auth, .am-keys) .am-auth__mini:hover {
  border-color: var(--c-evidence);
  color: var(--c-evidence);
  -webkit-text-fill-color: var(--c-evidence);
}

:is(.am-auth, .am-keys) .am-auth__mini--remove:hover {
  border-color: var(--c-down);
  color: var(--c-down);
  -webkit-text-fill-color: var(--c-down);
}

/* The one form on the site that is a row: a field and its button.
   `.am-form` is a column, and without resetting the direction the field's
   `flex: 1 1 14rem` grew *down* -- 200px of empty card under a single input. */
.am-auth__inline-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

.am-auth__inline-form .am-form__field { flex: 1 1 14rem; }

:is(.am-auth, .am-keys) .am-auth__inline-form .am-form__actions {
  flex: 0 0 auto;
  align-self: flex-end;
}

:is(.am-auth, .am-keys) .am-auth__inline-form button.am-form__submit {
  inline-size: auto;
  white-space: nowrap;
}

/* --- A group of related controls ---------------------------------------
   A `fieldset` with a `legend`, which is the semantic the scope list on the
   API-keys page needed and was faking with a bordered div. Browsers give a
   fieldset a default border, padding and margin that no other control here
   has, so all three are restated. */

.am-form__group {
  flex: 1 1 100%;
  min-inline-size: 0;
  margin: 0.3rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--c-line);
  border-radius: var(--c-r-control);
}

.am-form__group-title {
  padding-inline: 0.4rem;
  color: var(--c-text-secondary);
  font-size: 0.8rem;
  font-weight: var(--c-w-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.am-form__option {
  align-items: flex-start;
  padding-block: 0.35rem;
  font-size: 0.88rem;
}

.am-form__option-hint {
  display: block;
  color: var(--c-text-muted);
  font-family: var(--c-mono);
  font-size: 0.78rem;
}

/* ===========================================================================
   /account/api-keys/
   ======================================================================== */

/* The page is a table with one form under it, and the form is the only part
   this sheet owns. It gets its own scope class rather than borrowing
   `.am-auth`, because `.am-auth` is a 30rem centred card -- base.html already
   wraps page content in a `.container`, so this template's own `.container`
   *is* a direct child of one, and `.container > .am-auth` would have matched
   and squeezed an eight-column table into a sign-in card. */

.am-keys .am-auth__inline-form { align-items: flex-end; }

/* The copy control beside the one-time key reveal: a secondary action, so it
   uses the shared ghost and only asks for the height that lets it sit level
   with the `code` block it copies. */
.am-keys .am-keys__copy {
  inline-size: auto;
  flex: 0 0 auto;
}

/* ===========================================================================
   /contact/
   ======================================================================== */

.am-contact {
  inline-size: 100%;
  max-inline-size: var(--sh-max);
  margin-inline: auto;
  padding-block: var(--sh-page-start) var(--c-space-7);
}

/* Same reason as access.css: the shared page-head class belongs to
   canvas-2026.css, so the spacing hangs off this page's own modifier. */
.am-contact__head { margin-block-end: clamp(1.5rem, 3vw, 2.25rem); }

.am-contact__layout {
  max-inline-size: 62rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 3.5vw, 3rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .am-contact__layout { grid-template-columns: minmax(0, 1fr) 20rem; }
}

/* The form is the page. It sits in one opaque panel at a width a form can be
   read at, not stretched across a 1440px viewport. */
/* `.am-panel` on the same element owns the surface, the hairline, the radius
   and the shadow; the heading is an `.am-section-head`, so neither is
   described here any more. What is left is the measure -- a form reads at a
   narrower width than a dashboard panel -- and the sentence under the
   heading. */
.am-contact__panel {
  max-inline-size: var(--layout-form-max);
}

.am-contact__panel > p {
  margin: 0 0 var(--c-space-5);
  max-width: 56ch;
  color: var(--c-text-secondary);
  font-size: var(--c-t-body);
  line-height: 1.6;
}

.am-contact__aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.am-contact__block {
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--c-line-strong);
}

.am-contact__block:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

.am-contact__block h2 {
  margin: 0 0 0.75rem;
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: var(--c-w-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.am-contact__channels { list-style: none; margin: 0; padding: 0; }

.am-contact__channel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding-block: 0.6rem;
  border-block-end: 1px solid var(--c-line);
}

.am-contact__channel:last-child { border-block-end: 0; }

.am-contact__channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2rem;
  block-size: 2rem;
  border: 1px solid color-mix(in srgb, var(--c-line) 70%, transparent);
  border-radius: var(--c-r-chip);
  background: var(--c-inset);
  color: var(--c-text-muted);
}

.am-contact__channel-icon svg { inline-size: 16px; block-size: 16px; }

/* 0.74rem was 11.84px: under the 12px label floor the capture audit measures.
   `--c-t-label` is that floor, spelled once. */
.am-contact__channel-label {
  display: block;
  color: var(--c-text-muted);
  font-size: var(--c-t-label);
  font-weight: var(--c-w-semi);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Arabic has no capitals, and tracked capitals are what these three
   treatments are; without the reset they render as spaced-out Arabic
   letterforms. */
[dir="rtl"] :is(.am-contact__block h2, .am-contact__channel-label, .am-form__group-title) {
  letter-spacing: 0;
  text-transform: none;
}

.am-contact__channel a {
  color: var(--c-evidence);
  font-size: 0.86rem;
  font-weight: var(--c-w-semi);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.am-contact__channel a:hover { text-decoration: underline; }

.am-contact__facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.84rem;
}

.am-contact__facts dt {
  color: var(--c-text-muted);
  font-weight: var(--c-w-semi);
  white-space: nowrap;
}

.am-contact__facts dd {
  margin: 0;
  color: var(--c-text-secondary);
  overflow-wrap: anywhere;
}

.am-contact__facts dd a { color: var(--c-evidence); text-decoration: none; }
.am-contact__facts dd a:hover { text-decoration: underline; }

.am-contact__notice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--c-line);
  border-radius: var(--c-r-control);
  color: var(--c-text-muted);
  font-size: 0.79rem;
  line-height: 1.65;
}

.am-contact__notice svg {
  flex-shrink: 0;
  inline-size: 15px;
  block-size: 15px;
  margin-block-start: 2px;
  color: var(--c-attention);
}

@media (prefers-reduced-motion: reduce) {
  .am-form .am-form__input,
  .am-form button.am-form__submit,
  .am-auth a.am-form__submit { transition: none; }
  /* The spinner goes; the state does not. A reader who has asked for
     stillness still gets the "Sending…" label, the progress cursor and the
     inert button -- the information survives, only the movement stops. */
  .am-form button.am-form__submit[aria-busy="true"]::before,
  .am-form[aria-busy="true"] button.am-form__submit::before {
    animation: none;
    border-inline-end-color: currentColor;
    opacity: 0.55;
  }
}

@media (forced-colors: active) {
  .am-form button.am-form__submit,
  .am-auth a.am-form__submit { border: 1px solid ButtonBorder; }
  .am-form__alert { border-inline-start-width: 3px; }
  /* Forced colors throws every colour away, which is precisely why disabled
     is drawn as a dash and not as a tint: the shape is what is left. The
     system's own GrayText says the rest. */
  .am-form .am-form__input:disabled,
  .am-form button.am-form__submit:disabled,
  .am-form button.am-form__submit[aria-disabled="true"] {
    border-style: dashed;
    color: GrayText;
    -webkit-text-fill-color: GrayText;
  }
}

/* Printing an account or contact page: the controls are furniture, and a
   printed page has no focus, no hover and no spinner. What has to survive is
   anything the reader typed and any message the server sent back. */
@media print {
  /* No colour is restated here on purpose: every value in this sheet is a
     `--c-*` token and the theme the reader prints from is the theme those
     tokens resolve in. Overriding them with ink literals would be the one
     place in the file where a colour is not a token, to fix a problem that
     belongs to the site's print theme rather than to this form. */
  .am-form__alert,
  .am-form__field { break-inside: avoid; }
  .am-form button.am-form__submit[aria-busy="true"]::before { display: none; }
}


/* ===========================================================================
   /accounts/api-keys/
   ========================================================================

   The page used to draw itself: thirty-one inline `style` attributes building
   a table, four badge shapes and two section cards out of `--bg-secondary`,
   `--border-color`, `--card-bg` and `--text-primary` -- four names
   canvas-2026.css does not define, so most of that paint resolved to a
   fallback or to nothing. The markup is `.am-page-head`, `.am-panel`,
   `.am-table`, `.am-chip`, `.am-state` and `.am-btn` now, and what is left
   here is the handful of facts that are this page's own: the column width, the
   monospace a key is read in, and the muted ink of an absent value. */

.am-keys {
  inline-size: 100%;
  max-inline-size: var(--sh-max);
  margin-inline: auto;
  padding-block: var(--sh-page-start) var(--c-space-7);
}

.am-keys__section { margin-block-end: var(--c-space-6); }
.am-keys__section:last-child { margin-block-end: 0; }

.am-keys__note {
  margin: 0 0 var(--c-space-5);
  max-inline-size: 64ch;
  color: var(--c-text-secondary);
  font-size: var(--c-t-body);
  line-height: 1.6;
}

/* The one-time reveal. `break-all` rather than `anywhere`: a key has no word
   boundaries, and a reader who is about to paste it into a config file needs
   to see all of it rather than a truncated middle. */
.am-keys__reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--c-space-3);
  margin-block-start: var(--c-space-3);
}

.am-keys__secret {
  flex: 1 1 320px;
  min-inline-size: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--c-r-control);
  background: var(--c-inset);
  color: var(--c-text);
  font-family: var(--c-mono);
  font-size: var(--c-t-meta);
  word-break: break-all;
}

.am-keys__secret-cell {
  color: var(--c-text-muted);
  font-family: var(--c-mono);
  font-size: var(--c-t-meta);
}

.am-keys__scope { font-family: var(--c-mono); }

/* A value that is not there is muted, not italic: an italic "never" in an
   Arabic table is a synthetically slanted Arabic word. */
.am-keys__none { color: var(--c-text-muted); }

/* A revoked key stays readable -- it is the history of the account -- but it
   is not competing with the live ones. */
.am-keys__row--revoked { opacity: 0.55; }

.am-keys__row-actions { justify-content: flex-end; }

/* The table is a focusable scroll container (test_accessibility asks every
   one of them to be reachable and named), so it needs a focus ring of its
   own: a keyboard reader who tabs into it otherwise gets no feedback at all. */
.am-keys [tabindex="0"]:focus-visible {
  outline: 2px solid var(--c-evidence);
  outline-offset: 2px;
  border-radius: var(--c-r-control);
}

@media (max-width: 47.9375rem) {
  .am-keys { padding-inline: 0; }
  .am-keys__row-actions { justify-content: flex-start; }
}

/* --- Answering the blanket rules that reach inside the submit button -----
   The two spans inside `.am-form__submit` sit on `--c-text`, the inverted
   fill `.am-btn--primary` draws.  Two site-wide rules repaint them anyway,
   and neither can see what they are sitting on:

     canvas-bridge.css   :root[data-theme="light"] [class*="__label"]
                         :not(.am-form__label) -> --c-text-muted.  The
                         exclusion list names the *field* label, which is the
                         one on the canvas; these two are not.  Measured 3.2:1
                         -- the word "Sign In" was the lowest-contrast text on
                         the sign-in page.
     page-unification    html[data-theme="dark"] body.page-account_signup
                         :is(.helptext, .form-text, small, p, span) ->
                         #9bb4d0 !important.  Right for the help text it was
                         written for, and it also catches every span on the
                         page, so "Create Account" measured 4.1:1 on the light
                         pill the dark theme gives a primary button.

   Inheriting is the answer rather than a colour of its own: the button
   already sets the ink that goes with its own fill, and it is the only thing
   that knows what that fill is.  (0,5,3) with !important, because the second
   rule is important and the first also wins on order -- canvas-bridge.css is
   the last stylesheet in the document.  The same shape as the
   `.sym-mode.is-active` exception canvas-bridge already carries, for the same
   reason. */
body[class^="page-"] .am-form button.am-form__submit :is(.am-form__idle-label, .am-form__busy-label),
html[data-theme="dark"] body[class^="page-"] .am-form button.am-form__submit :is(.am-form__idle-label, .am-form__busy-label),
html[data-theme="light"] body[class^="page-"] .am-form button.am-form__submit :is(.am-form__idle-label, .am-form__busy-label) {
  color: inherit !important;
  -webkit-text-fill-color: currentColor;
}

/* --- The primary submit is the site's evidence-blue action ----------------
   `.am-btn--primary` is the inverted pill (--c-text fill), which in the dark
   theme is a near-white slab -- on /accounts/login/ the one white button on a
   site whose other primary actions (cookie "Accept all", the newsletter
   subscribe) are --c-evidence. The auth forms take the same fill and the
   same canvas ink as cookie-consent.css; secondary and danger buttons are
   untouched. */
html body[class^="page-"] .am-form button.am-form__submit.am-btn--primary {
  background-color: var(--c-evidence);
  border-color: var(--c-evidence);
  color: var(--c-canvas);
}
html body[class^="page-"] .am-form button.am-form__submit.am-btn--primary:hover {
  background-color: var(--c-evidence);
  filter: brightness(1.08);
}

/* page-unification.css paints every span on the signup page muted, with
   !important (`body.page-account_signup :is(..., span)`), and that reached the
   header's language switcher: muted ink on the accent pill. The label follows
   the ink its own pill sets. (!important because it must answer an important
   rule; the shell sheet itself may carry none.) */
body[class^="page-"] .lang-seg .lang-option .lang-name {
  color: inherit !important;
}
