/* ═══════════════════════════════════════════════════════════════════════════
   CONSOLIDATED APP SHELL STYLES
   Consolidation of site.css + admin-shell.css + admin-list-layout.css
   
   This file provides shared styling for:
   - App shell layout (navbar, sidebars, content areas)
   - Admin dashboard pages
   - List/table views
   - Common form components
   
   All styles reference centralized design tokens from design-tokens.css
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   LEGACY TOKEN ALIASES (for backward compatibility during transition)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Map old theme tokens to new centralized tokens */
  --theme-page-bg: var(--color-bg);
  --theme-surface-color: var(--color-surface);
  --theme-component-color: var(--color-component);
  --theme-accent: var(--color-accent);
  --theme-surface-soft: var(--color-surface-light);
  --theme-surface-strong: var(--color-surface-strong);
  --theme-component-soft: var(--color-component-light);
  --theme-component-strong: var(--color-component-strong);

  /* Admin shell local tokens */
  --admin-bg: var(--color-bg);
  --admin-surface: color-mix(in srgb, var(--color-surface) 66%, transparent);
  --admin-surface2: color-mix(in srgb, var(--color-component) 52%, transparent);
  --admin-ink: var(--color-text-primary);
  --admin-ink2: var(--color-text-secondary);
  --admin-ink3: var(--color-text-tertiary);
  --admin-rule: var(--color-border);
  --admin-red: var(--color-primary);
  --admin-red-dim: color-mix(in srgb, var(--color-primary) 8%, transparent);
  --admin-nav-bg: var(--topbar-bg);
  --admin-content-offset: calc(var(--admin-nav-h) + var(--space-3xl));
  --admin-nav-h: 50px;
  --admin-side-w: 264px;
  --admin-font-h: var(--font-family-heading);
  --admin-font-b: var(--font-family-body);

  /* Shared interaction state tokens */
  --color-primary-hover: var(--color-primary-dark);
  --color-disabled-bg: color-mix(in srgb, var(--color-component) 72%, transparent);
  --color-disabled-text: var(--color-text-tertiary);
  --color-disabled-border: var(--color-border-light);
  --focus-ring-color: color-mix(in srgb, var(--color-primary) 32%, transparent);
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* List layout local tokens */
  --bg: color-mix(in srgb, var(--color-component) 18%, transparent);
  --surface: color-mix(in srgb, var(--color-surface) 66%, transparent);
  --surface2: color-mix(in srgb, var(--color-component) 48%, transparent);
  --ink: var(--color-text-primary);
  --ink2: var(--color-text-secondary);
  --ink3: var(--color-text-tertiary);
  --rule: var(--color-border);
  --rule2: var(--color-border-light);
  --red: var(--color-primary);
  --red-h: var(--color-primary-dark);
  --green: var(--color-success);
  --green-bg: var(--color-success-bg);
  --amber: var(--color-warning);
  --amber-bg: var(--color-warning-bg);
  --blue: var(--color-info);
  --blue-bg: var(--color-info-bg);
  --r: var(--radius-md);
  --r-lg: var(--radius-lg);
}

/* ═════════════════════════════════════════════════════════════════════════════
   SKIP NAVIGATION
   ═════════════════════════════════════════════════════════════════════════════ */

.skip-to-main {
  position: fixed;
  top: -100%;
  left: var(--space-md);
  z-index: var(--z-skip-link);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top 0.14s ease;
}

.skip-to-main:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: -4px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   APP SHELL - Layout & Structure
   ═════════════════════════════════════════════════════════════════════════════ */

.app-shell {
  min-height: calc(100dvh - 120px);
  font-family: var(--font-family-body);
}

.app-side {
  border-right: 1px solid var(--color-border);
  background: var(--color-component-strong);
  font-family: var(--font-family-body);
}

.app-side .list-group-item {
  border: 0;
  border-radius: 0;
}

.app-side-link {
  font-family: var(--font-family-body);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  padding: 0.8rem 1rem;
}

.app-side-link.active,
.app-side-link:hover {
  background: color-mix(in srgb, var(--color-component) 56%, transparent);
  color: var(--color-primary);
}

.app-main {
  background: color-mix(in srgb, var(--color-surface) 34%, transparent);
  font-family: var(--font-family-body);
}

/* ═════════════════════════════════════════════════════════════════════════════
   TOPBAR STYLES - Glass Morphism
   ═════════════════════════════════════════════════════════════════════════════ */

/* The compound selector is not redundant: .admin-shell-nav further down this
   file also sets a z-index (--z-shell-nav, 300), the topbar markup carries both
   classes, and at equal specificity source order handed the win to the one
   declared later. The floating bar was computing to 300 — under --z-popover
   (320), a layer this scale documents as sitting beneath the topbar. */
.app-default-topbar,
.app-default-topbar.admin-shell-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

/* Preserve 10px floating gap when sticky — overrides admin-shell-nav's top: 0 */
.app-default-topbar.app-glass-topbar {
  top: 10px;
}

.app-glass-topbar {
  width: calc(100% - 32px);
  max-width: none;
  margin: 10px var(--space-lg) 0;
  min-height: 60px;
  padding: 6px 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--topbar-bg) 54%, transparent) 0%,
    color-mix(in srgb, var(--topbar-bg-soft) 28%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--topbar-border) 58%, transparent);
  box-shadow: var(--topbar-shadow), var(--shadow-inner);
  backdrop-filter: blur(var(--topbar-blur)) saturate(var(--topbar-saturation));
  -webkit-backdrop-filter: blur(var(--topbar-blur)) saturate(var(--topbar-saturation));
}

.app-topbar-brand {
  display: inline-flex;
  align-items: center;
  margin-right: 24px;
}

.app-topbar-brand-image {
  display: block;
  width: var(--topbar-brand-width);
  height: auto;
}

.app-auth-links {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

.app-auth-link {
  font-family: var(--font-family-body);
  color: var(--topbar-text) !important;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  padding: 0 !important;
}

.app-auth-chip {
  font-family: var(--font-family-body);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-lg) !important;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--topbar-chip-bg) 34%, transparent);
  border: 1px solid color-mix(in srgb, var(--topbar-border) 48%, transparent);
  color: color-mix(in srgb, var(--topbar-text) 82%, transparent) !important;
}

.admin-shell-topbar-logout-form {
  margin: 0;
  /* Match the inline-flex centering of the sibling icon buttons so the logout icon
     shares their baseline (the form wrapper otherwise offsets it by ~1-2px). */
  display: inline-flex;
  align-items: center;
}

.admin-shell-topbar-logout {
  padding: 0;
}

.app-auth-button {
  font-family: var(--font-family-body);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  /* Match landing page topbar pill: 36px height, 10px radius, compact font */
  min-height: 36px;
  padding: 0 16px !important;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
  /* Expand tap target to 44px on touch without changing visual height */
  position: relative;
}

.app-auth-button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  min-height: 44px;
}

/* All public topbar buttons use the glass secondary style — matching the
   landing page which shows only a single glass "Login / Signup" button */
.app-auth-button-primary,
.app-auth-button-secondary {
  color: var(--topbar-text) !important;
  background: color-mix(in srgb, var(--topbar-chip-bg) 38%, transparent);
  border-color: color-mix(in srgb, var(--topbar-border) 22%, transparent);
  box-shadow: var(--shadow-inner);
}

.app-auth-button:hover,
.app-auth-button:focus {
  color: var(--topbar-text) !important;
  background: color-mix(in srgb, var(--topbar-chip-bg) 54%, transparent);
  transform: translateY(-1px);
}

.topbar-cart-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.15s ease;
}
.topbar-cart-badge:hover { opacity: 0.88; color: var(--color-text-inverse); }

.app-account-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  color: var(--topbar-text) !important;
  background:
    radial-gradient(circle at 35% 25%, color-mix(in srgb, white 35%, transparent), transparent 38%),
    linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-info) 74%, var(--color-primary)));
  border: 1px solid color-mix(in srgb, var(--topbar-border) 42%, transparent);
  box-shadow: var(--shadow-sm), var(--shadow-inner);
  text-decoration: none;
}

.app-account-logo span {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.app-account-logo:hover,
.app-account-logo:focus {
  color: var(--topbar-text) !important;
  transform: translateY(-1px);
}

/* ═════════════════════════════════════════════════════════════════════════════
   ADMIN SHELL - Dark Navigation & Sidebar
   ═════════════════════════════════════════════════════════════════════════════ */

.admin-shell {
  margin: 0 calc(50% - 50vw) -2rem;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-primary) 7%, transparent), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-bg) 24%, white 76%) 0%, var(--color-bg) 100%);
  min-height: 100dvh;
  font-family: var(--font-family-body);
  color: var(--color-text-primary);
}

.admin-shell * {
  box-sizing: border-box;
}

.admin-shell-nav {
  font-family: var(--font-family-body);
  min-height: var(--admin-nav-h);
  display: flex;
  align-items: center;
  padding: 6px 20px;
  position: sticky;
  top: 0;
  z-index: var(--z-shell-nav);
}

.admin-shell-logo {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  letter-spacing: 0;
  color: var(--topbar-text);
  margin-right: 24px;
  text-decoration: none;
}

.admin-shell-logo em {
  color: var(--color-primary);
  font-style: normal;
}

.admin-shell-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.admin-shell-notif {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-button);
  background: color-mix(in srgb, var(--topbar-chip-bg) 88%, transparent);
  color: color-mix(in srgb, var(--topbar-text-muted) 92%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  border: 1px solid var(--topbar-border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.admin-shell-notif:hover {
  background: var(--topbar-chip-bg);
  color: var(--topbar-text);
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--topbar-border));
}

.admin-shell-icon {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.admin-shell-notif:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.admin-shell-count-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--admin-nav-bg);
}

/* On the narrower mobile topbar the rightmost icon sits near the rounded edge;
   inset the badge and add a little right padding so it never clips the border. */
@media (max-width: 767px) {
  .admin-shell-nav-right {
    padding-right: 3px;
  }

  .admin-shell-count-badge {
    right: -4px;
  }
}

.admin-shell-user {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  color: color-mix(in srgb, var(--topbar-text) 80%, transparent);
}

.admin-shell-main-wrap {
  display: grid;
  grid-template-columns: var(--admin-side-w) 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-lg) 34px;
  min-height: calc(100dvh - var(--admin-nav-h));
  align-items: start;
}

.admin-shell-side {
  font-family: var(--font-family-body);
  --sidenav-field-bg: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 82%, transparent) 0%, color-mix(in srgb, var(--color-component) 62%, transparent) 100%);
  --sidenav-panel-bg: var(--color-surface);
  --sidenav-card-line: var(--color-border-light);
  --sidenav-line: color-mix(in srgb, var(--color-border) 74%, var(--color-surface) 26%);
  --sidenav-line-soft: color-mix(in srgb, var(--color-border-light) 74%, var(--color-surface) 26%);
  --sidenav-heading: var(--color-text-primary);
  --sidenav-slate: var(--color-text-secondary);
  --sidenav-muted: var(--color-text-tertiary);
  --sidenav-faint: color-mix(in srgb, var(--color-text-tertiary) 70%, var(--color-surface) 30%);
  --sidenav-blue-deep: color-mix(in srgb, var(--color-text-primary) 78%, var(--color-primary) 22%);
  --sidenav-blue: var(--color-primary);
  --sidenav-blue-hover: var(--color-primary-dark);
  --sidenav-active-bg-1: color-mix(in srgb, var(--color-info-bg) 82%, var(--color-surface) 18%);
  --sidenav-active-bg-2: color-mix(in srgb, var(--color-primary-light) 18%, var(--color-info-bg) 82%);
  --sidenav-pill-bg: var(--color-info-bg);
  --sidenav-pill-ink: var(--color-info);
  display: flex;
  flex-direction: column;
  background: var(--sidenav-field-bg);
  border: 1px solid color-mix(in srgb, var(--color-component) 72%, transparent);
  box-shadow: var(--shadow-lg), var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius-xl);
  padding: 0;
  position: sticky;
  top: calc(var(--admin-nav-h) + var(--space-lg));
  height: calc(100dvh - var(--admin-nav-h) - (var(--space-lg) * 2));
  overflow: hidden;
}

.admin-shell-side-action {
  padding: 16px 14px 6px;
  flex: 0 0 auto;
}

.admin-shell-side-cta {
  font-family: var(--font-family-body);
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--radius-button);
  background: var(--sidenav-blue);
  color: var(--color-text-inverse);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--btn-raise);
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.06s ease;
}

.admin-shell-side-cta:hover {
  background: var(--sidenav-blue-hover);
  color: var(--color-text-inverse);
}

.admin-shell-side-cta:active {
  transform: translateY(1px);
}

.admin-shell-side-cta:focus-visible {
  outline: 2px solid var(--sidenav-blue-deep);
  outline-offset: 2px;
}

.admin-shell-side-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--sidenav-muted) 32%, transparent) transparent;
}

.admin-shell-side-group-primary,
.admin-shell-side-section {
  margin-bottom: 18px;
}

.admin-shell-side-section:last-child {
  margin-bottom: 4px;
}

.admin-shell-side-label {
  padding: 0 6px 8px;
  color: var(--sidenav-slate);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.13em;
  line-height: 1.1;
  text-transform: uppercase;
}

.admin-shell-side-group {
  overflow: hidden;
  background: var(--sidenav-panel-bg);
  border: 1px solid var(--sidenav-card-line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text-primary) 4%, transparent);
}

.admin-shell-side-link {
  font-family: var(--font-family-body);
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 10px 13px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
  color: var(--sidenav-slate);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.admin-shell-side-link + .admin-shell-side-link {
  border-top: 1px solid var(--sidenav-line-soft);
}

.admin-shell-side-link:not(.active):hover {
  background: color-mix(in srgb, var(--sidenav-blue) 6%, transparent);
  color: var(--sidenav-blue-deep);
}

.admin-shell-side-link.active {
  background: linear-gradient(180deg, var(--sidenav-active-bg-1) 0%, var(--sidenav-active-bg-2) 100%);
  color: var(--sidenav-blue-deep);
  font-weight: var(--font-weight-semibold);
}

.admin-shell-side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sidenav-blue);
}

.admin-shell-side-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--sidenav-faint);
}

.admin-shell-side-link.active .admin-shell-side-icon,
.admin-shell-side-cta .admin-shell-side-icon {
  color: currentColor;
}

.admin-shell-side-link-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell-side-badge {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--sidenav-pill-bg);
  color: var(--sidenav-pill-ink);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.admin-shell-side-badge-unread {
  padding: 1px 6px;
  background: var(--sidenav-blue);
  color: var(--color-text-inverse);
}

.admin-shell-side-active-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: var(--radius-full);
  background: var(--sidenav-blue);
}

.admin-shell-side-link:focus-visible {
  outline: 2px solid var(--sidenav-blue);
  outline-offset: -2px;
}

.admin-shell-side-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--sidenav-line);
  flex: 0 0 auto;
}

.admin-shell-side-user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 48px;
  flex: 1 1 auto;
  padding: 8px 9px;
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: background 0.14s ease;
}

.admin-shell-side-user-card:hover,
.admin-shell-side-user-card:focus-visible {
  background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
}

.admin-shell-side-user-card:focus-visible {
  outline: 2px solid var(--sidenav-blue);
  outline-offset: 2px;
}

.admin-shell-side-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--sidenav-heading);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Unfinished profile (customers): a ring around the initials fills clockwise with what is done
   (owner, 2026-11-18). A ring rather than stars: it reads as "nearly there", not as a rating, and it
   stays visible on the collapsed icon rail. */
.admin-shell-side-avatar-ring {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  /* The card's own padding already frames the avatar; the ring takes that space instead. */
  margin: -5px -2px -5px -5px;
}

.admin-shell-side-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Done in the success green, the rest a quiet grey: unfinished is "not yet", not "wrong" (owner, 2026-11-19). */
.admin-shell-side-ring__track {
  stroke: color-mix(in srgb, var(--color-text-primary) 13%, transparent);
  transition: stroke 0.14s ease;
}

/* The path starts at the top-left end of the top edge; this moves the start to the top centre
   ((19.75 − 11.75) ÷ 137.47 of the perimeter), so the fill runs clockwise from twelve o'clock. */
.admin-shell-side-ring__fill {
  stroke: var(--color-success);
  stroke-dashoffset: -5.82;
  animation: admin-shell-side-ring-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes admin-shell-side-ring-in {
  from { stroke-dasharray: 0 100; }
}

.admin-shell-side-user-card.has-profile-progress:hover .admin-shell-side-ring__track,
.admin-shell-side-user-card.has-profile-progress:focus-visible .admin-shell-side-ring__track {
  stroke: color-mix(in srgb, var(--color-text-primary) 22%, transparent);
}

/* The save that finished the profile: the ring fills to full, holds a moment, then fades away;
   the line under the name says so. Next page, the card is back to the plain name and role. */
.is-profile-complete .admin-shell-side-ring {
  animation: admin-shell-side-ring-done 3.2s ease forwards;
}

.is-profile-complete .admin-shell-side-user-progress {
  color: var(--color-success);
}

@keyframes admin-shell-side-ring-done {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-shell-side-ring__fill { animation: none; }
  .is-profile-complete .admin-shell-side-ring { animation: none; }
  .admin-shell-side-ring__track { transition: none; }
}

.admin-shell-side-user-progress {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell-side-user-meta {
  display: block;
  min-width: 0;
  line-height: 1.25;
}

.admin-shell-side-user-name {
  display: block;
  overflow: hidden;
  color: var(--sidenav-heading);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell-side-user-role {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--sidenav-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Sidebar collapse (owner, 2026-11-07) ──────────────────────────────────────────────────────────
   Open by default; the footer button folds it to an icon rail and the choice is remembered in this
   browser (js/side-collapse.js; the class sits on <html>, set before first paint). Same cards, same
   icons, same colours — only the words go: names become hover tooltips, counts become dots. */
.admin-shell-side-toggle {
  order: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--sidenav-muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.admin-shell-side-toggle:hover {
  background: color-mix(in srgb, var(--color-text-primary) 5%, transparent);
  color: var(--sidenav-blue-deep);
}

.admin-shell-side-toggle:focus-visible {
  outline: 2px solid var(--sidenav-blue);
  outline-offset: 2px;
}

.side-animating .admin-shell-main-wrap {
  transition: grid-template-columns 0.22s ease;
}

.side-collapsed {
  --admin-side-w: 72px;
}

.side-collapsed .admin-shell-side-toggle svg {
  transform: scaleX(-1);
}

.side-collapsed .admin-shell-side-action {
  padding: 16px 12px 6px;
}

.side-collapsed .admin-shell-side-cta {
  padding: 11px 0;
}

.side-collapsed .admin-shell-side-nav {
  padding: 10px 12px 16px;
}

/* Hidden from sight, not from screen readers: the link keeps its name. */
.side-collapsed .admin-shell-side-cta > span,
.side-collapsed .admin-shell-side-link-text,
.side-collapsed .admin-shell-side-user-meta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.side-collapsed .admin-shell-side-label {
  display: none;
}

.side-collapsed .admin-shell-side-group-primary,
.side-collapsed .admin-shell-side-section {
  margin-bottom: 12px;
}

.side-collapsed .admin-shell-side-link {
  justify-content: center;
  padding: 11px 0;
}

.side-collapsed .admin-shell-side-active-dot {
  display: none;
}

/* A count becomes a dot on the icon's corner; the number is still read out (its visually-hidden twin). */
.side-collapsed .admin-shell-side-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  min-width: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  background: var(--sidenav-blue);
  box-shadow: 0 0 0 2px var(--sidenav-panel-bg);
}

.side-collapsed .admin-shell-side-footer {
  flex-direction: column;
  padding: 12px 8px;
}

.side-collapsed .admin-shell-side-user-card {
  flex: 0 0 auto;
  justify-content: center;
  padding: 6px;
}

/* "Need more room?" tip: a speech bubble beside the sidebar's collapse button, shown only while the open
   sidebar squeezes the page (booking form, auction map). js/side-collapse.js decides when, moves it to
   <body> and places it next to the button (owner, 2026-11-07: bubble on the button, not a banner). */
.side-room-hint {
  --side-room-hint-edge: color-mix(in srgb, var(--color-info) 28%, var(--color-info-bg));
  position: fixed;
  top: var(--side-room-hint-y, 0px);
  left: var(--side-room-hint-x, 0px);
  z-index: var(--z-popover);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: max-content;
  max-width: min(300px, calc(100vw - var(--side-room-hint-x, 0px) - 16px));
  padding: var(--space-sm) var(--space-xs) var(--space-sm) var(--space-md);
  /* Tinted like the toggle it points at, so it reads as a tip from the site, not a menu (owner, 2026-11-18). */
  border: 1px solid var(--side-room-hint-edge);
  border-radius: var(--radius-lg);
  background: var(--color-info-bg);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  animation: side-room-hint-in 0.18s ease-out;
}

/* The arrow points at the button; its height follows the button even when the bubble is nudged up. */
.side-room-hint::before {
  content: "";
  position: absolute;
  top: var(--side-room-hint-arrow, 50%);
  left: -6px;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--side-room-hint-edge);
  border-bottom: 1px solid var(--side-room-hint-edge);
  background: var(--color-info-bg);
  transform: translateY(-50%) rotate(45deg);
}

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

@keyframes side-room-hint-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .side-room-hint { animation: none; }
}

.side-room-hint__text {
  min-width: 0;
}

.side-room-hint__action {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  cursor: pointer;
}

.side-room-hint__action:hover {
  background: var(--color-primary-dark);
}

.side-room-hint__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.side-room-hint__close:hover {
  background: color-mix(in srgb, var(--color-info) 12%, transparent);
  color: var(--color-text-primary);
}

.side-room-hint__action:focus-visible,
.side-room-hint__close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* While the bubble shows, the button it points at is lit so the eye finds it. */
.side-room-hint-on .admin-shell-side-toggle {
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.website-settings-tabs {
  /* Segmented theme: equal-width buttons, neutral gray track, content-sized. */
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: var(--seg-gap);
  margin-bottom: var(--space-xl);
  padding: var(--seg-pad);
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
  box-shadow: var(--shadow-sm), var(--shadow-inner);
}

/* Six equal-width tabs need six times "Auction Houses": wider than the content area below about
   1200px, which pushed the page 76px sideways at 768. There they size to their own labels; below
   900 even that is ~120px too wide, so the strip wraps to a second row rather than hide a tab.
   (Under 768 the strip is replaced by the scrolling Settings row in .hub-tabs.) */
@media (max-width: 1199.98px) {
  .website-settings-tabs {
    grid-auto-columns: max-content;
  }
}
@media (max-width: 899.98px) {
  .website-settings-tabs {
    display: flex;
    flex-wrap: wrap;
  }
}

/* Grouped settings navigation: each group is a small segmented track under its name. Groups wrap as
   whole units, never splitting a pair. */
.website-settings-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: var(--space-xl);
}

.website-settings-group {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.website-settings-group-label {
  padding-left: 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.website-settings-nav .website-settings-tabs {
  margin-bottom: 0;
  grid-auto-columns: max-content;
}

.website-settings-tab {
  min-height: var(--seg-item-min-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--seg-item-pad);
  border-radius: var(--seg-item-radius);
  color: var(--seg-rest-text);
  font-size: var(--font-size-sm);
  font-weight: var(--seg-item-weight);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.website-settings-tab:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-component) 72%, transparent);
}

.website-settings-tab.active {
  color: var(--seg-active-text);
  background: var(--seg-active-bg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .14), 0 1px 1px rgba(16, 24, 40, .06);
}

.website-settings-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

[data-motion-card] {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  [data-motion-card]:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-motion-card] {
    transition: none;
  }

  [data-motion-card]:hover {
    transform: none;
  }
}

.admin-shell-content {
  font-family: var(--font-family-body);
  padding: 20px var(--space-xl) var(--space-3xl);
  min-width: 0;
  /* Keep the shared glass panel distinct from the similarly light page canvas.
     Colors come from the --shell-panel-* tokens in design-tokens.css. */
  background: var(--shell-panel-bg);
  border: var(--shell-panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shell-panel-shadow);
}

/* ═════════════════════════════════════════════════════════════════════════════
   ALERTS & NOTIFICATIONS
   ═════════════════════════════════════════════════════════════════════════════ */

.admin-shell-content .alert,
.admin-list .alert {
  border: 1px solid color-mix(in srgb, var(--color-component) 72%, transparent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md), var(--shadow-inner);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.admin-shell-content .alert-success,
.admin-list .alert-success {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-success-bg) 86%, transparent) 0%, color-mix(in srgb, var(--color-success-bg) 72%, transparent) 100%);
  border-color: color-mix(in srgb, var(--color-success) 16%, transparent);
  color: var(--color-success);
}

.admin-shell-content .alert-danger,
.admin-list .alert-danger {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-error-bg) 88%, transparent) 0%, color-mix(in srgb, var(--color-error-bg) 72%, transparent) 100%);
  border-color: color-mix(in srgb, var(--color-error) 16%, transparent);
  color: var(--color-primary-dark);
}

.admin-shell-content .alert-info,
.admin-list .alert-info {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-info-bg) 88%, transparent) 0%, color-mix(in srgb, var(--color-info-bg) 72%, transparent) 100%);
  border-color: color-mix(in srgb, var(--color-info) 14%, transparent);
  color: var(--color-info);
}

.admin-shell-content .alert-warning,
.admin-list .alert-warning {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-warning-bg) 92%, transparent) 0%, color-mix(in srgb, var(--color-warning-bg) 76%, transparent) 100%);
  border-color: color-mix(in srgb, var(--color-warning) 16%, transparent);
  color: var(--color-warning);
}

/* Partner Automation: the safety check's held customer emails, with the button to send them. */
.partner-held-asks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
}
.partner-held-asks > div:first-child { flex: 1 1 0; min-width: min(100%, 20rem); }
.partner-held-asks__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* ═════════════════════════════════════════════════════════════════════════════
   ADMIN LIST - Tables, Filters, List Views
   ═════════════════════════════════════════════════════════════════════════════ */

.admin-list {
  font-family: var(--font-family-body);
  color: var(--color-text-secondary);
}

.admin-list .page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.admin-list .page-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-3xl);
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.admin-list .page-sub {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 4px;
  font-weight: var(--font-weight-medium);
}

