:root {
  --color-bg: #f3f4f6;
  --color-surface: #ffffff;
  --color-text: #111827;
  /* #6b7280 was 4.39:1 against --color-bg, just under WCAG AA's 4.5:1 -
     darkened slightly to clear it (5.4:1) without a visible color shift. */
  --color-text-muted: #5b6472;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-border: #d1d5db;
  /* Form-field outlines: --color-border is only ~1.3:1 against the field
     fill, under WCAG 1.4.11's 3:1 for control boundaries. This is
     3.1:1 on --color-bg and 3.4:1 on --color-surface. */
  --color-field-border: #858b95;
  --color-error-bg: #fef2f2;
  --color-error-text: #991b1b;
  --color-error-border: #fecaca;
  --color-success-bg: #f0fdf4;
  --color-success-text: #166534;
  --color-success-border: #bbf7d0;
  --color-warning-bg: #fffbeb;
  --color-warning-text: #92400e;
  --color-warning-border: #fcd34d;
  /* Field-state borders need 3:1 against the field (WCAG 1.4.11) - the
     *-border tokens above are tuned for tinted alert boxes and only reach
     ~1.2:1 as an input outline. */
  --color-success-strong: #15803d;
  --color-error-strong: #dc2626;
  --color-neutral-bg: #f3f4f6;
  --color-neutral-text: #4b5563;
  --color-primary-bg: #eff6ff;

  /* Dedicated token for white-text-on-solid-primary surfaces (buttons,
     the "Admin" badge) - kept separate from --color-primary because that
     one is tuned for use as a BACKGROUND against white/light foregrounds,
     while --color-primary-hover is tuned for use as TEXT against a light
     surface - neither alone gives enough contrast for a white-text pill
     in dark mode (see the dark-mode override below). */
  --color-primary-solid-bg: var(--color-primary);
  --color-primary-solid-bg-hover: var(--color-primary-hover);

  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Inter (self-hosted, app/assets/fonts - CSP allows fonts from self only),
     falling back to the platform UI font while it loads (font-display: swap). */
  --font-sans: "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode: follows the OS/browser preference by default. A visitor can
   override that with the header's light/dark toggle (form_validation.js's
   initThemeToggle sets data-theme on <html> and remembers it in
   localStorage) - the `:not([data-theme="light"])` guard below is what
   lets that override win even while the OS itself is in dark mode. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-border: #334155;
    --color-field-border: #64748b; /* 3.7:1 on the field, 3.1:1 on the card */
    --color-error-bg: #450a0a;
    --color-error-text: #fca5a5;
    --color-error-border: #7f1d1d;
    --color-success-bg: #052e16;
    --color-success-text: #86efac;
    --color-success-border: #166534;
    --color-warning-bg: #451a03;
    --color-warning-text: #fcd34d;
    --color-warning-border: #92400e;
    --color-success-strong: #4ade80;
    --color-error-strong: #f87171;
    --color-neutral-bg: #334155;
    --color-neutral-text: #cbd5e1;
    --color-primary-bg: #1e3a5f;
    /* See the equivalent comment in :root[data-theme="dark"] above. */
    --color-primary-solid-bg: #1d4ed8;
    --color-primary-solid-bg-hover: #1e40af;
  }
}

/* Explicit dark override (toggle switched on while the OS is in light
   mode) - same variables/rules as the media query above, just not gated
   on prefers-color-scheme. */
:root[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-border: #334155;
  --color-field-border: #64748b;
  --color-error-bg: #450a0a;
  --color-error-text: #fca5a5;
  --color-error-border: #7f1d1d;
  --color-success-bg: #052e16;
  --color-success-text: #86efac;
  --color-success-border: #166534;
  --color-warning-bg: #451a03;
  --color-warning-text: #fcd34d;
  --color-warning-border: #92400e;
  --color-success-strong: #4ade80;
  --color-error-strong: #f87171;
  --color-neutral-bg: #334155;
  --color-neutral-text: #cbd5e1;
  --color-primary-bg: #1e3a5f;
  /* #3b82f6 (--color-primary) only gives white text ~3.7:1 here, under
     WCAG AA's 4.5:1 - a dedicated darker shade for solid-background +
     white-text surfaces (buttons, badges) clears it with margin (~6.7:1)
     without affecting --color-primary's other (background-for-tints,
     etc.) uses. */
  --color-primary-solid-bg: #1d4ed8;
  --color-primary-solid-bg-hover: #1e40af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* A visually-hidden link that appears on keyboard focus, letting a
   keyboard/screen-reader user jump straight past the header's nav to the
   page's actual content instead of tabbing through it every time. */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  /* solid-bg, not --color-primary: white on #3b82f6 (dark mode) is only
     ~3.7:1. */
  background: var(--color-primary-solid-bg);
  color: #ffffff;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Soft, slowly-drifting gradient-blob animation - used by the login
   page's split-screen branding panel (.split-page__panel::before/::after
   below). GPU-friendly (transform/opacity), disabled entirely under
   prefers-reduced-motion. */
