/* =====================================================================
   Folio skin: sign-in. One sign-in card for every sign-in surface:
   /login/ (onboarding_v3/login.html), the v4 sign-in dialogs
   (onboarding_v4/partials/sign_in_modal.html, app_sign_in.html), the
   2FA / magic-link / password pages, MCP login and consent, the OAuth
   callback pages and the tenant viewer login.

   Loaded with <html class="folio folio-auth"> (folio_app="auth"), or on
   top of another skin by folio/_auth_skin.html. Every rule is scoped to
   html.folio, so the default UI never changes.

   Markup contract (classes sit beside the page's own classes):
     .fa-page        full-page paper background that centres the card
     .fa-scrim       the overlay behind a sign-in dialog
     .fa-card        the card: binding column + main column
       folio/_auth_binding.html   the binding column (first child)
       .fa-main      the form column
         .fa-logo    the page's own logo, hidden (the binding carries it)
         .fa-head > .fa-title + .fa-sub
         .fa-label  .fa-input  .fa-code (6-digit code)  .fa-turnstile
         .fa-primary (ember, one per view)  .fa-secondary (Google,
         LinkedIn, SSO)  .fa-dark (a second strong action)  .fa-or
         .fa-msg + --ok / --err / --info   .fa-chip (email + Change)
         .fa-meta (resend row)  .fa-link  .fa-back  .fa-choice
         .fa-lang (interface language)  .fa-foot  .fa-legal  .fa-close
   ===================================================================== */

/* ---------- 1. Page ---------- */
html.folio .fa-page {
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-ui);
  overflow-x: hidden;
}
/* Paper grain: the only texture in Folio (folio.css body::after). */
html.folio .fa-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  /* Some pages paint an aurora on body::before: reset everything it sets. */
  filter: none; animation: none; -webkit-mask-image: none; mask-image: none;
  background-size: auto; background-position: 0 0; background-repeat: repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html.folio .fa-page .aurora-effect,
