/*
 * The account pages' new look: the page around the controls (tallyfy/work-queue#5229).
 *
 * Every control on the form side is a real tf- element from the app's bundle, styled by the app's
 * own tokens in the bundle's account-elements.css. This file holds what an account page owns: the
 * split beside the scene, the quiet single column, the heading, the plain links and the words on
 * the scene. It reaches inside an element in three places only: it hides the required mark the input
 * elements draw (see "no required mark" below), it gives an outlined button the quiet edge (see "A
 * secondary button"), and it sets a button's focus on the button inside, so the primary keeps its edge
 * and focus is one ink ring in place of the app's bands (see "the app's filled green button on paper"
 * and "a focused button" below). Light only.
 *
 * Every color, radius, rule and type value comes from tokens.css; this file holds layout and
 * spacing only. The font faces are declared in the page head (account-new/look/page.blade.php),
 * because the heading font's address is one configuration value.
 */

:root {
  color-scheme: light;
}

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

/* the paper, with the website's fine, still grain, on the whole canvas however short the page */
html {
  background-color: var(--look-page);
  background-image: var(--look-grain);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--look-ink);
  font-family: var(--look-body);
  font-size: var(--look-body-size);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

/* the three-colour stripe along the top of every page, as on the website and the docs. It stays at the
   top while the page scrolls, as the website's does on its sticky header, under the skip link. */
body::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: var(--look-stripe-height);
  background: var(--look-stripe);
  pointer-events: none;
}

h1,
h2,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.nb {
  white-space: nowrap;
}

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

.skip {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--look-radius);
  background: var(--look-ink);
  color: var(--look-page);
  font-size: var(--look-text-size);
  font-weight: var(--look-w-label);
  text-decoration: none;
}

/* emphasis inside text: 600 in the ink, never another colour (owner decision 54) */
strong,
b {
  color: var(--look-ink);
  font-weight: var(--look-w-strong);
}

/* Short text of three lines at most (an intro, a note, a hint, a notice, a permission) takes `pretty`, so no word
   stands alone on its last line. Running text keeps the plain wrap, so every line runs to the measure. No paragraph
   takes `balance` (owner decisions 55 and 88). The headline's line under it and the facts box set their own. */
.intro,
.note,
.legal,
.hint,
.lead,
.notice p,
.scopes li {
  text-wrap: pretty;
}