@keyframes auth-bg-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 40px) scale(1.12); }
}

@keyframes auth-bg-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, -50px) scale(1.15); }
}

/* Full-page version of the same gradient-blob treatment, for the
   single-card pages (signup, forgot/reset/change-password, OAuth consent,
   admin verification) - previously a flat bg-[var(--color-bg)] with no
   visual identity of their own. Same mechanism as .split-page__panel
   (reuses its keyframes above), just as a full backdrop behind a centered
   card instead of a side panel with its own text. The gradient/blob colors
   are deliberately NOT theme-aware (same as the login panel already is) -
   the card sitting on top handles its own light/dark colors normally via
   the usual CSS variables. .auth-backdrop__card marks the card so it
   stacks above the blurred blobs (position:absolute siblings would
   otherwise paint over a plain non-positioned card - see .split-page__panel
   h2/p's own position:relative;z-index:1 for the same reason). */
.auth-backdrop {
  position: relative;
  overflow: hidden;
}

.auth-backdrop::before,
.auth-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.auth-backdrop::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -100px;
  animation: auth-bg-drift-1 24s ease-in-out infinite;
}

.auth-backdrop::after {
  width: 380px;
  height: 380px;
  bottom: -140px;
  left: -80px;
  animation: auth-bg-drift-2 28s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop::before,
  .auth-backdrop::after {
    animation: none;
  }
}

.auth-backdrop__card {
  position: relative;
  z-index: 1;
}