/* Dashboard heading layout: the title and clock own the first row, while the
   supporting copy wraps independently beneath the title. */
.admin-list .dashboard-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 0;
  align-items: start;
}
.dashboard-page-heading {
  display: contents;
}
.dashboard-page-heading > .page-title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.dashboard-page-heading > .page-sub {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}
.dashboard-page-head > .jst-clock {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

/* Shared right-aligned Japan clock for client and admin dashboards. It sits
   directly on the page background, with the flip tiles and metadata as two
   clean, aligned groups. */
.jst-clock {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: stretch;
  gap: clamp(10px, 1.25vw, 18px);
  margin-left: auto;
  color: var(--color-text-secondary);
}
.jst-clock__meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 84px;
  text-align: left;
}
.jst-clock__location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.jst-clock__location > span:last-child {
  color: var(--color-text-tertiary);
}
.jst-clock__time {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.jst-clock__unit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 31px;
  padding: 9px 5px 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-panel-header) 76%, black);
  border-radius: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-panel-header) 88%, white) 0 49%, var(--color-panel-header) 50% 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(18, 24, 32, 0.2);
  color: var(--color-panel-header-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  text-align: center;
}
.jst-clock__unit::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.38);
  pointer-events: none;
}
.jst-clock__unit.is-flipping {
  animation: jst-clock-flip 220ms ease-out;
}
.jst-clock__separator {
  align-self: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}
.jst-clock__date {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.1;
  white-space: nowrap;
  color: var(--color-text-tertiary);
}
@keyframes jst-clock-flip {
  0% { transform: perspective(90px) rotateX(-18deg); filter: brightness(0.78); }
  100% { transform: perspective(90px) rotateX(0); filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .jst-clock__unit.is-flipping { animation: none; }
}
@media (max-width: 520px) {
  .jst-clock { gap: 8px; }
  .jst-clock__meta { min-width: 72px; }
  .jst-clock__location { font-size: var(--font-size-2xs); }
  .jst-clock__date { font-size: var(--font-size-xs); }
  .jst-clock__unit { min-width: 26px; padding: 7px 4px 6px; font-size: var(--font-size-sm); }
  .jst-clock__separator { font-size: var(--font-size-xs); }
}
@media (max-width: 390px) {
  .jst-clock {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .jst-clock__meta {
    min-width: 0;
    gap: 3px;
  }
}

.admin-list .page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
}

/* ── Form grids follow the card, not the screen ──────────────────────────────────────
 * Create/edit forms lay their fields out with Bootstrap's col-md-*, which switch on at a 768px
 * SCREEN. Beside the admin sidebar the card is only ~370px wide there (~620px at 1024), so six
 * columns squeezed fields to 26-45px and Tiers' Video/Active toggles ran past the card edge.
 * Cards holding such a grid are containers, and the columns follow the card's width instead:
 * one per row when narrow, two in the middle range, the designed layout from 900px up. */
.filter-card:has(.row > [class*="col-md-"]) {
  container-type: inline-size;
  container-name: form-card;
}
@container form-card (max-width: 899.98px) {
  .row > [class*="col-md-"]:not(.col-md-12) {
    flex: 0 0 auto;
    width: 50%;
  }
}
@container form-card (max-width: 519.98px) {
  /* Same selector weight as the 50% rule above, so this one wins when both apply. */
  .row > [class*="col-md-"]:not(.col-md-12) {
    flex: 0 0 auto;
    width: 100%;
  }
}

.admin-list .filter-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 82%, transparent) 0%, color-mix(in srgb, var(--color-component) 62%, transparent) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px 22px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-lg), var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.admin-list .notification-filter-card {
  padding: var(--space-md);
}

/* Notification feed filter lives in the title band; the bulk action remains in
   the content area so it is not confused with the segmented view selector. */
.notification-feed-head {
  align-items: center;
}

/* Same treatment as the dashboard's finance period toggle (the other segmented
   control in a panel header): every colour derives from --color-panel-header-text,
   never a literal white, so a light PanelHeader in Website Settings → Theme keeps
   it visible. */
.notification-feed-head .notification-filter-tabs {
  background: transparent;
  border-color: color-mix(in srgb, var(--color-panel-header-text) 30%, transparent);
}

.notification-feed-head .notification-filter-tabs .pill-tab {
  color: color-mix(in srgb, var(--color-panel-header-text) 82%, transparent);
}

.notification-feed-head .notification-filter-tabs .pill-tab:hover {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 16%, transparent);
}

.notification-feed-head .notification-filter-tabs .pill-tab.active {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-panel-header-text) 30%, transparent);
}

.notification-feed-head .notification-filter-tabs .pill-tab:focus-visible {
  outline-color: var(--color-panel-header-text);
}

.notification-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--rule2);
}

.notification-filter-tabs {
  /* Neutral gray track so unselected buttons don't read as plain white. */
  --segmented-tint-bg: var(--seg-track-bg);
  /* Equal-width segments: every button sizes to the widest one. */
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: var(--seg-gap);
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.notification-filter-tabs::-webkit-scrollbar {
  display: none;
}

.notification-filter-actions {
  margin-left: auto;
  display: inline-flex;
}

/* Primary outline button — clear "mark all read" affordance. */
.notification-filter-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--seg-item-min-h);
  padding: var(--seg-item-pad);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--seg-item-weight);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.notification-filter-action:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
}

.admin-list .field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Default label (custom pickers / card grids): normal flow, above the control. */
.admin-list .field-label {
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Outlined (contained) label — only for real input boxes: sits inside the box,
   top-left aligned, value below. Card-grid pickers keep the flow label above. */
.admin-list .field:has(> .field-input, > .field-select, > textarea, > .iti > .field-input) > .field-label {
  position: absolute;
  top: 5px;
  left: 13px;
  z-index: 1;
  max-width: calc(100% - 26px);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-tertiary);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Shared required field marker — use <span class="req"> inside any label */
.req {
  color: var(--color-error);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  margin-left: 3px;
  line-height: 1;
}

/* No required-field tint: every field has the same fill and the red asterisk alone marks
   required (owner, 2026-11-25). A tint on some fields read as "disabled" and made forms patchy. */

.admin-list .field-input,
.admin-list .field-select {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--field-fill);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 46px;
  padding: 17px 12px 5px;
  line-height: var(--line-height-normal);
}

.admin-list .field-input:focus,
.admin-list .field-select:focus {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
  outline: none;
}

/* The open <select> popup list is OS-rendered chrome the page can't otherwise
   theme; background-color/color on <option> is the one part of it Chrome,
   Edge, and Firefox still honor (Safari ignores this and falls back to its
   own look regardless). Global and unscoped so every themed select on the
   site gets it, not just the admin list filters. */
.field-select option,
select.field-input option,
.form-select option {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
}

.field-select option:checked,
select.field-input option:checked,
.form-select option:checked {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Global field validation: mark the control, not a nearby error sentence. */
.field-validation-error,
.text-danger.field-validation-error,
[data-valmsg-for].field-validation-error {
  display: none !important;
}

/* Opt-in exception: a field whose rule cannot be guessed from the outline alone (the recovery code: no
   dates, repeats or runs) shows its sentence too. */
.field-validation-error.field-error-shown {
  display: block !important;
  margin-top: var(--space-xs);
  color: var(--color-error);
  font-size: var(--font-size-sm);
}

input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error,
.form-control.input-validation-error,
.field-input.input-validation-error,
.field-select.input-validation-error,
.auth-input.input-validation-error {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-error-bg) 72%, var(--color-surface) 28%),
      color-mix(in srgb, var(--color-error-bg) 52%, var(--color-surface) 48%)
    ) !important;
  border-color: color-mix(in srgb, var(--color-error) 42%, var(--color-border) 58%) !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--color-error) 18%, transparent),
    0 0 0 3px color-mix(in srgb, var(--color-error) 10%, transparent) !important;
}

.admin-list .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
}

/* Shared page/form action alignment. Page-specific settings styles define
   spacing only; this contract keeps their actual controls on the right. */
.admin-list .form-actions-row,
.admin-shell-content .settings-submit-row,
.admin-shell-content .danger-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

/* Standard card forms place their terminal action at the right edge. This is
   deliberately scoped to app/admin cards, so landing/auth flows and the New
   Request form keep their purpose-built layouts. */
.admin-list form.filter-card > .list-btn:last-child,
.admin-list .filter-card > form > .list-btn:last-child {
  display: flex;
  width: max-content;
  margin-inline-start: auto;
}

.admin-list .filter-card form > .col-12:last-child:has(> .list-btn) {
  display: flex;
  justify-content: flex-end;
}

/* Inline results toolbar: shared record-list filter/search system.
   Desktop filters live inside the results card, directly above the row header. */
.record-list-page .record-results-toolbar.record-filter-card {
  margin: 0;
  padding: var(--space-md);
  border: 0;
  border-bottom: 1px solid var(--rule2);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.record-list-page .record-results-toolbar > .client-panel-head {
  display: none;
}

.record-list-page .record-results-toolbar .row {
  --bs-gutter-x: var(--space-sm);
  --bs-gutter-y: var(--space-sm);
}

.record-list-page .record-results-toolbar .record-search-col {
  margin-bottom: var(--space-xs);
}

/* Filter fields flow naturally: as many per row as fit at a comfortable min width,
   wrapping to the next row instead of squeezing. Fits all filters on one line on a
   wide desktop; degrades gracefully to fewer columns, then a single column on mobile. */
.record-list-page .record-results-toolbar .record-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-sm);
  align-items: end;
}

/* ── Unified sort menu ──────────────────────────────────────────────────────────
   One control for every admin + customer list page. Lives in the results header;
   works at all breakpoints. Replaces the old dual "Sort By" + "Order" selects. */
/* Dedicated sort row directly above the list — keeps the control clear of the filter
   card, and (right-aligned) lets the panel open on-screen at every width, including
   mobile where a left-placed, right-anchored panel was clipping off the left edge. */
.record-sort-bar {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-sm) var(--space-md);
  /* Same neutral gray as the column header row (record-row.css) — reads as
     one continuous "controls" band instead of the sort row floating on the
     plain card background. */
  background: color-mix(in srgb, var(--color-text-primary) 5%, var(--color-surface));
}

.sort-menu {
  position: relative;
  flex-shrink: 0;
}

.sort-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0 12px;
  /* Matches the filter toggle it now usually sits next to
     (client-panel-head-controls) — was unset, sized only by padding, which
     left it ~9px shorter and off-center against a same-row button. */
  min-height: calc(var(--btn-height) - 4px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  list-style: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  /* Lets the label truncate below — needed now that this can share a row
     with the filter toggle (client-panel-head-controls, both flex:1 1 0)
     instead of always having its own full-width row. */
  min-width: 0;
}

.sort-menu__trigger::-webkit-details-marker { display: none; }
.sort-menu__trigger::marker { content: ""; }
.sort-menu__trigger:hover { background: var(--field-fill-hover); border-color: var(--color-text-tertiary); }
.sort-menu__trigger:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.sort-menu__label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.sort-menu__label strong { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
.sort-menu__icon { flex-shrink: 0; opacity: 0.75; }
.sort-menu__chevron { flex-shrink: 0; transition: transform 0.18s ease; }
.sort-menu[open] .sort-menu__chevron { transform: rotate(180deg); }

.sort-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 232px;
  padding: var(--space-2xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover);
}

.sort-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--field-font-size);
  color: var(--color-text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.sort-menu__item:hover { background: var(--field-fill-hover); }
.sort-menu__item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.sort-menu__item.is-selected { color: var(--color-primary); font-weight: var(--font-weight-semibold); }
.sort-menu__check { flex-shrink: 0; color: var(--color-primary); opacity: 0; }
.sort-menu__item.is-selected .sort-menu__check { opacity: 1; }

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

/* ── Themed select ─────────────────────────────────────────────────────────
   Custom button+listbox standing in for a native <select> — the open popup
   list of a native select is OS-rendered chrome no CSS can restyle in any
   browser (background-color/color on <option> only ever reaches the resting
   row in the best case, and Safari / Firefox-on-macOS ignore even that). The
   real <select> stays in the DOM, just visually hidden, so asp-for binding,
   its name/value, and any existing `change` listeners keep working exactly
   as before. See themed-select.js. */
.themed-select {
  position: relative;
  width: 100%;
}

/* !important because a page's own field rules (e.g. ".public-form-field select { width: 100% }") used to
   win and resize this hidden control; it sits beside the wrapper, not inside it, so a full-width copy made
   Contact 428px wide on a 375px phone (Codex audit, 2026-11-19). It must stay a 1px dot on every page. */
.themed-select__native {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.themed-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  text-align: left;
  appearance: none;
  cursor: pointer;
}

.themed-select__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.themed-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.themed-select__chevron {
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  transition: transform 0.18s ease;
}

.themed-select.is-open .themed-select__chevron {
  transform: rotate(180deg);
}

.themed-select__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: var(--z-popover);
  padding: var(--space-2xs);
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* The options scroll inside the panel, so a search field above them stays put. */
.themed-select__list {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A long list with data-themed-select-index: the A-Z strip sits to the left of the options. */
.themed-select__body {
  display: flex;
  align-items: stretch;
  gap: var(--space-2xs);
  min-height: 0;
}
.themed-select__body > .themed-select__list {
  flex: 1 1 auto;
  min-width: 0;
}
.themed-select__index {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: 22px;
  max-height: 280px;
  padding: 2px 0;
  touch-action: none; /* a finger dragging down the strip moves through the letters, not the page */
  user-select: none;
}
.themed-select__index[hidden] { display: none; }
.themed-select__index-letter {
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-primary);
  font: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  cursor: pointer;
}
.themed-select__index-letter:hover,
.themed-select__index-letter.is-current {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* Same search field as the auction house picker on the booking form. */
.themed-select__search {
  margin: calc(var(--space-2xs) * -1) calc(var(--space-2xs) * -1) var(--space-2xs);
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-component);
}
.themed-select__search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font: inherit;
  font-size: var(--field-font-size); /* 16px+ on phones, so iOS Safari does not zoom on focus */
  color: var(--color-text-primary);
  outline: none;
}
.themed-select__search input:focus {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
}
.themed-select__option[hidden],
.themed-select__empty[hidden] { display: none; }
.themed-select__empty {
  margin: 0;
  padding: 12px 10px;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.themed-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--field-font-size);
  color: var(--color-text-primary);
  cursor: pointer;
  white-space: nowrap;
}

/* A translucent-white --field-fill-hover (its usual job: tinting a form field
   against the page background) is invisible against this panel's own white
   background, so the active/hovered row needs real contrast of its own. */
.themed-select__option.is-active { background: color-mix(in srgb, var(--color-text-primary) 6%, var(--color-surface)); }
.themed-select__option.is-selected { color: var(--color-primary); font-weight: var(--font-weight-semibold); }
/* Its label carries the reason (e.g. "opens Sun 22 Nov (Japan time)"), so it wraps rather than being cut off. */
.themed-select__option.is-disabled { color: var(--color-text-secondary); opacity: .7; cursor: not-allowed; white-space: normal; }
.themed-select__option.is-disabled.is-active { background: transparent; }
.themed-select__check { flex-shrink: 0; color: var(--color-primary); opacity: 0; }
.themed-select__option.is-selected .themed-select__check { opacity: 1; }

/* Country flags (owner, 2026-11-25): an option with data-flag shows the phone field's own flag image
   (intl-tel-input's sprite, loaded by themed-select.js) before the name, in the list and the closed field. */
.themed-select__label { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.themed-select__label .themed-select__flag { flex: 0 0 auto; margin: 0; }
.themed-select__value .themed-select__flag { display: inline-block; margin: 0 8px 0 0; vertical-align: -2px; }

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

/* An open dropdown lifts the card it sits in: a card with a blur (Account) or its own z-index (the
   booking form's sections) keeps the list inside it, under the next card's header (owner, 2026-11-22). */
:is(.section-card, .form-section, .request-detail-card, .settings-card, .homepage-settings-card):has(.themed-select.is-open) {
  position: relative;
  z-index: var(--z-popover);
}

/* ═══ PICKERS (phone) ═══════════════════════════════════════════════════════════
   One design language for every picker list on a phone (picker.js, owner 2026-11-22): the dropdowns
   above, the booking form's auction house list (new-request-theme.css) and the phone number's country
   list (phone-input.css). Two shapes, one look: the same surface, rows, text size, colours and tick.
     .picker-sheet  a panel from the bottom of the screen, for a picker on the page itself
     .picker-menu   a menu at the field, for a picker inside the phone filter panel or a dialog (Apple
                    shows one panel at a time, so a second panel never opens on top of the first)
   Both sit on <body> while open, above the phone filter panel. The phone library's own popup rules
   out-rank a single class, hence its longer selectors here. */
.picker-sheet__head { display: none; }

/* Behind an open picker: a tap here closes the picker and nothing else. Dimmed behind a sheet; clear
   behind a menu, so the panel the menu opened from stays as it was. */
.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-picker-backdrop);
  background: color-mix(in srgb, var(--color-text-primary) 28%, transparent);
  touch-action: none;
}

.picker-backdrop--clear {
  background: transparent;
}

/* The shared surface. */
.picker-sheet,
.picker-menu,
.iti--fullscreen-popup .iti__dropdown-content.picker-sheet {
  position: fixed;
  z-index: var(--z-picker);
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.picker-sheet,
.iti--fullscreen-popup .iti__dropdown-content.picker-sheet {
  top: auto;
  left: 0;
  right: 0;
  bottom: var(--picker-sheet-bottom, 0px);
  max-height: var(--picker-sheet-max, 80dvh);
  padding: var(--space-xs) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom));
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -20px 60px color-mix(in srgb, var(--color-text-primary) 14%, transparent);
}

/* Placed by picker.js at its field (left, width, top and max-height). */
.picker-menu {
  right: auto;
  bottom: auto;
  padding: var(--space-2xs);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--color-text-primary) 22%, transparent),
              0 2px 8px color-mix(in srgb, var(--color-text-primary) 10%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .picker-sheet { animation: picker-sheet-in 0.2s ease-out; }
  .picker-menu { animation: picker-menu-in 0.14s ease-out; transform-origin: top center; }
  .picker-menu.is-above { transform-origin: bottom center; }
}

@keyframes picker-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes picker-menu-in {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* The keyboard covers the home-indicator strip, so no room is kept for it while typing. */
.picker-sheet.has-keyboard,
.iti--fullscreen-popup .iti__dropdown-content.picker-sheet.has-keyboard {
  padding-bottom: var(--space-sm);
}

.picker-sheet::before {
  content: "";
  flex: none;
  width: 42px;
  height: 5px;
  margin: 0 auto var(--space-xs);
  border-radius: var(--radius-full);
  background: var(--color-border);
}

.picker-sheet .picker-sheet__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  touch-action: none;
}

.picker-sheet__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.picker-sheet__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: calc(var(--space-xs) * -1);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.picker-sheet__close:focus-visible {
  outline: none;
  box-shadow: var(--field-focus-ring);
}

.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__search {
  flex: none;
  margin: 0 0 var(--space-xs);
  padding: 0;
  border-bottom: 0;
  background: none;
}

.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* In the phone sheet the strip runs the sheet's full height, with thumb-sized letters. */
.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__body {
  flex: 1 1 auto;
}
.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__index {
  width: 28px;
  max-height: none;
}
.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__index-letter {
  font-size: var(--font-size-sm);
}

/* The shared row: thumb-sized, readable text (the desktop dropdown's 12px rows were 34px tall). The
   auction house and phone lists use the same numbers in their own files. */
.themed-select__panel:is(.picker-sheet, .picker-menu) .themed-select__option {
  min-height: 48px;
  padding: 10px 12px;
  font-size: var(--field-font-size);
}

.record-search-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: stretch;
}

.record-search-group.record-search-group-with-export {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.record-search-box {
  position: relative;
  min-width: 0;
}

.record-search-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--color-text-tertiary);
  transform: translateY(-50%);
  pointer-events: none;
}

.admin-list .record-search-input,
.record-list-page .record-results-toolbar .record-search-input {
  min-height: 54px;
  padding: 0 18px 0 48px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: color-mix(in srgb, var(--color-component) 78%, transparent);
}

.record-list-page .record-search-submit {
  min-width: 132px;
  min-height: 54px;
  border-radius: var(--radius-button);
  justify-content: center;
}

.record-list-page .record-search-export {
  min-width: 132px;
  min-height: 54px;
  border-radius: var(--radius-lg);
  justify-content: center;
}

.record-list-page .record-results-toolbar .field-input,
.record-list-page .record-results-toolbar .field-select {
  min-height: 42px;
}

.record-list-page .record-results-toolbar .filter-actions {
  justify-content: flex-start;
}

.record-list-page .table-wrap > .active-filter-chips,
.record-list-page .record-results-toolbar + .active-filter-chips {
  margin: 0;
  /* Top inset keeps the chips from sitting flush against the filter panel's
     bottom border above them. */
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--rule2);
}

.admin-list .active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
}

.admin-list .active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 30px;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-component) 70%, transparent);
  color: var(--color-text-secondary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.admin-list .active-filter-chip strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.admin-list .active-filter-chip-clear {
  background: color-mix(in srgb, var(--color-component) 70%, transparent);
  border-color: var(--color-border);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.admin-list .active-filter-chip-clear:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.admin-list .filter-chip-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 14px;
  line-height: 1;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.admin-list .active-filter-chip[data-filter-param]:hover {
  background: color-mix(in srgb, var(--color-component) 88%, transparent);
  color: var(--color-text-primary);
}

.admin-list .active-filter-chip[data-filter-param]:hover .filter-chip-dismiss {
  color: var(--color-text-primary);
}

.admin-list .list-btn {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  min-height: var(--btn-height);
  padding: 8px 18px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.admin-list .list-btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.admin-list .list-btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--color-primary) 24%, transparent);
}

.admin-list .list-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-primary);
  outline-offset: var(--focus-ring-offset);
}

/* While a report PDF is being prepared. The label swaps to "Preparing PDF…";
   this is the rest of the state, kept here so both admin surfaces pick it up. */
.list-btn.is-busy {
  opacity: 0.72;
  cursor: progress;
}

.admin-list .list-btn-ghost {
  background: color-mix(in srgb, var(--color-component) 58%, transparent);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.admin-list .list-btn-ghost:hover {
  border-color: var(--color-text-tertiary);
  color: var(--color-text-primary);
}

.admin-list .list-btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.admin-list .list-btn-outline:hover {
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  border-color: var(--color-primary-dark);
  color: var(--color-primary-dark);
}

.admin-list .list-btn-export {
  background: transparent;
  color: var(--color-success);
  border: 1.5px solid var(--color-success);
}

.admin-list .list-btn-export:hover {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.admin-list .list-btn-danger {
  background: var(--color-error);
  color: var(--color-text-inverse);
  border-color: transparent;
}

.admin-list .list-btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-error) 82%, black);
  color: var(--color-text-inverse);
}

.admin-list .list-btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-list .list-btn-cancel {
  background: transparent;
  color: var(--color-error);
  border: 1.5px solid var(--color-error);
}

.admin-list .list-btn-cancel:hover {
  background: color-mix(in srgb, var(--color-error) 8%, transparent);
  color: var(--color-error);
}

.record-list-wrap .request-cancel-form {
  width: 100%;
}

.record-list-wrap .record-row__actions .request-cancel-form {
  display: flex;
  justify-content: flex-end;
}

/* Shared checkbox-to-switch presentation. The New Request add-on selector is
   intentionally excluded: that page owns its card-selection interaction and
   must remain unchanged. Hidden boolean state inputs also stay hidden. */
input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]) {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block;
  width: 38px !important;
  min-width: 38px;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 38px;
  vertical-align: middle;
  /* Off: a grey track with a white, outlined knob. The knob used to be --color-surface on a
     --color-component track, which are both white in the default theme, so an off switch looked
     like an empty box (login, checkout "I agree"; owner 2026-11-19). On is unchanged below. */
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 24%, transparent) !important;
  border-radius: var(--radius-full) !important;
  background-color: color-mix(in srgb, var(--color-text-primary) 14%, var(--color-surface)) !important;
  background-image: radial-gradient(circle at 10px 50%, var(--color-text-inverse) 0 7px, color-mix(in srgb, var(--color-text-primary) 22%, transparent) 7.5px 8.5px, transparent 9px) !important;
  background-repeat: no-repeat !important;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--color-text-primary) 10%, transparent);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]):checked {
  border-color: var(--color-primary) !important;
  background-color: var(--color-primary) !important;
  background-image: radial-gradient(circle at calc(100% - 10px) 50%, #fff 0 7px, transparent 7.5px) !important;
}

input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]):focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
}

input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]):disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Switches sit after their copy, at the right edge of their control row,
   regardless of whether legacy markup declared the input before the label. */
:where(label, .checkout-terms-field, .input-group-text):not(.evidence-item):has(> input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]))
  > input[type="checkbox"] {
  order: 2;
  margin-inline-start: auto !important;
}

/* Customer preference cards are grids rather than flex rows. Give copy the
   fluid first track and pin the shared switch to the right-hand track. */
.customer-manager-page .toggle-card:has(> input[type="checkbox"]) {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.customer-manager-page .toggle-card > span {
  grid-column: 1;
  grid-row: 1;
}

.customer-manager-page .toggle-card > input[type="checkbox"] {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

/* Evidence selectors overlay visual cards, so "right" means their top-right
   corner rather than after the card caption at the bottom. */
.evidence-item:has(> input[type="checkbox"]) {
  position: relative;
}

.evidence-item > input[type="checkbox"] {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"]:not([name="SelectedAddOnIds"]):not(.d-none):not([hidden]) {
    transition: none;
  }
}

/* Token checkbox row — replaces Bootstrap .form-check on admin forms */
.admin-list .field-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-component) 72%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
}

.admin-list .field-check:hover {
  border-color: var(--color-text-tertiary);
  color: var(--color-text-primary);
}

.admin-list .field-check input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

/* A labelled on/off box (Status on auction houses and notices, Home Page on closures) takes the same
   outlined label as the boxes beside it, so it lines up with them instead of sitting a label-height
   lower (Codex settings audit, 2026-11-19). */