html.folio .fa-page .aurora { display: none !important; }
html.folio body.fa-page { min-height: 100vh; box-sizing: border-box; }
/* Whatever wraps the card on the page spans the page, so the card keeps its own width. */
html.folio .fa-page > :not(.fa-card):not(script):not(style):not(input):not(template) { width: 100%; max-width: none; display: flex; flex-direction: column; align-items: center; height: auto; }
/* Layout wrappers of older pages (users/otp.html) step out of the way. */
html.folio .fa-page .fa-shell { display: block; width: 100%; max-width: none; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
html.folio .fa-page .fa-shell:empty { display: none; }
html.folio .fa-page .fa-hide { display: none !important; }
/* The sign-in pages' own wrapper backgrounds give way to the paper. */
html.folio.folio-auth body { background: var(--paper); }

/* ---------- 2. Dialog overlay ---------- */
html.folio .fa-scrim {
  background: rgba(29, 25, 21, .42) !important;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* A sign-in dialog with nothing behind it (the v4 dashboard before sign-in) sits on the paper, like /login/. */
html.folio .fa-scrim--page {
  background: var(--paper) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html.folio .fa-scrim--page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 3. The card ---------- */
html.folio .fa-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  overflow: clip; /* clip, not hidden: the binding's brand and bookcase stay sticky on tall cards */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-align: left;
  font: var(--t-body);
  font-size: 14px;
}
html.folio .fa-card *,
html.folio .fa-card *::before,
html.folio .fa-card *::after { box-sizing: border-box; }

/* ---------- 4. Binding column (folio/_auth_binding.html) ---------- */
html.folio .fa-card .fa-binding {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 26px 0 0;
  background: var(--binding);
  color: var(--binding-text);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
  overflow: hidden;
  overflow: clip;
}
/* The stitched edge of the binding (folio.css .rail::before). */
html.folio .fa-card .fa-binding::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: 7px;
  border-right: 1px dashed rgba(255, 255, 255, .07);
}
html.folio .fa-card .fa-binding__brand {
  position: sticky; top: 26px; z-index: 2;
  display: flex; align-items: center; gap: 10px; padding: 0 24px;
}
/* docsie_orange.svg is a wide canvas with the mark in the middle: crop to the mark. Logo orange stays logo-only. */
html.folio .fa-card .fa-binding__brand img {
  width: 28px; height: 28px; object-fit: cover; object-position: center; flex: none; display: block;
}
/* A customer's own logo (tenant / secure portal sign-in) sits on a white tile so any logo reads on the binding. */
html.folio .fa-card .fa-binding__brand img.fa-binding__logo {
  width: auto; height: 36px; max-width: 170px; padding: 5px 8px; object-fit: contain;
  background: var(--surface); border-radius: var(--r-md);
}
html.folio .fa-card .fa-binding__brand span {
  font: 600 20px/1.15 var(--f-display); letter-spacing: -.01em; color: var(--paper);
}
/* A small bookcase: two shelves of spines (folio.css .spine), the dog as the bookend. */
html.folio .fa-card .fa-case {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: auto;
  padding: 36px 0 16px;
  /* On a card taller than the window the bookcase stays in view. */
  position: sticky;
  bottom: 0;
}
html.folio .fa-card .fa-shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 20px 7px 24px;
}
/* The plank */
html.folio .fa-card .fa-shelf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: var(--binding-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .11), 0 6px 10px -4px rgba(0, 0, 0, .65);
}
html.folio .fa-card .fa-spine {
  position: relative;
  z-index: 1;
  flex: none;
  width: var(--w, 22px);
  height: var(--h, 110px);
  background: var(--c, var(--sp-ink));
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, .18), inset 2px 0 0 rgba(255, 255, 255, .10);
}
html.folio .fa-card .fa-spine::before,
html.folio .fa-card .fa-spine::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 2px;
  border-top: 1px solid rgba(255, 255, 255, .32);
  border-bottom: 1px solid rgba(255, 255, 255, .32);
}
html.folio .fa-card .fa-spine::before { top: 7px; }
html.folio .fa-card .fa-spine::after { bottom: 16px; }
/* Hatched = never published (folio.css .spine.draft) */
html.folio .fa-card .fa-spine--draft { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 80%, #fff) 5px 10px); }
/* A leaning book ends a row */
html.folio .fa-card .fa-spine--lean { transform: rotate(9deg); transform-origin: bottom left; margin-right: 16px; }
html.folio .fa-card .fa-dog {
  position: relative;
  z-index: 1;
  flex: none;
  width: 60px;
  height: 60px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--surface) 50% 40% / 96% no-repeat;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 3px var(--binding), 0 8px 18px -8px rgba(0, 0, 0, .7);
}

/* ---------- 5. Main column ---------- */
html.folio .fa-card .fa-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 40px 44px 30px;
  background: var(--surface);
}
html.folio .fa-card .fa-logo { display: none !important; }
html.folio .fa-card .fa-head { margin: 0 0 26px; text-align: left; }
/* A second view in the same card (the SSO form) brings its own heading: the page heading steps aside. */
html.folio .fa-card .fa-main:has(> .fa-sso:not([style*="none"]):not([x-cloak])) > .fa-head { display: none; }
html.folio .fa-card .fa-sso > .fa-head { margin-bottom: 4px; }
html.folio .fa-card .fa-title {
  margin: 0;
  font: 600 28px/1.15 var(--f-display);
  letter-spacing: -.02em;
  color: var(--ink);
  text-align: left;
}
html.folio .fa-card .fa-sub {
  margin: 8px 0 0;
  font: 400 14px/1.5 var(--f-ui);
  color: var(--ink-2);
  text-align: left;
}
html.folio .fa-card .fa-sub--last { margin-bottom: 24px; }
/* Body copy inside the card */
html.folio .fa-card .fa-text,
html.folio .fa-card .fa-text p { margin: 0 0 12px; font: 400 13.5px/1.5 var(--f-ui); color: var(--ink-2); text-align: left; }
html.folio .fa-card .fa-mono { font: var(--t-mono); color: var(--ink-2); }
/* Headings that come from a child template's block (oauth2/base.html) */
html.folio .fa-card .fa-head h1,
html.folio .fa-card .fa-head h2 { margin: 0; font: 600 28px/1.15 var(--f-display); letter-spacing: -.02em; color: var(--ink); text-align: left; }
html.folio .fa-card .fa-head p { margin: 8px 0 0; font: 400 14px/1.5 var(--f-ui); color: var(--ink-2); }
html.folio .fa-card .fa-sub strong,
html.folio .fa-card .fa-sub b { color: var(--ink); font-weight: 600; }