.auth-backdrop--indigo {
  background: linear-gradient(135deg, #1d4ed8, #4f46e5 55%, #7c3aed);
}

.auth-backdrop--indigo::before {
  background: radial-gradient(circle, #ffffff, transparent 70%);
}

.auth-backdrop--indigo::after {
  background: radial-gradient(circle, #a78bfa, transparent 70%);
}

.auth-backdrop--amber {
  background: linear-gradient(135deg, #b45309, #d97706 55%, #f59e0b);
}

.auth-backdrop--amber::before {
  background: radial-gradient(circle, #ffffff, transparent 70%);
}

.auth-backdrop--amber::after {
  background: radial-gradient(circle, #fde68a, transparent 70%);
}

.auth-backdrop--slate {
  background: linear-gradient(135deg, #334155, #475569 55%, #64748b);
}

.auth-backdrop--slate::before {
  background: radial-gradient(circle, #ffffff, transparent 70%);
}

.auth-backdrop--slate::after {
  background: radial-gradient(circle, #cbd5e1, transparent 70%);
}

/* Live field-validation border color (see form_validation.js's
   setFieldState) - deliberately OUTSIDE any @layer block. Tailwind wraps
   its own generated utilities (including the static border-[var(...)]
   classes these form fields also carry) inside @layer utilities; per the
   CSS cascade-layers spec, un-layered rules always win ties against
   anything in a named layer, so this reliably overrides the static border
   color without needing !important or fighting Tailwind's internal
   class-generation order. (Declared here rather than in
   app/assets/tailwind/application.css since that file's compiled output
   isn't loaded by the Doorkeeper layout - this one, auth_ui.css via
   stylesheet_link_tag "application", is loaded everywhere.) */
input[data-valid="true"] {
  border-color: var(--color-success-strong);
}

input[data-valid="false"] {
  border-color: var(--color-error-strong);
}

/* Everything interactive that doesn't carry its own Tailwind focus
   treatment (plain links, the header dropdown trigger/items, buttons)
   relies on this - the browser default outline can be clipped or
   low-contrast against some of this app's custom-background surfaces.
   One broad rule instead of enumerating every class. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== Signed-in header / account menu ===== */
/* (the header markup itself - admin/_header.html.erb and
   shared/_header.html.erb - is Tailwind now; only the pieces Tailwind
   can't drive, below, stay in CSS) */

/* Light/dark toggle - shows the icon for the theme that's currently
   active (sun in light mode, moon in dark mode), matching GitHub/similar
   convention. See app/javascript/form_validation.js's initThemeToggle. */
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* .app-header__menu stays a bare JS hook (initHeaderMenu's outside-click/
   Escape handling) - no CSS of its own anymore, the Tailwind classes on
   the element itself handle all its visual presentation. */

/* ===== Site footer ===== */

.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: var(--space-4);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0;
}

/* ===== Split-screen login page ===== */
/* (the card/form inside .split-page__form is Tailwind now - see
   sessions/new.html.erb; this decorative gradient/blob branding panel is
   the one piece of markup deliberately NOT rebuilt in Tailwind, since
   there was nothing wrong with it and recreating animated ::before/::after
   blobs and a many-stop gradient in pure utility classes would be more
   code for no visual change.) */

.split-page {
  flex: 1 0 auto;
  display: flex;
}

.split-page__panel {
  flex: 1 1 46%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6) calc(var(--space-6) * 1.5);
  background: linear-gradient(135deg, #1d4ed8, #4f46e5 55%, #7c3aed);
  color: #ffffff;
}

.split-page__panel::before,
.split-page__panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.split-page__panel::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, #ffffff, transparent 70%);
  animation: auth-bg-drift-1 24s ease-in-out infinite;
}

.split-page__panel::after {
  width: 380px;
  height: 380px;
  bottom: -140px;
  left: -80px;
  background: radial-gradient(circle, #a78bfa, transparent 70%);
  animation: auth-bg-drift-2 28s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .split-page__panel::before,
  .split-page__panel::after {
    animation: none;
  }
}

/* Icon-chip + wordmark instead of the raster logo inverted to white - at
   28px tall, the logo's fine line-work (a small document icon next to
   the wordmark) got muddy against the gradient + blurred color blobs
   behind it. Plain bold text renders crisp at any size with no filter
   artifacts, and the glass-chip icon gives it some visual weight. */
.split-page__brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.split-page__brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.split-page__brand-mark svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.split-page__brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.split-page__panel h2,
.split-page__headline {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 0 var(--space-4);
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 700;
}

.split-page__panel p {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 0 var(--space-5);
  font-size: 1rem;
  opacity: 0.92;
}

.split-page__features {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.split-page__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.9375rem;
  opacity: 0.95;
}

.split-page__check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.split-page__form {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--color-bg);
  overflow-y: auto;
}

/* App-directory tiles on the login page's dark branding panel (see
   shared/_app_tiles, variant :panel). Phones get the compact strip under
   the form instead (.split-page__mobile-apps), since the panel is hidden
   below 860px. */
.app-tiles--panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-2);
  max-width: 420px;
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.app-tile--panel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.app-tile--panel:hover,
.app-tile--panel:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}

.app-tile__avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 0.8125rem;
  font-weight: 700;
}

.app-tile__body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.app-tile__name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.app-tile__meta {
  overflow: hidden;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tile__arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.8);
}

.split-page__mobile-apps {
  display: none;
}

@media (max-width: 860px) {
  .split-page__panel {
    display: none;
  }

  .split-page__form {
    flex: 1 1 100%;
  }

  .split-page__mobile-apps {
    display: block;
  }
}

/* account-tile__icon: sizing for the apps/clock/shield/warning icon
   helpers (ApplicationHelper), used standalone (no .account-tile wrapper
   needed) inside Tailwind-built tile/badge markup - admin dashboard,
   admin verification screen, etc. */
.account-tile__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-primary);
}

/* Respect "reduce motion" everywhere, not just the backdrop blobs above:
   transitions (skip link, menu chevron, strength bar, theme toggle) and any
   smooth scrolling collapse to instant. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   Signed-out landing page (sessions/_landing)
   --------------------------------------------------------------------- */
.landing-hero {
  background:
    radial-gradient(60rem 30rem at 85% 10%, color-mix(in srgb, var(--color-primary) 12%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at 0% 100%, color-mix(in srgb, #7c3aed 10%, transparent), transparent 70%),
    var(--color-surface);
}

/* Illustration: a mock sign-in card with the apps it unlocks floating
   around it. Decorative (aria-hidden in the markup). */
.landing-art {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 380px;
  margin: 0 auto;
}

.landing-art__glow {
  position: absolute;
  inset: 10% 5%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 28%, transparent), transparent 70%);
  filter: blur(20px);
}

.landing-art__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  padding: 22px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 20px 50px rgba(30, 58, 138, 0.18);
}

.landing-art__title {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.landing-art__field {
  height: 34px;
  margin-bottom: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}

.landing-art__button {
  display: flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  border-radius: 8px;
  background: var(--color-primary-solid-bg);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.landing-art__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-success-text);
}

.landing-art__verified svg,
.landing-art__chip-check svg {
  width: 14px;
  height: 14px;
}

.landing-art__chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  animation: landing-float 6s ease-in-out infinite;
}