.admin-list .field:has(> .field-label + .field-check) > .field-label {
  position: absolute;
  top: 5px;
  left: 13px;
  z-index: 1;
  max-width: calc(100% - 26px);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.admin-list .field > .field-label + .field-check {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 17px 12px 5px;
}

/* Delete sections: a quiet heading, so deleting never competes with the edit above it. */
.admin-list .danger-panel-title {
  margin: 0 0 6px;
  font-family: var(--font-family-body);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-error);
}

.admin-list .results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-list .results-count {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
}

.admin-list .results-count strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.admin-list .table-wrap {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 82%, transparent) 0%, color-mix(in srgb, var(--color-component) 62%, transparent) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: var(--shadow-lg), var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* At sheet breakpoints the glass blur must go: backdrop-filter turns .table-wrap
   into a stacking context AND the containing block for fixed descendants, which
   traps the mobile filter bottom sheet (a fixed child) beneath the body-level
   dim backdrop — the whole screen, sheet included, rendered blurred. The glass
   effect is imperceptible on flat mobile backgrounds; desktop keeps it. */
@media (max-width: 767px), (orientation: landscape) and (max-height: 520px) and (max-width: 960px) and (pointer: coarse) {
  .admin-list .table-wrap {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.admin-list .pagination .page-link {
  border-radius: var(--radius-button-sm);
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-component) 62%, transparent);
  color: var(--color-text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.admin-list .pagination .page-item.active .page-link,
.admin-list .pagination .page-link:hover {
  background: color-mix(in srgb, var(--color-component) 82%, transparent);
  color: var(--color-text-primary);
  border-color: var(--color-border-light);
}

.admin-list .pagination .page-item.disabled .page-link {
  background: color-mix(in srgb, var(--color-component) 34%, transparent);
  color: var(--color-text-tertiary);
}

.admin-list table {
  width: 100%;
  border-collapse: collapse;
}

.admin-list thead tr {
  border-bottom: 1.5px solid var(--color-border);
  background: color-mix(in srgb, var(--color-component) 46%, transparent);
}

.admin-list th {
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 11px 16px;
  white-space: nowrap;
}

.admin-list th a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-list th a:hover {
  color: var(--color-text-primary);
}

.admin-list .sort-arrow {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1;
}

.admin-list td {
  font-family: var(--font-family-body);
  padding: 13px 16px;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  vertical-align: middle;
  line-height: var(--line-height-normal);
}

.admin-list tbody tr {
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.14s ease;
}

.admin-list tbody tr:last-child {
  border-bottom: none;
}

/* Reading aid for wide tables — rows are not click targets (links live inside
   cells), so no cursor: pointer here. */
.admin-list tbody tr:hover {
  background: color-mix(in srgb, var(--color-component) 40%, transparent);
}

.admin-list .col-main {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.admin-list .col-sub {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.status-pill,
.admin-shell .status-pill,
.admin-shell-content .status-pill,
.admin-list .pill {
  font-family: var(--font-family-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  padding: var(--space-2xs) calc(var(--space-sm) + var(--space-2xs));
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

/* Negative ledger amounts (credit notes, refunds) — semantic error tone, not
   Bootstrap's text-danger (A-V15). */
.rr-amt--negative {
  color: var(--color-error);
}

/* Plain metadata chip for ages/durations (e.g. refund queue "3d") — matches
   status-pill metrics but is deliberately NOT a status pill (A-V10). */
.refund-age-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xs) calc(var(--space-sm) + var(--space-2xs));
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────────────
   Segmented tabs — reusable items for a segmented toggle control. Transparent
   with muted text at rest; brand tint fill + primary text + soft shadow when
   .active. Drop them into a segmented container (tint fill, 1px border,
   ~15px radius, 4px padding) — e.g. .hub-tabs, .notification-filter-tabs,
   .finance-periods, .mobile-admin-settings-pills, .report-gallery-tabs.
   Optional .danger accent for a destructive/attention tab; an inner .ct span
   renders a count.
   ────────────────────────────────────────────────────────────────────────── */
.pill-tab,
.mobile-admin-settings-pills a,
.hub-tab,
.mobile-context-tab,
.imjdm-dash-theme .finance-period {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--seg-item-min-h);
  padding: var(--seg-item-pad);
  border: 0;
  border-radius: var(--seg-item-radius);
  background: transparent;
  color: var(--seg-rest-text);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--seg-item-weight);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.pill-tab:hover,
.mobile-admin-settings-pills a:hover,
.hub-tab:hover,
.mobile-context-tab:hover,
.imjdm-dash-theme .finance-period:hover {
  background: color-mix(in srgb, var(--color-text-tertiary) 10%, transparent);
  color: var(--color-text-primary);
}

.pill-tab:focus-visible,
.mobile-admin-settings-pills a:focus-visible,
.hub-tab:focus-visible,
.mobile-context-tab:focus-visible,
.imjdm-dash-theme .finance-period:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.pill-tab.active,
.mobile-admin-settings-pills a.active,
.hub-tab.active,
.mobile-context-tab.active {
  background: var(--seg-active-bg);
  color: var(--seg-active-text);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, .14),
    0 1px 1px rgba(16, 24, 40, .06);
}

.pill-tab .ct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-text-tertiary) 18%, transparent);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.pill-tab.active .ct {
  background: color-mix(in srgb, white 24%, transparent);
  color: var(--color-text-inverse);
}

.pill-tab.danger {
  color: var(--color-error);
}

.pill-tab.danger:hover {
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
  color: var(--color-error);
}

.pill-tab.danger .ct {
  background: color-mix(in srgb, var(--color-error) 14%, transparent);
  color: var(--color-error);
}

.pill-tab.danger.active,
.pill-tab.danger.active .ct {
  color: var(--color-text-inverse);
}

.pill-tab.danger.active {
  background: var(--color-error);
}

.pill-tab.danger.active .ct {
  background: color-mix(in srgb, #fff 26%, transparent);
}

.admin-shell h1,
.admin-shell h2,
.admin-shell h3,
.admin-shell h4,
.admin-shell h5,
.admin-shell h6,
.admin-shell .card-title,
.admin-shell-content h1,
.admin-shell-content h2,
.admin-shell-content h3,
.admin-shell-content h4,
.admin-shell-content h5,
.admin-shell-content h6,
.admin-shell-content .card-title {
  font-family: var(--font-family-heading);
}

/* Panel and section titles: the body font in semibold (--font-panel-title, design-tokens.css), not the heading
   face; see the note there. No text-transform (owner, 2026-11-26): titles are written in Apple-style title case
   by hand; "capitalize" also capitalised small words ("Access And Sign-In"). */
.admin-shell .panel-title,
.admin-shell-content .panel-title {
  font-family: var(--font-panel-title);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-panel-title);
  line-height: var(--line-height-tight);
  letter-spacing: 0;
  color: var(--color-text-primary);
}

.admin-shell .section-title,
.admin-shell-content .section-title {
  font-family: var(--font-panel-title);
  font-weight: var(--font-weight-panel-title);
  letter-spacing: 0;
}

.admin-shell button,
.admin-shell input,
.admin-shell select,
.admin-shell textarea,
.admin-shell label,
.admin-shell .btn,
.admin-shell .badge,
.admin-shell .breadcrumb,
.admin-shell .breadcrumb-item,
.admin-shell p,
.admin-shell li,
.admin-shell span,
.admin-shell div {
  font-family: inherit;
}

/* Workflow progression: amber → blue → teal → green */
.status-pill.paid,
.admin-list .pill.paid {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pill.inprogress,
.admin-list .pill.inprogress {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.status-pill.completed,
.admin-list .pill.completed {
  background: color-mix(in srgb, var(--color-success-bg) 52%, var(--color-info-bg) 48%);
  color: color-mix(in srgb, var(--color-success) 52%, var(--color-info) 48%);
}

.status-pill.published,
.admin-list .pill.published {
  background: var(--color-success-bg);
  color: var(--color-success);
}

/* Cancelled, released, superseded: over and nothing to do, so neutral slate. Not the primary
   colour (that read as an active state) and not red (red is kept for failures). */
.status-pill.cancelled,
.admin-list .pill.cancelled {
  background: color-mix(in srgb, var(--color-text-primary) 9%, var(--color-surface));
  color: var(--color-text-secondary);
}

.status-pill.refund-remediation,
.admin-list .pill.refund-remediation,
.status-pill.missed-sla,
.admin-list .pill.missed-sla {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.status-pill.refund-required,
.admin-list .pill.refund-required,
.status-pill.action-needed {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pill.refund-sla,
.admin-list .pill.refund-sla {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.status-pill.failed,
.admin-list .pill.failed {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.status-pill.pending,
.admin-list .pill.pending {
  background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
  color: var(--color-text-tertiary);
}

.status-pill.inactive,
.admin-list .pill.inactive {
  background: color-mix(in srgb, var(--color-text-primary) 7%, var(--color-surface));
  color: var(--color-text-secondary);
}

/* Semantic variants (mapped via Helpers/StatusPill.cs) */
.status-pill.open,
.admin-list .pill.open,
.status-pill.refund-partial,
.admin-list .pill.refund-partial {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pill.unread,
.admin-list .pill.unread,
.status-pill.refunded,
.admin-list .pill.refunded {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.status-pill.closed,
.admin-list .pill.closed {
  background: color-mix(in srgb, var(--color-success-bg) 52%, var(--color-info-bg) 48%);
  color: color-mix(in srgb, var(--color-success) 52%, var(--color-info) 48%);
}

/* Locked: permanently closed — neutral slate, deliberately not a success tone */
.status-pill.locked,
.admin-list .pill.locked {
  background: color-mix(in srgb, var(--color-text-primary) 9%, var(--color-surface));
  color: var(--color-text-secondary);
}

/* Bootstrap-default inputs across the app shells inherit the same translucent
   glass fill as the .field-input pattern, so every page reads consistently. */
.admin-shell-content .form-control,
.admin-shell-content .form-select,
.admin-list .form-control,
.admin-list .form-select,
.record-list-page .form-control,
.record-list-page .form-select {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  background: var(--field-fill);
  border-color: var(--color-border);
  border-radius: var(--radius-md);
}

/* ═════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
  .admin-list,
  .imjdm-dash-theme {
    --mobile-dashboard-metric-size: clamp(var(--font-size-xl), 6.8vw, var(--font-size-2xl));
    --mobile-dashboard-card-title-size: var(--font-size-base);
    --mobile-dashboard-row-title-size: var(--font-size-base);
    --mobile-dashboard-meta-size: var(--font-size-sm);
    --mobile-dashboard-badge-size: var(--font-size-xs);
  }

  .app-glass-topbar {
    width: calc(100% - 24px);
    margin: 12px var(--space-md) 0;
    padding: 11px 16px;
    border-radius: var(--radius-xl);
  }

  .app-default-topbar.app-glass-topbar {
    top: 12px;
  }

  .app-topbar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .admin-shell .app-topbar-brand {
    flex: 0 1 auto;
    margin-right: var(--space-sm);
  }

  .app-topbar-brand-image {
    width: clamp(110px, 30vw, 140px);
  }

  .app-auth-links {
    gap: var(--space-xs);
  }

  .admin-shell-nav {
    gap: 6px;
    min-width: 0;
  }

  .admin-shell-nav-right {
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .admin-shell-notif,
  .app-account-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  /* Expand icon tap area to 44px without visually enlarging the pill */
  .admin-shell-notif::before,
  .app-account-logo::before {
    content: "";
    position: absolute;
    inset: -4px;
  }

  .app-auth-chip {
    display: none !important;
  }

  .app-auth-button {
    min-height: 44px;
    padding: 0 10px !important;
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }

  .app-public-how-link {
    display: none !important;
  }

  .app-side {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  /* Admin shell: hide sidebar, collapse to single-column */
  .admin-shell-side {
    display: none;
  }

  .admin-shell-main-wrap {
    grid-template-columns: 1fr;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    /* Not the bottom-nav clearance: the footer below the shell carries that (.admin-shell ~
       .app-footer). Both had it, which left about 130px of empty page above the footer. */
    padding-bottom: var(--space-lg);
  }

  .admin-shell-content {
    padding-top: var(--space-sm);
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    border-radius: var(--radius-xl);
  }

  /* Page head: stack title above actions on narrow viewports */
  /* nowrap with the direction: a wrapping flex container sizes each line to
     its content, so a child that cannot shrink would widen the line and drag
     its siblings past the screen. The children here are wrapping text, whose
     minimum is a single word, so this changes nothing today — it is here so
     that a strip or a fixed width added later stays harmless. */
  .admin-list .page-head {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .admin-list .page-title {
    font-size: clamp(var(--font-size-xl), 6vw, var(--font-size-2xl));
  }

  .admin-list .page-actions {
    align-self: flex-end;
    justify-content: flex-end;
  }

  /* Refund Queue cross-link reads as a full-width secondary action on mobile,
     aligned with the segmented status filter below it. */
  .admin-list .page-actions.page-actions-stretch {
    width: 100%;
  }

  .page-actions-stretch .list-btn {
    width: 100%;
    justify-content: center;
  }

  /* Superseded on mobile by the merged Settings row in _Layout's .hub-tabs, which
     carries Account plus all six website sections in one scrolling track. This rule
     previously hardcoded repeat(4, ...) against six tabs, so the last two wrapped onto
     a second line inside a track drawn for a single row. */
  .website-settings-tabs,
  .website-settings-nav {
    display: none;
  }

  .client-dashboard .pipeline-tags {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: calc(var(--space-xs) + var(--space-2xs));
    width: 100%;
    padding: 0;
  }

  .client-dashboard .pipeline-tag {
    --pipe-accent: var(--color-text-tertiary);
    position: relative;
    min-width: 0;
    min-height: calc(var(--space-6xl) + var(--space-md) + var(--space-xs) + var(--space-2xs));
    padding: var(--space-sm) var(--space-xs) calc(var(--space-sm) - var(--space-2xs));
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid color-mix(in srgb, var(--color-border-light) 82%, transparent);
    box-shadow: var(--shadow-sm);
    color: var(--color-text-primary);
    text-align: center;
    overflow: hidden;
  }

  .client-dashboard .pipeline-tag:hover:not(.pipeline-tag-disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }

  .client-dashboard .pipeline-tag.paid {
    --pipe-accent: var(--color-warning);
  }

  .client-dashboard .pipeline-tag.inprogress {
    --pipe-accent: var(--color-info);
  }

  .client-dashboard .pipeline-tag.completed,
  .client-dashboard .pipeline-tag.published {
    --pipe-accent: var(--color-success);
  }

  .client-dashboard .pipeline-tag.cancelled {
    --pipe-accent: var(--color-text-tertiary);
  }

  .client-dashboard .pipeline-tag-icon {
    display: none;
  }

  .client-dashboard .pipeline-tag-count {
    order: 1;
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
    letter-spacing: 0;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
  }

  .client-dashboard .pipeline-tag-label {
    order: 2;
    min-height: calc(var(--space-xl) + var(--space-xs));
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: var(--space-2xs);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-semibold);
    overflow-wrap: anywhere;
    color: var(--color-text-secondary);
    max-width: 100%;
  }

  .client-dashboard .pipeline-tag-disabled {
    opacity: 0.72;
  }

  .client-dashboard .pipeline-tag-bar {
    order: 3;
    display: block;
    width: calc(var(--space-xl) + var(--space-xs) + var(--space-2xs));
    height: var(--space-2xs);
    border-radius: var(--radius-full);
    background: var(--pipe-accent);
  }
}

/* ── App footer ───────────────────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
  margin-top: var(--space-2xl);
}

.app-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.app-footer-col--brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.app-footer-logo-link {
  display: inline-block;
  margin-bottom: 4px;
}

.app-footer-logo {
  display: block;
  width: clamp(120px, 10vw, 152px);
  height: auto;
  opacity: 0.72;
}

.app-footer-email {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  /* Taller tap target with no change to the footer's layout (owner, 2026-11-19). */
  display: inline-block;
  padding-block: 10px;
  margin-block: -10px;
  transition: opacity 0.18s ease;
}

.app-footer-email:hover,
.app-footer-email:focus-visible {
  opacity: 0.72;
}

.app-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-footer-nav-primary {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Guest header navigation on the shared topbar (mirrors .topbar-links on the
   landing page). Hidden by default; revealed only once the bar is wide enough to
   carry it without crowding the logo or the login button. Narrow portrait phones
   and short landscape phones keep the compact bar and use the footer instead. */
.app-glass-topbar .topbar-links {
  display: none;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
  margin-right: var(--space-lg);
  min-width: 0;
}

.app-glass-topbar .topbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3xs, 2px);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.app-glass-topbar .topbar-links a:hover,
.app-glass-topbar .topbar-links a:focus-visible {
  color: var(--color-primary);
}

@media (min-width: 900px) {
  .app-glass-topbar.app-public-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .app-glass-topbar.app-public-topbar > .app-topbar-brand {
    grid-column: 1;
    justify-self: start;
  }

  .app-glass-topbar .topbar-links {
    display: flex;
  }

  /* Right-aligned beside Login / Signup, as on the home page's bar. */
  .app-glass-topbar.app-public-topbar > .topbar-links {
    grid-column: 2;
    justify-self: end;
    gap: clamp(18px, 2.2vw, 34px); /* same spacing as the home page's .topbar-nav */
    margin: 0 var(--space-xl) 0 0;
  }

  .app-glass-topbar.app-public-topbar > .admin-shell-nav-right {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1100px) and (pointer: coarse) {
  .app-glass-topbar .topbar-links {
    display: none;
  }
}

/* Signed-out bar: the same --public-topbar-* tokens the home page's bar reads
   (design-tokens.css), so the two separate implementations cannot drift apart
   again. Scoped to .app-public-topbar — the signed-in bar keeps its own styles.
   Compound selectors outrank the unscoped .app-glass-topbar / .app-auth-button
   rules above, including their mobile overrides; !important only where those
   rules already use it. */
.app-glass-topbar.app-public-topbar {
  box-sizing: border-box;
  min-height: var(--public-topbar-height);
  margin-top: var(--public-topbar-offset);
  padding: var(--public-topbar-pad-block) var(--public-topbar-pad-inline);
  border-radius: var(--public-topbar-radius);
  /* Edge as an outline, like the home bar: a border takes 1px of layout and
     pushed the logo and button 1px inward. */
  border: 0;
  outline: 1px solid var(--public-topbar-edge);
  outline-offset: -1px;
}

.app-glass-topbar.app-public-topbar > .admin-shell-nav-right {
  padding-right: 0;
}

.app-default-topbar.app-glass-topbar.app-public-topbar {
  top: var(--public-topbar-offset);
}

.app-glass-topbar.app-public-topbar .topbar-links a {
  position: relative;
  color: var(--public-topbar-link-color);
  font-size: var(--public-topbar-link-size);
  font-weight: var(--public-topbar-link-weight);
  letter-spacing: var(--public-topbar-link-tracking);
}

/* Same hover as the home page's top bar (blue text, underline sliding in), and the page being viewed keeps
   it. The colour rule above outranked the shared :hover rule, so hovering here used to do nothing. */
.app-glass-topbar.app-public-topbar .topbar-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.app-glass-topbar.app-public-topbar .topbar-links a:hover,
.app-glass-topbar.app-public-topbar .topbar-links a:focus-visible,
.app-glass-topbar.app-public-topbar .topbar-links a[aria-current="page"] {
  color: var(--color-primary);
}

.app-glass-topbar.app-public-topbar .topbar-links a:hover::after,
.app-glass-topbar.app-public-topbar .topbar-links a:focus-visible::after,
.app-glass-topbar.app-public-topbar .topbar-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .app-glass-topbar.app-public-topbar .topbar-links a::after { transition: none; }
}

.app-public-topbar .app-auth-button {
  padding: 0 var(--public-topbar-action-pad-inline) !important;
  font-size: var(--public-topbar-action-size);
  font-weight: var(--public-topbar-action-weight);
}

.app-public-topbar .app-auth-button-secondary {
  color: var(--public-topbar-action-text) !important;
  background: var(--public-topbar-action-bg);
  border-color: var(--public-topbar-action-border);
  box-shadow: none;
}

.app-public-topbar .app-auth-button-secondary:hover,
.app-public-topbar .app-auth-button-secondary:focus {
  color: var(--public-topbar-action-text) !important;
  background: var(--public-topbar-action-bg-hover);
}

/* Footer links carry a 44px hit area. The visible text size is unchanged — the
   height comes from padding around it — because on most pages the footer is the
   only route to How It Works / About / Contact, so it has to be thumb-reliable. */
.app-footer-nav-primary a,
.app-footer-nav-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2xs);
}

.app-footer-nav-primary a {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-footer-nav-primary a:hover,
.app-footer-nav-primary a:focus-visible {
  color: var(--color-primary);
}

.app-footer-nav-legal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-footer-nav-legal a {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-footer-nav-legal a:hover,
.app-footer-nav-legal a:focus-visible {
  color: var(--color-text-secondary);
}

.app-footer-nav-legal-sep {
  color: var(--color-border);
  font-size: var(--font-size-xs);
  user-select: none;
}

.app-footer-col--end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.app-footer-copy {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  text-align: right;
}

/* Signed-out pages share the home page's frame, so the content lines up with
   the topbar and the landing sections: 1760px at most, a clamp(20px, 2.4vw,
   48px) gutter, 12px at 740px and below. Keep in step with --max and
   --page-gutter on Pages/Index.cshtml and .container in css/landing-v7.css.
   Only the public layout's wrapper is matched; the signed-in shell and the
   login/register stack are untouched. */
body.public-page > .container.pb-3.mt-3 {
  width: min(1760px, calc(100% - (var(--public-frame-gutter) * 2)));
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* The footer's content takes the same frame, as the home page's footer does. */
body.public-page > .container.pb-3.mt-3,
body.public-page .app-footer-inner {
  --public-frame-gutter: clamp(20px, 2.4vw, 48px);
}

body.public-page .app-footer-inner {
  width: min(1760px, calc(100% - (var(--public-frame-gutter) * 2)));
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 740px) {
  body.public-page > .container.pb-3.mt-3,
  body.public-page .app-footer-inner {
    --public-frame-gutter: 12px;
  }
}

/* The home page's hero, and so its topbar, stops growing at 1920px; past that
   the glass bar stays 1888px wide and centred instead of running edge to edge.
   Login/register too: signed out, so the same bar as every other public page. */
@media (min-width: 1921px) {
  body.public-page .app-public-topbar,
  body.auth-page .app-public-topbar {
    width: 1888px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* About, Contact, Terms and Error: the card fills the frame rather than sitting
   980px wide in the middle of it. Terms keeps its text at the old reading width
   inside the wider card — legal copy at 1300px+ a line is hard to follow. */
body.public-page .public-info-shell {
  width: 100%;
}

/* Every signed-out page's first content starts --public-page-top below the bar's
   row, as How It Works does. The card pages (About, Contact, Terms, Error) had
   32px; Auction Map had 0 (it drops its padding to sit flush in the signed-in
   shell); the booking form had 0. Auction Map's phone/small-tablet full-screen
   map keeps its own !important padding. */
body.public-page .public-info-page,
body.public-page .public-info-page.auction-map-outer,
body.public-page .new-request-port {
  padding-top: var(--public-page-top);
}

body.public-page .terms-shell .terms-box,
body.public-page .terms-shell .terms-toc,
body.public-page .terms-shell .terms-content {
  max-width: 974px;
}

.public-info-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.public-info-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: var(--space-2xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--color-surface) 88%, var(--color-component) 12%);
  box-shadow: var(--shadow-md), var(--shadow-inner);
}

.public-info-kicker {
  margin: 0 0 var(--space-sm);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-info-shell h1 {
  max-width: 760px;
  margin: 0;
  font-size: var(--font-size-3xl);
}

.public-info-lead {
  max-width: 780px;
  margin: var(--space-md) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
}

.public-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.public-info-stack {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.public-info-grid article,
.public-info-stack article {
  padding: var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-component) 72%, transparent);
}

.public-info-grid h2,
.public-info-stack h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-size-lg);
}

.public-info-grid p,
.public-info-stack p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.public-info-link {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.public-info-link:hover {
  color: var(--color-primary-dark);
}

/* Action buttons for the public info/error pages. These used to reuse .list-btn,
   but that class is only ever defined as `.admin-list .list-btn` — outside the
   admin shell it matched nothing, so the error page rendered its two actions as
   bare inline anchors with no gap between them. */
.public-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
}

.public-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-height);
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: color-mix(in srgb, var(--color-component) 58%, transparent);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.public-info-btn:hover {
  background: color-mix(in srgb, var(--color-component) 76%, transparent);
  color: var(--color-text-primary);
}

.public-info-btn-primary {
  border-color: transparent;
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.public-info-btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
}

.terms-page .terms-shell {
  width: min(100%, 1040px);
}

.terms-box {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-left: var(--space-2xs) solid var(--color-primary);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-component) 64%, transparent);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  box-shadow: var(--shadow-sm), var(--shadow-inner);
}

.terms-box strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
}

.terms-box ul {
  margin: var(--space-xs) 0 0;
}

.terms-box-warning,
.terms-box-highlight {
  border-left-color: var(--color-warning);
  background: color-mix(in srgb, var(--color-warning-bg) 58%, var(--color-surface) 42%);
}

.terms-box-important {
  border-left-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-error-bg) 42%, var(--color-surface) 58%);
}

.terms-box-info {
  border-left-color: var(--color-info);
  background: color-mix(in srgb, var(--color-info-bg) 50%, var(--color-surface) 50%);
}

.terms-toc {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-surface) 88%, transparent) 0%,
    color-mix(in srgb, var(--color-component) 56%, transparent) 100%
  );
  box-shadow: var(--shadow-sm), var(--shadow-inner);
}