/* Fields */
html.folio .fa-card .fa-label,
html.folio .fa-card .fa-field > label {
  display: block;
  margin: 0 0 6px;
  font: 600 12.5px/1.3 var(--f-ui);
  color: var(--ink);
  text-align: left;
}
html.folio .fa-card .fa-input {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: 400 14px/1.2 var(--f-ui);
  letter-spacing: 0;
  text-align: left;
  box-shadow: 0 1px 0 rgba(40, 25, 10, .03);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
/* Older pages style this field inline: Folio wins only where it is on. */
html.folio .fa-card .fa-input--inline { width: 100% !important; height: 52px !important; padding: 0 0 0 .55em !important; border: 1px solid var(--line-2) !important; background-color: var(--surface) !important; text-align: center !important; }
html.folio .fa-card .fa-input--inline:focus { border-color: var(--ember) !important; }
html.folio .fa-card .fa-input::placeholder { color: var(--faint); opacity: 1; }
html.folio .fa-card .fa-input:hover { border-color: var(--faint); }
html.folio .fa-card .fa-input:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}
/* The 6-digit code: a code, so JetBrains Mono, spaced like a key. */
html.folio .fa-card .fa-code {
  height: 52px;
  padding: 0 0 0 .55em;
  font: 500 22px/1 var(--f-mono);
  letter-spacing: .55em;
  text-align: center;
}
html.folio .fa-card .fa-code::placeholder { color: var(--line-2); letter-spacing: .55em; }
html.folio .fa-card .fa-hint { margin-top: 6px; font: 400 12px/1.45 var(--f-ui); color: var(--muted); text-align: left; }
html.folio .fa-card .fa-turnstile { display: flex; justify-content: flex-start; }
html.folio .fa-card .fa-turnstile:empty { display: none; }

/* Buttons */
html.folio .fa-card .fa-primary,
html.folio .fa-card .fa-dark,
html.folio .fa-card .fa-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  margin-left: 0;
  margin-right: 0;
  padding: 0 16px;
  border-radius: var(--r-md);
  font: 600 14px/1 var(--f-ui);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
html.folio .fa-card .fa-primary {
  border: 1px solid var(--ember);
  background: var(--ember);
  color: #fff;
  box-shadow: 0 1px 0 var(--ember-ink), 0 6px 14px -8px rgba(228, 83, 44, .8);
}
html.folio .fa-card .fa-primary:hover { background: color-mix(in srgb, var(--ember) 90%, var(--ink)); border-color: color-mix(in srgb, var(--ember) 90%, var(--ink)); box-shadow: 0 1px 0 var(--ember-ink), 0 8px 16px -8px rgba(228, 83, 44, .8); }
html.folio .fa-card .fa-primary:active { transform: translateY(1px); }
html.folio .fa-card .fa-primary:disabled,
html.folio .fa-card .fa-primary[disabled] { opacity: .55; cursor: default; box-shadow: none; transform: none; }
html.folio .fa-card .fa-dark {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}
html.folio .fa-card .fa-dark:hover { background: var(--binding-2); border-color: var(--binding-2); }
html.folio .fa-card .fa-secondary {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  box-shadow: 0 1px 0 rgba(40, 25, 10, .04);
}
html.folio .fa-card .fa-secondary:hover { border-color: var(--faint); background: var(--paper); }
html.folio .fa-card .fa-secondary svg { width: 18px; height: 18px; flex: none; }
html.folio .fa-card .fa-primary svg { width: 18px; height: 18px; }
/* Enterprise SSO: a lock (Folio icon set, 1.75 stroke) instead of the trailing arrow. */
html.folio .fa-card .fa-secondary--sso > span { display: none; }
html.folio .fa-card .fa-secondary--sso::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='4.5' y='10.5' width='15' height='10' rx='2'/><path d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='4.5' y='10.5' width='15' height='10' rx='2'/><path d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/></svg>") center / contain no-repeat;
}