.landing-art__chip--1 { top: 6%; left: 0; }
.landing-art__chip--2 { top: 16%; right: 0; animation-delay: -2s; }
.landing-art__chip--3 { bottom: 6%; left: 12%; animation-delay: -4s; }

.landing-art__chip-avatar {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.landing-art__chip-check {
  color: var(--color-success-text);
}

@keyframes landing-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Phones: chips sit above and below the card instead of overlapping it. */
@media (max-width: 640px) {
  .landing-art { height: 420px; max-width: 340px; }
  .landing-art__card { top: 52%; width: 220px; padding: 18px; }
  .landing-art__chip { font-size: 12px; }
  .landing-art__chip--1 { top: 0; left: 0; }
  .landing-art__chip--2 { top: 0; right: 0; left: auto; }
  .landing-art__chip--3 { top: auto; bottom: 0; left: 50%; margin-left: -56px; }
}

.landing-cta {
  background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 55%, #7c3aed 100%);
}

/* ---------------------------------------------------------------------
   Help / Terms / Privacy content (site_pages/show) - admin-edited HTML,
   so styled by element rather than with utility classes.
   --------------------------------------------------------------------- */
.page-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

.page-content > :first-child { margin-top: 0; }

.page-content h2 {
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.25rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  scroll-margin-top: 6rem;
}

.page-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.page-content div,
.page-content p { margin: 0 0 1rem; }

.page-content ul,
.page-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin: 0.35rem 0; }

.page-content a {
  color: var(--color-primary-hover);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-content blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.page-content pre {
  margin: 0 0 1rem;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--color-bg);
  font-size: 0.875rem;
}

.page-content hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

/* Developer docs (/developers): tables, inline code and code blocks. Wide
   tables scroll inside themselves instead of widening the page. */
.dev-docs table {
  display: block;
  max-width: 100%;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.dev-docs th,
.dev-docs td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.dev-docs th {
  background: var(--color-bg);
  font-weight: 600;
}

.dev-docs :not(pre) > code {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--color-bg);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.dev-docs pre code {
  white-space: pre;
}

/* Trix editor (Admin > Site pages) themed to match the app, light + dark. */
trix-editor.page-editor {
  min-height: 420px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
}

trix-editor.page-editor:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

trix-toolbar .trix-button-row { flex-wrap: wrap; gap: 4px; }
trix-toolbar .trix-button-group { margin-bottom: 6px; border-color: var(--color-border); }
trix-toolbar .trix-button { border-color: var(--color-border); }
:root[data-theme="dark"] trix-toolbar .trix-button { filter: invert(0.85); background: #fff; }

/* Header tab rows scroll sideways on narrow screens without a visible bar. */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* =====================================================================
   Aurora design (2026-10): a dark, slowly moving aurora behind the
   signed-out pages and frosted-glass cards on top of it. Everything is
   CSS - no images or video: the drifting colour fields are two blurred
   pseudo-element layers that only animate `transform` (cheap, GPU), the
   grid and grain are data-URI backgrounds (CSP allows img-src data:). All
   motion stops under prefers-reduced-motion. This block comes last on
   purpose: it overrides the older .auth-backdrop / .split-page rules
   above, and as un-layered CSS it also beats Tailwind's layered utilities.
   ===================================================================== */

@font-face {
  font-family: "InterVariable";
  src: url(/assets/inter-latin-wght-normal-6cb0cbcb7a2a366352c7398c8952c74e46fe323e64dc7244639d7f16de256082.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --aurora-base: #060a18;
  --aurora-1: #4f46e5;
  --aurora-2: #06b6d4;
  --aurora-3: #a855f7;
  --aurora-4: #2563eb;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 30px 80px -24px rgba(2, 6, 23, 0.55), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  --card-shadow-hover: 0 18px 40px -18px rgba(37, 99, 235, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-bg: rgba(15, 23, 42, 0.72);
    --glass-border: rgba(148, 163, 184, 0.2);
    --glass-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    --card-shadow-hover: 0 18px 40px -18px rgba(96, 165, 250, 0.3);
  }
}

:root[data-theme="dark"] {
  --glass-bg: rgba(15, 23, 42, 0.72);
  --glass-border: rgba(148, 163, 184, 0.2);
  --glass-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --card-shadow-hover: 0 18px 40px -18px rgba(96, 165, 250, 0.3);
}

/* Inter's alternate digits/letters read better in UI; tighter headings. */
body {
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 {
  letter-spacing: -0.02em;
}

/* ---- The aurora surface ------------------------------------------- */
.aurora,
.auth-backdrop,
.split-page,
.landing-hero,
.landing-cta,
.aurora-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--aurora-base);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23n)' opacity='.05'/%3E%3C/svg%3E"),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 160px 160px, 48px 48px, 48px 48px;
  color: #e2e8f0;
}