.terms-toc h2 {
  margin: 0 0 var(--space-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
}

.terms-toc ol {
  columns: 2;
  column-gap: var(--space-2xl);
  margin: 0;
  padding-left: var(--space-lg);
}

.terms-toc li {
  break-inside: avoid;
  margin-bottom: 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.terms-toc a,
.terms-section a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

/* A taller tap target on phones (owner, 2026-11-19): ~15px links were hard to hit. The padding replaces
   the list item's old bottom margin, so each line only grows a few pixels. */
.terms-toc a {
  display: inline-block;
  padding-block: 6px;
}

.terms-toc a:hover,
.terms-section a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: var(--space-2xs);
}

.terms-content {
  display: grid;
  /* A grid item's default min-width is auto, so the 620px table below stretched its
     wrapper instead of scrolling inside it, and the whole page overflowed on a phone.
     minmax(0, 1fr) lets the wrapper be narrower than its content, which is what makes
     its overflow-x: auto take effect. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.terms-section {
  scroll-margin-top: calc(var(--admin-nav-h) + var(--space-4xl));
  padding: var(--space-xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface) 84%, var(--color-component) 16%);
  box-shadow: var(--shadow-sm), var(--shadow-inner);
}

.terms-section-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.terms-section-num {
  min-width: calc(var(--space-xl) + var(--space-lg));
  min-height: calc(var(--space-xl) + var(--space-xs));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.terms-section h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

.terms-section h3 {
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
}

.terms-section p,
.terms-section li,
.terms-section dd {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.terms-section p {
  margin: 0 0 var(--space-md);
}

.terms-section p:last-child {
  margin-bottom: 0;
}

.terms-section ul {
  display: grid;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
  padding-left: var(--space-lg);
}

.terms-definition {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) 1fr;
  gap: var(--space-sm) var(--space-lg);
  margin: 0;
}

.terms-definition dt {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-normal);
}

.terms-definition dd {
  margin: 0;
}

.terms-badge {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-lg);
  margin-left: var(--space-xs);
  padding: 0 var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  vertical-align: middle;
}

.terms-badge-new {
  border: 1px solid color-mix(in srgb, var(--color-success) 26%, transparent);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.terms-badge-updated {
  border: 1px solid color-mix(in srgb, var(--color-warning) 28%, transparent);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.terms-table-wrap {
  overflow-x: auto;
  min-width: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.terms-version-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--color-surface);
}

.terms-version-table th,
.terms-version-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  text-align: left;
  vertical-align: top;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.terms-version-table th {
  background: color-mix(in srgb, var(--color-component) 76%, transparent);
  color: var(--color-text-secondary); /* was tertiary, ~3:1 on the tinted header (owner, 2026-11-19) */
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.terms-version-table td {
  color: var(--color-text-secondary);
}

.terms-version-table tr:last-child td {
  border-bottom: 0;
}

.terms-footer-note {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.public-contact-form {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface) 82%, var(--color-component) 18%);
}

.public-form-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  gap: var(--space-lg);
  align-items: end;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.public-form-head .public-info-kicker {
  margin-bottom: var(--space-xs);
}

.public-form-head h2 {
  margin: 0;
  font-size: var(--font-size-xl);
}

.public-form-head p:last-child {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.public-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.public-form-field {
  display: grid;
  gap: var(--space-xs);
}

.public-form-field label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.public-form-field input,
.public-form-field select,
.public-form-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--field-fill);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  padding: var(--space-sm) var(--space-md);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.public-form-field textarea {
  resize: vertical;
  min-height: 132px;
}

.public-form-field input::placeholder,
.public-form-field textarea::placeholder {
  color: var(--color-text-tertiary);
}

.public-form-field input:focus,
.public-form-field select:focus,
.public-form-field textarea:focus {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.public-form-field span,
.public-form-error {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.public-form-field input[type="file"] {
  padding: var(--space-xs) 0;
  border: none;
  background: transparent;
}

/* Contact's Topic uses the site's themed dropdown (owner, 2026-11-19). Its trigger takes the same box as
   the fields around it, and the rule above that colours every span red (for error messages) is undone
   inside it. */
.public-form-field .themed-select__trigger {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--field-fill);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  padding: var(--space-sm) var(--space-md);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.public-form-field .themed-select__trigger:focus-visible,
.public-form-field .themed-select.is-open .themed-select__trigger {
  outline: none;
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.public-form-field .themed-select span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.public-form-field .public-form-hint {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  text-transform: none;
  letter-spacing: normal;
}

.public-form-field span:empty,
.public-form-error.validation-summary-valid {
  display: none;
}

.public-form-success {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid color-mix(in srgb, var(--color-success) 22%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-success-bg) 78%, transparent);
  color: var(--color-success);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.public-form-success a {
  color: inherit;
  margin-left: var(--space-xs);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.public-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-sm);
}

.public-form-actions p {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.public-form-actions button {
  min-height: 44px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: var(--color-surface);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-sm) var(--space-xl);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.public-form-actions button:hover {
  border-color: var(--color-primary-dark);
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.public-form-actions button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .app-footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .app-footer-col--brand {
    align-items: center;
  }

  .app-footer-col--end {
    align-items: center;
  }

  .app-footer-copy {
    text-align: center;
  }

  .public-info-shell {
    padding: var(--space-xl);
  }

  .terms-toc {
    padding: var(--space-lg);
  }

  .terms-toc ol {
    columns: 1;
  }

  .terms-section {
    padding: var(--space-lg);
  }

  .terms-section-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .terms-section h2 {
    font-size: var(--font-size-lg);
  }

  .terms-definition {
    grid-template-columns: 1fr;
    gap: var(--space-2xs);
  }

  .terms-definition dd {
    margin-bottom: var(--space-sm);
  }

  .terms-badge {
    margin-left: 0;
    margin-top: var(--space-xs);
  }

  .public-form-head,
  .public-form-grid {
    grid-template-columns: 1fr;
  }

  .public-contact-form {
    padding: var(--space-lg);
  }

  .public-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Support tickets */
/* minmax(0, …) and min-width: 0: without them a long file name in the conversation set the column's
   width, and on a phone the page grew sideways (375px screen, 501px page). */
.support-ticket-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}

.support-ticket-panel {
  min-width: 0;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 84%, transparent) 0%, color-mix(in srgb, var(--color-component) 62%, transparent) 100%);
  box-shadow: var(--shadow-md), var(--shadow-inner);
}

/* 150px, not 180px: on a tablet with the sidebar open the panel is ~360px wide, and 180px left every detail
   on a line of its own. */
.support-ticket-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--space-lg);
}

.support-ticket-meta > * {
  min-width: 0;
}

/* Admin's six details: three to a row on a wide screen, not five and a lone "Last activity". */
@media (min-width: 900px) {
  .support-ticket-meta--six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

a.support-ticket-link {
  display: inline-block;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.support-ticket-message {
  margin: var(--space-md) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  white-space: pre-wrap;
}

.support-ticket-admin-form {
  display: grid;
  gap: var(--space-md);
}

/* ── Support ticket: status tracker ─────────────────────────────────────── */
.ticket-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.ticket-track-step {
  position: relative;
  padding-top: 22px;
  text-align: center;
}

.ticket-track-step::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  z-index: 1;
}

/* Connector runs dot-centre to dot-centre (column width + grid gap), behind the
   dots, so the steps read as an evenly centred timeline. */
.ticket-track-step::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: calc(100% + var(--space-sm));
  height: 2px;
  border-radius: 999px;
  background: var(--color-border-light);
}

.ticket-track-step:last-child::after {
  display: none;
}

.ticket-track-step.is-done::before {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.ticket-track-step.is-done::after {
  background: color-mix(in srgb, var(--color-primary) 45%, var(--color-border-light));
}

.ticket-track-step.is-current::before {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 24%, var(--color-surface));
}

.ticket-track-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.ticket-track-step:not(.is-done):not(.is-current) .ticket-track-label {
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.ticket-track-time {
  margin-top: 2px;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

/* ── Support ticket: conversation thread ────────────────────────────────── */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.ticket-day-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-sm);
  margin: 2px 0 var(--space-xs);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticket-day-divider::before,
.ticket-day-divider::after {
  content: "";
  height: 1px;
  background: var(--color-border-light);
}

.ticket-msg {
  display: flex;
  gap: var(--space-sm);
  max-width: min(72%, 560px);
  align-self: flex-start;
}

.ticket-msg.ticket-msg-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ticket-msg-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-border-light));
}

.ticket-msg-own .ticket-msg-avatar {
  background: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface));
  color: var(--color-text-secondary);
  border-color: var(--color-border-light);
}

.ticket-msg-body {
  min-width: 0;
}

.ticket-msg-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: 2px;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.ticket-msg-own .ticket-msg-meta {
  justify-content: flex-end;
}

.ticket-msg-author {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.ticket-msg-bubble {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-msg-bubble a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ticket-msg:not(.ticket-msg-own) .ticket-msg-bubble {
  border-top-left-radius: 3px;
  background: color-mix(in srgb, var(--color-text-primary) 5%, var(--color-surface));
}

.ticket-msg-own .ticket-msg-bubble {
  border-top-right-radius: 3px;
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-primary) 16%, var(--color-border-light));
}

.ticket-msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  min-width: 0;
}

.ticket-msg-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticket-msg-own .ticket-msg-photos {
  justify-content: flex-end;
}

.ticket-photo {
  position: relative;
  display: block;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  background: var(--color-component);
  overflow: hidden;
  cursor: zoom-in;
}

.ticket-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ticket-photo:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border-light));
}

/* A thumbnail that would not load shows the file's name instead of a broken picture. */
.ticket-photo.is-broken img {
  display: none;
}

.ticket-photo.is-broken::after {
  content: attr(title);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  text-align: center;
  overflow-wrap: anywhere;
}

.ticket-file {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.ticket-file .ticket-attachment-chip {
  flex: 1 1 auto;
  min-width: 0;
}

.ticket-file-download {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

.ticket-file-download:hover {
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border-light));
  color: var(--color-text-primary);
}

.ticket-file-download svg {
  width: 16px;
  height: 16px;
}

.ticket-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  text-decoration: none;
  max-width: 100%;
}

.ticket-attachment-chip:hover {
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border-light));
  color: var(--color-text-primary);
}

.ticket-attachment-chip svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
}

.ticket-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ticket-attachment-size {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
}

/* ── Support ticket: composer bar ────────────────────────────────────────── */
.ticket-composer-area {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.ticket-composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px 4px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ticket-composer-bar:focus-within {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
}

.ticket-composer-input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 120px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  padding: 10px 6px;
}

.ticket-composer-input::placeholder {
  color: var(--color-text-tertiary);
}

.ticket-composer-icon-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ticket-composer-icon-btn:hover {
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  color: var(--color-text-secondary);
}

.ticket-composer-icon-btn svg {
  width: 20px;
  height: 20px;
}

.ticket-composer-icon-btn:focus-within,
.ticket-composer-icon-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.ticket-composer-icon-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.ticket-composer-send {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ticket-composer-send:hover {
  opacity: 0.9;
}

.ticket-composer-send svg {
  width: 18px;
  height: 18px;
  transform: translateX(-1px);
}

.ticket-composer-send:disabled {
  cursor: progress;
  opacity: 0.85;
}

.ticket-composer-send-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: imjdm-btn-spin 0.6s linear infinite;
}

.ticket-composer-send.is-sending .ticket-composer-send-icon {
  display: none;
}

.ticket-composer-send.is-sending .ticket-composer-send-spinner {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .ticket-composer-send-spinner {
    animation-duration: 1.6s;
  }
}

.ticket-status-menu {
  position: relative;
  flex: 0 0 auto;
}

.ticket-status-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.ticket-status-dropdown.is-open {
  display: flex;
}

.ticket-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
}

.ticket-status-option:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-text-primary) 5%, transparent);
}

.ticket-status-option:disabled {
  color: var(--color-text-tertiary);
  cursor: default;
}

.ticket-status-option .status-pill {
  pointer-events: none;
}

.ticket-status-option svg {
  margin-left: auto;
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

.ticket-composer-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 4px 0;
  min-width: 0;
}

.ticket-composer-attach-preview:empty {
  display: none;
}

/* A file chosen but not yet sent. The name shortens on a phone; the full name is in its tooltip and the
   Remove button's label. */
.ticket-pending-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 4px 4px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.ticket-pending-file__thumb,
.ticket-pending-file__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.ticket-pending-file__thumb {
  object-fit: cover;
}

.ticket-pending-file__icon {
  display: grid;
  place-items: center;
  background: var(--color-component);
  color: var(--color-text-tertiary);
}

.ticket-pending-file__icon svg {
  width: 18px;
  height: 18px;
}

.ticket-pending-file__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-pending-file__size {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
}

.ticket-pending-file__remove {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}

.ticket-pending-file__remove:hover {
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  color: var(--color-text-primary);
}

.ticket-pending-file__remove svg {
  width: 16px;
  height: 16px;
}

.ticket-composer-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 4px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--color-error) 32%, var(--color-border-light));
  background: color-mix(in srgb, var(--color-error) 7%, var(--color-surface));
  color: var(--color-error);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.ticket-composer-error[hidden] {
  display: none;
}

.ticket-composer-error svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.ticket-composer-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  padding: 8px 8px 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* Only where Shift exists: on a phone Enter makes a new line and the button sends. */
.ticket-composer-keys {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .ticket-composer-keys {
    display: inline;
  }
}

.ticket-composer-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.ticket-composer-count[hidden] {
  display: none;
}

.ticket-composer-count.is-full {
  color: var(--color-error);
}

/* ── Support ticket: photo viewer ───────────────────────────────────────── */
/* Colours follow the report's photo viewer: the theme's darkest ink, nearly opaque, so the photograph is
   the only thing in the room. */
.ticket-photo-viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: color-mix(in srgb, var(--color-text-primary) 94%, transparent);
  color: var(--color-surface);
}

.ticket-photo-viewer[open] {
  display: flex;
  flex-direction: column;
}

.ticket-photo-viewer::backdrop {
  background: transparent;
}

.ticket-photo-viewer__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
}

.ticket-photo-viewer__title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ticket-photo-viewer__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.ticket-photo-viewer__size {
  font-size: var(--font-size-sm);
  color: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

.ticket-photo-viewer__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-surface) 28%, transparent);
  background: color-mix(in srgb, var(--color-surface) 10%, transparent);
  color: var(--color-surface);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
}

.ticket-photo-viewer__btn:hover {
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
  color: var(--color-surface);
}

.ticket-photo-viewer__btn:focus-visible {
  outline: 2px solid var(--color-surface);
  outline-offset: 2px;
}

.ticket-photo-viewer__btn svg {
  width: 18px;
  height: 18px;
}

.ticket-photo-viewer__close {
  padding: 0;
}

.ticket-photo-viewer__stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}

.ticket-photo-viewer__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.ticket-track-time--your-turn {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.ticket-composer-caption {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 8px 10px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.ticket-composer-caption svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.ticket-composer-caption a {
  color: var(--color-primary);
}

@media (max-width: 640px) {
  .support-ticket-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .ticket-track {
    gap: 6px;
  }

  /* Connector spans column width + the tighter mobile gap. */
  .ticket-track-step::after {
    width: calc(100% + 6px);
  }

  .ticket-track-label {
    font-size: var(--font-size-xs);
  }

  .ticket-track-time {
    font-size: var(--font-size-xs);
  }

  .ticket-msg {
    max-width: 100%;
  }
}

/* ── Admin requests: panel header + actions ───────────────────────────── */
/* Adopts the global panel-header convention: primary-accent tint band + left
   accent + separator (see the .panel-head rules above). The header is a
   full-width child of its results card so the band bleeds to the card edges;
   the filter-card variant below restores the bleed past that card's padding. */
.admin-list .client-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--rule2);
  /* charcoal band + strips defined in the shared "Charcoal panel-header" block below */
}

/* Filter-card header bleeds past the card's 20px/22px padding so the tint band
   spans edge-to-edge with rounded top corners, matching the results card. */
.admin-list .filter-card > .client-panel-head,
.admin-list .record-filter-card > .client-panel-head {
  margin: -20px -22px var(--space-md);
  padding: var(--space-md) 22px var(--space-sm);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Notification filter card uses tighter padding (var(--space-md)) than the
   standard filter card, so its header must bleed by that amount instead. */
.admin-list .notification-filter-card > .client-panel-head {
  margin: calc(var(--space-md) * -1) calc(var(--space-md) * -1) var(--space-md);
  padding: var(--space-sm) var(--space-md);
}

.admin-list .client-panel-sub {
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.admin-list .client-panel-head .panel-title {
  margin: 0;
}

.record-list-page .table-wrap > .client-panel-head {
  align-items: center;
  margin-bottom: 0;
  /* !important to beat Bootstrap's .pt-3 on this element's own class list
     (Bootstrap utilities are !important by design — same reason the charcoal
     treatment below needs !important on padding-left). Left at 16px top vs
     8px bottom, the toggle button (now living in this header, see below)
     centered within that lopsided content box, not the header band itself. */
  padding-top: var(--space-sm) !important;
  padding-bottom: var(--space-sm) !important;
}

.record-list-page .table-wrap > .client-panel-head > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
  flex-wrap: wrap;
  /* Was width:100%, back when this was the header's only child. Now the
     filter toggle lives here too (see below) — flex:1 1 auto lets this block
     still claim the whole row on its own (unchanged look) when the toggle
     wraps to a row of its own, or share the row with it when the toggle
     goes inline on desktop, instead of the two overlapping. */
  flex: 1 1 auto;
  min-width: 0;
}

.record-list-page .table-wrap > .client-panel-head .client-panel-sub {
  margin-left: auto;
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
}

/* Filter toggle, living inside this same header instead of floating above
   the card as a separate element. flex-basis:100% is the standard flexbox
   line-break trick: with flex-wrap already on from the base .client-panel-head
   rule, it forces the button onto its own full-width row below the title on
   mobile — same big tap target as before, just inside the card now.
   Sort now lives inside the filter form itself (a <select> next to the other
   filter fields, see the per-page markup) rather than a separate popover —
   .sort-menu/.sort-menu__panel here got trapped behind row content by a
   stacking-context issue (root cause not pinned down: ruled out both
   backdrop-filter and .record-list-wrap's container-type as the sole cause)
   that a form field sidesteps entirely. */
.record-list-page .table-wrap > .client-panel-head .mobile-filter-toggle {
  flex: 0 0 100%;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .record-list-page .table-wrap > .client-panel-head .mobile-filter-toggle {
    flex: 0 0 auto;
    width: auto;
  }
}

/* Site-wide header tint — extends the panel-header convention (primary accent
   wash + left bar) to the remaining section headers across the app. Rendered as
   a self-contained band so it sits cleanly inside each page's bespoke cards
   without per-card bleed. The exception is .report-section-head, which bleeds to
   its card's edges (geometry in Reports/Details.cshtml) so a report section reads
   as one panel with a header rather than a heading panel above a body panel. Intentionally excluded: landing pages (home/pricing
   .section-head, .pricing-card-head) and the new-request booking flow
   (.pkg-card-head, new-request/booking .form-section-head). .report-card-head
   already carries its own severity tint and is left as-is. */
.section-headline,
.settings-card-head,
.token-section-head,
.homepage-settings-card-head,
.cl-section-head,
.terms-section-header,
.customer-manager-page .section-head,
.checkout-summary-card .form-section-head {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  /* charcoal band + strips defined in the shared "Charcoal panel-header" block below */
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHARCOAL PANEL-HEADER TREATMENT — app-wide
   A washed-charcoal band with white title, a brightened numbered circle (where one
   exists), a full-width red/blue split rule on the bottom edge, and a soft drop shadow
   for depth. Replaces the old primary-wash + accent-rail convention on every panel
   header. Excluded by construction: the dashboard (uses its own header classes, never
   .client-panel-head/.section-headline), the landing pages, and .report-card-head
   (own severity tint). The selector list is written once via :is().
   ═══════════════════════════════════════════════════════════════════════════════ */
:is(
  .admin-list .client-panel-head,
  .section-headline,
  .settings-card-head,
  .token-section-head,
  .homepage-settings-card-head,
  .report-section-head,
  .cl-section-head,
  .terms-section-header,
  .customer-manager-page .section-head,
  .checkout-summary-card .form-section-head,
  .new-request-port .form-section-head,
  .request-detail-card__head
) {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-panel-header) 86%, white) 0%,
    var(--color-panel-header) 100%
  );
  box-shadow: 0 4px 12px -7px rgba(18, 24, 32, 0.18);
}

/* Full-width brand rule: equal red and blue segments along the bottom edge. */
:is(
  .admin-list .client-panel-head,
  .section-headline,
  .settings-card-head,
  .token-section-head,
  .homepage-settings-card-head,
  .report-section-head,
  .cl-section-head,
  .terms-section-header,
  .customer-manager-page .section-head,
  .checkout-summary-card .form-section-head,
  .new-request-port .form-section-head,
  .request-detail-card__head
)::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    #c0181e 0 50%,
    var(--color-info) 50% 100%
  );
  pointer-events: none;
}

/* Title + subtitle → light so they read on the dark band. */
:is(
  .admin-list .client-panel-head,
  .section-headline,
  .settings-card-head,
  .token-section-head,
  .homepage-settings-card-head,
  .report-section-head,
  .cl-section-head,
  .terms-section-header,
  .customer-manager-page .section-head,
  .checkout-summary-card .form-section-head,
  .new-request-port .form-section-head,
  .request-detail-card__head
) :is(.panel-title, .section-title) {
  color: var(--color-panel-header-text);
}
:is(
  .admin-list .client-panel-head,
  .section-headline,
  .settings-card-head,
  .token-section-head,
  .homepage-settings-card-head,
  .report-section-head,
  .cl-section-head,
  .terms-section-header,
  .customer-manager-page .section-head,
  .checkout-summary-card .form-section-head,
  .new-request-port .form-section-head,
  .request-detail-card__head
) :is(.client-panel-sub, .panel-sub, p, .report-section-copy, .fold-summary, .token-fold-sub, .token-fold-summary) {
  color: color-mix(in srgb, var(--color-panel-header-text) 72%, transparent) !important;
}

/* Numbered circle (booking form, checkout): the primary colour itself, as on every other
   primary element (owner, 2026-11-23; it was lightened for a dark band the theme no longer uses),
   with a faint ring that keeps it clear of any band colour. */
:is(
  .admin-list .client-panel-head,
  .section-headline,
  .settings-card-head,
  .token-section-head,
  .homepage-settings-card-head,
  .report-section-head,
  .cl-section-head,
  .terms-section-header,
  .customer-manager-page .section-head,
  .checkout-summary-card .form-section-head,
  .new-request-port .form-section-head,
  .request-detail-card__head
) .section-num {
  background: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
/* ═══════════════════════ END CHARCOAL PANEL-HEADER TREATMENT ═══════════════════════ */

/* Account + Website Settings cards all pad 24px horizontally — bleed their
   section headers to the card edges with a bottom separator so they read as
   full-width bands like the list-page .client-panel-head, not floating chips.
   Vertical padding (16px top / 8px bottom) matches the list-page results header
   (.client-panel-head + Bootstrap pt-3) so band heights are identical app-wide.
   (The nested .token-section-head sub-headers keep the compact chip above.) */
.section-headline,
.homepage-settings-card-head,
.settings-card-head {
  display: flex;
  align-items: center;
  margin-left: -24px;
  margin-right: -24px;
  padding-top: var(--space-lg);
  padding-right: 24px;
  padding-bottom: var(--space-sm);
  padding-left: 24px;
  border-radius: 0;
  border-bottom: 1px solid var(--rule2);
}

/* Title inside these bands matches the global .admin-shell .panel-title recipe
   so the Account page (which renders outside .admin-shell) gets the same 18px
   panel title. */
.section-headline > .panel-title,
.homepage-settings-card-head > .panel-title,
.settings-card-head > .panel-title {
  margin: 0;
  font-family: var(--font-panel-title);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-panel-title);
  line-height: var(--line-height-tight);
  letter-spacing: 0;
  color: var(--color-text-primary);
}

/* Single-header cards bleed their one header to the top edge too, keeping the
   card's rounded top corners. Each Theme .settings-card is a single-header card
   (THEME PRESETS, DESIGN TOKENS, LIVE PREVIEW are separate cards), so it bleeds
   the same way — the nested .token-section-head chips inside DESIGN TOKENS are a
   different class and are left untouched. */
