/* sapawoo.tech account pages (Sign up, Log in, Choose a product, Profile and settings).
   Uses the design tokens in /assets/tokens/sapawoo.css; load that file first. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
  color: var(--content-primary);
  font: var(--text-body-md);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul { margin: 0; }
img { display: block; }
a { color: inherit; }

.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;
}

/* ---------- Type styles ---------- */
.t-h1 { font: var(--text-heading-h1); letter-spacing: var(--tracking-heading-h1); }
.t-h3 { font: var(--text-heading-h3); letter-spacing: var(--tracking-heading-h3); }
.t-h4 { font: var(--text-heading-h4); letter-spacing: var(--tracking-heading-h4); }
.t-body-lg { font: var(--text-body-lg); color: var(--content-secondary); }
.t-body-md { font: var(--text-body-md); }
.t-body-sm { font: var(--text-body-sm); color: var(--content-secondary); }
.t-caption { font: var(--text-caption); color: var(--content-secondary); }
.t-label { font: var(--text-label-md); color: var(--content-primary); }
.t-secondary { color: var(--content-secondary); }

.t-body-sm a, .t-caption a, .link-button {
  color: var(--content-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-button {
  font: inherit;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ---------- Top bar ---------- */
.topbar {
  flex: none;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: 0 var(--space-40);
  background: var(--surface-page);
  border-bottom: var(--stroke-default) solid var(--border-subtle);
}
.topbar__brand { display: inline-flex; border-radius: 4px; }
.topbar__brand img { width: 145.24px; height: 24px; }
.topbar__right { display: flex; align-items: center; gap: var(--space-12); }
.topbar__prompt { white-space: nowrap; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-accent);
  color: var(--content-on-accent);
  font-size: 14px; line-height: 20px; font-weight: 600;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  border: var(--stroke-default) solid transparent;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible,
.topbar__brand:focus-visible,
.link-button:focus-visible,
.t-body-sm a:focus-visible,
.t-caption a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn img { flex: none; }

/* Large: full-width card actions (button/lg) */
.btn--lg {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-32);
  border-radius: var(--radius-button);
  font-size: 18px;
  line-height: 24px;
}
/* Medium: Open / Coming soon (button/md) */
.btn--md {
  height: 44px;
  padding: 0 var(--space-20);
  border-radius: var(--radius-control);
  font-size: 16px;
  line-height: 24px;
}

.btn--primary { background: var(--surface-accent); color: var(--content-on-accent); }
.btn--primary:hover { background: var(--surface-accent-hover); }
.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
  background: var(--surface-disabled);
  color: var(--content-disabled);
  cursor: default;
}
.btn--primary[aria-busy="true"] { cursor: progress; }

.btn--secondary {
  background: var(--surface-panel);
  border-color: var(--border-strong);
  color: var(--content-accent);
}
.btn--secondary:hover { background: var(--surface-page); }
.btn--static, .btn--static:hover { cursor: default; background: var(--surface-panel); }

.btn--ghost {
  height: 44px;
  padding: 0 var(--space-12);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--content-accent);
  font-size: 16px;
  line-height: 24px;
}
.btn--ghost:hover { background: var(--surface-accent-subtle); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-badge);
  background: var(--surface-accent);
  color: var(--content-on-accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 1.68px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Card ---------- */
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  width: 100%;
  padding: var(--space-32);
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.card > * { width: 100%; }
.card > .btn--ghost { width: auto; }
.card--signup { max-width: 440px; }
.card--login { max-width: 480px; }
.card--code { max-width: 500px; gap: var(--space-20); }

.card__title { display: flex; flex-direction: column; gap: var(--space-4); }
.card--code .card__title { gap: var(--space-8); }
.card__title strong { color: var(--content-primary); font-weight: 700; }
.card__separator { height: 1px; background: var(--border-subtle); border: 0; margin: 0; }

.card form { display: flex; flex-direction: column; gap: var(--space-16); width: 100%; }

/* ---------- Text field ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-8); }
.field__input {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-16);
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--content-primary);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: var(--content-secondary); opacity: 1; }
.field__input:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.field.is-error .field__input { background: var(--surface-error-subtle); border-color: var(--border-error); }
.field.is-error .field__input:focus { box-shadow: 0 0 0 3px rgba(185, 74, 72, .3); }

.helper { display: flex; align-items: flex-start; gap: var(--space-8); }
.helper img { width: 20px; height: 20px; margin-top: .5px; }
.helper--error p { color: var(--content-error); }

/* ---------- Code digits ---------- */
.code { display: flex; flex-direction: column; gap: var(--space-8); border: 0; padding: 0; margin: 0; min-width: 0; }
/* Floated so the legend joins the flex column instead of the fieldset border. */
.code legend { padding: 0; float: left; width: 100%; }
.code__boxes { display: flex; gap: var(--space-12); }
.code__digit {
  width: 52px;
  height: 60px;
  min-width: 0;
  padding: 0;
  text-align: center;
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--content-primary);
  caret-color: var(--content-accent);
  font: inherit;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.24px;
  transition: border-color .15s, box-shadow .15s;
}
.code__digit:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.code__digit:disabled { color: var(--content-disabled); background: var(--surface-disabled); }
.code.is-error .code__digit { background: var(--surface-error-subtle); border-color: var(--border-error); }
.code.is-error .code__digit:focus { box-shadow: 0 0 0 3px rgba(185, 74, 72, .3); }