.aurora::before,
.aurora::after,
.auth-backdrop::before,
.auth-backdrop::after,
.split-page::before,
.split-page::after,
.landing-hero::before,
.landing-hero::after,
.landing-cta::before,
.landing-cta::after,
.aurora-banner::before,
.aurora-banner::after {
  content: "";
  position: absolute;
  inset: -35%;
  width: auto;
  height: auto;
  border-radius: 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  filter: blur(70px) saturate(140%);
}

.aurora::before,
.auth-backdrop::before,
.split-page::before,
.landing-hero::before,
.landing-cta::before,
.aurora-banner::before {
  background:
    radial-gradient(closest-side at 28% 34%, var(--aurora-1), transparent 70%),
    radial-gradient(closest-side at 72% 26%, var(--aurora-2), transparent 70%),
    radial-gradient(closest-side at 50% 78%, var(--aurora-3), transparent 70%);
  opacity: 0.55;
  animation: aurora-drift-a 26s ease-in-out infinite alternate;
}

.aurora::after,
.auth-backdrop::after,
.split-page::after,
.landing-hero::after,
.landing-cta::after,
.aurora-banner::after {
  background:
    radial-gradient(closest-side at 65% 62%, var(--aurora-4), transparent 70%),
    radial-gradient(closest-side at 22% 70%, var(--aurora-2), transparent 70%);
  opacity: 0.4;
  mix-blend-mode: screen;
  animation: aurora-drift-b 34s ease-in-out infinite alternate;
}

@keyframes aurora-drift-a {
  0% { transform: translate3d(-4%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, 4%, 0) rotate(12deg) scale(1.08); }
  100% { transform: translate3d(5%, -3%, 0) rotate(-6deg) scale(1.02); }
}

@keyframes aurora-drift-b {
  0% { transform: translate3d(4%, 3%, 0) rotate(0deg) scale(1.05); }
  50% { transform: translate3d(-3%, -4%, 0) rotate(-14deg) scale(0.96); }
  100% { transform: translate3d(-5%, 2%, 0) rotate(8deg) scale(1.08); }
}

/* Per-page moods, same mechanism. */
.auth-backdrop--amber {
  --aurora-1: #f59e0b;
  --aurora-2: #f97316;
  --aurora-3: #db2777;
  --aurora-4: #b45309;
}

.auth-backdrop--slate {
  --aurora-1: #475569;
  --aurora-2: #64748b;
  --aurora-3: #6366f1;
  --aurora-4: #334155;
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after,
  .auth-backdrop::before, .auth-backdrop::after,
  .split-page::before, .split-page::after,
  .landing-hero::before, .landing-hero::after,
  .landing-cta::before, .landing-cta::after,
  .aurora-banner::before, .aurora-banner::after {
    animation: none;
  }
}

/* ---- Frosted glass cards on the aurora ------------------------------ */
.auth-backdrop__card,
.glass-card {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  border-color: var(--glass-border);
  border-radius: 1.25rem;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: var(--color-text);
}

/* Without backdrop-filter support, a near-solid card stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .auth-backdrop__card,
  .glass-card {
    background: var(--color-surface);
  }
}

/* ---- Sign-in split screen: one aurora behind both halves ------------ */
.split-page__panel,
.split-page__form {
  background: transparent;
}

.split-page__panel::before,
.split-page__panel::after {
  display: none;
}

.split-page__panel {
  z-index: 1;
}