.section-card > .section-headline {
  margin-top: -22px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.homepage-settings-card > .homepage-settings-card-head,
.settings-card > .settings-card-head {
  margin-top: -24px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Account .section-card tightens to 16/14 padding on small screens. */
@media (max-width: 640px) {
  .section-headline {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .section-card > .section-headline {
    margin-top: -16px;
  }
}

.admin-list .req-acts {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.record-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.record-load-more:empty {
  display: none;
  padding: 0;
  border-top: 0;
}

.record-load-more-btn {
  min-width: 168px;
  justify-content: center;
}

/* The list scrolls inside its panel and loads the next rows at the end (see the incremental script in _Layout):
   the button is only a fallback then. */
.record-load-more.record-load-more--auto {
  display: none;
}

.record-load-more-btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

/* Global submit-button loading feedback (set by the shared submit handler). */
.list-btn.is-loading,
.btn.is-loading,
.app-auth-button.is-loading,
.pill-tab.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.list-btn.is-loading::before,
.btn.is-loading::before,
.app-auth-button.is-loading::before,
.pill-tab.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: imjdm-btn-spin 0.6s linear infinite;
}

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

/* Inline SVG sort indicator (replaces the old Unicode arrows). */
.sort-arrow-icon {
  vertical-align: middle;
}

.record-list-page {
  min-height: calc(100dvh - var(--admin-content-offset, 92px) - var(--space-lg));
  display: flex;
  flex-direction: column;
}

.record-list-page .record-incremental {
  flex: 1 1 auto;
  min-height: clamp(360px, 52vh, 760px);
  display: flex;
  flex-direction: column;
}

.record-list-page .record-incremental > table {
  flex: 0 0 auto;
}

/* Desktop and tablet with real height (768px+ wide, 600px+ tall). Everything in the panel except the rows
   (results header, filter form, sort bar, page head, context tabs) keeps its natural size with
   flex-shrink: 0: several have overflow of their own, which gives a flex item an automatic minimum size of 0,
   so the flex algorithm squeezed them first. Phones, and phones held sideways (wide but ~390px tall), are
   outside this block; there the page simply scrolls and compact cards have no column header. */
/* List pages grow with their rows (owner, 2026-11-26): the panel was held to exactly one screen with the rows
   scrolling inside it. Now the height above is only a floor, the same line the sidebar ends on, so a short
   list still ends level with the sidebar, and a long one runs on down the page with the sidebar pinned (the
   top bar scrolls away, as on every long page). The rows no longer scroll inside the panel, so the column
   header row (record-row.css, top: 0) pins to the top of the screen instead; for that the table card clips
   its rounded corners with overflow: clip, which, unlike the sideways auto it had, does not make it a
   scroll box the header would pin inside. */
@media (min-width: 768px) and (min-height: 600px) {
  .record-list-page .table-wrap {
    overflow: clip;
  }

  /* Same squeeze, one level up: .record-list-page's OTHER direct children
     (page-head, .mobile-context-tabs, the refund-attention card, etc.) are
     flex items here too, and .mobile-context-tabs also has its own
     overflow-x:auto (for horizontal scroll when tabs don't fit) — same
     automatic-minimum-size-0 trap. Without this it was the one squeezed to
     ~10px instead of .record-incremental taking the bounded height. */
  .record-list-page > *:not(.record-incremental) {
    flex-shrink: 0;
  }

  .record-list-page .record-incremental > *:not(.record-list-wrap) {
    flex-shrink: 0;
  }

  /* The page's own floor sets the height, so the rows' panel needs none: the 52vh floor above pushed a short
     list's panel past the sidebar (Admin → Requests at 1280×720, and on iPad Safari, where vh is the screen
     height without its toolbars, by far more). */
  .record-list-page .record-incremental {
    min-height: 0;
  }

  .record-list-page .record-incremental > .record-list-wrap {
    flex: 1 1 auto;
  }
}

.record-list-page .record-incremental .record-load-more {
  margin-top: auto;
}

/* ── Admin dashboard theme ────────────────────────────────────────────── */
.imjdm-dash-theme {
  --bg: var(--color-bg);
  --surface: color-mix(in srgb, var(--color-surface) 72%, transparent);
  --surface2: color-mix(in srgb, var(--color-component) 54%, transparent);
  --ink: var(--color-text-primary);
  --ink2: var(--color-text-secondary);
  --ink3: var(--color-text-tertiary);
  --ink-inverse: var(--color-surface);
  --rule: var(--color-border);
  --rule2: var(--color-border-light);
  --red: var(--color-primary);
  --red-dim: color-mix(in srgb, var(--color-primary) 8%, transparent);
  --green: var(--color-success);
  --green-bg: var(--color-success-bg);
  --amber: var(--color-warning);
  --amber-bg: var(--color-warning-bg);
  --blue: var(--color-info);
  --blue-bg: var(--color-info-bg);
  --font-h: var(--font-family-heading);
  --font-b: var(--font-family-body);
  --nav-h: 50px;
  --side-w: 200px;
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-b);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
}
.imjdm-dash-theme *, .imjdm-dash-theme *::before, .imjdm-dash-theme *::after { box-sizing: border-box; margin: 0; padding: 0; }
.imjdm-dash-theme .content { padding: 0; min-width: 0; }
.imjdm-dash-theme .topbar-actions { display: flex; gap: var(--space-sm); margin-left: auto; }

.imjdm-dash-theme .btn { font-family: var(--font-b); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); min-height: var(--btn-height); padding: var(--space-xs) var(--space-lg); border-radius: var(--radius-button); border: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-xs); transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.12s; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); }
.imjdm-dash-theme .btn-primary { background: var(--red); color: var(--ink-inverse); }
.imjdm-dash-theme .btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.imjdm-dash-theme .btn-ghost { background: color-mix(in srgb, var(--color-component) 58%, transparent); color: var(--ink2); border: 1px solid var(--rule); }
.imjdm-dash-theme .btn-ghost:hover { background: color-mix(in srgb, var(--color-component) 74%, transparent); color: var(--ink); }
.imjdm-dash-theme .btn-sm { font-size: var(--font-size-xs); min-height: 34px; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-button-sm); }

.imjdm-dash-theme .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-xl); box-shadow: var(--shadow-sm); }
.imjdm-dash-theme .stat { background: var(--surface); padding: var(--space-xl) var(--space-xl); }
.imjdm-dash-theme .stat-lbl { font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); letter-spacing: 0; text-transform: uppercase; color: var(--ink3); margin-bottom: var(--space-xs); }
.imjdm-dash-theme .stat-val { font-family: var(--font-h); font-size: var(--font-size-3xl); line-height: var(--line-height-tight); color: var(--ink); }
.imjdm-dash-theme .stat-val.red { color: var(--red); }
.imjdm-dash-theme .stat-val.green { color: var(--green); }
.imjdm-dash-theme .stat-val.amber { color: var(--amber); }
.imjdm-dash-theme .stat-val.blue { color: var(--blue); }
.imjdm-dash-theme .stat-sub { font-size: var(--font-size-xs); color: var(--ink3); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.imjdm-dash-theme .stat-sub.up { color: var(--green); }
.imjdm-dash-theme .stat-sub.down { color: var(--red); }

.imjdm-dash-theme .main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(380px, 0.95fr);
  grid-template-areas:
    "queue feed"
    "pipeline requests"
    "finance invoices";
  gap: var(--space-xl);
  align-items: stretch;
}
.imjdm-dash-theme .main-grid > * { min-width: 0; }
.imjdm-dash-theme .main-grid > .panel-spaced { margin-bottom: 0; }
.imjdm-dash-theme .main-grid > .panel,
.imjdm-dash-theme .main-grid > .imjdm-pipeline { align-self: stretch; }
.imjdm-dash-theme .risk-panel { grid-area: queue; }
.imjdm-dash-theme .imjdm-pipeline { grid-area: pipeline; }
.imjdm-dash-theme .dashboard-finance-panel { grid-area: finance; }
.imjdm-dash-theme .dashboard-feed-panel { grid-area: feed; }
.imjdm-dash-theme .dashboard-req-panel { grid-area: requests; }
.imjdm-dash-theme .dashboard-inv-panel { grid-area: invoices; }
.imjdm-dash-theme .panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.imjdm-dash-theme .panel-spaced { margin-bottom: var(--space-xl); }
/* "Needs your reply" (owner, 2026-11-19): our team is waiting on the customer. */
.dash-needs-reply {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 var(--space-lg);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--color-warning) 45%, transparent);
  background: color-mix(in srgb, var(--color-warning-bg) 70%, var(--color-surface));
}
.dash-needs-reply__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-warning);
}
.dash-needs-reply__text { flex: 1 1 14rem; min-width: 0; display: grid; gap: 2px; }
.dash-needs-reply__text strong { color: var(--color-text-primary); font-size: var(--font-size-base); }
.dash-needs-reply__text span { color: var(--color-text-secondary); font-size: var(--font-size-sm); overflow-wrap: anywhere; }
.dash-needs-reply__btn {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}
.dash-needs-reply__btn:hover { background: var(--color-primary-dark); color: var(--color-text-inverse); }

.client-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, .95fr);
  grid-template-areas:
    "pipeline feed"
    "requests requests";
  gap: var(--space-xl);
  align-items: stretch;
}
.client-dashboard-grid > * { min-width: 0; }
.client-dashboard-grid > .panel-spaced { margin-bottom: 0; }
.client-dashboard-grid > .panel,
.client-dashboard-grid > .imjdm-pipeline { align-self: stretch; }

/* ── Global panel-header convention ───────────────────────────────────────────
   Promoted out of the dashboard scope so every .panel-head across the app shares
   the same separator, uniform height and semantic tint (see the tint block
   below). Non-dashboard panels fall back to the brand/primary accent; dashboard
   panels override --sem on their container for meaning-based colours. */
.panel-head { display: flex; align-items: center; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--rule2); }
/* Tracking and size come from the shared .admin-shell-content .panel-title
   rule, so a dashboard panel header reads the same as the one on the requests
   page. This used to zero the letter-spacing and, below, shrink the size on
   mobile, which left the two surfaces with different headings — 15px and no
   tracking here against 18px and 0.5px there. */
.imjdm-dash-theme .panel-title { font-family: var(--font-panel-title); font-size: var(--font-size-lg); line-height: var(--line-height-tight); }
.panel-sub { font-size: var(--font-size-sm); color: var(--ink3); margin-left: var(--space-sm); }
.panel-action { margin-left: auto; }

/* Any plain button dropped into a panel header — .list-btn or .btn alike —
   must match the segmented item's height, padding and radius (--seg-item-*)
   so a header never mixes a 44px button next to a 34px one. Scoped to the
   header containers rather than to a button variant so a future button
   inherits the right size for free without needing a special class; segmented
   items themselves (.pill-tab etc.) already size off these same tokens. */
.panel-head .list-btn,
.panel-head .btn,
.client-panel-head .list-btn,
.client-panel-head .btn {
  min-height: var(--seg-item-min-h);
  padding: var(--seg-item-pad);
  line-height: 1;
  border-radius: var(--radius-button-sm);
}
.imjdm-dash-theme .queue-head-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 34px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid color-mix(in srgb, var(--amber) 18%, transparent);
  text-decoration: none;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}
.imjdm-dash-theme .queue-head-link strong {
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  background: var(--amber);
  font-family: var(--font-h);
  font-size: var(--font-size-sm);
  line-height: 1;
}
.imjdm-dash-theme .queue-head-link:hover {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber-bg) 70%, white 30%);
}

/* ── Pipeline (premium flow) — shared by admin + client dashboards ────────────
   Local theme vars map the component palette onto global design tokens so the
   brand colour / green / ink / line / surface all stay token-driven. */
.imjdm-pipeline {
  --nv: var(--color-primary);
  --nv-2: color-mix(in srgb, var(--color-primary) 80%, #fff 20%);
  --pgreen: var(--color-success);
  --p-ink: var(--color-text-primary);
  --p-muted: var(--color-text-secondary);
  --p-faint: var(--color-text-tertiary);
  --p-line: var(--color-border-light);
  --p-line-soft: color-mix(in srgb, var(--color-border-light) 55%, transparent);
  --p-card: var(--color-surface);
  --p-track: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface));

  --pad-x: clamp(var(--space-md), 3vw, var(--space-xl));
  --pad-y: var(--space-lg);
  box-sizing: border-box;
  container-type: inline-size;
  container-name: pipeline;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: var(--pad-y) var(--pad-x) var(--space-xl);
  box-shadow: var(--shadow-sm);
  color: var(--p-ink);
}
.imjdm-pipeline *, .imjdm-pipeline *::before, .imjdm-pipeline *::after { box-sizing: border-box; }

/* Header conforms to the standard .panel-head: same height + an end-to-end
   separator (negative margins bleed past the section padding). */
.imjdm-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) var(--space-lg); padding: var(--space-md) var(--pad-x); border-bottom: 1px solid var(--rule2); }
.imjdm-head__title { display: flex; align-items: baseline; gap: var(--space-sm); }
.imjdm-head h2 { margin: 0; }
.imjdm-head__sub { color: var(--ink3); font-size: var(--font-size-sm); }
.imjdm-meta { display: flex; align-items: center; gap: var(--space-lg); }
.imjdm-meta__funnel { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--p-faint); }
.imjdm-meta__pub { display: inline-flex; align-items: center; gap: 7px; font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--pgreen); }
.imjdm-meta__pub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pgreen); }

.imjdm-flow { --edge: 12.5%; --progress: 0%; position: relative; display: flex; }
.imjdm-track, .imjdm-track-fill { position: absolute; left: var(--edge); right: var(--edge); top: 28px; height: 3px; border-radius: 3px; }
.imjdm-track { background: var(--p-track); }
.imjdm-track-fill { right: auto; width: var(--progress); background: linear-gradient(90deg, var(--nv), var(--nv-2), var(--nv)); background-size: 200% 100%; animation: imjdm-flow 3s linear infinite; }
@keyframes imjdm-flow { to { background-position: -200% 0; } }

.imjdm-stage { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 9px; min-width: 0; text-decoration: none; color: inherit; }

.imjdm-node { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.imjdm-node--done { background: var(--p-card); border: 2px solid var(--nv); color: var(--nv); box-shadow: 0 5px 12px color-mix(in srgb, var(--nv) 12%, transparent); }
.imjdm-node--current { width: 62px; height: 62px; background: linear-gradient(135deg, var(--nv-2), var(--nv)); color: var(--color-text-inverse); }
.imjdm-node--end { background: var(--color-success-bg); border: 2px solid color-mix(in srgb, var(--pgreen) 35%, var(--p-card)); color: var(--pgreen); box-shadow: 0 5px 12px color-mix(in srgb, var(--pgreen) 14%, transparent); }
/* Pulse only when the stage has items in the queue (.imjdm-pulse added server-side). */
.imjdm-node--current.imjdm-pulse { animation: imjdm-glow 2.6s ease-in-out infinite; }
@keyframes imjdm-glow {
  0%,100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--nv) 10%, transparent), 0 12px 24px color-mix(in srgb, var(--nv) 30%, transparent); }
  50%     { box-shadow: 0 0 0 10px color-mix(in srgb, var(--nv) 4%, transparent), 0 12px 24px color-mix(in srgb, var(--nv) 30%, transparent); }
}
/* Attention node — error-token accent; pulsing glow only when it has items. */
.imjdm-node--alert { background: color-mix(in srgb, var(--color-error) 8%, var(--p-card)); border: 2px solid color-mix(in srgb, var(--color-error) 45%, var(--p-card)); color: var(--color-error); }
.imjdm-node--alert.imjdm-pulse { animation: imjdm-glow-alert 2.6s ease-in-out infinite; }
@keyframes imjdm-glow-alert {
  0%,100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-error) 12%, transparent), 0 12px 24px color-mix(in srgb, var(--color-error) 28%, transparent); }
  50%     { box-shadow: 0 0 0 10px color-mix(in srgb, var(--color-error) 4%, transparent), 0 12px 24px color-mix(in srgb, var(--color-error) 28%, transparent); }
}
.imjdm-pipeline .is-alert .imjdm-panel__label { color: var(--color-error); }
.imjdm-pipeline .is-alert .imjdm-panel__count { color: var(--color-error); }

.imjdm-panel { position: relative; width: 100%; margin-top: var(--space-lg); background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--radius-lg); padding: var(--space-lg); text-align: center; transition: transform .18s ease, box-shadow .18s ease; }
a.imjdm-stage:not(.is-current) .imjdm-panel { cursor: pointer; }
a.imjdm-stage:not(.is-current) .imjdm-panel:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -16px color-mix(in srgb, var(--p-ink) 28%, transparent); }
.imjdm-pipeline .is-current .imjdm-panel { margin-top: var(--space-md); background: color-mix(in srgb, var(--nv) 5%, var(--p-card)); border: 1.5px solid color-mix(in srgb, var(--nv) 28%, var(--p-card)); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--nv) 32%, transparent); }
.imjdm-pipeline .is-end .imjdm-panel { background: color-mix(in srgb, var(--pgreen) 5%, var(--p-card)); border: 1px solid color-mix(in srgb, var(--pgreen) 28%, var(--p-card)); }
a.imjdm-stage.is-end .imjdm-panel:hover { box-shadow: 0 16px 30px -16px color-mix(in srgb, var(--pgreen) 30%, transparent); }

.imjdm-panel__text { display: block; }
.imjdm-panel__label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--p-muted); }
.imjdm-pipeline .is-current .imjdm-panel__label { font-weight: var(--font-weight-extrabold); color: var(--nv); }
.imjdm-pipeline .is-end .imjdm-panel__label { color: var(--pgreen); }
.imjdm-panel__count { display: block; margin-top: var(--space-sm); font-family: var(--font-h); font-weight: var(--font-weight-extrabold); font-size: 38px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.imjdm-pipeline .is-current .imjdm-panel__count { color: var(--nv); }
.imjdm-pipeline .is-end .imjdm-panel__count { color: var(--pgreen); }
.imjdm-panel__meta { display: block; margin-top: var(--space-sm); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); color: var(--p-faint); }
.imjdm-pipeline .is-current .imjdm-panel__meta { font-weight: var(--font-weight-bold); color: color-mix(in srgb, var(--nv) 60%, var(--p-muted)); }
.imjdm-pipeline .is-end .imjdm-panel__meta { color: color-mix(in srgb, var(--pgreen) 55%, var(--p-faint)); }

.imjdm-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: var(--font-size-xs); font-weight: var(--font-weight-extrabold); letter-spacing: .06em; color: var(--color-text-inverse); padding: 3px 11px; border-radius: var(--radius-full); white-space: nowrap; }
.imjdm-tag--now { background: var(--nv-2); box-shadow: 0 4px 10px color-mix(in srgb, var(--nv-2) 40%, transparent); }
.imjdm-tag--end { background: var(--pgreen); }

.imjdm-exited { margin: var(--space-lg) 9px 0; min-height: 66px; padding: var(--space-md) var(--space-lg); border: 1px dashed var(--p-line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--p-faint) 5%, var(--p-card)); display: flex; align-items: center; gap: var(--space-md); text-decoration: none; color: inherit; }
a.imjdm-exited { cursor: pointer; transition: background .15s ease, border-color .15s ease; }
a.imjdm-exited:hover { background: color-mix(in srgb, var(--color-primary) 5%, var(--p-card)); border-color: color-mix(in srgb, var(--color-primary) 22%, var(--p-line)); }
.imjdm-exited__icon { width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); background: color-mix(in srgb, var(--p-faint) 8%, var(--p-card)); border: 1px solid var(--p-line); color: var(--p-faint); display: flex; align-items: center; justify-content: center; }
.imjdm-exited__body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.imjdm-exited__label { display: block; font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--p-muted); }
.imjdm-exited__desc { display: block; font-size: var(--font-size-xs); color: var(--p-faint); }
.imjdm-exited__right { margin-left: auto; min-width: 58px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.imjdm-exited__num { display: block; font-family: var(--font-h); font-weight: var(--font-weight-extrabold); font-size: var(--font-size-xl); line-height: 1; font-variant-numeric: tabular-nums; color: var(--p-muted); }
.imjdm-exited__off { display: block; font-size: var(--font-size-xs); font-weight: var(--font-weight-extrabold); letter-spacing: .06em; color: var(--p-faint); margin-top: 3px; }
.imjdm-exited--urgent .imjdm-exited__num,
.imjdm-exited--urgent .imjdm-exited__label { color: var(--color-error); }

/* Pipeline → vertical timeline on small screens (admin + client). */
/* Switch to the vertical timeline whenever the pipeline's own column is too
   narrow for 4 horizontal stages — covers narrow tablet-landscape columns, not
   just small viewports. */
@container pipeline (max-width: 600px) {
  /* The node column is --p-node wide, so its centre is half that, and the rail
     has to be drawn half its own width to the left of that to sit on the line
     rather than beside it. It was pinned at a flat 28px against 44px nodes
     whose centres are at 22px, so the timeline ran 7.5px to the right of every
     icon it was supposed to thread through. */
  .imjdm-flow { flex-direction: column; --p-node: 44px; --p-rail: 3px; }
  .imjdm-track, .imjdm-track-fill { display: none; }
  .imjdm-flow::before { content: ""; position: absolute; left: calc((var(--p-node) - var(--p-rail)) / 2); top: 24px; bottom: 24px; width: var(--p-rail); background: var(--p-track); border-radius: 3px; }

  /* The current stage's node is 2px larger. Left to grow from its leading edge
     it pushed its own centre 1px off the rail and its panel 2px out of line
     with the others; a negative inline margin grows it about the same axis. */
  .imjdm-node--current {
    --p-node-current: 46px;
    margin-left: calc((var(--p-node) - var(--p-node-current)) / 2);
    margin-right: calc((var(--p-node-current) - var(--p-node)) / 2);
  }
  .imjdm-stage { flex-direction: row; align-items: center; gap: var(--space-md); padding: 7px 0; }
  .imjdm-node { width: 44px; height: 44px; }
  .imjdm-node--current { width: 46px; height: 46px; }
  .imjdm-node--current svg { width: 19px; height: 19px; }
  /* Every stage is a bordered timeline row; the current stage keeps its filled
     navy panel, the rest are plain outlined rows. */
  .imjdm-panel, .imjdm-pipeline .is-current .imjdm-panel { margin-top: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); text-align: left; padding: var(--space-sm); background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--radius-md); box-shadow: none; transition: background .15s ease, border-color .15s ease; }
  .imjdm-pipeline .is-current .imjdm-panel { margin: 0 -2px; background: color-mix(in srgb, var(--nv) 6%, var(--p-card)); border: 1.5px solid color-mix(in srgb, var(--nv) 28%, var(--p-card)); }
  .imjdm-pipeline .is-end .imjdm-panel { background: var(--p-card); border: 1px solid var(--p-line); }
  .imjdm-panel__count { margin-top: 0; font-size: var(--font-size-xl); order: 2; }
  .imjdm-panel__text { order: 1; }
  .imjdm-panel__meta { margin-top: 2px; }
  .imjdm-tag { position: static; transform: none; display: inline-block; margin-left: 7px; padding: 2px 7px; font-size: var(--font-size-xs); box-shadow: none; }

  /* Hover/press tints the bordered row (matching the global row hover) instead
     of the desktop panel lift, which only flashed a floating shadow on tap. */
  a.imjdm-stage:not(.is-current) .imjdm-panel:hover { transform: none; box-shadow: none; }
  a.imjdm-stage:not(.is-current):hover .imjdm-panel,
  a.imjdm-stage:not(.is-current):active .imjdm-panel { background: color-mix(in srgb, var(--nv) 7%, var(--p-card)); border-color: color-mix(in srgb, var(--nv) 22%, var(--p-line)); }
}

.imjdm-dash-theme .pipe-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-2xl) var(--space-xl); text-align: center; }
.imjdm-dash-theme .pipe-empty-icon { color: var(--ink3); }
.imjdm-dash-theme .pipe-empty-text { font-size: var(--font-size-sm); color: var(--ink3); }

/* ── Operational Risk Queue (admin dashboard) ─────────────────────────────────
   Priority rail (desktop) + list (mobile). Per-bucket colour comes from local
   --risk-accent / --risk-soft tokens set by the severity modifiers below. */
.imjdm-dash-theme .risk--critical { --risk-accent: var(--color-error); }
.imjdm-dash-theme .risk--high     { --risk-accent: var(--amber); }
.imjdm-dash-theme .risk--medium   { --risk-accent: var(--blue); }
.imjdm-dash-theme .risk--low      { --risk-accent: var(--ink3); }
.imjdm-dash-theme .risk-panel { display: flex; flex-direction: column; }
.imjdm-dash-theme .risk-card,
.imjdm-dash-theme .risk-li { --risk-text: color-mix(in srgb, var(--risk-accent) 78%, var(--ink) 22%); --risk-soft: color-mix(in srgb, var(--risk-accent) 14%, var(--color-surface)); }

/* Desktop rail: cards wrap onto further rows rather than scrolling sideways (the scroll
   had no visible scrollbar, so a fifth or sixth card was simply off-screen). auto-fit
   lets a short row stretch to the full width, as the single row always did. */
.imjdm-dash-theme .risk-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--space-sm); align-items: stretch; padding: var(--space-md) var(--space-lg); }
.imjdm-dash-theme .risk-card { min-width: 0; display: flex; flex-direction: column; padding: var(--space-md); border: 1px solid var(--rule2); border-top: 3px solid var(--risk-accent); border-radius: var(--radius-md); background: var(--color-surface); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.imjdm-dash-theme .risk-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--risk-soft); }
.imjdm-dash-theme .risk-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.imjdm-dash-theme .risk-tag { font-family: var(--font-h); font-size: var(--font-size-xs); font-weight: var(--font-weight-extrabold); letter-spacing: .06em; color: var(--risk-text); }
.imjdm-dash-theme .risk-card__count { font-family: var(--font-h); font-weight: var(--font-weight-extrabold); font-size: var(--font-size-3xl); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--risk-text); }
.imjdm-dash-theme .risk-card__name { margin-top: var(--space-sm); font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--ink2); line-height: 1.25; }
.imjdm-dash-theme .risk-card__age { margin-top: var(--space-xs); font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); color: var(--risk-text); }

/* Shared severity dot */
.imjdm-dash-theme .risk-dot { width: 10px; height: 10px; flex: none; border-radius: var(--radius-full); background: var(--risk-accent); }
.imjdm-dash-theme .risk--critical .risk-dot { animation: risk-buzz 1.6s ease-out infinite; }
.imjdm-dash-theme .risk--noanim .risk-dot { animation: none; }

/* Mobile list */
.imjdm-dash-theme .risk-mlist { display: none; padding: var(--space-xs) var(--space-lg) var(--space-md); }
.imjdm-dash-theme .risk-li { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) 0; border-bottom: 1px solid var(--rule2); text-decoration: none; color: inherit; }
.imjdm-dash-theme .risk-li:last-child { border-bottom: 0; }
.imjdm-dash-theme .risk-li__body { flex: 1; min-width: 0; }
.imjdm-dash-theme .risk-li__name { display: block; font-size: var(--font-size-base); font-weight: var(--font-weight-bold); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imjdm-dash-theme .risk-li__age { display: block; margin-top: 1px; font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); color: var(--risk-text); }
.imjdm-dash-theme .risk-li__chip { font-family: var(--font-h); font-weight: var(--font-weight-extrabold); font-size: var(--font-size-sm); color: var(--risk-text); background: var(--risk-soft); padding: 3px 11px; border-radius: var(--radius-md); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.imjdm-dash-theme .risk-placeholder { display: none; }

/* The placeholder only fills height the panel has spare (it stretches to match the panel
   beside it). The outer box is a size container that takes the leftover height and
   nothing more; the dashed box inside hides itself once that space is too small for it,
   so rows of wrapped cards never push the panel taller just to keep the message. */
@media (min-width: 768px) {
  .imjdm-dash-theme .risk-placeholder {
    flex: 1 1 0;
    min-height: 0;
    container-type: size;
    display: block;
  }
  .imjdm-dash-theme .risk-placeholder__box {
    box-sizing: border-box;
    height: calc(100cqh - var(--space-lg));
    margin: 0 var(--space-lg) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    color: var(--ink3);
    background: color-mix(in srgb, var(--amber-bg) 45%, var(--color-surface));
    border: 1px dashed color-mix(in srgb, var(--amber) 24%, var(--rule2));
    border-radius: var(--radius-md);
    font-family: var(--font-b);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-align: center;
  }
  @container (max-height: 96px) {
    .imjdm-dash-theme .risk-placeholder__box { display: none; }
  }
}

@keyframes risk-buzz {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-error) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--color-error) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-error) 0%, transparent); }
}

