/* Account pages: ASP.NET Core Identity's pages (and /Household/Join, the status pages) in the Vuexy auth card
   (Areas/Identity/Pages/_Layout), and the account pages (Manage, "Your account") inside the main layout
   (Account/Manage/_Layout, which wraps them in .pl-auth.pl-account). One heading and one supporting line per
   page, labelled fields, one primary button, quiet links. Every rule is scoped to .pl-auth, so the main
   layout's own classes (.pl-top, .pl-nav, .pl-content...) are never touched. */

/* Until Public Sans arrives, Arial sized to its metrics (as site.css), so the swap moves nothing. */
@font-face {
  font-family: 'Public Sans Fallback';
  font-weight: 100 500;
  src: local('Arial'), local('ArialMT');
  size-adjust: 104.3%;
  ascent-override: 91%;
  descent-override: 22%;
}

@font-face {
  font-family: 'Public Sans Fallback';
  font-weight: 600 900;
  src: local('Arial Bold'), local('Arial-BoldMT');
  size-adjust: 99.1%;
  ascent-override: 95.9%;
  descent-override: 23.2%;
}

body {
  font-family: 'Public Sans', 'Public Sans Fallback', var(--bs-body-font-family);
}

/* Colours with enough contrast for text (4.5:1) on the card and on the alert tints. The theme's primary,
   danger and success colours are made for fills and icons: as text, or under white text, they fall short.
   --pl-link          links and the outline button's text
   --pl-primary-fill  fills that carry white text (primary buttons, the current account page)
   --pl-danger-fill   the same for the danger button
   --pl-quiet         secondary text: "Sign out", the "Off" pill, a disabled field's value
   --pl-placeholder   placeholders
   In the main layout (.pl-account) links, primary buttons and the current section follow this device's
   accent colour (site.css: --pl-accent-ink, --pl-accent-fill). */