/* Two classes, so it beats the older `.split-page__panel p` rule above. */
.split-page__panel .split-page__headline {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

/* A short strip: keep the colour fields inside it and let them show. */
.aurora-banner::before,
.aurora-banner::after {
  inset: -60% -10%;
  filter: blur(40px) saturate(150%);
}

.aurora-banner::before {
  opacity: 0.9;
}

.aurora-banner::after {
  opacity: 0.7;
}

/* Landing feature icons. */
.icon-chip-aurora {
  background-image: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.6);
}

/* The icon helpers colour their own svg (.account-tile__icon). */
.icon-chip-aurora > svg {
  color: #fff;
}

/* ---- Gradient text and glowing primary buttons ---------------------- */
.text-aurora {
  background: linear-gradient(100deg, #a5b4fc 0%, #67e8f9 45%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-glow {
  background-image: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.7), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-glow:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 34px -10px rgba(79, 70, 229, 0.85), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
}

/* ---- Landing page ---------------------------------------------------- */
.landing-hero {
  min-height: min(760px, calc(100vh - 4rem));
  display: flex;
  align-items: center;
}

.landing-hero .landing-hero__eyebrow {
  border: 1px solid rgba(165, 180, 252, 0.35);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
}

.landing-art__card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  color: #f1f5f9;
}

.landing-art__title {
  color: #f8fafc;
}

.landing-art__field {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}

.landing-art__button {
  background-image: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.landing-art__verified {
  color: #86efac;
}

.landing-art__chip {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.landing-art__glow {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 65%);
}

/* ---- Signed-in pages ------------------------------------------------- */
/* A soft glow at the top of the page instead of flat grey. */
.account-canvas {
  background-image:
    radial-gradient(60rem 22rem at 50% -8rem, rgba(99, 102, 241, 0.16), transparent 70%),
    radial-gradient(40rem 18rem at 85% -6rem, rgba(6, 182, 212, 0.12), transparent 70%);
  background-repeat: no-repeat;
}

/* Cards that lift slightly on hover (account tiles, app tiles). */
.lift-card {
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lift-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

@media (prefers-reduced-motion: reduce) {
  .lift-card,
  .btn-glow {
    transition: none;
  }

  .lift-card:hover,
  .btn-glow:hover {
    transform: none;
  }
}

/* ---- Help: info tips (info_tip helper) ------------------------------ */
/* A tooltip bubble above a small (i) button. Shown on hover, focus or tap;
   display:none while hidden so an off-screen bubble never widens the page.
   initInfoTips shifts it back on screen with --tip-shift. */
.info-tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.info-tip__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.25rem 0;
  border-radius: 9999px;
  color: var(--color-text-muted);
  cursor: help;
}

.info-tip__button svg {
  width: 1rem;
  height: 1rem;
}

.info-tip__button:hover,
.info-tip__button:focus-visible {
  color: var(--color-primary);
}

.info-tip__button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.info-tip__bubble {
  position: absolute;
  z-index: 50;
  bottom: calc(100% + 6px);
  left: 50%;
  display: none;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  transform: translateX(calc(-50% + var(--tip-shift, 0px)));
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  background: var(--color-text);
  color: var(--color-surface);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
}

.info-tip:hover .info-tip__bubble,
.info-tip__button:focus + .info-tip__bubble,
.info-tip.is-open .info-tip__bubble {
  display: block;
}

.info-tip.is-dismissed .info-tip__bubble {
  display: none;
}

@media (forced-colors: active) {
  .info-tip__bubble {
    border: 1px solid CanvasText;
  }
}

/* ---- Collapsible left menu (shared/_side_nav) ------------------------ */
/* html[data-side-nav="collapsed"] is set before first paint from
   localStorage (layouts/application) and toggled by initSideNav. Only from
   lg up - below that the menu is the row of pills. 4.5rem = the menu's
   0.75rem padding each side + one 3rem icon button, so the icons stay at
   the same x whether it's open or closed. Labels are hidden visually but
   stay readable to screen readers. */
.side-nav {
  transition: width 0.15s ease;
}

.side-nav__toggle svg {
  transition: transform 0.15s ease;
}

@media (min-width: 1024px) {
  html[data-side-nav="collapsed"] .side-nav {
    width: 4.5rem;
  }

  html[data-side-nav="collapsed"] .side-nav__head {
    justify-content: center;
  }

  html[data-side-nav="collapsed"] .side-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  html[data-side-nav="collapsed"] .side-nav__toggle svg {
    transform: rotate(180deg);
  }

  /* The room the menu gave up goes to the wide pages (tables, reports,
     account details); forms and short lists keep their reading width. */
  html[data-side-nav="collapsed"] .account-canvas > [class*="max-w-[960px]"],
  html[data-side-nav="collapsed"] .account-canvas > [class*="max-w-[1040px]"],
  html[data-side-nav="collapsed"] .account-canvas > [class*="max-w-[1120px]"],
  html[data-side-nav="collapsed"] .account-canvas > [class*="max-w-[1200px]"] {
    max-width: 1480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-nav,
  .side-nav__toggle svg {
    transition: none;
  }
}

/* ---- Scrollbars ------------------------------------------------------ */
/* Slim, rounded, theme-aware scrollbars everywhere (page, left menu,
   tables, code blocks, text areas). The thumb is the muted text colour at
   partial strength, so it follows light/dark automatically and stays
   visible on both the page and card backgrounds. scrollbar-width and
   scrollbar-color are the standard properties (Firefox, Chrome 121+,
   Safari 18.2+); the ::-webkit-scrollbar rules give older Chrome and
   Safari the same look. .no-scrollbar (below, earlier) still wins. */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-text-muted) 50%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-button {
  display: none;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 9999px;
  background-color: color-mix(in srgb, var(--color-text-muted) 45%, transparent);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--color-text-muted) 75%, transparent);
  background-clip: content-box;
}