/* "or" divider */
html.folio .fa-card .fa-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; padding: 0; position: relative; }
html.folio .fa-card .fa-or > .h-px,
html.folio .fa-card .fa-or .border-t { background: var(--line); border-color: var(--line); }
html.folio .fa-card .fa-or span {
  padding: 0;
  background: var(--surface);
  font: var(--t-overline);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
/* The v4 dialog divider is an absolutely-placed rule behind a label. */
html.folio .fa-card .fa-or > .absolute { position: static; flex: 1; }
html.folio .fa-card .fa-or.fa-or--rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Links and small text actions */
html.folio .fa-card .fa-link,
html.folio .fa-card a.fa-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ember-ink);
  font: 600 12.5px/1.4 var(--f-ui);
  text-decoration: none;
  cursor: pointer;
}
html.folio .fa-card .fa-link:hover { text-decoration: underline; text-underline-offset: 2px; }
html.folio .fa-card .fa-link--block { display: block; width: auto; margin: 14px 0 0; text-align: left; }
html.folio .fa-card .fa-link:disabled { color: var(--muted); text-decoration: none; cursor: default; opacity: 1; }
html.folio .fa-card .fa-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 400 12px/1.4 var(--f-ui); color: var(--muted);
}
html.folio .fa-card .fa-meta > span:last-child:not(:first-child) { font: var(--t-mono); color: var(--muted); }
html.folio .fa-card .fa-back {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  margin: -6px 0 18px; padding: 4px 8px 4px 4px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); font: 500 13px/1 var(--f-ui); cursor: pointer;
}
html.folio .fa-card .fa-back:hover { background: var(--sunk); color: var(--ink); }
html.folio .fa-card .fa-back svg { width: 15px; height: 15px; }

/* The address a code went to, with its Change action */
html.folio .fa-card .fa-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2); color: var(--ink-2); font: 500 13px/1.3 var(--f-ui);
}
html.folio .fa-card .fa-chip svg { color: var(--muted); }
html.folio .fa-card .fa-chip--note { display: block; margin-bottom: 10px; text-align: left; line-height: 1.5; }
html.folio .fa-card .fa-chip--note strong { color: var(--ink); font-weight: 600; }

/* Status messages: always words, never colour alone */
html.folio .fa-card .fa-msg {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 400 13px/1.45 var(--f-ui);
  text-align: left;
}
/* !important: some pages colour these lines inline. */
html.folio .fa-card .fa-msg--ok { background: var(--live-wash) !important; border-color: color-mix(in srgb, var(--live) 22%, var(--live-wash)); color: var(--live) !important; }
html.folio .fa-card .fa-msg--err { background: var(--danger-wash) !important; border-color: color-mix(in srgb, var(--danger) 20%, var(--danger-wash)); color: var(--danger) !important; }
html.folio .fa-card .fa-msg--info { background: var(--paper-2) !important; border-color: var(--line); color: var(--ink-2) !important; }
html.folio .fa-card .fa-msg--warn { background: var(--draft-wash); border-color: color-mix(in srgb, var(--draft) 22%, var(--draft-wash)); color: color-mix(in srgb, var(--draft) 70%, var(--ink)); }
html.folio .fa-card .fa-msg p,
html.folio .fa-card .fa-msg strong,
html.folio .fa-card .fa-msg .font-semibold { color: inherit; }
html.folio .fa-card .fa-msg .fa-dark,
html.folio .fa-card .fa-msg .fa-primary { margin-top: 10px; }

/* Choice rows (SSO organisations, MCP organisations and workspaces) */
html.folio .fa-card .fa-choice {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: 600 13.5px/1.3 var(--f-ui); text-align: left;
  cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast);
}
html.folio .fa-card .fa-choice:hover { border-color: var(--faint); background: var(--paper); }
html.folio .fa-card .fa-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
html.folio .fa-card .fa-choice input[type="radio"],
html.folio .fa-card .fa-choice input[type="checkbox"] { accent-color: var(--ink); margin: 0; }
html.folio .fa-card .fa-choice .fa-choice__meta { margin-left: auto; font: var(--t-mono); color: var(--muted); font-weight: 400; }
html.folio .fa-card .fa-choice .fa-choice__text { display: block; }
html.folio .fa-card .fa-choice .fa-choice__text > span { display: block; margin-top: 2px; font: 400 12px/1.4 var(--f-ui); color: var(--muted); }