/* ---------- Layout ---------- */
.auth-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-80) var(--space-40);
}

/* U1 Sign up: value column + card */
.signup-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 120px;
  width: 100%;
}
.value { display: flex; flex-direction: column; gap: var(--space-24); width: 520px; flex: none; }
.included { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.included li { display: flex; align-items: center; gap: var(--space-12); }
.included img { width: 24px; height: 24px; flex: none; }

/* U2 Choose a product */
.welcome { display: flex; flex-direction: column; gap: var(--space-32); width: 100%; max-width: 1200px; }
.welcome__title { display: flex; flex-direction: column; gap: var(--space-16); }
.welcome__title .t-body-lg { max-width: 900px; }
.products { list-style: none; padding: 0; display: flex; gap: var(--space-24); }
.product {
  flex: 1 1 0;
  min-width: 0;
  /* Each card takes half the row (588 px at full width), even when it is the only one. */
  max-width: calc((100% - var(--space-24)) / 2);
  min-height: 264px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-24);
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-subtle);
  border-radius: var(--radius-card);
  transition: box-shadow .15s;
}
.product:hover { box-shadow: var(--shadow-md); }
.product__info { display: flex; flex-direction: column; gap: var(--space-16); }
.product__tile {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-control);
  background: var(--surface-accent-subtle);
  color: var(--content-primary);
}
.product .btn { align-self: flex-start; }

/* ---------- Icons ----------
   The Figma SVGs used as masks, so they take the text colour (and follow the theme). */