@media (max-width: 820px) {
  .imjdm-dash-theme .risk-rail { display: none; }
  .imjdm-dash-theme .risk-mlist { display: block; }
}
/* ── Financial Activity: compact KPI + mini bar chart ─────────────────────── */
.imjdm-dash-theme .financial-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--rule2);
}

/* Uniform header height across every dashboard panel — content (toggles,
   buttons, plain titles) is vertically centred within a shared min-height so
   the bars line up regardless of what each header contains. */
.panel-head,
.imjdm-dash-theme .imjdm-head,
.imjdm-dash-theme .financial-activity-header {
  min-height: 52px;
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

/* Semantic header tint — each panel carries a meaning colour in --sem; the
   header gets a subtle wash + a left accent (inset shadow, no layout shift). */
.imjdm-dash-theme .risk-panel { --sem: var(--amber); }
.imjdm-dash-theme .imjdm-pipeline { --sem: var(--color-primary); }
.imjdm-dash-theme .dashboard-finance-panel { --sem: var(--green); }
.imjdm-dash-theme .dashboard-req-panel { --sem: var(--blue); }
.imjdm-dash-theme .dashboard-inv-panel { --sem: var(--green); }
.imjdm-dash-theme .dashboard-activity-panel { --sem: var(--blue); }
.panel-head,
.imjdm-dash-theme .imjdm-head,
.imjdm-dash-theme .financial-activity-header {
  background: color-mix(in srgb, var(--sem, var(--color-primary)) 7%, var(--color-surface));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sem, var(--color-primary)) 60%, transparent);
}

/* Charcoal dashboard panel headers — matches the app-wide charcoal panel-header
   treatment (charcoal band + white title + bottom split rule + depth). The
   in-header controls (View all, Live badge, funnel/published meta, finance period
   toggle, risk count pill) are converted to white-glass so they read on the dark
   band. Scoped to the dashboard; semantic colours survive in the panel bodies. */
.imjdm-dash-theme .panel-head,
.imjdm-dash-theme .imjdm-head,
.imjdm-dash-theme .financial-activity-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-panel-header) 86%, white) 0%,
    var(--color-panel-header) 100%
  );
  box-shadow: 0 4px 12px -7px rgba(18, 24, 32, 0.18);
  border-bottom: none;
}
/* Full-width red/blue split rule on the bottom edge. */
.imjdm-dash-theme .panel-head::before,
.imjdm-dash-theme .imjdm-head::before,
.imjdm-dash-theme .financial-activity-header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    #c0181e 0 50%,
    var(--color-info) 50% 100%
  );
  pointer-events: none;
}
/* Title → white; meta → translucent white. */
.imjdm-dash-theme .panel-head .panel-title,
.imjdm-dash-theme .imjdm-head .panel-title,
.imjdm-dash-theme .financial-activity-header .panel-title {
  color: var(--color-panel-header-text);
}
/* News-feed heading forces a muted-grey title later in the file; this higher-
   specificity selector keeps it white on the charcoal band. */
.imjdm-dash-theme .panel-head .dashboard-feed-heading .panel-title {
  color: var(--color-panel-header-text);
}
.imjdm-dash-theme .imjdm-head .imjdm-meta__funnel,
.imjdm-dash-theme .imjdm-head .imjdm-meta__pub,
.imjdm-dash-theme .panel-head .panel-sub {
  color: color-mix(in srgb, var(--color-panel-header-text) 80%, transparent);
}
/* Interactive header controls stay transparent so the header remains the glass
   surface; borders, hover tint and active state carry the hierarchy. Every colour
   here derives from --color-panel-header-text (Website Settings → Theme →
   PanelHeaderText), never a literal white — so a light header with dark text
   keeps these controls visible instead of white-on-white. */
.imjdm-dash-theme .panel-head .list-btn-ghost,
.imjdm-dash-theme .panel-head .btn-ghost {
  color: var(--color-panel-header-text);
  background: transparent;
  border-color: color-mix(in srgb, var(--color-panel-header-text) 36%, transparent);
}
.imjdm-dash-theme .panel-head .list-btn-ghost:hover,
.imjdm-dash-theme .panel-head .btn-ghost:hover {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 14%, transparent);
}
.imjdm-dash-theme .panel-head .dashboard-feed-status {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 18%, transparent);
}
.imjdm-dash-theme .panel-head .dashboard-feed-status__dot {
  background: var(--color-panel-header-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-panel-header-text) 22%, transparent);
}
.imjdm-dash-theme .panel-head .queue-head-link {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 16%, transparent);
  border-color: color-mix(in srgb, var(--color-panel-header-text) 42%, transparent);
}
.imjdm-dash-theme .panel-head .queue-head-link strong {
  color: var(--color-panel-header);
  background: var(--color-panel-header-text);
}
.imjdm-dash-theme .financial-activity-header .financial-period-toggle {
  background: transparent;
  border-color: color-mix(in srgb, var(--color-panel-header-text) 30%, transparent);
}
.imjdm-dash-theme .financial-activity-header .financial-period-btn {
  color: color-mix(in srgb, var(--color-panel-header-text) 82%, transparent);
}
.imjdm-dash-theme .financial-activity-header .financial-period-btn:hover {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 16%, transparent);
}
.imjdm-dash-theme .financial-activity-header .financial-period-btn.active {
  background: color-mix(in srgb, var(--color-panel-header-text) 18%, transparent);
  color: var(--color-panel-header-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-panel-header-text) 30%, transparent);
}
/* END charcoal dashboard panel headers */
.imjdm-dash-theme .financial-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
  min-width: 0;
}
.imjdm-dash-theme .financial-title-row .panel-title { margin: 0; }

/* Segmented 7D / 6W / 6M selector — squarish, tint container, tint-filled
   active. Items are <a> links so the existing server-side period
   switch (asp-route-financePeriod) keeps working with no JS. */
.imjdm-dash-theme .financial-period-toggle {
  flex: 0 0 auto;
  /* Equal-width segments: every button sizes to the widest one. */
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--seg-gap);
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  /* Neutral gray track so unselected buttons don't read as plain white. */
  background: var(--seg-track-bg);
}
.imjdm-dash-theme .financial-period-btn {
  min-width: 44px;
  min-height: var(--seg-item-min-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 0;
  border-radius: var(--seg-item-radius);
  padding: var(--seg-item-pad);
  background: transparent;
  color: var(--seg-rest-text);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--seg-item-weight);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.imjdm-dash-theme .financial-period-btn:hover {
  color: var(--color-text-primary);
  background: color-mix(in srgb, var(--color-text-tertiary) 10%, transparent);
}
.imjdm-dash-theme .financial-period-btn.active {
  background: var(--seg-active-bg);
  color: var(--seg-active-text);
  box-shadow: var(--shadow-sm);
}
.imjdm-dash-theme .financial-period-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Unlike other segmented toggles (which sit in their own row and so target
   --btn-height for their track), this one lives directly inside the panel
   header next to plain buttons like "View all" — those are sized to
   --seg-item-min-h there, so this track needs to match that instead of
   growing to the usual --btn-height. Only the vertical inset is tightened
   (horizontal stays aligned with every other segmented track) and the pill
   shrinks to compensate. Scoped to this component only. */
.imjdm-dash-theme .financial-period-toggle {
  padding-top: 2px;
  padding-bottom: 2px;
}
.imjdm-dash-theme .financial-period-btn {
  min-height: calc(var(--seg-item-min-h) - 6px);
}

/* Body: KPI summary above a full-width time-series chart. Keeping these in one
   vertical flow gives the trend enough horizontal room to remain readable. */
.imjdm-dash-theme .financial-activity-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
  padding: var(--space-lg);
  transition: opacity .15s ease;
}
.imjdm-dash-theme .financial-activity-card.is-refreshing .financial-activity-body {
  opacity: 0.55;
}
.imjdm-dash-theme .kpi-label {
  color: var(--ink3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.imjdm-dash-theme .kpi-value {
  margin-top: var(--space-2xs);
  font-family: var(--font-h);
  /* Hero KPI: no token is this large, so derive it from the largest text token. */
  font-size: clamp(var(--font-size-3xl), 5vw, calc(var(--font-size-3xl) * 1.45));
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  line-height: 0.98;
  color: var(--ink);
}
.imjdm-dash-theme .kpi-value span {
  color: var(--ink3);
  font-weight: var(--font-weight-semibold);
}
.imjdm-dash-theme .kpi-value.negative {
  color: var(--color-error);
}

.imjdm-dash-theme .finance-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.imjdm-dash-theme .finance-stat-card {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--rule2);
  border-radius: var(--radius-lg);
  background: var(--color-surface-light, #f9fafb);
  min-width: 0;
}
.imjdm-dash-theme .finance-stat-card strong {
  display: block;
  font-family: var(--font-h);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.imjdm-dash-theme .finance-stat-card span {
  display: block;
  margin-top: var(--space-2xs);
  color: var(--ink3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}
.imjdm-dash-theme .finance-stat-card.danger strong { color: var(--color-error); }

.imjdm-dash-theme .financial-area-chart {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-2xs);
}

.imjdm-dash-theme .financial-chart-legend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  color: var(--ink3);
  font-family: var(--font-b);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.imjdm-dash-theme .financial-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}

.imjdm-dash-theme .financial-chart-key {
  width: var(--space-sm);
  height: var(--space-sm);
  border-radius: var(--radius-full);
  display: inline-block;
}

.imjdm-dash-theme .financial-chart-key--current {
  background: var(--blue);
}

.imjdm-dash-theme .financial-chart-key--previous {
  background: var(--green);
}

.imjdm-dash-theme .financial-area-chart__plot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: stretch;
}

.imjdm-dash-theme .financial-y-axis {
  position: relative;
  height: 124px;
  color: var(--ink3);
  font-family: var(--font-b);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}

.imjdm-dash-theme .financial-y-axis__tick {
  position: absolute;
  right: 0;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
}

.imjdm-dash-theme .financial-axis-tick--negative {
  color: var(--color-error);
}

.imjdm-dash-theme .financial-plot-surface {
  position: relative;
  min-width: 0;
  height: 124px;
  overflow: visible;
}

.imjdm-dash-theme .financial-area-chart__svg {
  width: 100%;
  height: 124px;
  display: block;
  overflow: visible;
}

.imjdm-dash-theme .financial-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid color-mix(in srgb, var(--ink3) 14%, transparent);
  transform: translateY(-50%);
  pointer-events: none;
}

.imjdm-dash-theme .financial-grid-line.financial-axis-tick--zero {
  border-top-color: color-mix(in srgb, var(--ink3) 42%, transparent);
  border-top-width: 1.5px;
}

.imjdm-dash-theme .finance-area,
.imjdm-dash-theme .finance-line {
  pointer-events: none;
}

.imjdm-dash-theme .finance-area--previous {
  fill: color-mix(in srgb, var(--green) 58%, transparent);
  opacity: 0.82;
}

.imjdm-dash-theme .finance-line--previous {
  fill: none;
  stroke: color-mix(in srgb, var(--green) 84%, var(--color-surface) 16%);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
}

.imjdm-dash-theme .finance-area--current {
  fill: color-mix(in srgb, var(--blue) 62%, transparent);
  opacity: 0.68;
}

.imjdm-dash-theme .finance-line--current {
  fill: none;
  stroke: color-mix(in srgb, var(--blue) 88%, var(--color-surface) 12%);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.imjdm-dash-theme .finance-point {
  fill: transparent;
  stroke: transparent;
  cursor: help;
}

.imjdm-dash-theme .financial-chart-labels {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  margin-left: calc(42px + var(--space-sm));
  padding-top: var(--space-xs);
  color: var(--ink3);
  font-family: var(--font-b);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}

.imjdm-dash-theme .financial-chart-labels::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--rule2);
}

.imjdm-dash-theme .financial-chart-labels span {
  text-align: center;
}

.imjdm-dash-theme .callout.callout-paid { border-left-color: var(--amber); background: var(--amber-bg); }
.imjdm-dash-theme .callout.callout-inprogress { border-left-color: var(--blue); background: var(--blue-bg); }
.imjdm-dash-theme .callout.callout-completed { border-left-color: var(--red); background: var(--red-dim); }
.imjdm-dash-theme .callout.callout-refunds { border-left-color: var(--color-error); background: var(--color-error-bg); }
.imjdm-dash-theme .callout.callout-paid .callout-icon { color: var(--amber); }
.imjdm-dash-theme .callout.callout-inprogress .callout-icon { color: var(--blue); }
.imjdm-dash-theme .callout.callout-completed .callout-icon { color: var(--red); }
.imjdm-dash-theme .callout.callout-refunds .callout-icon { color: var(--color-error); }

.imjdm-dash-theme .tbl-wrap { overflow-x: auto; }
.imjdm-dash-theme .tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.imjdm-dash-theme .tbl thead th { text-align: left; padding: var(--space-sm) var(--space-lg); font-family: var(--font-b); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); background: var(--surface); border-bottom: 1px solid var(--rule); }
.imjdm-dash-theme .tbl tbody td { padding: var(--space-md) var(--space-lg); font-family: var(--font-b); border-bottom: 1px solid var(--rule2); color: var(--ink2); font-size: var(--font-size-base); vertical-align: middle; }
.imjdm-dash-theme .tbl tbody tr:last-child td { border-bottom: none; }
.imjdm-dash-theme .tbl tbody tr { transition: background 0.1s; }
.imjdm-dash-theme .tbl tbody tr:hover td { background: var(--surface2); }
.imjdm-dash-theme .td-main { color: var(--ink); font-weight: var(--font-weight-semibold); font-size: var(--font-size-base); }
.imjdm-dash-theme .td-dim { color: var(--ink3); font-size: var(--font-size-sm); }
.imjdm-dash-theme .tbl-acts { display: flex; gap: var(--space-xs); justify-content: flex-end; }

/* ── Dashboard Activity feed ─────────────────────────────────────────────────
 * Icon + two lines, no status pill:
 *   Line 1:  Report (Lot …) / Request (Lot …) / Invoice (Number)
 *   Line 2:  #request · date                                                    */
.imjdm-dash-theme .dash-feed { display: flex; flex-direction: column; }
.imjdm-dash-theme .dash-feed-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 60px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.15s ease;
}
.imjdm-dash-theme .dash-feed-item:last-child { border-bottom: 0; }
.imjdm-dash-theme a.dash-feed-item:hover { background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface)); }
.imjdm-dash-theme .dash-feed__icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--ink3);
  background: color-mix(in srgb, var(--color-component) 54%, transparent);
  border: 1px solid var(--rule2);
}
.imjdm-dash-theme .dash-feed__body { min-width: 0; flex: 1 1 auto; }
.imjdm-dash-theme .dash-feed__line1 {
  display: block;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.imjdm-dash-theme .dash-feed__line2 {
  display: block;
  margin-top: var(--space-2xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* Shared dashboard streaming feed widget. */
.imjdm-dash-theme .dashboard-feed-panel {
  --sem: var(--amber);
  --feed-accent: var(--blue);
  --feed-accent-bg: var(--blue-bg);
}

.imjdm-dash-theme .dashboard-feed-panel .panel-head {
  gap: var(--space-md);
}

.imjdm-dash-theme .dashboard-feed-panel .panel-head > :first-child {
  min-width: 0;
}

.imjdm-dash-theme .dashboard-feed-panel .panel-sub {
  margin-left: 0;
}

.imjdm-dash-theme .dashboard-feed-heading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

/* System Activity used to restate the panel-title styling here, and the restating
   was the problem. Family, size, weight, line-height and transform were already
   what every other panel title gets, the colour was dead (the .panel-head rule
   overrides it), and the one real difference — letter-spacing — made this
   heading read as a different typeface to its neighbours. Worse, the extra
   specificity outranked `@media (max-width: 767px) .imjdm-dash-theme
   .panel-title`, so on a phone this title stayed at 18px while every other
   panel heading shrank to 15px. Inheriting the shared rule settles both. */

.imjdm-dash-theme .dashboard-feed-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.imjdm-dash-theme .dashboard-feed-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: var(--space-2xs) calc(var(--space-sm) + var(--space-2xs));
  color: var(--green);
  background: var(--green-bg);
  border-radius: var(--radius-full);
  font-family: var(--font-b);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.imjdm-dash-theme .dashboard-feed-status__dot {
  width: var(--space-sm);
  height: var(--space-sm);
  flex: 0 0 var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}

.imjdm-dash-theme .dashboard-feed-panel.is-refreshing .dashboard-feed-status__dot {
  animation: dashboardFeedPulse 1.2s ease-in-out infinite;
}

.imjdm-dash-theme .dashboard-feed-panel.has-refresh-error .dashboard-feed-status {
  color: var(--amber);
  background: var(--amber-bg);
}

.imjdm-dash-theme .dashboard-feed-panel.has-refresh-error .dashboard-feed-status__dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent);
}

.imjdm-dash-theme .dashboard-feed {
  display: flex;
  flex-direction: column;
}

.imjdm-dash-theme .dashboard-feed__item {
  --feed-accent: var(--blue);
  --feed-accent-bg: var(--blue-bg);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  min-height: 58px;
  padding: var(--space-md) var(--space-lg);
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule2);
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.imjdm-dash-theme .dashboard-feed__item--report {
  --feed-accent: var(--green);
  --feed-accent-bg: var(--green-bg);
}

.imjdm-dash-theme .dashboard-feed__item--invoice {
  --feed-accent: var(--amber);
  --feed-accent-bg: var(--amber-bg);
}

.imjdm-dash-theme .dashboard-feed__item--refund {
  --feed-accent: var(--color-error);
  --feed-accent-bg: var(--color-error-bg);
}

.imjdm-dash-theme .dashboard-feed__item--cancel {
  --feed-accent: var(--color-text-tertiary);
  --feed-accent-bg: color-mix(in srgb, var(--color-text-tertiary) 12%, transparent);
}

.imjdm-dash-theme .dashboard-feed__item--ticket {
  --feed-accent: var(--color-primary);
  --feed-accent-bg: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.imjdm-dash-theme .dashboard-feed__item:last-child {
  border-bottom: 0;
}

.imjdm-dash-theme .dashboard-feed__item:hover {
  background: color-mix(in srgb, var(--feed-accent) 6%, var(--surface));
}

.imjdm-dash-theme .dashboard-feed__item:focus-visible {
  outline: 2px solid var(--feed-accent);
  outline-offset: -2px;
}

.imjdm-dash-theme .dashboard-feed__avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--feed-accent);
  background: var(--feed-accent-bg);
  border: 1px solid color-mix(in srgb, var(--feed-accent) 16%, transparent);
  border-radius: var(--radius-md);
  font-family: var(--font-b);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-extrabold);
  line-height: 1;
  letter-spacing: 0.02em;
}

.imjdm-dash-theme .dashboard-feed__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.imjdm-dash-theme .dashboard-feed__title {
  color: var(--color-text-primary);
  font-family: var(--font-b);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imjdm-dash-theme .dashboard-feed__meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-tertiary);
  font-family: var(--font-b);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
}

.imjdm-dash-theme .dashboard-feed__summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imjdm-dash-theme .dashboard-feed__separator {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--color-text-tertiary) 68%, transparent);
}

.imjdm-dash-theme .dashboard-feed__time {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.imjdm-dash-theme .dashboard-feed__tail {
  display: flex;
  justify-content: flex-end;
  min-width: max-content;
}

.imjdm-dash-theme .dashboard-feed__tag {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  padding: var(--space-2xs) calc(var(--space-sm) + var(--space-2xs));
}

.imjdm-dash-theme .dashboard-feed__tag::before {
  display: none;
}

.imjdm-dash-theme .dashboard-feed-empty {
  padding: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.imjdm-dash-theme .dashboard-feed__item.fresh {
  animation: dashboardFeedRowIn 0.45s ease, dashboardFeedGlowFade 1.8s ease forwards;
}

@keyframes dashboardFeedPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
  }
  50% {
    opacity: 0.42;
    transform: scale(1.15);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 7%, transparent);
  }
}

@keyframes dashboardFeedRowIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dashboardFeedGlowFade {
  0% {
    background: color-mix(in srgb, var(--feed-accent-bg) 76%, var(--surface));
    box-shadow: inset 3px 0 0 var(--feed-accent), 0 0 14px color-mix(in srgb, var(--feed-accent) 18%, transparent);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imjdm-dash-theme .dashboard-feed-panel.is-refreshing .dashboard-feed-status__dot,
  .imjdm-dash-theme .dashboard-feed__item.fresh {
    animation: none;
  }
}

@media (max-width: 480px) {
  .imjdm-dash-theme .dashboard-feed-actions {
    gap: var(--space-xs);
  }

  .imjdm-dash-theme .dashboard-feed-status {
    min-height: 22px;
    font-size: var(--font-size-xs);
  }

  /* The status pill stays on the right on a phone too (owner, 2026-11-05), centred in its row like pills across
     the site; the text wraps beside it instead of the pill dropping onto a line of its own. */
  .imjdm-dash-theme .dashboard-feed__item {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-sm);
  }

  .imjdm-dash-theme .dashboard-feed__tail {
    justify-content: flex-end;
  }

  /* With the pill beside it the summary wraps instead of cutting the email off. */
  .imjdm-dash-theme .dashboard-feed__summary {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .imjdm-dash-theme .dashboard-feed__meta {
    flex-wrap: wrap;
    row-gap: 0;
  }
}
.imjdm-dash-theme .callout { position: relative; display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-left: 4px solid var(--rule); background: var(--surface); text-decoration: none; color: inherit; cursor: pointer; transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; }
.imjdm-dash-theme .callout + .callout { border-top: 1px solid var(--rule2); }
.imjdm-dash-theme .callout:hover { background: color-mix(in srgb, var(--surface2) 82%, var(--surface) 18%); }
.imjdm-dash-theme .callout:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 34%, transparent); outline-offset: -3px; }
.imjdm-dash-theme .callout-icon { width: 34px; height: 34px; border-radius: var(--radius-md); color: var(--ink3); flex-shrink: 0; margin-top: var(--space-2xs); display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--color-component) 54%, transparent); border: 1px solid var(--rule2); }
.imjdm-dash-theme .callout.callout-clear { border-left-color: var(--green); background: var(--green-bg); }
.imjdm-dash-theme .callout.callout-clear .callout-icon { color: var(--green); }
.imjdm-dash-theme .callout-body { min-width: 0; flex: 1 1 auto; }
.imjdm-dash-theme .callout-kicker { display: none; }
.imjdm-dash-theme .callout-title { font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); color: var(--ink); }
.imjdm-dash-theme .callout-title strong { font-weight: var(--font-weight-bold); }
.imjdm-dash-theme .callout-sub { font-size: var(--font-size-sm); color: var(--ink2); margin-top: var(--space-2xs); }
.imjdm-dash-theme .callout-action { margin-left: auto; flex-shrink: 0; }

.imjdm-dash-theme .queue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--rule2);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

/* Title and its description sit inline by default; stack only when narrow. */
.refund-attention-card > .client-panel-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-sm);
  row-gap: var(--space-2xs);
}

.refund-queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-error-bg) 46%, var(--color-surface) 54%);
}

.refund-queue-summary-label {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.refund-queue-summary-value {
  margin-top: var(--space-2xs);
  color: var(--color-text-primary);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.refund-queue-summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.refund-queue-summary-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  white-space: nowrap;
}

.imjdm-dash-theme .panel-head + .queue-row {
  border-top: none;
}

.imjdm-dash-theme .queue-row:hover {
  background: var(--surface2);
  color: var(--ink);
}

.imjdm-dash-theme .queue-row-count {
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-h);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid color-mix(in srgb, var(--amber) 18%, transparent);
}

.imjdm-dash-theme .queue-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.imjdm-dash-theme .queue-row-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.imjdm-dash-theme .queue-row-sub {
  font-size: var(--font-size-xs);
  color: var(--ink3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imjdm-dash-theme .queue-row-action {
  color: var(--ink3);
  display: inline-flex;
}

.imjdm-dash-theme ::-webkit-scrollbar { width: 4px; }
.imjdm-dash-theme ::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 10px; }

@media (max-width: 1100px) {
  .imjdm-dash-theme .main-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "queue"
      "feed"
      "pipeline"
      "requests"
      "finance"
      "invoices";
  }

  .client-dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "pipeline"
      "feed"
      "requests";
  }
}

@media (min-width: 1600px) {
  .imjdm-dash-theme .main-grid { grid-template-columns: minmax(0, 1.45fr) minmax(420px, 1fr); }
}

@media (max-width: 960px) {
  .imjdm-dash-theme .stats-row { grid-template-columns: repeat(2, 1fr); }
  .imjdm-dash-theme .topbar { flex-wrap: wrap; }
}

/* ═════════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═════════════════════════════════════════════════════════════════════════════ */

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

@media (max-width: 640px) {
  .imjdm-dash-theme .content { padding: 0; }
  .imjdm-dash-theme .stats-row { grid-template-columns: 1fr; }
  /* Client dashboard has 4 stats — keep 2-col on mobile for a cleaner 2×2 grid */
  .client-dashboard .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .imjdm-dash-theme .main-grid {
    grid-template-areas:
      "queue"
      "feed"
      "pipeline"
      "finance";
  }

  /* ── Needs Action: whole callout is the tap target, hide inline button ── */
  .imjdm-dash-theme .callout-action { display: none; }
  .imjdm-dash-theme .panel-spaced:first-child {
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .imjdm-dash-theme .panel-spaced:first-child .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2xs);
    padding: var(--space-md);
  }
  .imjdm-dash-theme .panel-spaced:first-child .panel-sub {
    margin-left: 0;
    line-height: 1.35;
  }
  .imjdm-dash-theme .callout {
    min-height: 48px;
    align-items: center;
    gap: 0;
    padding: var(--space-sm) var(--space-md);
    border-left-width: 0;
    border-top: 1px solid var(--rule2);
    box-shadow: inset 4px 0 0 var(--callout-accent, var(--rule));
    touch-action: manipulation;
  }
  .imjdm-dash-theme .panel-head + .callout {
    border-top: 0;
  }
  .imjdm-dash-theme .callout::after {
    content: none;
  }
  .imjdm-dash-theme .callout.callout-paid { --callout-accent: var(--amber); }
  .imjdm-dash-theme .callout.callout-inprogress { --callout-accent: var(--blue); }
  .imjdm-dash-theme .callout.callout-completed { --callout-accent: var(--red); }
  .imjdm-dash-theme .callout.callout-refunds { --callout-accent: var(--color-error); }
  .imjdm-dash-theme .callout.callout-clear { --callout-accent: var(--green); }
  .imjdm-dash-theme .callout-icon {
    display: none;
  }
  .imjdm-dash-theme .callout-kicker {
    display: none;
  }
  .imjdm-dash-theme .callout-title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .imjdm-dash-theme .callout-title strong {
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-xs);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-inverse);
    background: var(--callout-accent, var(--ink3));
    font-family: var(--font-h);
    font-size: var(--font-size-sm);
    line-height: 1;
    box-shadow: none;
  }
  .imjdm-dash-theme .callout-sub {
    display: none;
  }

  /* ── Hide desktop table/invoice panels on mobile ── */
  .imjdm-dash-theme .dashboard-req-panel,
  .imjdm-dash-theme .dashboard-inv-panel { display: none; }
  .client-dashboard .dashboard-req-panel { display: block; }

  /* ── Date sub-text not needed on small screens ── */
  .imjdm-dash-theme .page-sub { display: none; }
}