.no-scrollbar {
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---- Loading feedback and small polish --------------------------------- */

/* Top-of-page progress bar while a click or form submit loads the next page
   (form_validation.js startNavProgress). It creeps towards 90% and the new
   page replaces it, so it never claims to be finished. */
.nav-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9999;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #4f46e5, #7c3aed);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}

.nav-progress.is-active {
  opacity: 1;
  animation: nav-progress-creep 12s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes nav-progress-creep {
  to { transform: scaleX(0.9); }
}

/* A submit button (or social sign-in link) waiting on the server: a light
   sweep across it; real <button>/<a> elements also get a spinner. */
[type="submit"].is-busy,
a.is-busy {
  position: relative;
  cursor: progress;
  pointer-events: none;
  background-image: linear-gradient(110deg, transparent 30%, color-mix(in srgb, currentColor 16%, transparent) 50%, transparent 70%);
  background-size: 250% 100%;
  background-repeat: no-repeat;
  animation: busy-sweep 1.2s linear infinite;
}

.btn-glow.is-busy {
  background-image:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%),
    linear-gradient(135deg, #2563eb, #4f46e5);
  background-size: 250% 100%, 100% 100%;
  transform: none;
}

@keyframes busy-sweep {
  from { background-position: 150% 0, 0 0; }
  to { background-position: -50% 0, 0 0; }
}

button.is-busy::before,
a.is-busy::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: busy-spin 0.7s linear infinite;
}

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

/* Caps Lock hint under a password field. */
.caps-hint {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-warning-text);
}

.caps-hint[hidden] {
  display: none;
}

/* Flash messages: close button, and the fade when one is dismissed. */
[data-flash] {
  position: relative;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

[data-flash].is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.flash-close {
  margin: -0.25rem -0.5rem -0.25rem auto;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}

.flash-close:hover,
.flash-close:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

/* Small things that add up. */
::selection {
  background: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-primary);
}

a,
button,
[type="submit"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

table,
code,
.tabular {
  font-variant-numeric: tabular-nums;
}

main table tbody tr {
  transition: background-color 0.12s ease;
}

main table tbody tr:hover {
  background-color: color-mix(in srgb, var(--color-primary) 5%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
  }

  /* Pages ease in, and (where the browser supports it) cross-fade between
     our own pages instead of flashing white. */
  main {
    animation: page-in 0.28s ease-out;
  }

  button:not(:disabled):active,
  [type="submit"]:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
  }

  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.16s;
  }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-progress.is-active { animation: none; transform: scaleX(0.6); }
  [type="submit"].is-busy,
  a.is-busy,
  button.is-busy::before,
  a.is-busy::before { animation: none; }
}

/* ---- Round two: sticky table headers, toast ----------------------------- */

/* Long tables scroll inside their card so the header row stays in view. */
.table-scroll {
  max-height: 70vh;
  overflow: auto;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-border);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9998;
  max-width: calc(100vw - 2rem);
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(-50%, 0.75rem);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ---- Round three: skeleton, live results, shortcuts, print -------------- */