.skip:focus-visible {
  top: 12px;
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

/* ---- the split: the form first in the markup, the scene beside it or above it ---- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.pane-form {
  display: flex;
  flex-direction: column;
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  padding: 0 48px;
}

.pane-scene {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--look-band);
}

/* the picture runs the full height of its panel, with no words on it */
.pane-scene .scene {
  flex: 1 1 auto;
  min-height: 0;
}

/* ---- the quiet page: one column, no scene ---- */
.quiet {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 48px;
}

/* side margins, as on the website: 48px from 1024 wide, 32px from 640, 20px below (owner decision 55) */
@media (max-width: 1023px) {
  .pane-form,
  .quiet {
    padding: 0 32px;
  }
}

@media (max-width: 639px) {
  .pane-form,
  .quiet {
    padding: 0 20px;
  }
}

.quiet .sheet {
  margin: 0 auto;
  padding: 48px 0 96px;
}

/* ---- the logo, the same on every page: on the column's left edge, above the heading ---- */
.brand {
  margin: 0 0 32px;
  line-height: 0;
}

.logo {
  display: block;
  width: auto;
  height: var(--look-logo-height);
}

.logo__orange {
  fill: var(--look-logo-orange);
}

.logo__blue {
  fill: var(--look-logo-blue);
}

.logo__green {
  fill: var(--look-logo-green);
}

.logo__word {
  fill: var(--look-wordmark);
}

/* The column holds people's own strings (an email address, an organization's or an app's name, often one
   long word), so any of its lines may break inside a word rather than push the page sideways on a phone.
   overflow-wrap is inherited, so the headings, intros, notes and alerts in the column all take it, as
   .facts already did. It only breaks a word that would not fit its line. */
.sheet {
  width: min(400px, 100%);
  margin: auto;
  padding: 32px 0 40px;
  overflow-wrap: anywhere;
}

.sheet--wide {
  width: min(560px, 100%);
}

/* the heading of a split page: a small label (the page's plain name), the one headline, its quiet line */
.masthead {
  margin: 0 0 28px;
}

.label {
  margin: 0 0 12px;
  color: var(--look-label);
  font-size: var(--look-label-size);
  font-weight: var(--look-label-weight);
  line-height: var(--look-label-line);
  letter-spacing: var(--look-label-tracking);
  text-transform: uppercase;
}

.headline,
.title {
  font-family: var(--look-heading);
  font-weight: var(--look-heading-weight);
  letter-spacing: var(--look-heading-tracking);
  color: var(--look-ink);
  text-wrap: pretty;
}

.headline {
  font-size: var(--look-headline-size);
  line-height: var(--look-headline-line);
}

.line {
  margin: 12px 0 0;
  color: var(--look-ink-soft);
  font-size: var(--look-line-size);
  line-height: var(--look-line-line);
  text-wrap: pretty;
}

/* the heading of a quiet page */
.title {
  margin: 0 0 24px;
  font-size: var(--look-title-size);
  line-height: var(--look-title-line);
}

.intro {
  margin: 0 0 20px;
  color: var(--look-ink-soft);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

.title + .intro,
.masthead + .intro {
  margin-top: -12px;
}

.prose {
  color: var(--look-ink-text);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: 12px;
}

.prose ul {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
}

.prose li + li {
  margin-top: 8px;
}

/* links: ink, with an ink underline set a little below the text; hover changes only the underline */
.prose a,
.note a,
.legal a,
.inline-link,
.link {
  color: var(--look-link);
  font-weight: var(--look-link-weight);
  text-decoration: underline;
  text-decoration-color: var(--look-link-line);
  text-decoration-thickness: var(--look-underline-width);
  text-underline-offset: var(--look-underline-offset);
}

.prose a:hover,
.note a:hover,
.legal a:hover,
.inline-link:hover,
.link:hover {
  text-decoration-color: var(--look-link-line-hover);
  text-decoration-thickness: var(--look-underline-width-hover);
}

.prose a:focus-visible,
.note a:focus-visible,
.legal a:focus-visible,
.inline-link:focus-visible {
  border-radius: var(--look-radius-inline);
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: 2px;
}

.spaced {
  margin-top: 24px;
}

/* A lead line names what follows it. Its weight follows what the markup makes it (the lead's ruling of
   2026-11-16): a label of a list ("What Claude can do", "Your organizations", each the list's
   aria-labelledby) is 500, as labels are; a heading of a part of the page ("Didn't get it?", an h2) is 600,
   with a heading's line height. */
.lead {
  margin: 0 0 16px;
  font-size: var(--look-text-size);
  font-weight: var(--look-label-weight);
  line-height: var(--look-text-line);
}

h2.lead {
  font-weight: var(--look-heading-weight);
  line-height: var(--look-lead-heading-line);
}

/* A lead line inside a form ("Didn't get it?") belongs to the control under it: 24px above it, 8px
   below, where the form's 16px gap and the line's own margin made it 16 above and 32 below. */
.form > .lead {
  margin: 8px 0 -8px;
}

/* ---- the form side ---- */
.form {
  display: grid;
  gap: 16px;
  margin: 0;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* The email preferences page's list of email types (#12152): a fieldset with no frame and its legend a lead
   line. The .choices rule further down sets the grid, the 12px between boxes, the margin and the padding. */
fieldset.choices {
  min-width: 0;
  border: 0;
}

fieldset.choices > legend {
  margin: 0 0 12px;
  padding: 0;
}

.stack {
  display: grid;
  gap: 16px;
}

.stack + .form,
.stack + .stack,
.form + .stack {
  margin-top: 16px;
}

.providers {
  display: grid;
  gap: 12px;
}

/*
 * Google and Microsoft are links, as on today's pages. tf-button renders a <button> and has no
 * href, so the anchor is the control and the tf-button inside it is its face: out of the tab
 * order, hidden from assistive technology, and never the click target.
 */
.link-button {
  display: block;
  border-radius: var(--look-radius);
  color: inherit;
  text-decoration: none;
}

/* Focus on a control that is not a field is one 2px ring in the ink, 2px outside it, with no second band (CALM
   A9); the button's own edge stays as it is. */
.link-button:focus-visible {
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: var(--look-ring-offset);
}

.link-button tf-button {
  pointer-events: none;
}

/* A secondary button ("Continue with Google", "Cancel", "Stay on this page") takes the quiet edge, so the
   primary button is the one loud thing on the page (owner decision 55). With the elements bundle the edge is
   the component's own border, set one selector more exactly than the component sets it. */
tf-button[variant='outlined'] > .tf-button.tf-button--outlined {
  border-color: var(--look-edge);
}

.link-button.is-busy {
  pointer-events: none;
  opacity: 0.5;
}

.mark {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -4px;
  object-fit: contain;
}

/* "or": two tf-divider lines with the word between them */
.or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0 14px;
  color: var(--look-ink-soft);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

.aside {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0;
}

/* a link on its own line: the same ink link, with a 40px tall target round it */
.link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: var(--look-radius-inline);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
  letter-spacing: var(--look-link-tracking);
}

.link:focus-visible {
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: 2px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  align-items: center;
  margin: 12px 0 0;
  padding: 0;
  color: var(--look-ink-soft);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
  list-style: none;
}

.links li {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 40px;
}

.legal {
  margin-top: 12px;
  color: var(--look-ink-soft);
  font-size: var(--look-small-size);
  line-height: var(--look-small-line);
}

.legal a {
  color: inherit;
  white-space: nowrap;
}

.note {
  margin: 14px 0 0;
  color: var(--look-ink-soft);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

/* The note account.js puts under a creating form's button when it is still waiting after thirty seconds.
   It sits in the form's own gap, right under the button it is about, in the main ink, with room below it so
   it does not run into the legal line. Until then its status region is empty and out of the flow, wherever
   it sits, so it adds no gap; it is never display: none, which would take it away from a screen reader. */
.form > [data-look-busy-note] {
  margin: 0 0 8px;
  color: var(--look-ink);
}

[data-look-busy-note]:empty {
  position: absolute;
  margin: 0;
}

/* a note above its buttons, at the form's own gap */
.note + .stack {
  margin-top: 16px;
}

/* The AI connector's "Connected" page: today's script writes two sentences about the same countdown,
   the ticking one ("in 18 seconds") and a status line written once ("in 20 seconds", for a screen
   reader). While the ticking one shows, the status line is kept for a screen reader only, so the page
   shows one countdown and a screen reader still hears one announcement, not one a second. Once "Stay
   on this page" hides the countdown, the status line ("Automatic redirect stopped") shows again. */
.countdown:not([hidden]) ~ .countdown-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* No required mark (tallyfy/work-queue#5229): every field on these forms is required, so the mark tells
   nobody anything. The fields keep required and aria-required. The input elements draw the mark as
   their own span once they upgrade; before that, the bundle's stylesheet draws it after the label. */
:is(tf-input, tf-password-input) .tf-input__required {
  display: none;
}

:is(tf-input, tf-password-input):not(:defined):has(> input:required) > label::after {
  content: none;
}

.notice {
  display: block;
  margin: 0 0 16px;
}

.providers + .notice {
  margin: 16px 0 0;
}

/* sign up: the email form waits behind "Continue with email", as the page does today. The head's script
   marks the page data-look-fold before anything is drawn and opens the form on a press (auth/register). With
   scripts off, or if that script does not run, nothing sets the mark, so the form is simply there and the
   button is not. When the server sent the form back with errors, it comes open (signup-open). */
html[data-look-fold] .signup-closed #js-sign-up-form {
  display: none;
}

html:not([data-look-fold]) #js-via-email,
.signup-open #js-via-email {
  display: none;
}

/* a box of facts: who is signed in, where access goes. It only groups, so it takes the hairline, and its
   words keep 24px from its edge (16px on a phone), as the calm ruling asks (owner decision 55). */
.facts {
  margin: 0 0 16px;
  padding: 24px;
  border: var(--look-rule-width) solid var(--look-panel-edge);
  border-radius: var(--look-radius-box);
  background: var(--look-surface);
  color: var(--look-ink-text);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.facts__code,
.reference {
  font-family: var(--look-mono);
  font-size: var(--look-mono-size);
  line-height: var(--look-text-line);
}

.reference {
  margin: 8px 0 0;
  padding: 24px;
  border: var(--look-rule-width) solid var(--look-panel-edge);
  border-radius: var(--look-radius-box);
  background: var(--look-surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 639px) {
  .facts,
  .reference {
    padding: 16px;
  }
}

/* the organization chooser on company sign-in and the email preferences page's list */
.choices {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-select {
  display: grid;
  gap: 6px;
}

.field-select label {
  font-size: var(--look-text-size);
  font-weight: var(--look-w-label);
  line-height: var(--look-text-line);
}

.field-select select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: var(--look-rule-width) solid var(--look-control-edge);
  border-radius: var(--look-radius);
  background: var(--look-surface);
  color: var(--look-ink);
  font: inherit;
  font-size: var(--look-text-size);
}

/* A focused field shows one edge: its own border, in the ink and 2px, with no gap, no second colour and no
   shadow beside it (owner decisions 55 and 89). The side padding gives back the extra pixel, so the words stay
   put. The transparent outline is what a forced-colours mode draws instead. */
.field-select select:focus-visible {
  padding: 0 11px;
  border: var(--look-ring-width) solid var(--look-ring);
  outline: var(--look-ring-width) solid transparent;
}

.field-select small,
.hint {
  color: var(--look-ink-soft);
  font-size: var(--look-small-size);
  line-height: var(--look-small-line);
}

/* the permissions are parted by space, not by a line under each (owner decision 55) */
.scopes {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scopes .scope {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
  cursor: pointer;
}

/* the scope boxes stay native (see the consent view); drawn in the app's accent at the app's size */
.scopes input[type='checkbox'] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--look-check);
  cursor: pointer;
}

.scopes input[type='checkbox']:focus-visible {
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: 2px;
}

.scopes .scope-code {
  color: var(--look-ink-soft);
  font-family: var(--look-mono);
  font-size: var(--look-small-size);
}

.scope-msg {
  margin-top: 12px;
  color: var(--look-error-text);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

.scope-msg:focus {
  outline: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.actions > form {
  flex: 1 1 160px;
  margin: 0;
}

/* A scene still above a quiet page's heading ("Connected", "Check your email"): the crane at the size its
   img gives it, 120px tall, on the page's paper, with the heading's own gap below it. */
.still {
  display: block;
  margin: 0 0 16px;
}

/* A laptop window, under 940px tall once the browser's own bars are drawn: the space between the parts
   of a split page closes up, the type stays, so sign in fits a 780px window with "Create an account" on
   screen, and a 900px window with a sign-in error. */
@media (min-width: 900px) and (max-height: 939px) {
  .split .sheet {
    padding-top: 24px;
  }

  .split .brand {
    margin-bottom: 24px;
  }

  .split .masthead {
    margin-bottom: 20px;
  }

  .split .label {
    margin-bottom: 8px;
  }

  .split .line {
    margin-top: 8px;
  }

  .split .or {
    margin: 12px 0;
  }

  .split .links {
    margin-top: 4px;
  }
}

@media (max-width: 899px) {
  /* On a phone the picture is a band above the form, 32vw tall (125px at 390), at least 120px and at
     most 300px, so the Sign in button and "Create an account" fit an 844px screen. Its height is kept
     free from the first paint, in the band's own color, and the band is laid into it: the form comes
     first in the markup and account.js sits between it and the band, so a browser may draw the form
     before it has read the band, and the form must not move when the band comes. */
  .split {
    --look-band-height: clamp(120px, 32vw, 300px);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: var(--look-band-height);
    background: linear-gradient(var(--look-band), var(--look-band)) top / 100% var(--look-band-height) no-repeat;
  }

  .pane-scene {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: var(--look-band-height);
  }

  .pane-scene .scene {
    flex: none;
    height: var(--look-band-height);
  }

  .brand {
    margin-bottom: 24px;
  }

  .logo {
    height: var(--look-logo-height-phone);
  }

  .sheet {
    margin: 0 auto;
    padding: 24px 0 40px;
  }

  .quiet .sheet {
    padding: 24px 0 48px;
  }

  .masthead {
    margin-bottom: 20px;
  }

  /* a split page closes up on a phone: the space between its parts, not the type. The links under the form
     sit straight under the button, because each one has a 40px row of its own, which already leaves about
     10px above its words. */
  .split .sheet {
    padding-top: 12px;
  }

  .split .brand {
    margin-bottom: 16px;
  }

  .split .masthead {
    margin-bottom: 12px;
  }

  .split .or {
    margin: 12px 0;
  }

  .split .links {
    margin-top: 0;
  }

  .label {
    margin-bottom: 8px;
  }

  .headline {
    font-size: var(--look-headline-size-phone);
    line-height: var(--look-headline-line-phone);
  }

  .line {
    margin-top: 8px;
    font-size: var(--look-line-size-phone);
    line-height: var(--look-line-line-phone);
  }

  .title {
    margin-bottom: 20px;
    font-size: var(--look-title-size-phone);
    line-height: var(--look-title-line-phone);
  }
}

@media (max-width: 359px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}

/* ---- the app's filled green button on paper: a 1px edge in green's text step, inside its box ----
   The fill alone reads 2.2 to 1 against the paper (tallyfy/work-queue#5229). With the elements bundle
   the button reads its rest and hover shadows from --tf-btn-shadow-sm and --tf-btn-shadow-md on its
   host, and its focus ring from --tf-btn-focus-ring on the button inside, so the edge goes in through
   those three and stays through rest, hover, press and keyboard focus. The bundle drops every shadow
   on a disabled or busy button, which also dims it. Before the bundle's script has run, its stylesheet
   draws the plain button, which takes the same edge here. */
tf-button:is(:not([variant]), [variant='filled']):is(:not([color]), [color='primary']) {
  --tf-btn-shadow-sm: inset 0 0 0 var(--look-rule-width) var(--look-button-edge), var(--look-button-shadow);
  --tf-btn-shadow-md: inset 0 0 0 var(--look-rule-width) var(--look-button-edge), var(--look-button-shadow-hover);
  /* Its hover is the lighter green the pages draw without the bundle, which the Worker pages take too, so
     the button hovers alike on every account surface. On it the bundle's label reads 5.9 to 1 (4.6 on the
     app's #2c8d44); the ink label of the pages without the bundle reads 4.9 to 1 (3.8 on #2c8d44). */
  --tf-btn-primary-hover: var(--look-green-hover);
}

tf-button:is(:not([variant]), [variant='filled']):is(:not([color]), [color='primary']) > .tf-button {
  --tf-btn-focus-ring: inset 0 0 0 var(--look-rule-width) var(--look-button-edge), var(--look-button-shadow);
}

/* ---- a focused button: one 2px ring in the ink, 2px outside it, and no second band (CALM A9) ----
   The bundle draws focus as three bands from --tf-btn-focus-ring on the button inside: a gap in the surface,
   the button's own colour, then the ink. Here that token is the button's resting shadow (a shadow that draws
   nothing on the other buttons; the primary's is set above), so focus adds no band, and the ring is the
   outline, as on the Worker pages (cloudflare-workers 4e8225f). The plain button before the bundle's script
   has run, and with no bundle, takes the same ring in place of the app's green one. An intended difference
   from the app's skin, listed by scripts/account-look/skin-tokens.cjs --check, which goes when the skin's
   next commit lands (app-flair-3 adds it as a token). */
tf-button > .tf-button.tf-button {
  --tf-btn-focus-ring: 0 0 #0000;
}

tf-button > .tf-button.tf-button:focus-visible,
tf-button:not(:defined) > :is(button, input[type='submit']):focus-visible {
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: var(--look-ring-offset);
}

tf-button:not(:defined):is(:not([variant]), [variant='filled']) > :is(button, input[type='submit']),
tf-button:not(:defined):is(:not([variant]), [variant='filled']):not(:has(> :is(button, input[type='submit']))) {
  box-shadow: inset 0 0 0 var(--look-rule-width) var(--look-button-edge), var(--look-button-shadow);
}

/* Before the bundle's script has run, its stylesheet edges a secondary button in the app's neutral grey; it
   takes the quiet edge here too, so nothing changes colour when the element takes over. That holds for a
   face with no button inside as well, such as "Continue with Google", whose control is the link round it. */
tf-button:not(:defined)[variant='outlined'] > :is(button, input[type='submit']),
tf-button:not(:defined)[variant='outlined'][color] > :is(button, input[type='submit']),
tf-button:not(:defined)[variant='outlined'][color]:not(:has(> :is(button, input[type='submit']))) {
  border-color: var(--look-edge);
}

/* While the bundle's script can still run and has not yet, the app's checkbox ("I agree" on the invite page) is
   drawn as the element will draw it while unticked: its 20px box, clear inside, with a 2px edge in the control's
   edge colour and a 4px corner, in the same place. So nothing repaints when the element takes over. A box ticked
   before then keeps the browser's own tick until the element takes over. "Can still run" means scripts are on
   (the head's inline script adds the js class), a bundle is named, and nothing has marked the page failed:
   account.js marks it when the bundle's sheet or script fails to load, and the bundle when it cannot start. In
   every other case (no bundle, scripts off, or a failure) the browser's own checkbox stays as it is, ticked or
   not, because no element will ever take over. */
html.js:not([data-look-elements='none']):not([data-tf-account-elements='failed']) tf-checkbox:not(:defined) input[type='checkbox']:not(:checked) {
  box-sizing: border-box;
  border: var(--look-check-edge-width) solid var(--look-control-edge);
  border-radius: var(--look-check-radius);
  background: transparent;
  appearance: none;
}

/* Focus on the app's checkbox is one 2px ring in the ink, 2px outside its box, and the box keeps the look it has at
   rest (CALM A9). The element draws focus three ways: a tinted circle round the box (--tf-checkbox-focus-bg), its
   edge turned to the tick colour, and a near-black band at no gap (--tf-focus-ring-contrast). The two tokens are
   set clear on the parts that read them, which beats the value the element gives its own host. An unticked box
   gets its resting edge back with a rule heavier than the element's (0,9,0 against 0,9,1), because the element's
   styles come after this sheet; a ticked box's resting edge is already the tick colour. The ring is an outline,
   as on a button, and the box before the element takes over, or with no bundle, gets the same ring. */
tf-checkbox .tf-checkbox__control {
  --tf-checkbox-focus-bg: transparent;
}

tf-checkbox .tf-checkbox__box {
  --tf-focus-ring-contrast: transparent;
}

tf-checkbox:not(.tf-checkbox-host--checked):not(.tf-checkbox-host--indeterminate):not(.tf-checkbox-host--disabled) .tf-checkbox__native:focus-visible ~ .tf-checkbox__control .tf-checkbox__box.tf-checkbox__box.tf-checkbox__box {
  border-color: var(--tf-checkbox-border);
}

tf-checkbox .tf-checkbox__native:focus-visible ~ .tf-checkbox__control .tf-checkbox__box,
tf-checkbox:not(:defined) input[type='checkbox']:focus-visible {
  outline: var(--look-ring-width) solid var(--look-ring);
  outline-offset: var(--look-ring-offset);
}

/* ---- with no elements bundle (ACCOUNT_ELEMENTS_BASE unset outside local work): the tf- tags stay
   plain, and these rules lay out the native fields, buttons and messages inside them ---- */
[data-look-elements='none'] :is(tf-input, tf-password-input) {
  display: grid;
  gap: 4px;
}

[data-look-elements='none'] :is(tf-input, tf-password-input) > label {
  font-size: var(--look-small-size);
  font-weight: var(--look-w-label);
  line-height: var(--look-small-line);
}

[data-look-elements='none'] :is(tf-input, tf-password-input) > input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: var(--look-rule-width) solid var(--look-control-edge);
  border-radius: var(--look-radius);
  background: var(--look-surface);
  color: var(--look-ink);
  font: inherit;
  font-size: var(--look-text-size);
}

/* A focused field shows one edge: its own border, in the ink and 2px, with no gap, no second colour and no
   shadow beside it (owner decisions 55 and 89). The side padding gives back the extra pixel, so the words stay
   put. The transparent outline is what a forced-colours mode draws instead. With the elements bundle the
   component draws the field's focus, as the same one edge through two tokens in app-skin.css (CALM A9). */
[data-look-elements='none'] :is(tf-input, tf-password-input) > input:focus-visible {
  padding: 0 15px;
  border: var(--look-ring-width) solid var(--look-ring);
  outline: var(--look-ring-width) solid transparent;
}

[data-look-elements='none'] :is(tf-input, tf-password-input) > :is([data-tf-hint], [data-tf-error]) {
  color: var(--look-ink-soft);
  font-size: var(--look-small-size);
  line-height: var(--look-small-line);
}

[data-look-elements='none'] :is(tf-input, tf-password-input) > [data-tf-error] {
  color: var(--look-error-text);
}

[data-look-elements='none'] tf-button {
  display: block;
}

[data-look-elements='none'] tf-button > button,
[data-look-elements='none'] tf-button:not(:has(> button)) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: var(--look-rule-width) solid var(--look-button-edge);
  border-radius: var(--look-radius);
  background: var(--look-green);
  color: var(--look-ink);
  font: inherit;
  font-size: var(--look-text-size);
  font-weight: var(--look-w-label);
  cursor: pointer;
}

[data-look-elements='none'] tf-button:is(:not([variant]), [variant='filled']) > button:hover:not(:disabled) {
  background: var(--look-green-hover);
}

[data-look-elements='none'] tf-button > button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* a button the page holds back with aria-disabled rather than disabled (the AI connector's Allow while
   no permission is ticked): it stays in the tab order, so a screen reader hears its state and the reason,
   and it looks held back. Before or without the bundle that is the native button; with it, the bundle's
   own button, which the consent page marks data-look-soft-disabled, so a busy button the bundle already
   dims is not dimmed twice. */
tf-button:not(:defined) > button[aria-disabled='true'],
tf-button:defined button[data-look-soft-disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

[data-look-elements='none'] tf-button[variant='outlined'] > button,
[data-look-elements='none'] tf-button[variant='outlined']:not(:has(> button)) {
  border-color: var(--look-edge);
  background: var(--look-surface);
}

/* Without the bundle a button is one drawing too: the primary button's edge is its border alone (the inset line
   above is for the bundle's own plain button, which has none). Its focus is the ring above. */
[data-look-elements='none'] tf-button:not(:defined):is(:not([variant]), [variant='filled']) > :is(button, input[type='submit']),
[data-look-elements='none'] tf-button:not(:defined):is(:not([variant]), [variant='filled']):not(:has(> :is(button, input[type='submit']))) {
  box-shadow: var(--look-button-shadow);
}

[data-look-elements='none'] tf-alert {
  display: block;
  padding: 12px 16px;
  border-radius: var(--look-radius-box);
  background: var(--look-blue-tint);
  color: var(--look-blue-text);
  font-size: var(--look-text-size);
  line-height: var(--look-text-line);
}

[data-look-elements='none'] tf-alert[title]::before {
  content: attr(title);
  display: block;
  font-weight: var(--look-strong-weight);
}

[data-look-elements='none'] tf-alert[variant='success'] {
  background: var(--look-green-tint);
  color: var(--look-green-text);
}

[data-look-elements='none'] tf-alert[variant='warning'] {
  background: var(--look-orange-tint);
  color: var(--look-orange-text);
}

[data-look-elements='none'] tf-alert[variant='error'] {
  background: var(--look-error-tint);
  color: var(--look-error-text);
}

[data-look-elements='none'] tf-checkbox label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  font-size: var(--look-text-size);
}

/* flex: none keeps the box 20px square: in the label's inline-flex a long label would otherwise squash it (#12304). */
[data-look-elements='none'] tf-checkbox input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--look-check);
}

[data-look-elements='none'] tf-divider {
  display: block;
  height: var(--look-rule-width);
  background: var(--look-rule);
}