.icon {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.icon--24 { width: 24px; height: 24px; }
/* These two SVGs are the glyph only; scale them as they sit inside the 24 px icon frame. */
.icon--receipt { -webkit-mask-size: 66.667% 91.667%; mask-size: 66.667% 91.667%; }
.icon--credit-card { -webkit-mask-size: 91.667% 66.667%; mask-size: 91.667% 66.667%; }
.icon--qr-code { -webkit-mask-size: 83.333% 83.375%; mask-size: 83.333% 83.375%; }

/* Wordmark: Steel Blue in light mode, white in dark mode. */
.wordmark-dark { display: none !important; }
[data-theme="dark"] .wordmark-light { display: none !important; }
[data-theme="dark"] .wordmark-dark { display: block !important; }

.t-overline {
  font: var(--text-overline);
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  color: var(--content-secondary);
}
.t-label-sm { font: var(--text-label-sm); color: var(--content-secondary); }

/* ---------- Avatar ---------- */
.avatar { flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar--photo { background: var(--surface-muted); }
.avatar--40 { font-size: 16px; line-height: 24px; }
.avatar--80 { width: 80px; height: 80px; border-radius: var(--radius-full); font-size: 24px; line-height: 32px; letter-spacing: -0.24px; }
.avatar--120 { width: 120px; height: 120px; border-radius: var(--radius-full); font-size: 32px; line-height: 40px; }

button.avatar {
  padding: 0;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow .15s;
}
button.avatar[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--border-focus); }
button.avatar:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Avatar menu (A1) ---------- */
.account-menu { position: relative; display: flex; }
.avatar-menu {
  position: absolute;
  top: calc(100% + 24px);
  right: 0;
  z-index: 10;
  width: 320px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
}
.avatar-menu__header { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-12) var(--space-8); }
.avatar-menu__who { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
/* Long names: up to 2 lines, then "…". */
.avatar-menu__name {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.avatar-menu__plan { display: flex; padding: var(--space-4) var(--space-12) var(--space-12) 64px; }
/* The plan badge can run long ("Ngày do sapawoo.tech tặng · Còn dưới 1 giờ"), so here it may wrap. */
.avatar-menu__plan .badge,
.welcome__title .badge { white-space: normal; }
.avatar-menu__divider { height: 1px; margin: var(--space-8) 0; background: var(--border-subtle); }

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  width: 100%;
  padding: 10px var(--space-12);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--content-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { outline: none; background: var(--surface-muted); }
.menu-item[aria-disabled="true"], .menu-item[aria-disabled="true"]:hover { background: transparent; color: var(--content-disabled); cursor: default; }
.menu-item__label { flex: 1; min-width: 0; }
.avatar-menu__label { padding: var(--space-4) var(--space-12); }

/* ---------- Badge tones ---------- */
/* The 1 px border adds to the size, as in Figma (Outline badges are 26 px tall). */
.badge--outline { background: var(--surface-panel); color: var(--content-primary); border: var(--stroke-default) solid var(--border-strong); }
.badge--success { background: var(--surface-success-subtle); color: var(--content-success); }

/* ---------- Notice ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  border: var(--stroke-default) solid;
  border-radius: var(--radius-control);
}
.notice__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.notice__title { font-weight: 600; }
.notice__body { font-size: 14px; line-height: 21px; }
.notice--error { background: var(--surface-error-subtle); border-color: var(--border-error); }
.notice--error .icon, .notice--error .notice__title { color: var(--content-error); }
.notice--success { background: var(--surface-success-subtle); border-color: var(--border-success); }
.notice--success .icon { color: var(--content-success); }

/* ---------- Toast: bottom centre, 24 px above the edge ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-24);
  z-index: 20;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-12);
  max-width: calc(100vw - 32px);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-control);
  background: var(--surface-inverse);
  color: var(--content-on-inverse);
  box-shadow: var(--shadow-lg);
}
.toast__action {
  padding: 0 0 0 var(--space-4);
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.toast__action:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Form controls: segmented control, checkbox, select ---------- */
.segmented {
  display: flex;
  gap: var(--space-4);
  min-width: 0;
  margin: 0;
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
}
.segmented label { position: relative; flex: 1 1 0; min-width: 0; }
.segmented input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 var(--space-12);
  border-radius: var(--radius-full);
  color: var(--content-secondary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, box-shadow .15s;
}
.segmented input:checked + span { background: var(--surface-panel); color: var(--content-primary); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { box-shadow: var(--focus-ring); }

.checkbox { position: relative; display: flex; align-items: center; gap: var(--space-12); cursor: pointer; }
.checkbox input { position: absolute; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.checkbox__box {
  flex: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-panel);
  color: var(--content-on-accent);
}
.checkbox__box .icon { width: 14px; height: 14px; visibility: hidden; }
.checkbox input:checked + .checkbox__box { background: var(--surface-accent); border-color: var(--border-focus); }
.checkbox input:checked + .checkbox__box .icon { visibility: visible; }
.checkbox input:focus-visible + .checkbox__box { box-shadow: var(--focus-ring); }

.select { position: relative; display: flex; }
.select select {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 var(--space-16);
  appearance: none;
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--content-primary);
  font: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}
.select select:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.select select:disabled { background: var(--surface-muted); border-color: var(--border-disabled); color: var(--content-disabled); opacity: 1; cursor: default; }
.select .icon { position: absolute; top: 16px; right: var(--space-16); color: var(--content-disabled); pointer-events: none; }

/* ---------- A2 Profile and settings ---------- */
.profile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-32); width: 100%; max-width: 1200px; }
.profile__title { display: flex; flex-direction: column; gap: var(--space-16); }
.profile__columns { display: flex; align-items: flex-start; gap: var(--space-24); width: 100%; }
.profile__main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-24); }
.profile__side { flex: 0 0 384px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-24); }

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-32);
  background: var(--surface-panel);
  border: var(--stroke-default) solid var(--border-subtle);
  border-radius: var(--radius-card);
  /* Rows inside respond to the card's own width (see "Card width" below), which changes
     with the two-column layout as well as the window. */
  container-type: inline-size;
}
.panel--compact { gap: var(--space-16); padding: var(--space-24); }
.panel__head { display: flex; flex-direction: column; gap: var(--space-4); }
.panel .btn { align-self: flex-start; }