/* Step progress (tenant viewer login) */
html.folio .fa-card .fa-steps { margin-bottom: 20px; }
html.folio .fa-card .fa-steps .step-indicator { height: 3px; border-radius: 2px; background: var(--line); }
html.folio .fa-card .fa-steps .step-indicator.active { background: var(--ink); }
html.folio .fa-card .fa-steps .fa-mono { font: var(--t-mono); color: var(--muted); }

/* Six single-digit boxes (tenant viewer login): a code, so JetBrains Mono */
html.folio .fa-card .fa-digits { justify-content: flex-start; gap: 8px; }
html.folio .fa-card .fa-digits > * + * { margin-left: 0 !important; }
html.folio .fa-card .fa-digit {
  width: 44px; height: 52px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: 500 22px/1 var(--f-mono); text-align: center;
  box-shadow: 0 1px 0 rgba(40, 25, 10, .03); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
html.folio .fa-card .fa-digit:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--focus); outline: none; }
html.folio .fa-card .fa-digit.error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-wash); }

/* A single checkbox row (remember me) */
html.folio .fa-card .fa-check { gap: 8px; font: 400 13px/1.4 var(--f-ui); color: var(--ink-2); }
html.folio .fa-card .fa-check input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
html.folio .fa-card .fa-check label { color: var(--ink-2); font-size: 13px; }

/* Working… */
html.folio .fa-card .fa-spin-row { justify-content: flex-start; }
html.folio .fa-card .fa-spin { border-color: var(--line-2); border-bottom-color: var(--ink); }

/* A list of choice rows */
html.folio .fa-card .fa-choice-list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
html.folio .fa-card .fa-choice-list > li { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
html.folio .fa-card .fa-choice--check { align-items: flex-start; }
html.folio .fa-card .fa-choice--check input { margin-top: 2px; }
html.folio .fa-card .fa-choice--check strong { display: block; font: 600 13.5px/1.3 var(--f-ui); color: var(--ink); }

/* A quiet panel (the app asking for access, the permissions it asks for) */
html.folio .fa-card .fa-panel {
  margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2); color: var(--ink-2); font: 400 13px/1.45 var(--f-ui);
}
html.folio .fa-card .fa-panel ul { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font: 400 13.5px/1.45 var(--f-ui); }
html.folio .fa-card .fa-panel li { margin: 0; padding: 3px 0 3px 16px; position: relative; }
html.folio .fa-card .fa-panel li::before { content: ""; position: absolute; left: 3px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
html.folio .fa-card .fa-panel .fa-choice { background: var(--surface); }
html.folio .fa-card .fa-panel .fa-choice-list { margin-bottom: 0; }
html.folio .fa-card .fa-panel__title { font: var(--t-overline); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
html.folio .fa-card .fa-panel__name { font: 600 14px/1.3 var(--f-ui); color: var(--ink); word-break: break-word; }
html.folio .fa-card .fa-panel__meta { margin-top: 2px; font: var(--t-mono); color: var(--muted); word-break: break-all; }

/* Plain Django forms ({{ form }}) inside the card */
html.folio .fa-card .fa-form label { display: block; margin: 0 0 6px; font: 600 12.5px/1.3 var(--f-ui); color: var(--ink); }
html.folio .fa-card .fa-form input[type="text"],
html.folio .fa-card .fa-form input[type="email"],
html.folio .fa-card .fa-form input[type="password"] {
  display: block; width: 100%; height: 40px; margin: 0 0 14px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface);
  color: var(--ink); font: 400 14px/1.2 var(--f-ui); outline: none;
}
html.folio .fa-card .fa-form input:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--focus); }
html.folio .fa-card .fa-form input[type="submit"] {
  width: 100%; height: 40px; border: 1px solid var(--ember); border-radius: var(--r-md); background: var(--ember);
  color: #fff; font: 600 14px/1 var(--f-ui); cursor: pointer;
  box-shadow: 0 1px 0 var(--ember-ink), 0 6px 14px -8px rgba(228, 83, 44, .8);
}
/* A large page icon (the success tick) shrinks to a quiet mark above the title */
html.folio .fa-card .fa-icon { display: block; margin: 0 0 14px; text-align: left; }
html.folio .fa-card .fa-icon svg { width: 40px !important; height: 40px !important; }