.pl-auth {
  --pl-link: color-mix(in sRGB, var(--bs-primary) 80%, #000);
  --pl-primary-fill: color-mix(in sRGB, var(--bs-primary) 90%, #000);
  --pl-primary-ink: var(--bs-primary-contrast, #fff);
  --pl-danger-fill: color-mix(in sRGB, var(--bs-danger) 80%, #000);
  --pl-danger-text: color-mix(in sRGB, var(--bs-danger) 68%, #000);
  --pl-success-text: color-mix(in sRGB, var(--bs-success) 55%, #000);
  --pl-warning-text: color-mix(in sRGB, var(--bs-warning) 50%, #000);
  --pl-quiet: #63616c;
  --pl-placeholder: #6f6d79;
}

[data-bs-theme='dark'] .pl-auth {
  --pl-link: color-mix(in sRGB, var(--bs-primary) 60%, #fff);
  --pl-danger-text: color-mix(in sRGB, var(--bs-danger) 60%, #fff);
  --pl-success-text: color-mix(in sRGB, var(--bs-success) 75%, #fff);
  --pl-warning-text: color-mix(in sRGB, var(--bs-warning) 85%, #fff);
  --pl-quiet: #b0afc4;
  --pl-placeholder: #a09fb6;
}

.pl-auth.pl-account,
[data-bs-theme='dark'] .pl-auth.pl-account {
  --pl-link: var(--pl-accent-ink, var(--bs-primary));
  --pl-primary-fill: var(--pl-accent-fill, var(--bs-primary));
}

.pl-auth a:not(.btn):not(.pl-acc-nav a):not(.app-brand-link) {
  color: var(--pl-link);
}

@media (hover: hover) {
  .pl-auth a:not(.btn):not(.pl-acc-nav a):not(.app-brand-link):hover {
    color: color-mix(in sRGB, var(--pl-link) 85%, var(--bs-heading-color));
  }
}

/* On the dark theme the alert tints are lighter than the card, so a link inside one is lighter still. */
[data-bs-theme='dark'] .pl-auth .alert a:not(.btn) {
  color: color-mix(in sRGB, var(--bs-primary) 45%, #fff);
}

/* The sign-in card's buttons (the account pages keep the main layout's accent buttons). */
.pl-auth:not(.pl-account) .btn-primary {
  --bs-btn-bg: var(--pl-primary-fill);
  --bs-btn-border-color: var(--pl-primary-fill);
  --bs-btn-hover-bg: color-mix(in sRGB, #000 10%, var(--pl-primary-fill));
  --bs-btn-hover-border-color: color-mix(in sRGB, #000 10%, var(--pl-primary-fill));
  --bs-btn-active-bg: color-mix(in sRGB, #000 10%, var(--pl-primary-fill));
  --bs-btn-active-border-color: color-mix(in sRGB, #000 10%, var(--pl-primary-fill));
  --bs-btn-disabled-bg: var(--pl-primary-fill);
  --bs-btn-disabled-border-color: var(--pl-primary-fill);
}

.pl-auth:not(.pl-account) .btn-outline-primary {
  --bs-btn-color: var(--pl-link);
  --bs-btn-border-color: var(--pl-link);
  --bs-btn-hover-color: var(--pl-link);
  --bs-btn-hover-border-color: var(--pl-link);
  --bs-btn-active-color: var(--pl-link);
  --bs-btn-active-border-color: var(--pl-link);
}

.pl-auth .btn-danger {
  --bs-btn-bg: var(--pl-danger-fill);
  --bs-btn-border-color: var(--pl-danger-fill);
  --bs-btn-hover-bg: color-mix(in sRGB, #000 10%, var(--pl-danger-fill));
  --bs-btn-hover-border-color: color-mix(in sRGB, #000 10%, var(--pl-danger-fill));
  --bs-btn-active-bg: color-mix(in sRGB, #000 10%, var(--pl-danger-fill));
  --bs-btn-active-border-color: color-mix(in sRGB, #000 10%, var(--pl-danger-fill));
  --bs-btn-disabled-bg: var(--pl-danger-fill);
  --bs-btn-disabled-border-color: var(--pl-danger-fill);
}

.pl-auth .btn-outline-danger {
  --bs-btn-color: var(--pl-danger-text);
  --bs-btn-border-color: var(--pl-danger-text);
  --bs-btn-hover-color: var(--pl-danger-text);
  --bs-btn-hover-border-color: var(--pl-danger-text);
  --bs-btn-active-color: var(--pl-danger-text);
  --bs-btn-active-border-color: var(--pl-danger-text);
}

.pl-auth :is(.btn-outline-secondary, .btn-text-secondary) {
  --bs-btn-color: var(--pl-quiet);
  --bs-btn-hover-color: var(--bs-heading-color);
  --bs-btn-active-color: var(--bs-heading-color);
}

.pl-auth .form-control::placeholder {
  color: var(--pl-placeholder);
  opacity: 1;
}

/* A disabled field here shows the account's own email: quieter than a live field, still easy to read. */
.pl-auth .form-control:disabled {
  color: var(--pl-quiet);
  -webkit-text-fill-color: var(--pl-quiet);
  opacity: 1;
}

.pl-auth .pl-state.bg-label-success {
  color: var(--pl-success-text) !important;
}

.pl-auth .pl-state.bg-label-secondary {
  color: var(--pl-quiet) !important;
}

.pl-auth .alert-warning {
  color: var(--pl-warning-text);
}

.pl-auth .alert-danger {
  color: var(--pl-danger-text);
}

.pl-auth .alert-success,
.pl-auth .text-success {
  color: var(--pl-success-text) !important;
}

/* ---------- Card and brand (the sign-in pages) ---------- */

/* The card's page fills the screen as the browser shows it (100dvh: without the part under the address bar). */
.pl-auth.authentication-wrapper {
  min-block-size: 100vh;
  min-block-size: 100dvh;
}

.pl-auth .app-brand-logo {
  font-size: 1.5rem;
  width: auto;
  height: auto;
}

.pl-auth .authentication-inner .card .app-brand {
  margin-block-end: 2rem;
}

.pl-auth .app-brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.pl-auth .app-brand-text {
  font-size: 1.375rem;
  color: var(--bs-heading-color);
}

/* Vuexy's two decorative squares stick out of the card: where the card nearly fills the screen (a phone,
   upright or on its side) they would make the page scroll sideways, so they go. */
@media (max-width: 767.98px), (max-height: 500px) {
  .pl-auth.authentication-wrapper .authentication-inner::before,
  .pl-auth.authentication-wrapper .authentication-inner::after {
    display: none;
  }
}

/* On a phone (upright, or on its side) the card is the page: it starts at the top, with no border, shadow
   or second gutter around it, on the card's own colour. */
@media (max-width: 575.98px), (max-height: 500px) {
  body:has(.authentication-wrapper.pl-auth) {
    background-color: var(--bs-paper-bg);
  }

  .pl-auth.authentication-wrapper {
    align-items: flex-start;
    padding-block: 0 !important;
  }

  .pl-auth .authentication-inner {
    margin-block: 0;
    padding-block: 0.5rem 1rem !important;
  }

  .pl-auth .authentication-inner > .card {
    border: 0;
    box-shadow: none;
    background-color: transparent;
  }

  .pl-auth .authentication-inner > .card > .card-body {
    padding: 1rem 0.25rem 1.5rem;
  }

  .pl-auth .authentication-inner .card .app-brand {
    margin-block-end: 1.25rem;
  }
}

/* ---------- Headings and copy ---------- */

.pl-auth:not(.pl-account) h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.375rem;
}

.pl-auth .pl-intro {
  margin-bottom: 1.5rem;
}

.pl-auth .pl-intro p {
  margin-bottom: 0;
  color: var(--bs-body-color);
}

.pl-auth .pl-intro p + p {
  margin-top: 0.5rem;
}

.pl-auth h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.pl-auth h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

/* ---------- Fields ---------- */

.pl-auth .pl-field {
  margin-bottom: 1.25rem;
}

.pl-auth .pl-field .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bs-heading-color);
  margin-bottom: 0.375rem;
}

.pl-auth .pl-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--bs-body-color);
}

/* A field's own validation message, directly under it, in the danger colour. */
.pl-auth .field-validation-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--pl-danger-text);
}

.pl-auth .field-validation-valid {
  display: none;
}

.pl-auth .form-control.input-validation-error,
.pl-auth .input-group:has(.input-validation-error) .form-control,
.pl-auth .input-group:has(.input-validation-error) .input-group-text {
  border-color: var(--bs-danger);
}

/* A field with an error keeps the danger colour while it has the focus: its ring and glow too (the
   theme's focus ring is the primary colour, which would hide the red). */
.pl-auth .form-control.input-validation-error:focus {
  border-color: var(--bs-danger);
  box-shadow: 0 0.125rem 0.375rem 0 rgba(var(--bs-danger-rgb), 0.3);
}

.pl-auth .input-group:has(.input-validation-error):focus-within {
  box-shadow: 0 0 0 var(--bs-border-width) var(--bs-danger);
}

.pl-auth .input-group:has(.input-validation-error):focus-within::before {
  box-shadow: 0 0.125rem 0.375rem 0 rgba(var(--bs-danger-rgb), 0.3);
}

/* While a field shows an error, the error replaces its hint. */
.pl-auth .pl-field:has(.field-validation-error) .pl-hint {
  display: none;
}

/* The form's own errors (_ErrorSummary, the sign-in page's): a tinted box with an icon, above the fields. */
.pl-auth .pl-summary p {
  margin-bottom: 0;
}

.pl-auth .pl-summary p + p {
  margin-top: 0.375rem;
}

.pl-auth .pl-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pl-auth .pl-summary li + li {
  margin-top: 0.25rem;
}

.pl-auth .pl-summary-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  font-weight: 500;
}

/* ---------- Password fields: the show/hide button sits inside the field ---------- */

.pl-auth .pl-password .form-control {
  border-inline-end: 0;
}

/* The field and its button are one box: one border colour on hover (no seam between them), and no hover
   colour at all on a touch screen, where a hover sticks after a tap. */
.pl-auth .pl-password .pl-password-toggle {
  border-inline-start: 0;
}

.pl-auth .pl-password:hover:not(:focus-within) .form-control,
.pl-auth .pl-password:hover:not(:focus-within) .pl-password-toggle {
  border-color: var(--bs-gray-600);
}

@media (hover: none) {
  .pl-auth .pl-password:hover:not(:focus-within) .form-control,
  .pl-auth .pl-password:hover:not(:focus-within) .pl-password-toggle,
  .pl-auth .form-control:hover:not(:focus) {
    border-color: var(--bs-border-color);
  }
}

/* Vuexy draws the group's focus ring with a ::before that covers the whole group; it must not take
   the button's clicks. */
.pl-auth .pl-password::before {
  pointer-events: none;
}

.pl-auth .pl-password-toggle {
  cursor: pointer;
  min-width: 2.75rem;
  justify-content: center;
  color: var(--bs-body-color);
}

@media (hover: hover) {
  .pl-auth .pl-password-toggle:hover {
    color: var(--bs-heading-color);
  }
}

.pl-auth .pl-password-toggle:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
  z-index: 5;
}

/* ---------- Buttons and links ---------- */

.pl-auth .btn {
  min-height: 2.375rem;
}

.pl-auth a:focus-visible,
.pl-auth .btn:focus-visible,
.pl-auth .form-check-input:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* "Remember me" on the left, "Forgot password?" on the right. */
.pl-auth .pl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

/* A checkbox and its words as one label: the whole row ticks it. */
.pl-auth .pl-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
  margin: 0;
  color: var(--bs-heading-color);
  cursor: pointer;
}

.pl-auth .pl-check .form-check-input {
  float: none;
  flex: none;
  margin: 0;
}

.pl-auth .pl-row a,
.pl-auth .pl-alt a,
.pl-auth .pl-note a,
.pl-auth .pl-back {
  display: inline-block;
  padding-block: 0.125rem;
  min-height: 1.5rem;
}

/* The secondary action under the primary button. */
.pl-auth .pl-alt {
  margin: 1.5rem 0 0;
  text-align: center;
}

/* Smaller and muted, below the secondary action. */
.pl-auth .pl-note {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--bs-body-color);
}

.pl-auth .pl-back {
  font-size: 0.9375rem;
}

.pl-auth .pl-back i {
  margin-inline-end: 0.5rem;
  font-size: 0.8125rem;
}

/* ---------- Result pages: round icon, heading, a sentence or two, the next step ---------- */

.pl-auth .pl-result {
  text-align: center;
}

.pl-auth .pl-result p {
  color: var(--bs-body-color);
  margin-bottom: 1.5rem;
}

.pl-auth .pl-result .pl-intro {
  margin-bottom: 0;
}

.pl-auth .pl-result .pl-intro p {
  margin-bottom: 1.5rem;
}

.pl-auth .pl-result .pl-intro p:has(+ p) {
  margin-bottom: 0;
}

.pl-auth .pl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  font-size: 1.375rem;
}

.pl-auth .pl-result .pl-note {
  margin-bottom: 0;
}

/* ---------- Alerts (status messages and model errors) ---------- */

.pl-auth .alert {
  font-size: 0.875rem;
  line-height: 1.45;
}

.pl-auth .alert p:last-child {
  margin-bottom: 0;
}

.pl-auth .pl-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.pl-auth .pl-alert > i {
  margin-top: 0.1875rem;
  flex: none;
}

.pl-auth .pl-alert > div {
  flex: 1;
  min-width: 0;
}

.pl-auth .pl-alert.alert-dismissible {
  padding-inline-end: 3rem;
}

/* ---------- Signed-in footer on the sign-in card ---------- */

.pl-auth .pl-auth-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
  font-size: 0.8125rem;
  color: var(--bs-body-color);
}

.pl-auth .pl-auth-account form {
  margin: 0;
  flex: none;
}

.pl-auth .pl-auth-account .pl-email {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Account pages (Manage) in the main layout ---------- */

.pl-account .pl-manage-head {
  margin-bottom: 1.5rem;
}

.pl-account .pl-manage-head .pl-back {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.pl-account .pl-manage-head .pl-content-title {
  margin-bottom: 0.5rem;
}

/* Who is signed in, on its own line (a long address wraps), and Sign out after it. */
.pl-account .pl-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--bs-body-color);
}

.pl-account .pl-who .pl-email {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

/* The address in two parts (before the @, and from it): each moves to the next line whole, and only one
   longer than the line wraps inside. */
.pl-account .pl-who .pl-email-part {
  display: inline-block;
  max-width: 100%;
}

.pl-account .pl-who form {
  margin: 0;
  flex: none;
}

.pl-account .pl-manage {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.pl-account .pl-acc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pl-account .pl-acc-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.875rem;
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.pl-account .pl-acc-nav a i {
  width: 1rem;
  text-align: center;
  color: var(--bs-body-color);
}

@media (hover: hover) {
  .pl-account .pl-acc-nav a:hover {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) 92%, var(--bs-primary));
    color: var(--bs-heading-color);
  }
}

.pl-account .pl-acc-nav a.active,
.pl-account .pl-acc-nav a.active:hover {
  background-color: var(--pl-primary-fill);
  color: var(--pl-primary-ink);
}

.pl-account .pl-acc-nav a.active i {
  color: inherit;
}

.pl-account .pl-acc-nav a:focus-visible {
  outline: 2px solid var(--pl-accent-line, var(--bs-primary));
  outline-offset: 2px;
}

.pl-account .pl-manage-body {
  min-width: 0;
}

.pl-account .pl-manage-body > .pl-intro {
  margin-bottom: 1.5rem;
}

/* A comfortable width for forms and text in the content column. */
.pl-auth .pl-form {
  max-width: 28rem;
}

.pl-auth .pl-text {
  max-width: 38rem;
}

.pl-auth .pl-section + .pl-section {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--bs-border-color);
}

.pl-auth .pl-section > p {
  color: var(--bs-body-color);
  margin-bottom: 1rem;
  max-width: 38rem;
}

.pl-auth .pl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.pl-auth .pl-actions form {
  margin: 0;
}

.pl-auth .pl-actions a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

/* Two-step status line and the verified badge on the email page. */
.pl-auth .pl-state {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

/* Authenticator setup: numbered steps; the app link, the key and the QR code. */
.pl-auth .pl-steps {
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 40rem;
}

.pl-auth .pl-steps > li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 2.75rem;
  padding-bottom: 1.5rem;
}

.pl-auth .pl-steps > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: -0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-primary));
  color: var(--pl-link);
}

.pl-auth .pl-steps > li:last-child {
  padding-bottom: 0;
}

.pl-auth .pl-steps p {
  margin-bottom: 0.75rem;
}

/* Step 1's apps, one per line, with their store links. */
.pl-auth .pl-app-links {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

/* On a phone: the link to the app on this phone, then the key, then the QR code (for another device).
   On a wide screen the QR code comes first. */
.pl-auth .pl-setup {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pl-auth .pl-setup p {
  margin-bottom: 0;
}

.pl-auth .pl-setup-link .btn {
  width: 100%;
  max-width: 24rem;
}

.pl-auth .pl-on-wide {
  display: none;
}

/* "Add to my authenticator app" opens the app on this device: a computer with a mouse has none, so there
   the key and the QR code are enough. */
@media (pointer: fine) and (min-width: 768px) {
  .pl-auth .pl-setup-link {
    display: none;
  }
}

@media (min-width: 768px) {
  .pl-auth .pl-setup-qr,
  .pl-auth .pl-setup > .pl-qr {
    order: -1;
  }

  .pl-auth .pl-on-wide {
    display: inline;
  }

  .pl-auth .pl-on-narrow {
    display: none;
  }
}

/* The QR code keeps a light quiet zone in both themes so authenticator apps can read it. */
.pl-auth #qrCode {
  line-height: 0;
}

.pl-auth #qrCode img,
.pl-auth #qrCode canvas {
  display: inline-block;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
}

.pl-auth .pl-key {
  min-width: 0;
}

.pl-auth .pl-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.25rem 0;
}

.pl-auth .pl-key code {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
  color: var(--bs-heading-color);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  word-break: break-word;
  user-select: all;
}

.pl-auth .pl-copy.is-copied {
  --bs-btn-color: var(--pl-success-text);
  --bs-btn-border-color: var(--pl-success-text);
}

/* Recovery codes: a tidy monospace grid, then Copy and Download. */
.pl-auth .pl-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 24rem;
  margin: 0 0 1rem;
  padding: 1rem;
  list-style: none;
  border-radius: var(--bs-border-radius);
  border: 1px dashed var(--bs-border-color);
  background-color: var(--bs-body-bg);
}

.pl-auth .pl-codes code {
  display: block;
  text-align: center;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  color: var(--bs-heading-color);
  user-select: all;
}

.pl-auth .pl-code-actions {
  margin-bottom: 1rem;
}

.pl-auth .pl-code-actions:not(:has(.btn:not([hidden]))) {
  display: none;
}

/* Comfortable targets: an alert's close button. Vuexy draws its × as a mask the size of the whole button
   (mask-size 100%), so a bigger button would draw a bigger ×: the mask keeps the glyph's own size. */
.pl-auth .alert-dismissible .btn-close {
  box-sizing: content-box;
  padding: 0.375rem;
  -webkit-mask-size: 0.8125rem 0.8125rem;
  mask-size: 0.8125rem 0.8125rem;
  -webkit-mask-position: center;
  mask-position: center;
}

@media (max-width: 767.98px) {
  .pl-account .pl-manage-head {
    margin-bottom: 1rem;
  }

  .pl-account .pl-manage {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  /* The sections as one row of pills in a rounded box that scrolls sideways (the current one is scrolled
     into view: js/auth-forms.js). */
  .pl-account .pl-manage > nav {
    overflow-x: auto;
    padding: 3px;
    border: 1px solid var(--bs-border-color);
    border-radius: calc(var(--bs-border-radius) + 3px);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .pl-account .pl-manage > nav::-webkit-scrollbar {
    display: none;
  }

  /* An edge with more of the row beyond it fades out, so the row reads as one to scroll (js/auth-forms.js
     marks the edges). */
  .pl-account .pl-manage > nav {
    --pl-fade-before: #000;
    --pl-fade-after: #000;
    -webkit-mask-image: linear-gradient(to right, var(--pl-fade-before), #000 1rem, #000 calc(100% - 1rem), var(--pl-fade-after));
    mask-image: linear-gradient(to right, var(--pl-fade-before), #000 1rem, #000 calc(100% - 1rem), var(--pl-fade-after));
  }

  .pl-account .pl-manage > nav.pl-more-before {
    --pl-fade-before: transparent;
  }

  .pl-account .pl-manage > nav.pl-more-after {
    --pl-fade-after: transparent;
  }

  .pl-account .pl-acc-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.25rem;
    width: max-content;
  }

  .pl-account .pl-acc-nav a {
    min-height: 2.5rem;
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
  }

  /* Actions are full-width buttons, one under another; "Cancel" is centred under them. */
  .pl-account .pl-manage-body .btn:not(.pl-password-toggle):not(.btn-link):not(.btn-close),
  .pl-account .pl-actions,
  .pl-account .pl-actions form {
    width: 100%;
  }

  .pl-account .pl-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pl-account .pl-actions a:not(.btn) {
    justify-content: center;
  }

  .pl-auth .pl-setup-link .btn {
    max-width: none;
  }

  /* Who is signed in, and Sign out beside the address as a quiet link-style button (still a form's button,
     so it works without JavaScript). */
  .pl-account .pl-who {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .pl-account .pl-who .pl-sign-out {
    --bs-btn-color: var(--pl-link);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--bs-heading-color);
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--bs-heading-color);
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    padding-inline: 0.5rem;
    margin-inline-end: -0.5rem;
    font-weight: 500;
    box-shadow: none;
  }

  .pl-account .pl-who .pl-sign-out i {
    margin-inline-end: 0.375rem !important;
  }
}

/* ---------- Touch screens: 44px targets, and 16px fields (iOS zooms into a smaller one) ---------- */

@media (pointer: coarse) {
  .pl-auth .form-control {
    min-height: 2.75rem;
    font-size: max(16px, 1em);
  }

  .pl-auth .btn:not(.btn-link) {
    min-height: 2.75rem;
  }

  .pl-auth .btn-link {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
  }

  .pl-auth .pl-password-toggle {
    min-width: 2.75rem;
  }

  .pl-auth .pl-check {
    min-height: 2.75rem;
  }

  .pl-auth .pl-check .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }

  .pl-auth .pl-row a,
  .pl-auth .pl-alt a,
  .pl-auth .pl-note a,
  .pl-auth .pl-back,
  .pl-auth .pl-summary-link,
  .pl-auth .pl-actions a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding-block: 0;
  }

  /* A row of text links sits closer, so the taller links do not spread the page. */
  .pl-auth .pl-alt {
    margin-top: 1rem;
  }

  .pl-auth .pl-note {
    margin-top: 0;
  }

  .pl-auth .pl-row {
    margin-bottom: 1rem;
  }

  .pl-account .pl-acc-nav a {
    min-height: 2.75rem;
  }

  /* A link inside a sentence on the account pages: a 44px tall target (and a little wider) from padding,
     which an inline element does not lay out, so the text and its lines stay where they are. */
  .pl-account .pl-manage-body :is(p, .pl-hint) a:not(.btn) {
    padding-block: 0.9375rem;
    padding-inline: 0.375rem;
    margin-inline: -0.375rem;
  }

  /* The app store links (short words, one app per line): 44px boxes, the lines 44px apart. */
  .pl-auth .pl-app-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    vertical-align: middle;
  }

  .pl-auth .alert-dismissible .btn-close {
    box-sizing: border-box;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    margin: 0;
    top: 0.125rem;
    right: 0.125rem;
  }
}

/* A button whose form is on its way (js/auth-forms.js, data-sent): its label gives way to a spinner of the
   same size, so the button keeps its width; a second tap does nothing. Still, when motion is reduced. */
.pl-auth .btn[data-sent] {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.pl-auth .btn[data-sent]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pl-spin 0.75s linear infinite;
}

.pl-auth .btn-outline-primary[data-sent]::after,
.pl-auth .btn-outline-secondary[data-sent]::after,
.pl-auth .btn-outline-danger[data-sent]::after {
  border-color: currentColor transparent currentColor currentColor;
  color: var(--bs-body-color);
}

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

@media (prefers-reduced-motion: reduce) {
  .pl-auth .btn[data-sent]::after {
    animation: none;
  }
}