.rows { display: flex; flex-direction: column; }
.divider { height: 1px; background: var(--border-subtle); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-8); }

.detail-row { display: flex; align-items: center; gap: var(--space-24); padding: var(--space-16) 0; }
.detail-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); overflow-wrap: anywhere; }
.detail-row__value.is-empty { color: var(--content-secondary); }

.photo-row { display: flex; align-items: center; gap: var(--space-24); padding-bottom: var(--space-16); }
.photo-row--preview { align-items: flex-start; }
.photo-row--preview .actions { padding-top: var(--space-12); }
.photo-notice { margin-bottom: var(--space-16); }

.edit-form { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-16) 0; }
.company-form { display: flex; flex-direction: column; gap: var(--space-24); }
.company-form__fields { display: flex; flex-direction: column; gap: var(--space-20); }
.field .helper p { color: var(--content-secondary); }
.field .helper--error p { color: var(--content-error); }
.helper--error .icon { margin-top: .5px; color: var(--content-error); }

.setting-row { display: flex; align-items: flex-start; gap: var(--space-24); padding: var(--space-16) 0; }
.setting-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.setting-row__control { flex: 0 0 360px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.save-status { min-height: 0; }
.save-status.is-error { color: var(--content-error); }

.plan__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
.plan__body { display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .signup-layout { flex-direction: column; align-items: center; gap: var(--space-40); }
  .value { width: 100%; max-width: 520px; }
}

@media (max-width: 1100px) {
  .profile__columns { flex-direction: column; }
  .profile__main, .profile__side { flex: none; width: 100%; }
}

/* Card width: below 600 px of content the photo buttons move under the text and each
   setting's control goes under its label; below 360 px everything stacks. */
@container (max-width: 600px) {
  .photo-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-16) var(--space-24); }
  .photo-row > .actions { grid-column: 2; }
  .setting-row { flex-direction: column; gap: var(--space-12); }
  .setting-row__control { flex: none; width: 100%; }
}

@container (max-width: 360px) {
  .photo-row { grid-template-columns: minmax(0, 1fr); }
  .photo-row > .actions { grid-column: 1; }
  .detail-row { flex-wrap: wrap; }
  /* Share the row by text length, so a longer option is not clipped. */
  .segmented label { flex: 1 1 auto; }
  .segmented span { padding: 0 var(--space-8); }
}

@media (max-width: 900px) {
  .products { flex-direction: column; }
  /* flex: 1 1 0 shares a row's width; stacked, each card must keep its content height. */
  .product { flex: none; min-height: 0; max-width: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 var(--space-16); }
  .topbar__prompt { display: none; }
  .auth-main { padding: var(--space-40) var(--space-16); }
  .card, .panel { padding: var(--space-24); }
  .t-h1 { font-size: 36px; line-height: 44px; letter-spacing: -0.72px; }
  .btn--lg { padding: 0 var(--space-16); }
  .code__boxes { gap: var(--space-8); }
  .code__digit { flex: 1 1 0; width: auto; max-width: 52px; }
  /* The Vietnamese label is longer than a phone's card: let it take two lines. */
  #plan-action { white-space: normal; height: auto; min-height: 44px; padding-block: var(--space-8); text-align: center; text-wrap: balance; }
}

/* ---------- Motion (Profile-Flow spec 17, 13 Nov 2026) ----------
   Things come in with a small bounce and leave quickly with no bounce. The four Figma motion
   styles, played by adding the class (SapawooAccount.play restarts one); --fx-delay delays it.
   They fill backwards only, so a finished element is back to its own style (no leftover
   sub-pixel transform).
   They move with the `translate` and `scale` properties, so an element's own transform (the
   centred toast) still applies.
   Rise: up 32 px, 600 ms gentle spring; fades in over 350 ms ease-out. Cards, forms, toasts.
   Drop: down 16 px from 92 %, 450 ms bouncy; fades in over 250 ms. Avatar menu and notices.
   Pop: grows from 70 %, 550 ms bouncy; fades in over 200 ms. One thing that just changed.
   Sink: down 24 px and out, 300 ms ease-in. Toasts leaving.
   The springs are Figma's, sampled as linear() curves. */