/* ═════════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION, DRAWERS & CONTEXT TABS
   ═════════════════════════════════════════════════════════════════════════════ */

@keyframes mobileOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Desktop: hide mobile-only elements. Not .mobile-filter-toggle — that one is
   also the desktop filter-collapse trigger now (see "desktop fixes" below); the
   backdrop/scroll-lock/close-button that come with it on mobile stay hidden. */
.mobile-bottom-nav,
.mobile-more-drawer,
.mobile-drawer-overlay,
.mobile-top-menu,
.mobile-filter-backdrop,
.mobile-context-tabs,
.mobile-admin-settings-pills,
.mobile-customer-settings,
.hub-tabs,
.mobile-sort-field {
  display: none;
}

/* Sideways rows on a phone (shortcut row, Finance/Settings tabs): the edge with more to show fades
   out and an arrow points to it, so the items past it don't look missing (owner, 2026-11-22). A row
   that overflows gets its arrows in their own columns beside it, never over its items (the back arrow
   sat on the current tab). The classes come from scroll-hint.js and are only ever set on a row that
   overflows, so desktop is untouched. */
.scroll-hint {
  position: relative;
}

.scroll-hint.is-overflowing {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

.scroll-hint.is-overflowing > [data-scroll-hint-row] {
  grid-area: 1 / 2;
}

.scroll-hint.has-more-right > [data-scroll-hint-row] {
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
}

.scroll-hint.has-more-left > [data-scroll-hint-row] {
  -webkit-mask-image: linear-gradient(to right, transparent, black 32px);
  mask-image: linear-gradient(to right, transparent, black 32px);
}

.scroll-hint.has-more-left.has-more-right > [data-scroll-hint-row] {
  -webkit-mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
}

/* At an end there is nothing more that way: its arrow stays, faint, so the row doesn't shift. */
.scroll-hint__step {
  display: none;
  align-items: center;
  justify-content: center;
  grid-row: 1;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-primary);
  cursor: pointer;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.scroll-hint.is-overflowing > .scroll-hint__step { display: flex; }
.scroll-hint__step--back { grid-column: 1; }
.scroll-hint__step--next { grid-column: 3; }

.scroll-hint.has-more-left .scroll-hint__step--back,
.scroll-hint.has-more-right .scroll-hint__step--next {
  opacity: 1;
  pointer-events: auto;
}

.scroll-hint__step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

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

.record-list-page > .mobile-context-tabs {
  /* Equal-width buttons sized to the widest label; container shrinks to content
     (not full width). Neutral gray track to match the other segmented toggles. */
  --segmented-tint-bg: var(--seg-track-bg);
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: auto;
  max-width: 100%;
  align-self: flex-end;
  justify-self: end;
  align-items: center;
  gap: var(--seg-gap);
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
  margin: 0 0 var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.record-list-page > .mobile-context-tabs::-webkit-scrollbar {
  display: none;
}

.record-list-page > .mobile-context-tabs .mobile-context-tab {
  min-width: 0;
}

/* ── Phone navigation: option A, a floating capsule of clear glass (owner, 2026-11-26) ──
   ONE look for the upright bottom bar and the sideways rail; the two @media blocks below only place it.
   The page you're on sits in a brighter glass highlight that keeps about 9px clear of its label (the owner
   saw an earlier mock-up's highlight touch "Dashboard"). Book is a solid round button with no label.
   Hidden on desktop by the rule above, so none of this shows there. */
.mobile-bottom-nav-inner {
  position: relative;
  display: flex;
  padding: var(--space-xs);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: calc(var(--radius-xl) + var(--space-xs) + 1px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--topbar-bg) 66%, transparent) 0%,
    color-mix(in srgb, var(--topbar-bg-soft) 38%, transparent) 100%
  );
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  box-shadow: 0 14px 34px rgba(8, 18, 34, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  overflow: visible;
  pointer-events: auto;
}

/* Light catching the glass: across the top of the bar, down the left side of the rail. */
.mobile-bottom-nav-inner::before {
  content: "";
  position: absolute;
  inset: 1px 18px auto 18px;
  height: 45%;
  border-radius: calc(var(--radius-xl) + 2px) calc(var(--radius-xl) + 2px) 60% 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.mobile-nav-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--topbar-text-muted);
  font-family: var(--font-family-body);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-tab:hover {
  color: var(--topbar-text);
}

.mobile-nav-tab.active:not(.create) {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--topbar-bg) 80%, transparent);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 2px color-mix(in srgb, var(--color-primary) 10%, transparent),
    0 4px 12px color-mix(in srgb, var(--color-primary) 16%, transparent);
}

/* A press dips the icon instead of drawing a box, so nothing lands on the label. */
.mobile-nav-tab-icon {
  transition: transform 0.14s ease;
}

.mobile-nav-tab:active .mobile-nav-tab-icon {
  transform: scale(0.9);
}

.mobile-nav-tab:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.mobile-nav-tab.create .mobile-nav-tab-label {
  display: none; /* the round button speaks for itself; the link keeps its "Book inspection" name */
}

.mobile-nav-tab.create .mobile-nav-tab-icon {
  border-radius: var(--radius-full);
  background: linear-gradient(160deg, color-mix(in srgb, var(--color-primary) 82%, #ffffff), var(--color-primary));
  color: var(--color-text-inverse);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 6px 14px color-mix(in srgb, var(--color-primary) 35%, transparent);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.mobile-nav-tab.create .mobile-nav-tab-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.mobile-nav-tab.create:active .mobile-nav-tab-icon {
  transform: scale(0.94);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 3px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

@media (max-width: 767px) {

  /* ── Bottom navigation bar: option A upright ───────────────────────────────
     The capsule floats above the screen's bottom edge (on an iPhone, inside the home-bar strip). The
     wrapper is the bar's whole footprint, which the Settings/Theme save bars and site toasts measure to
     stay clear, but taps go through it to the page; only the capsule takes them. */
  :root {
    --mobile-nav-bar-h: 64px;
    --mobile-nav-float: max(10px, calc(env(safe-area-inset-bottom, 0px) - 8px));
    --mobile-nav-footprint: calc(var(--mobile-nav-bar-h) + var(--mobile-nav-float));
  }

  .mobile-bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-mobile-nav);
    padding: 0 max(10px, env(safe-area-inset-right, 0px)) var(--mobile-nav-float) max(10px, env(safe-area-inset-left, 0px));
    pointer-events: none;
  }

  .mobile-sort-field {
    display: block;
  }

  /* Clear the floating bottom bar so footer links stay reachable (shell pages only): its whole footprint
     plus the same 16px of air the flush bar had. */
  .admin-shell ~ .app-footer {
    padding-bottom: calc(var(--mobile-nav-footprint) + var(--space-md));
  }

  .mobile-customer-settings {
    display: inline-flex;
  }

  .mobile-admin-settings-pills {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-admin-settings-pills::-webkit-scrollbar {
    display: none;
  }

  /* Quick-access shortcuts inherit the shared segmented .pill-tab. Equal-width
     when they fit; scroll only when labels overflow. */
  .mobile-admin-settings-pills a {
    flex: 1 1 0;
    min-width: max-content;
    padding-inline: var(--space-sm);
  }

  .mobile-admin-settings-pills .pill-badge,
  .hub-tab .pill-badge {
    margin-left: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    line-height: 18px;
    text-align: center;
  }

  /* Finance / Settings sub-section strip (mobile-only; desktop uses the sidebar). */
  .hub-tabs {
    display: flex;
    width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    /* Snap a tab's edge to inside the track's padding: snapping it to the track's edge moved the row
       a few pixels on load, which lit the back arrow over the first tab. */
    scroll-padding-inline: var(--seg-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hub-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Each row's gap below moves to its scroll-hint wrapper, so arrows beside the row line up with it. */
  .scroll-hint:has(> .mobile-admin-settings-pills) { margin-bottom: var(--space-sm); }
  .scroll-hint:has(> .hub-tabs) { margin-bottom: var(--space-md); }
  .scroll-hint > :is(.mobile-admin-settings-pills, .hub-tabs) { margin-bottom: 0; }

  /* .hub-tab appearance/active/focus come from the shared global .pill-tab.
     Equal-width when they fit; scroll only when labels overflow. */
  .hub-tab {
    flex: 1 1 0;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .notification-filter-card {
    padding: var(--space-sm);
  }

  .admin-list .notification-filter-card > .client-panel-head {
    margin: calc(var(--space-sm) * -1) calc(var(--space-sm) * -1) var(--space-md);
    padding: var(--space-sm);
  }

  .notification-filter-bar {
    width: 100%;
    align-items: stretch;
  }

  .notification-feed-head .notification-filter-tabs {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .notification-feed-head .notification-filter-tabs .pill-tab {
    min-width: 0;
  }

  .notification-filter-actions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .notification-filter-action {
    width: 100%;
  }

  .notification-filter-action {
    width: 100%;
  }

  .mobile-bottom-nav-inner {
    flex-direction: row;
    align-items: stretch;
    height: var(--mobile-nav-bar-h);
  }

  /* The highlighted tab takes its label's width plus 13px a side, so the highlight's rounded corners stay
     about 9px off "Dashboard" at 12px (owner, 2026-11-26). The other tabs start from their own label's
     width and share the spare room equally, so the gaps between labels stay even on narrow phones. */
  .mobile-nav-tab {
    flex: 1 1 auto;
    gap: var(--space-xs);
    padding: 0 var(--space-2xs);
  }

  .mobile-nav-tab.active:not(.create) {
    flex: 0 0 auto;
    padding-inline: 13px;
  }

  .mobile-nav-tab-icon {
    width: calc(var(--space-lg) + var(--space-xs) + var(--space-2xs));
    height: calc(var(--space-lg) + var(--space-xs) + var(--space-2xs));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-tab-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
  }

  /* Book: a round blue button in the middle of the capsule (its look is in the shared block above). */
  .mobile-nav-tab.create {
    flex: 0 0 64px;
    padding: 0;
  }

  .mobile-nav-tab.create .mobile-nav-tab-icon {
    width: 52px;
    height: 52px;
  }

  /* Category tab open state */
  .mobile-nav-tab.menu-open {
    color: var(--color-primary);
  }

  /* ── Top floating menus (admin category submenus) ──────────────────────── */

  .mobile-top-menu {
    display: block;
    position: fixed;
    top: calc(var(--admin-nav-h, 50px) + 8px);
    left: 12px;
    right: 12px;
    z-index: var(--z-mobile-menu);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 96%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 90%, transparent) 100%
    );
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl), var(--shadow-inner);
    backdrop-filter: blur(26px) saturate(165%);
    -webkit-backdrop-filter: blur(26px) saturate(165%);
    padding: var(--space-sm);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.18s ease, visibility 0s linear 0.22s;
    pointer-events: none;
  }

  .mobile-top-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.18s ease;
    pointer-events: auto;
  }

  .mobile-top-menu-label {
    display: block;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    padding: var(--space-xs) var(--space-xs) var(--space-sm);
  }

  .mobile-top-menu-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
  }

  .mobile-top-menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-component) 64%, transparent);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-body);
    min-height: 52px;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-top-menu-link:hover,
  .mobile-top-menu-link.active {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  }

  .mobile-top-menu-link svg {
    flex-shrink: 0;
    opacity: 0.7;
  }

  .mobile-top-menu-link.active svg {
    opacity: 1;
  }

  /* ── More drawer overlay ───────────────────────────────────────────────── */

  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-mobile-nav-overlay);
    background: color-mix(in srgb, var(--color-text-primary) 40%, transparent);
    animation: mobileOverlayIn 0.2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
  }

  .mobile-drawer-overlay.open {
    display: block;
  }

  /* ── More drawer panel ─────────────────────────────────────────────────── */

  .mobile-more-drawer {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-mobile-nav);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 94%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 84%, transparent) 100%
    );
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid var(--color-border);
    border-bottom: none;
    box-shadow: var(--shadow-xl), var(--shadow-inner);
    backdrop-filter: blur(26px) saturate(165%);
    -webkit-backdrop-filter: blur(26px) saturate(165%);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    padding: var(--space-xs) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom));
    visibility: hidden;
  }

  .mobile-more-drawer.open {
    transform: translateY(0);
    visibility: visible;
  }

  .mobile-more-drawer-handle {
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    margin: var(--space-sm) auto var(--space-lg);
  }

  .mobile-more-drawer-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    color: var(--color-text-primary);
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
  }

  .mobile-more-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .mobile-more-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-component) 72%, transparent);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-body);
    min-height: 64px;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
  }

  .mobile-more-link:hover,
  .mobile-more-link.active {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  }

  .mobile-more-link svg {
    flex-shrink: 0;
    opacity: 0.7;
  }

  .mobile-more-link.active svg {
    opacity: 1;
  }

  /* ── Context tabs ──────────────────────────────────────────────────────── */

  .mobile-context-tabs {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: auto;
    max-width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-context-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Appearance comes from the shared segmented .pill-tab; equal-width when they
     fit, scroll only when labels overflow. */
  .mobile-context-tab {
    min-width: max-content;
  }

  .record-list-page > .mobile-context-tabs .mobile-context-tab {
    min-width: max-content;
    max-width: none;
  }

  /* ── Mobile filter toggle ──────────────────────────────────────────────── */

  html.js .mobile-filter-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    background: color-mix(in srgb, var(--color-component) 64%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    line-height: 1;
    /* Same height as every other control living in a panel header — reuse
       the segmented item's formula directly rather than a standalone offset
       from --btn-height, so the two can never drift apart. */
    min-height: var(--seg-item-min-h);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
  }

  .mobile-filter-toggle:hover {
    background: color-mix(in srgb, var(--color-component) 82%, transparent);
    color: var(--color-text-primary);
  }

  .mobile-filter-toggle-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-toggle-icon {
    transform: rotate(180deg);
  }

  .mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-sheet-backdrop);
    border: 0;
    padding: 0;
    background: color-mix(in srgb, var(--color-text-primary) 28%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
  }

  .mobile-filter-backdrop.mobile-visible {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.18s ease;
  }

  body.mobile-filter-open {
    overflow: hidden;
  }

  .record-list-page .record-filter-toggle {
    min-height: 46px;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-md);
    border-radius: var(--radius-button);
    color: var(--color-text-primary);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 88%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 72%, transparent) 100%
    );
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
  }

  .record-list-page .record-filter-toggle:hover,
  .record-list-page .record-filter-toggle[aria-expanded="true"] {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-component) 84%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 20%, var(--color-border) 80%);
  }

  /* Shared mobile filter sheet for record index pages.
     Scoped to html.js so that without JS the filter form simply renders inline
     (and the toggle button — also html.js-scoped — stays hidden), keeping
     filtering usable when scripts fail to load. */
  html.js .record-list-page .record-filter-card {
    display: none;
  }

  html.js .record-list-page .record-filter-card.mobile-visible {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-sheet);
    max-height: min(72vh, 620px);
    max-height: min(72dvh, 620px);
    overflow-y: auto;
    margin: 0;
    padding: var(--space-lg) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid color-mix(in srgb, var(--color-border) 84%, white 16%);
    border-bottom: 0;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 96%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 88%, transparent) 100%
    );
    box-shadow: 0 -20px 60px color-mix(in srgb, var(--color-text-primary) 14%, transparent), var(--shadow-inner);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
  }

  .record-list-page .record-filter-card.mobile-visible::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-full);
    background: var(--color-border);
  }

  .record-list-page .mobile-filter-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-component) 82%, transparent);
    color: var(--color-text-secondary);
    font-family: var(--font-family-body);
    font-size: calc(var(--font-size-lg) + var(--space-xs));
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .record-list-page .mobile-filter-close:hover {
    color: var(--color-text-primary);
    border-color: color-mix(in srgb, var(--color-primary) 22%, var(--color-border) 78%);
  }

  .record-list-page .record-filter-card.mobile-visible .mobile-filter-close {
    display: inline-flex;
  }

  .record-list-page .record-filter-card .filter-actions {
    position: sticky;
    bottom: calc(var(--space-xl) * -1);
    margin: var(--space-md) calc(var(--space-lg) * -1) calc(var(--space-xl) * -1);
    padding: var(--space-md) var(--space-lg) calc(var(--space-md) + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    border-top: 1px solid var(--color-border-light);
  }

  .record-list-page .record-filter-card .filter-actions .list-btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .record-list-page .record-load-more {
    margin: 0 var(--space-md) var(--space-md);
    border-top: 0;
    padding: 0;
  }

  .record-list-page .record-load-more-btn {
    width: 100%;
    min-height: 46px;
    border-radius: var(--radius-button);
  }

  /* ── Dashboard mobile fixes ─────────────────────────────────────────────── */
  .imjdm-dash-theme .main-grid {
    gap: var(--space-md);
  }

  .client-dashboard-grid {
    gap: var(--space-md);
  }

  .imjdm-dash-theme .panel {
    border-radius: var(--radius-md);
  }

  .imjdm-dash-theme .panel-spaced {
    margin-bottom: var(--space-md);
  }

  .imjdm-dash-theme .dashboard-pipeline-panel,
  .imjdm-dash-theme .dashboard-finance-panel {
    margin-bottom: var(--space-md);
  }

  .imjdm-dash-theme .panel-head {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-xs);
  }

  /* Pipeline + finance headers track the standard panel-head at mobile sizes. */
  .imjdm-dash-theme .imjdm-pipeline { --pad-x: var(--space-md); --pad-y: var(--space-md); border-radius: var(--radius-md); padding-bottom: var(--space-md); }
  .imjdm-dash-theme .imjdm-head { padding: var(--space-sm) var(--pad-x); }
  .imjdm-dash-theme .financial-activity-header { padding: var(--space-sm) var(--space-md); }
  .imjdm-dash-theme .panel-head,
  .imjdm-dash-theme .imjdm-head,
  .imjdm-dash-theme .financial-activity-header {
    min-height: 44px;
    padding-top: var(--space-xs);
    padding-bottom: var(--space-xs);
  }

  /* The mobile shrink that used to sit here is gone — see the note on
     .imjdm-dash-theme .panel-title above. */

  .imjdm-dash-theme .panel-sub {
    margin-left: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Pipeline mobile layout now lives with the .imjdm-pipeline component
     (vertical timeline @ max-width: 720px). */
  /* Financial Activity: stack KPI above chart, hide the period note, keep short. */
  .imjdm-dash-theme .financial-activity-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }
  .imjdm-dash-theme .financial-title-row {
    flex: 1 1 auto;
  }
  .imjdm-dash-theme .financial-title-row .panel-title {
    white-space: nowrap;
  }
  /* The compact three-option control stays beside its title at normal phone
     widths instead of dropping merely because the viewport is below 768px. */
  .imjdm-dash-theme .financial-period-toggle {
    width: auto;
    margin-left: auto;
  }
  .imjdm-dash-theme .financial-period-btn {
    min-width: 44px;
    font-size: var(--font-size-sm);
  }
  .imjdm-dash-theme .financial-activity-body {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: 0 var(--space-md) var(--space-md);
  }
  .imjdm-dash-theme .kpi-value {
    font-size: clamp(var(--font-size-2xl), 9vw, var(--font-size-3xl));
  }
  .imjdm-dash-theme .finance-stat-grid {
    gap: var(--space-xs);
    margin-top: var(--space-sm);
  }
  .imjdm-dash-theme .finance-stat-card {
    padding: var(--space-xs) var(--space-sm);
  }
  .imjdm-dash-theme .financial-chart-legend {
    justify-content: flex-start;
    gap: var(--space-sm);
  }
  .imjdm-dash-theme .financial-area-chart__plot {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--space-xs);
  }
  .imjdm-dash-theme .financial-y-axis,
  .imjdm-dash-theme .financial-plot-surface {
    height: 102px;
  }
  .imjdm-dash-theme .financial-area-chart__svg {
    height: 102px;
  }
  .imjdm-dash-theme .financial-chart-labels {
    margin-left: calc(36px + var(--space-xs));
  }

  /* Dashboard topbar-actions: wrap and fill */
  .imjdm-dash-theme .topbar-actions {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }
  .imjdm-dash-theme .topbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }

  .imjdm-dash-theme .queue-head-link {
    max-width: 52%;
    overflow: hidden;
  }

  .imjdm-dash-theme .queue-head-link span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Recent Requests: horizontal scroll menu of mini-cards */
  .imjdm-dash-theme .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .imjdm-dash-theme .tbl-wrap::-webkit-scrollbar { display: none; }
  .imjdm-dash-theme .tbl { display: block; min-width: 0; }
  .imjdm-dash-theme .tbl thead { display: none; }
  .imjdm-dash-theme .tbl tbody {
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-xs);
  }
  .imjdm-dash-theme .tbl tbody tr {
    display: flex;
    flex-direction: column;
    min-width: min(72vw, 230px);
    max-width: min(72vw, 230px);
    flex-shrink: 0;
    gap: var(--space-2xs);
    background: var(--surface);
    border: 1px solid var(--rule2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: background 0.1s;
  }
  .imjdm-dash-theme .tbl tbody tr:hover { background: var(--surface); }
  .imjdm-dash-theme .tbl tbody tr:hover td { background: transparent; }
  .imjdm-dash-theme .tbl tbody td { padding: 0; border-bottom: none; }
  /* #ID */
  .imjdm-dash-theme .tbl tbody td:nth-child(1) { order: 1; }
  /* Customer */
  .imjdm-dash-theme .tbl tbody td:nth-child(2) {
    order: 2; font-size: var(--font-size-sm); color: var(--ink2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  }
  /* Vehicle */
  .imjdm-dash-theme .tbl tbody td:nth-child(3) {
    order: 3; font-size: var(--font-size-xs); color: var(--ink3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  }
  /* Auction/Lot — hidden */
  .imjdm-dash-theme .tbl tbody td:nth-child(4) { display: none; }
  /* Status pill */
  .imjdm-dash-theme .tbl tbody td:nth-child(5) { order: 4; }
  /* Actions — push to bottom of card */
  .imjdm-dash-theme .tbl tbody td:nth-child(6) { order: 5; margin-top: auto; padding-top: var(--space-xs); }
  .imjdm-dash-theme .tbl-acts { justify-content: flex-start; }
  .imjdm-dash-theme .tbl-acts .btn { min-height: 34px; font-size: var(--font-size-xs); padding: var(--space-xs) var(--space-sm); }

  /* ── Admin list tables → card layout ────────────────────────────────────── */

}

/* Phone landscape: keep the mobile shell, but move primary nav to a left rail
   so scarce vertical space is not consumed by a bottom bar. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 960px) and (pointer: coarse) {
  :root {
    --mobile-landscape-rail-w: 92px; /* 8px gap + the 84px glass rail (option A, 2026-11-26) */
  }

  .admin-shell ~ .app-footer {
    padding-bottom: var(--space-md);
    padding-right: calc(var(--mobile-landscape-rail-w) + env(safe-area-inset-right));
  }

  .admin-shell-nav {
    gap: 6px;
    min-width: 0;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .admin-shell-side {
    display: none;
  }

  .admin-shell .app-topbar-brand {
    flex: 0 1 auto;
    min-width: 0;
    margin-right: var(--space-sm);
  }

  .admin-shell-nav-right {
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    padding-right: 3px;
  }

  .admin-shell-notif,
  .app-account-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .admin-shell-count-badge {
    right: -4px;
  }

  .admin-shell-main-wrap {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: var(--space-sm);
    padding-right: calc(var(--mobile-landscape-rail-w) + var(--space-sm) + env(safe-area-inset-right));
    padding-bottom: var(--space-sm);
    padding-left: calc(var(--space-sm) + env(safe-area-inset-left));
  }

  .admin-shell-content {
    padding: var(--space-sm) var(--space-md) var(--space-lg);
    border-radius: var(--radius-xl);
  }

  .mobile-admin-settings-pills {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-admin-settings-pills::-webkit-scrollbar {
    display: none;
  }

  .mobile-admin-settings-pills a {
    flex: 1 1 0;
    min-width: max-content;
    padding-inline: var(--space-sm);
  }

  .mobile-admin-settings-pills .pill-badge,
  .hub-tab .pill-badge {
    margin-left: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    line-height: 18px;
    text-align: center;
  }

  .hub-tabs {
    display: flex;
    width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    /* Snap a tab's edge to inside the track's padding: snapping it to the track's edge moved the row
       a few pixels on load, which lit the back arrow over the first tab. */
    scroll-padding-inline: var(--seg-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hub-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Each row's gap below moves to its scroll-hint wrapper, so arrows beside the row line up with it. */
  .scroll-hint:has(> .mobile-admin-settings-pills) { margin-bottom: var(--space-sm); }
  .scroll-hint:has(> .hub-tabs) { margin-bottom: var(--space-md); }
  .scroll-hint > :is(.mobile-admin-settings-pills, .hub-tabs) { margin-bottom: 0; }

  .hub-tab {
    flex: 1 1 0;
    min-width: max-content;
    scroll-snap-align: start;
  }

  /* Option A sideways (owner, 2026-11-26): the same glass capsule standing up, floating 8px off the RIGHT
     edge, under the right thumb when the phone is held sideways (owner moved it from the left, 2026-11-26).
     --mobile-landscape-rail-w is its whole footprint (gap + 84px capsule), which every page keeps clear of. The rail is 84px so the highlight keeps about 9px off "Dashboard" at 10px, even on the shortest phones. */
  .mobile-bottom-nav {
    display: block;
    position: fixed;
    top: calc(var(--admin-nav-h, 50px) + var(--space-lg));
    bottom: var(--space-sm);
    left: auto;
    right: env(safe-area-inset-right);
    width: var(--mobile-landscape-rail-w);
    padding: 0 var(--space-sm) 0 0;
    z-index: var(--z-mobile-nav);
    pointer-events: none;
  }

  .mobile-bottom-nav-inner {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 0;
  }

  .mobile-bottom-nav-inner::before {
    inset: 18px auto 18px 1px;
    width: 45%;
    height: auto;
    border-radius: calc(var(--radius-xl) + 2px) 60% 60% calc(var(--radius-xl) + 2px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  }

  .mobile-nav-tab,
  .mobile-nav-tab.active:not(.create) {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 4px 3px;
    gap: 3px;
  }

  .mobile-nav-tab-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-tab-label {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-nav-tab.create {
    flex: 1 1 0;
    padding: 0;
  }

  .mobile-nav-tab.create .mobile-nav-tab-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .mobile-sort-field {
    display: block;
  }

  .mobile-context-tabs {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: auto;
    max-width: 100%;
    gap: var(--seg-gap);
    padding: var(--seg-pad);
    border: 1px solid var(--seg-track-border);
    border-radius: var(--seg-radius);
    background: var(--seg-track-bg);
    margin: 0 0 var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-context-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Appearance comes from the shared segmented .pill-tab. */
  .mobile-context-tab {
    min-width: max-content;
  }

  .record-list-page > .mobile-context-tabs .mobile-context-tab {
    min-width: max-content;
    max-width: none;
  }

  html.js .mobile-filter-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    background: color-mix(in srgb, var(--color-component) 64%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    line-height: 1;
    /* Same height as every other control living in a panel header — reuse
       the segmented item's formula directly rather than a standalone offset
       from --btn-height, so the two can never drift apart. */
    min-height: var(--seg-item-min-h);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
  }

  .mobile-filter-toggle:hover {
    background: color-mix(in srgb, var(--color-component) 82%, transparent);
    color: var(--color-text-primary);
  }

  .mobile-filter-toggle-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-toggle-icon {
    transform: rotate(180deg);
  }

  .mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-sheet-backdrop);
    border: 0;
    padding: 0;
    background: color-mix(in srgb, var(--color-text-primary) 28%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
  }

  .mobile-filter-backdrop.mobile-visible {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.18s ease;
  }

  body.mobile-filter-open {
    overflow: hidden;
  }

  .record-list-page .record-filter-toggle {
    min-height: 46px;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-md);
    border-radius: var(--radius-button);
    color: var(--color-text-primary);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 88%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 72%, transparent) 100%
    );
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
  }

  .record-list-page .record-filter-toggle:hover,
  .record-list-page .record-filter-toggle[aria-expanded="true"] {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-component) 84%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 20%, var(--color-border) 80%);
  }

  html.js .record-list-page .record-filter-card {
    display: none;
  }

  html.js .record-list-page .record-filter-card.mobile-visible {
    display: block;
    position: fixed;
    left: env(safe-area-inset-left);
    right: calc(var(--mobile-landscape-rail-w) + env(safe-area-inset-right));
    bottom: 0;
    z-index: var(--z-sheet);
    max-height: min(78vh, 620px);
    max-height: min(78dvh, 620px);
    overflow-y: auto;
    margin: 0;
    padding: var(--space-lg) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid color-mix(in srgb, var(--color-border) 84%, white 16%);
    border-bottom: 0;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 96%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 88%, transparent) 100%
    );
    box-shadow: 0 -20px 60px color-mix(in srgb, var(--color-text-primary) 14%, transparent), var(--shadow-inner);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
  }

  .record-list-page .record-filter-card.mobile-visible::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-full);
    background: var(--color-border);
  }

  .record-list-page .mobile-filter-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-component) 82%, transparent);
    color: var(--color-text-secondary);
    font-family: var(--font-family-body);
    font-size: calc(var(--font-size-lg) + var(--space-xs));
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .record-list-page .record-filter-card.mobile-visible .mobile-filter-close {
    display: inline-flex;
  }

  .record-list-page .record-filter-card .filter-actions {
    position: sticky;
    bottom: calc(var(--space-xl) * -1);
    margin: var(--space-md) calc(var(--space-lg) * -1) calc(var(--space-xl) * -1);
    padding: var(--space-md) var(--space-lg) calc(var(--space-md) + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    border-top: 1px solid var(--color-border-light);
  }

  .record-list-page .record-filter-card .filter-actions .list-btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .record-list-page .record-load-more {
    margin: 0 var(--space-md) var(--space-md);
    border-top: 0;
    padding: 0;
  }

  .record-list-page .record-load-more-btn {
    width: 100%;
    min-height: 46px;
    border-radius: var(--radius-button);
  }
}