/* Placeholder shown over <main> when a side-menu page is slow to arrive. */
main.is-skeleton > :not(.skeleton-overlay) {
  visibility: hidden;
}

.skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--color-bg);
}

.skeleton-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

main.is-skeleton {
  position: relative;
}

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--color-border) 30%, color-mix(in srgb, var(--color-border) 40%, var(--color-surface)) 50%, var(--color-border) 70%);
  background-size: 250% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
}

.skeleton--title { width: min(16rem, 60%); height: 1.75rem; margin-bottom: 0.25rem; }
.skeleton--line { width: min(28rem, 90%); height: 0.875rem; }
.skeleton--card { width: 100%; height: 7.5rem; border-radius: var(--radius-lg); }

@keyframes skeleton-shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

/* Results being refreshed by a live filter. */
.is-loading {
  opacity: 0.55;
  cursor: progress;
  transition: opacity 0.15s ease;
}

/* Keyboard-shortcut list. */
.shortcuts-dialog {
  width: min(24rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.shortcuts-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.shortcuts-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.shortcuts-dialog ul {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.shortcuts-dialog li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border);
}

.shortcuts-dialog kbd {
  min-width: 1.5rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--color-field-border);
  border-bottom-width: 2px;
  border-radius: 0.375rem;
  background: var(--color-bg);
  font: 600 0.75rem/1.4 var(--font-sans);
  text-align: center;
}

.shortcuts-dialog__close {
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Printing (backup codes, the data export, docs): the page content only. */
@media print {
  .site-header,
  header,
  .side-nav,
  footer,
  .site-footer,
  .skip-link,
  .nav-progress,
  .toast,
  .flash-close,
  .page-help,
  .info-tip,
  button,
  [type="submit"],
  .impersonation-banner {
    display: none !important;
  }

  html,
  body,
  .account-canvas,
  main {
    background: #fff !important;
    color: #000 !important;
    animation: none !important;
  }

  main {
    padding: 0 !important;
    max-width: none !important;
  }

  a { color: inherit; text-decoration: underline; }
  a[href^="/"]:after,
  a[href^="http"]:after { content: none; }

  .table-scroll { max-height: none; overflow: visible; }
  tr, li { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .is-loading { transition: none; }
}

/* ---- Admin > Users: bulk action bar ------------------------------------ */
.bulk-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.bulk-bar[hidden],
.bulk-bar [hidden] {
  display: none;
}

.bulk-bar__count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ---- Welcome tour (app/javascript/tour.js) ------------------------------- */

.tour-spot {
  position: fixed;
  z-index: 9990;
  display: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62), 0 0 0 2px var(--color-primary);
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}

/* Welcome and closing cards have no target: a zero-size spot in the middle
   still casts the dim. */
.tour-spot--none {
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62);
}

/* Invisible shield so the page behind can't be clicked mid-tour. */
body.tour-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9989;
}

.tour-card {
  position: fixed;
  z-index: 9991;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.tour-card:focus { outline: none; }

.tour-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

.tour-close:hover { background: var(--color-bg); color: var(--color-text); }

.tour-count {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tour-title { margin: 0 2rem 0.375rem 0; font-size: 1.0625rem; font-weight: 700; }
.tour-text { margin: 0 0 1rem; font-size: 0.9375rem; line-height: 1.5; color: var(--color-text-muted); }

.tour-dots { display: flex; gap: 0.25rem; margin-bottom: 1rem; }
.tour-dots span { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: var(--color-border); }
.tour-dots span.is-on { width: 1.125rem; background: var(--color-primary); }

.tour-actions { display: flex; align-items: center; gap: 0.5rem; }
.tour-spacer { flex: 1; }
.tour-actions [hidden] { display: none; }

.tour-btn {
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
}

.tour-btn:hover { background: var(--color-primary-hover); }
.tour-btn--ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.tour-btn--ghost:hover { background: var(--color-bg); }
.tour-link { min-height: 2.5rem; padding: 0 0.25rem; background: none; color: var(--color-text-muted); font-size: 0.875rem; text-decoration: underline; }
.tour-link:hover { color: var(--color-text); }

.tour-btn:focus-visible, .tour-link:focus-visible, .tour-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot { transition: none; }
}

@media print {
  .tour-spot, .tour-card { display: none; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