:root {
  --spring-gentle: linear(0, 0.0242, 0.0871, 0.1757, 0.2793, 0.3892, 0.4987, 0.6028, 0.6982, 0.7827, 0.8552, 0.9156, 0.9641, 1.0017, 1.0295, 1.0486, 1.0606, 1.0666, 1.068, 1.0659, 1.0613, 1.0551, 1.048, 1.0405, 1.0331, 1.026, 1.0197, 1.014, 1.0092, 1.0052, 1.002, 0.9996, 0.9978, 0.9965, 0.9958, 0.9954, 0.9954, 0.9955, 0.9959, 0.9963, 0.9968, 0.9973, 0.9978, 0.9983, 0.9987, 0.9991, 0.9994, 0.9997, 0.9999, 1.0001, 1.0002);
  --spring-bouncy: linear(0, 0.0985, 0.342, 0.6483, 0.9442, 1.1767, 1.3179, 1.364, 1.3302, 1.2427, 1.1314, 1.0233, 0.9377, 0.8853, 0.8675, 0.8791, 0.9105, 0.9509, 0.9904, 1.0219, 1.0414, 1.0482, 1.0443, 1.033, 1.0183, 1.0039, 0.9923, 0.9851, 0.9825, 0.9838, 0.9878, 0.9932, 0.9984, 1.0027, 1.0054, 1.0064, 1.0059, 1.0045, 1.0025, 1.0006, 0.9991, 0.9981, 0.9977, 0.9978, 0.9983, 0.9991, 0.9998, 1.0003, 1.0007, 1.0008, 1.0008);
}
@keyframes fx-fade-in { from { opacity: 0; } }
@keyframes fx-rise-in { from { translate: 0 32px; } }
@keyframes fx-drop-in { from { translate: 0 -16px; scale: .92; } }
@keyframes fx-pop-in { from { scale: .7; } }
@keyframes fx-sink-out { to { opacity: 0; translate: 0 24px; } }
/* Errors: the field shakes left and right for 440 ms (A3.1, A5.1). */
@keyframes fx-shake {
  13.64% { translate: -10px 0; }
  31.82% { translate: 10px 0; }
  50% { translate: -8px 0; }
  68.18% { translate: 6px 0; }
  84.09% { translate: -3px 0; }
  100% { translate: 0 0; }
}
.fx-rise { animation: fx-rise-in .6s var(--spring-gentle) var(--fx-delay, 0s) backwards, fx-fade-in .35s ease-out var(--fx-delay, 0s) backwards; }
.fx-drop { animation: fx-drop-in .45s var(--spring-bouncy) var(--fx-delay, 0s) backwards, fx-fade-in .25s ease-out var(--fx-delay, 0s) backwards; }
.fx-pop { animation: fx-pop-in .55s var(--spring-bouncy) var(--fx-delay, 0s) backwards, fx-fade-in .2s ease-out var(--fx-delay, 0s) backwards; }
.fx-shake { animation: fx-shake .44s ease-in-out var(--fx-delay, 0s) backwards; }
.fx-sink { animation: fx-sink-out .3s ease-in both; }

/* Theme: Light and Dark cross-fade the page over 500 ms (where the browser can). */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .5s; animation-timing-function: ease-in-out; }

/* Hover and press: colour changes in 120 ms on hover and 80 ms on press; checkboxes in 200 ms. */
.btn { transition-duration: .12s; }
.menu-item { transition: background-color .12s; }
.btn:active, .menu-item:active { transition-duration: .08s; }
.checkbox__box { transition: background-color .2s, border-color .2s; }

/* Reduced motion keeps the fades only: no moving, growing, bounce or shake. Errors still show
   the red message. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  @keyframes fx-rise-in { from { translate: none; } }
  @keyframes fx-drop-in { from { translate: none; } }
  @keyframes fx-pop-in { from { scale: none; } }
  @keyframes fx-sink-out { to { opacity: 0; } }
  @keyframes fx-shake { to { translate: none; } }
}