/* ── Record list filter form — desktop fixes ──────────────────────────────── */

/* X button injected by JS has no display:none outside the 767px block — hide it globally */
.record-list-page .mobile-filter-close {
  display: none;
}

/* Bootstrap lg columns (col-lg-2, col-lg-3) fire at 992px viewport, but the sidebar
   reduces actual content width to ~670px — override to wider columns in squeeze zone */
@media (min-width: 992px) and (max-width: 1280px) {
  .record-list-page .record-filter-card form .col-lg-2 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
  .record-list-page .record-filter-card form .col-lg-3 {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* col-md-4 at the narrowest desktop range (sidebar present, content ~450px) */
@media (min-width: 768px) and (max-width: 899px) {
  .record-list-page .record-filter-card form .col-md-4 {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* Tier create/edit forms — col-md-1/2/3 squeeze at 768-992px due to sidebar */
@media (min-width: 768px) and (max-width: 991.98px) {
  .admin-list .card .row > .col-md-1,
  .admin-list .card .row > .col-md-2,
  .admin-list .card .row > .col-md-3 {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* The filter card's own "FILTER …" header stays hidden at every size (base rule):
   the results header directly above already titles the area, and the mobile sheet
   is identified by its drag pill + close button. Two former re-show rules lived
   here — the (max-width: 899px) landscape one had no pointer/height guard, so the
   header leaked inline into ordinary narrow desktop windows. */
@media (max-width: 767.98px) {
  .record-search-group,
  .record-search-group.record-search-group-with-export {
    grid-template-columns: 1fr;
  }

  .record-list-page .record-search-submit,
  .record-list-page .record-search-export {
    width: 100%;
  }
}

/* ── Collapsible filters on desktop too ──────────────────────────────────────
 * Same toggle button, same .mobile-visible target class, same html.js graceful-
 * degradation guard as the mobile sheet above (JS off ⇒ filters stay inline and
 * usable) — just an inline collapse instead of a fixed sheet: no backdrop, no
 * body-scroll-lock, no injected close button (all three already stay hidden
 * outside the ≤767px block, see the "desktop fixes" section above). Collapsed
 * by default; active-filter-chips already shows whatever's currently applied
 * even while the form itself is closed. */
@media (min-width: 768px) {
  html.js .record-list-page .record-filter-card {
    display: none;
  }

  html.js .record-list-page .record-filter-card.mobile-visible {
    display: block;
  }

  html.js .record-list-page .mobile-filter-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    /* Same height as every other control living in a panel header (matches
       the mobile rule above) — reuse the segmented item's formula directly
       rather than a standalone offset from --btn-height. */
    min-height: var(--seg-item-min-h);
    line-height: 1;
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 88%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 72%, transparent) 100%
    );
    box-shadow: var(--shadow-sm);
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  }

  html.js .record-list-page .mobile-filter-toggle:hover,
  html.js .record-list-page .mobile-filter-toggle[aria-expanded="true"] {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-component) 84%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 20%, var(--color-border) 80%);
  }

  .record-list-page .mobile-filter-toggle-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .record-list-page .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-toggle-icon {
    transform: rotate(180deg);
  }
}

/* Shared checkout/order summary panel */
.order-summary {
  padding: var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 78%, var(--color-component-strong));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  display: grid;
  gap: 10px;
}

.order-summary__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
}

.order-summary__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 18px;
  align-items: baseline;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding: 2px 0;
}

.order-summary__row span:first-child {
  min-width: 0;
}

.order-summary__row span:last-child {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.order-summary__row--discount,
.order-summary__row--discount span:last-child {
  color: var(--color-success);
}

.order-summary__row--grand {
  /* Stack label above amount — clear hierarchy, no competing sizes */
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: none;
  border: none;
  border-top: 2px solid var(--color-text-primary);
  border-radius: 0;
  color: var(--color-text-primary);
  font-size: inherit;
  font-weight: inherit;
  padding: var(--space-sm) 0 0;
  margin-top: var(--space-xs);
}

.order-summary__row--grand span:first-child {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  opacity: 1;
  align-self: auto;
}

.order-summary__row--grand span:last-child {
  color: var(--color-text-primary);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── color-mix() fallback (companion to the block in design-tokens.css) ──────
   These two surfaces declare color-mix fills in THIS file, so their opaque
   fallbacks must also live here to win the cascade on non-supporting browsers
   (Safari <16.2, Chrome <111): otherwise the invalid declarations compute to
   transparent and the sticky topbar/page shell lose their surfaces. */
@supports not (background: color-mix(in srgb, red, blue)) {
  .app-glass-topbar {
    background: var(--topbar-bg);
    border-color: var(--topbar-border);
  }

  .admin-shell {
    background: var(--color-bg);
  }
}

/* Sheet content clearance: with the filter-card header hidden everywhere, the
   floating × close (38px at top-right) needs headroom so it can't overlap the
   first form row — widen the drag pill's bottom margin to clear it. */
.record-list-page .record-filter-card.mobile-visible::before {
  margin-bottom: calc(var(--space-lg) + 22px);
}

/* ── Empty states ─────────────────────────────────────────────────────────────
   The page-level "you have nothing here yet", used where the filters and table
   are hidden entirely rather than left standing over an empty result set.
   Mirrors the app's EmptyStateView: icon, title, message, one action. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  width: 44px;
  height: 44px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-2xs);
}

.empty-state__icon svg { width: 100%; height: 100%; display: block; }

/* Owner's Mount Fuji picture on the pages a new customer lands on (Dashboard, Requests, Reports), in place of
   the icon. Fixed colours: it matches the logo's red and blue rather than following the theme. */
.empty-state__art {
  width: min(320px, 78%);
  height: auto;
  margin-bottom: var(--space-sm);
}

.empty-state__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  text-wrap: balance;
}

.empty-state__message {
  /* Held near 50ch so the sentence wraps into two comfortable lines rather than
     one long measure on a wide dashboard. */
  max-width: 50ch;
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* N4 (owner, 2026-11-05): one primary button on every empty page. It used Bootstrap's own
   .btn-primary outside the dashboard theme (bright #0d6efd, square, 34px on a phone), so four pages
   showed a different blue from the rest of the app. */
.empty-state__action.btn {
  margin-top: var(--space-md);
  min-height: var(--btn-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-lg);
  border: none;
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.empty-state__action.btn:hover,
.empty-state__action.btn:focus-visible {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
}

.empty-state__secondary {
  margin-top: var(--space-2xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.empty-state__secondary:hover { color: var(--color-text-primary); }

.empty-state__link-icon { display: inline-flex; flex: none; width: 22px; height: 22px; }
.empty-state__link-icon svg { width: 100%; height: 100%; display: block; }

/* A new customer's welcome on the Dashboard (owner, 2026-11-07, from their mockup): large title and tagline, a larger button with an icon, and the sample report as the secondary link. */
.empty-state--welcome { gap: var(--space-sm); padding-top: var(--space-xl); }

.empty-state--welcome .empty-state__title {
  font-family: var(--font-family-body);
  font-size: clamp(var(--font-size-xl), 1.1rem + 1.8vw, 40px);
  font-weight: var(--font-weight-bold);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.empty-state__tagline {
  font-size: clamp(var(--font-size-lg), 0.95rem + 0.8vw, var(--font-size-xl));
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  text-wrap: balance;
  margin-bottom: var(--space-xs);
}

.empty-state--welcome .empty-state__message {
  max-width: 46ch;
  font-size: var(--font-size-md);
}

.empty-state--welcome .empty-state__action.btn {
  gap: 10px;
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--font-size-md);
}

.empty-state--welcome .empty-state__secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-xs);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

.empty-state--welcome .empty-state__secondary > span:last-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state--welcome .empty-state__secondary:hover { color: var(--color-primary-dark); }

/* N5 (owner, 2026-11-05): the next three auction days under a new customer's welcome, each opening the
   booking form on that date. Same three-up day cards as the booking form's date strip. */
.dash-next-days {
  width: 100%;
  max-width: 520px;
  margin: calc(-1 * var(--space-xl)) auto var(--space-2xl);
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
}

.dash-next-days .dash-next-days__title {
  margin: 0;
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  /* Hairlines either side of the heading (owner's mockup, 2026-11-07). */
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dash-next-days .dash-next-days__title::before,
.dash-next-days .dash-next-days__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.dash-next-days__row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}

.dash-next-day {
  min-height: var(--btn-height);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.dash-next-day:hover,
.dash-next-day:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-primary);
}

.dash-next-day__dow {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.dash-next-day__date { font-size: var(--font-size-lg); line-height: 1.2; }

.dash-next-day__count { font-size: var(--font-size-xs); color: var(--color-text-secondary); }

.dash-next-day__book {
  margin-top: var(--space-2xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.dash-next-day__arrow { display: inline-block; transition: transform 0.15s ease; }
.dash-next-day:hover .dash-next-day__arrow,
.dash-next-day:focus-visible .dash-next-day__arrow { transform: translateX(3px); }

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

/* Closed or not open yet: keeps its place, but reads as unavailable (docs/BOOKING-DAYS.md). */
.dash-next-day--unavailable,
.dash-next-day--unavailable:hover {
  border-style: dashed;
  border-color: var(--color-border);
  background: var(--color-surface-light);
  box-shadow: none;
  color: var(--color-text-secondary);
  cursor: default;
}

@media (max-width: 640px) {
  .dash-next-days { margin-top: calc(-1 * var(--space-md)); }
  .empty-state { padding: var(--space-2xl) var(--space-md); }
  /* Full-width tap target on a phone: a centred pill is the one thing on screen
     worth touching, and thumb reach beats visual balance here. */
  .empty-state__action.btn { width: 100%; max-width: 320px; justify-content: center; text-align: center; }
}

/* ── sr-only ────────────────────────────────────────────────────────────────
   Defined on the two landing pages in their own inline styles, and nowhere
   else — Bootstrap 5 renamed its version to .visually-hidden, so every other
   use of this class was an unstyled block element.

   That is how the financial activity toggle came to wander. Its header is a
   flex row with justify-content: space-between, and the live region beside the
   toggle was a real flex item rather than a hidden one — so the space was
   shared between three children and the toggle parked in the middle, at a
   position that moved with the title's width and the panel's. Below 768px the
   title grows to fill, which pushed the toggle right and hid the problem.

   Hidden properly it leaves the flex flow, the row has the two children it
   looks like it has, and the toggle sits at the end. The status text also
   stops being able to appear on screen when it is announced.
   ────────────────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Filter & Sort in a panel header: the same ghost treatment as the dashboard's
   header controls ("View all"), derived from --color-panel-header-text so it
   reads on any header colour set in Website Settings → Theme. Covers every size
   at once — the phone, short-landscape and desktop rules above each paint the
   standalone light pill; this sits last and matches their specificity, so it
   wins wherever the button is inside .client-panel-head (all 12 list pages). */
html.js .client-panel-head .mobile-filter-toggle {
  color: var(--color-panel-header-text);
  background: transparent;
  border-color: color-mix(in srgb, var(--color-panel-header-text) 36%, transparent);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.js .client-panel-head .mobile-filter-toggle:hover,
html.js .client-panel-head .mobile-filter-toggle[aria-expanded="true"] {
  color: var(--color-panel-header-text);
  background: color-mix(in srgb, var(--color-panel-header-text) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-panel-header-text) 50%, transparent);
}

/* ═════════════════════════════════════════════════════════════════════════════
   New-customer audit fixes (owner, 2026-11-05; N12, N14, N16, N17, N19).
   Kept together at the end so each one reads against the rule it overrides.
   ═════════════════════════════════════════════════════════════════════════════ */

/* N14: the page panel always reaches the same bottom edge as the sidebar, however little it holds. The
   wrap already fills the screen; the panel was aligned to its own content, so short pages (Dashboard,
   Account, Change Password) stopped half way with bare page below. */
.admin-shell-content {
  align-self: stretch;
}

/* Rounded bottoms (owner, 2026-11-05): every height here was worked out from --admin-nav-h (50px), but the
   floating top bar really takes 68px with its padding, so the sidebar ended 2px and list pages ~40px below the
   screen and their rounded bottom corners were never in view; the panels read as square-bottomed. One measured
   number now drives all three, so the sidebar and the page panel end on the same line, 34px above the screen
   bottom (the wrap's own bottom padding), corners showing. */
:root {
  --shell-chrome-h: calc(var(--admin-nav-h) + 18px);
  /* What the one-line signed-in footer adds below the frame (its 60px less the frame's -2rem margin). */
  --shell-footer-h: 38px;
  --admin-content-offset: calc(var(--shell-chrome-h) + 20px + var(--space-3xl) + 36px + var(--shell-footer-h));
}

/* The frame no longer forces a full screen of its own: the wrap below already fills the screen less the
   footer line, so a short page shows top bar, panels and footer without scrolling. */
.admin-shell {
  min-height: 0;
}

.admin-shell-main-wrap {
  min-height: calc(100dvh - var(--shell-chrome-h) - var(--shell-footer-h));
}

.admin-shell-side {
  height: calc(100dvh - var(--shell-chrome-h) - var(--space-lg) - 34px - var(--shell-footer-h));
}

/* N14: an empty list keeps its panel's natural height instead of stretching an empty box down the page
   inside the panel (Notifications); the outer panel already carries the page's height. */
.record-list-page .record-incremental:has(> .empty-state) {
  flex: 0 0 auto;
  min-height: 0;
}

/* N17: the flip-clock fold is a hairline behind the digits, not a line through them, and the tiles stand as
   tall as the page title beside them. */
.jst-clock__unit::after {
  border-top-color: color-mix(in srgb, var(--color-panel-header-text) 14%, transparent);
}

.dashboard-page-head .jst-clock__unit {
  height: calc(var(--font-size-3xl) * var(--line-height-tight));
  padding-block: 0;
}

/* N19: the signed-in footer is one quiet line: legal links and copyright. */
.app-footer--compact {
  margin-top: 0;
  padding: var(--space-sm) var(--space-lg);
  border-top: 0;
}

.app-footer-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.app-footer-compact a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary);
  text-decoration: none;
}

.app-footer-compact a:hover,
.app-footer-compact a:focus-visible {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/* N16: bottom-bar labels at 12px on an upright phone only; held sideways the bar is a 64px rail and
   "Dashboard" at 12px broke onto two lines. */
@media (max-width: 767px) and (orientation: portrait) {
  .mobile-nav-tab-label {
    font-size: var(--font-size-sm);
  }
}

/* Phones under 360px wide: a tighter capsule and 11px labels, so five tabs still sit side by side with the
   highlight clear of its label. */
@media (max-width: 359px) and (orientation: portrait) {
  .mobile-bottom-nav {
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
  }

  .mobile-bottom-nav .mobile-nav-tab-label {
    font-size: 11px;
  }

  .mobile-nav-tab.active:not(.create) {
    padding-inline: 10px;
  }

  .mobile-nav-tab.create {
    flex-basis: 56px;
  }
}

@media (max-width: 767px) {
  /* N14: on a phone the panel ends just above the compact footer, which in turn clears the bottom bar,
     so the panel's foot is never hidden behind the bar. */
  /* The frame itself was at least one screen tall with the footer after it, so every short page scrolled
     ~110px into a blank band. Here the frame is only as tall as its parts, and the wrap is sized so that top
     bar + panel + the one-line footer + the bottom bar's clearance fit one screen exactly. */
  .admin-shell {
    min-height: 0;
  }

  .admin-shell-main-wrap {
    min-height: calc(100dvh - var(--shell-chrome-h) - 4px - 44px - var(--space-sm) * 2 - var(--space-6xl) - var(--space-md) - env(safe-area-inset-bottom));
  }

  /* Rounded bottoms: list pages carried a full-screen minimum height of their own, which on a phone pushed the
     panel's foot ~100px behind the bottom bar; the wrap above already sizes the panel. */
  .record-list-page {
    min-height: 0;
  }

  /* N12: room between the shortcut bar and the page title. */
  .mobile-admin-settings-pills {
    margin-bottom: var(--space-md);
  }

  /* N12: the Dashboard keeps its one-line subtitle like every other page. */
  .imjdm-dash-theme.client-dashboard .page-sub {
    display: block;
  }

  .dashboard-page-head .jst-clock__unit {
    height: calc(clamp(var(--font-size-xl), 6vw, var(--font-size-2xl)) * var(--line-height-tight));
  }

  /* N16: readable labels and comfortable tap targets on a phone (12px text, 44px targets). */
  .admin-list .field-label,
  .field-label {
    font-size: var(--font-size-sm);
  }

  .jst-clock__location {
    font-size: var(--font-size-sm);
  }

  .mobile-admin-settings-pills a {
    min-height: 44px;
  }

  .dash-next-days .dash-next-days__title,
  .dash-next-day__dow,
  .dash-next-day__count {
    font-size: 12px;
  }
}

/* N15: one hint-text grey in every app form (Account Settings used the browser's own). */
.admin-list .field-input::placeholder,
.admin-list textarea::placeholder {
  color: var(--color-text-tertiary);
  opacity: 1;
}

/* N18 (owner, 2026-11-05): one message style for success, error, warning and info, in the app and on the
   sign-in pages. A plain card in the page's own surface with the meaning carried by a coloured edge and a
   small round mark, instead of a tinted box with tinted text (the stock Bootstrap look). Applies wherever
   the markup already says .alert-* or body .auth-alert*, so no page changes. */
.admin-shell-content .alert,
.admin-list .alert,
body .auth-alert,
.auth-page .alert {
  --msg-accent: var(--color-info);
  position: relative;
  padding: var(--space-sm) var(--space-md) var(--space-sm) calc(var(--space-md) + 28px);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--msg-accent);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed, 1.5);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.admin-shell-content .alert::before,
.admin-list .alert::before,
body .auth-alert::before,
.auth-page .alert::before {
  content: "i";
  position: absolute;
  left: var(--space-md);
  top: calc(var(--space-sm) + 1px);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--msg-accent);
  color: var(--color-text-inverse);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.admin-shell-content .alert-success,
.admin-list .alert-success,
body .auth-alert-success,
.auth-page .alert-success { --msg-accent: var(--color-success); }

.admin-shell-content .alert-success::before,
.admin-list .alert-success::before,
body .auth-alert-success::before,
.auth-page .alert-success::before { content: "✓"; }

.admin-shell-content .alert-danger,
.admin-list .alert-danger,
body .auth-alert:not(body .auth-alert-success),
.auth-page .alert-danger { --msg-accent: var(--color-error); }

.admin-shell-content .alert-danger::before,
.admin-list .alert-danger::before,
body .auth-alert:not(body .auth-alert-success)::before,
.auth-page .alert-danger::before,
.admin-shell-content .alert-warning::before,
.admin-list .alert-warning::before { content: "!"; }

.admin-shell-content .alert-warning,
.admin-list .alert-warning { --msg-accent: var(--color-warning); }

.admin-shell-content .alert-info,
.admin-list .alert-info { --msg-accent: var(--color-info); }

/* A validation summary with nothing to say renders as an empty element; never show it as an empty card. */
.alert.validation-summary-valid { display: none; }

.admin-shell-content .alert > ul,
.admin-list .alert > ul { margin: 0; padding-left: var(--space-md); }

/* Sideways phone (owner, 2026-11-05): the left rail was placed from --admin-nav-h (50px), but the top bar really
   ends at 63px, and on phones under 768px wide (which keep the upright top bar) at 73px, so there the rail's top
   ~7px, with the "Dashboard" item, sat behind the top bar. The rail now starts level with the page panel. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 960px) and (pointer: coarse) {
  .mobile-bottom-nav {
    top: calc(var(--admin-nav-h, 50px) + 21px);
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 767px) and (pointer: coarse) {
  .mobile-bottom-nav {
    top: calc(var(--admin-nav-h, 50px) + 31px);
  }
}

/* Bootstrap 5.1 hard-codes its own colours (blue links, grey muted text, pink code, near-black fields). Anything
   that falls through to them follows the theme tokens instead (owner, 2026-11-06). Same specificity as Bootstrap's
   rules and loaded after it, so every element with its own colour rule keeps it. */
a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }
.text-muted { color: var(--color-text-secondary) !important; }
.form-text { color: var(--color-text-secondary); }
.form-control, .form-select { color: var(--color-text-primary); }
code { color: var(--color-text-primary); }

/* Password rules under a new-password box (Pages/Shared/_PasswordRules.cshtml), ticked as the customer types. */
.password-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: var(--space-xs) var(--space-md);
  margin: var(--space-sm) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

/* An empty ring until the rule is met, then a filled tick in the success colour. */
.password-rules li::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--color-border-strong, var(--color-border));
  border-radius: 50%;
  box-sizing: border-box;
  transition: background-color 0.15s, border-color 0.15s;
}

.password-rules li.is-met {
  color: var(--color-success);
}

.password-rules li.is-met::before {
  border-color: var(--color-success);
  background: var(--color-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 9px no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .password-rules li::before { transition: none; }
}


/* File pickers (Contact, "Ask about this request", support replies, admin uploads): the browser's grey
   "Choose files" button becomes a themed one (owner, 2026-11-19). The "No file chosen" words are the
   browser's own and stay. */
input[type="file"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-secondary);
  max-width: 100%;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: var(--font-weight-semibold);
  min-height: 40px;
  padding: 8px 16px;
  margin-right: 12px;
  border-radius: var(--radius-button-sm);
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

input[type="file"]::file-selector-button:hover {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  border-color: var(--color-primary);
}