/* Section label inside the card (MCP permissions) */
html.folio .fa-card .fa-overline { margin: 0 0 8px; font: var(--t-overline); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Interface language (v4): a quiet row at the foot of the card */
html.folio .fa-card .fa-lang { order: 90; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
html.folio .fa-card .fa-lang > div { margin: 0; }
html.folio .fa-card .fa-lang label { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; font: 400 12.5px/1.3 var(--f-ui); color: var(--muted); }
html.folio .fa-card .fa-lang label svg { color: var(--muted); }
html.folio .fa-card .fa-lang label > span { white-space: nowrap; }
html.folio .fa-card .fa-lang select {
  width: auto; min-width: 0; margin-left: auto; height: 30px; padding: 0 28px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background-color: var(--surface);
  color: var(--ink); font: 500 12.5px/1 var(--f-ui); box-shadow: none;
}
html.folio .fa-card .fa-lang select:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--focus); outline: none; }
html.folio .fa-card .fa-lang p { font-size: 11.5px; color: var(--draft); }

/* Footer: account switch and legal */
html.folio .fa-card .fa-foot {
  order: 80;
  margin: 26px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font: 400 12.5px/1.5 var(--f-ui);
  color: var(--muted);
  text-align: left;
}
html.folio .fa-card .fa-foot p { margin: 0; }
html.folio .fa-card .fa-legal { display: flex; gap: 14px; margin-top: 6px !important; font-size: 11.5px; }
html.folio .fa-card .fa-legal a { color: var(--muted); text-decoration: none; }
html.folio .fa-card .fa-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
html.folio .fa-card .fa-legal > span { display: none; }

/* Dialog close */
html.folio .fa-card .fa-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted);
  font: 400 20px/1 var(--f-ui); cursor: pointer;
}
html.folio .fa-card .fa-close:hover { background: var(--sunk); color: var(--ink); }

/* Keyboard focus, Folio style */
html.folio .fa-card a:focus-visible,
html.folio .fa-card button:focus-visible,
html.folio .fa-card select:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

/* ---------- 6. Spacing inside the main column ---------- */
/* Pages bring their own Tailwind spacing (space-y-*); these keep one rhythm across them. */
html.folio .fa-card .fa-stack > * + * { margin-top: 14px; }
html.folio .fa-card .fa-main form + .fa-msg,
html.folio .fa-card .fa-main .fa-msg + .fa-msg { margin-top: 12px; }

/* A hidden first child (an empty error line) must not push the rest down via space-y. */
html.folio .fa-card [style*="display: none"]:first-child + * { margin-top: 0; }
html.folio .fa-card .fa-msg svg { color: var(--muted); }

/* ---------- 7. Narrow screens: the binding becomes a band on top ---------- */
@media (max-width: 720px) {
  html.folio .fa-page { padding: 24px 16px; justify-content: flex-start; }
  html.folio .fa-card { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  html.folio .fa-card .fa-binding { flex-direction: row; align-items: center; min-height: 0; padding: 12px 16px 12px 20px; }
  html.folio .fa-card .fa-binding::before { display: none; }
  html.folio .fa-card .fa-case { margin: 0 0 0 auto; padding: 0; }
  html.folio .fa-card .fa-shelf { padding: 0; }
  html.folio .fa-card .fa-shelf--top,
  html.folio .fa-card .fa-shelf::after,
  html.folio .fa-card .fa-spine { display: none; }
  html.folio .fa-card .fa-dog { width: 36px; height: 36px; transform: none; box-shadow: none; }
  html.folio .fa-card .fa-main { padding: 28px 22px 22px; }
  html.folio .fa-card .fa-title { font-size: 24px; }
}
