@charset "UTF-8";
/* ── Design Tokens ───────────────────────────────────────────────────────── */
/* Warm-neutral palette, brand-aligned (no blue/green tints in greys).        */
/* All text tokens target WCAG AA (4.5:1) or better on their intended bg.     */
/* Default = LIGHT mode; dark mode opts in via [data-theme="dark"].           */
:root {
  /* Brand — fixed across modes */
  --brand: #e33b25;
  --brand-hover: #f04d38;
  --brand-subtle: rgba(227, 59, 37, 0.09);
  --brand-glow: rgba(227, 59, 37, 0.18);
  /* Text-only brand: deeper red meets AA on white */
  --brand-text: #b8301a;
  /* Surfaces — warm off-white page, pure white cards */
  --bg-root: #f5f3ee;
  --bg-base: #fdfbf6;
  --bg-raised: #ffffff;
  --bg-overlay: #f9f6f0;
  --bg-elevated: #ece7de;
  /* Text — warm near-black, AA+ on white */
  --text-primary: #1b1816;
  --text-secondary: #55504a;
  --text-muted: #7a7068;
  --text-inverse: #f4f1ec;
  /* Borders */
  --border-subtle: rgba(21, 22, 23, 0.06);
  --border-default: rgba(21, 22, 23, 0.11);
  --border-strong: rgba(21, 22, 23, 0.20);
  /* Semantic — darker variants for white backgrounds */
  --success: #2f7d4f;
  --success-subtle: rgba(47, 125, 79, 0.10);
  --warning: #a66400;
  --warning-subtle: rgba(166, 100, 0, 0.10);
  --danger: #b02a1b;
  --danger-subtle: rgba(176, 42, 27, 0.10);
  --info: #8c5a23; /* dark amber — brand guide forbids blue */
  --info-subtle: rgba(140, 90, 35, 0.10);
  /* Effects */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(21, 18, 15, 0.06);
  --shadow-md: 0 6px 18px rgba(21, 18, 15, 0.09);
  --shadow-lg: 0 14px 44px rgba(21, 18, 15, 0.14);
  --shadow-glow: 0 0 24px var(--brand-glow);
  --glass-bg: rgba(253, 251, 246, 0.82);
  --glass-border: rgba(21, 22, 23, 0.08);
  --glass-blur: blur(16px);
  /* Atmospheric gradient — subtle warm halo anchored at top of page */
  --page-atmosphere:
      radial-gradient(ellipse 90% 55% at 50% -15%, var(--brand-subtle), transparent 70%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 59, 37, 0.03), transparent 70%);
  /* Typography scale */
  --font-heading: "Encode Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  /* Layout */
  --content-max: 1280px;
  --topbar-height: 64px;
  /* Legacy compatibility aliases — used by demo-specific sections */
  --bg: var(--bg-root);
  --surface: var(--bg-raised);
  --text: var(--text-primary);
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --border: var(--border-default);
  --shadow: var(--shadow-sm);
  --radius: var(--radius-md);
  --text-muted-legacy: var(--text-secondary);
}

/* ── Dark Theme (opt-in via [data-theme="dark"]) ─────────────────────────── */
[data-theme=dark] {
  /* Brand halos are stronger on charcoal */
  --brand-subtle: rgba(227, 59, 37, 0.14);
  --brand-glow: rgba(227, 59, 37, 0.28);
  /* Softer coral reads on dark */
  --brand-text: #ff7a5c;
  /* Surfaces — warm charcoals */
  --bg-root: #0b0b0c;
  --bg-base: #131314;
  --bg-raised: #1a1a1c;
  --bg-overlay: #212123;
  --bg-elevated: #2a2a2c;
  /* Text — warm off-white, AA+ on charcoal */
  --text-primary: #f4f1ec;
  --text-secondary: #b5afa7;
  --text-muted: #8e877e;
  --text-inverse: #131314;
  /* Borders — derived from warm white */
  --border-subtle: rgba(244, 241, 236, 0.06);
  --border-default: rgba(244, 241, 236, 0.11);
  --border-strong: rgba(244, 241, 236, 0.20);
  /* Semantic — brighter variants for dark backgrounds */
  --success: #6ec488;
  --success-subtle: rgba(110, 196, 136, 0.14);
  --warning: #e8b547;
  --warning-subtle: rgba(232, 181, 71, 0.14);
  --danger: #e55c46;
  --danger-subtle: rgba(229, 92, 70, 0.14);
  --info: #c9935f; /* amber-tan — no blue */
  --info-subtle: rgba(201, 147, 95, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 28px var(--brand-glow);
  --glass-bg: rgba(19, 19, 20, 0.78);
  --glass-border: rgba(244, 241, 236, 0.08);
  --page-atmosphere:
      radial-gradient(ellipse 90% 55% at 50% -15%, var(--brand-subtle), transparent 70%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 59, 37, 0.05), transparent 70%);
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--page-atmosphere), var(--bg-root);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: var(--text-base);
  font-feature-settings: "ss01", "cv11"; /* Inter stylistic set for friendlier numerals */
  transition: background-color var(--duration-slow) var(--ease-out), color var(--duration-slow) var(--ease-out);
  min-height: 100vh;
}

/* Form controls don't inherit color/font from their ancestor by default —
   this makes them honor the themed body color so a <button> with a custom
   background doesn't render user-agent black text on a dark card surface. */
button, input, select, textarea {
  color: inherit;
  font: inherit;
}

::selection {
  background: var(--brand);
  color: #fff;
}

/* Focus visible — global accessibility */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Page Layout ─────────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--duration-slow) var(--ease-out);
}

.top-bar .brand {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: opacity var(--duration-fast);
}

.top-bar .brand:hover {
  opacity: 0.8;
}

.top-bar .brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* Theme-aware logo swap: :root is light (default); [data-theme="dark"] is dark.
   Scope every rule under .top-bar so specificity matches the sibling
   `.top-bar .brand-logo { display: block; }` rule above — otherwise that
   rule wins and both logos render. */
.top-bar .brand-logo--on-dark {
  display: none;
}

[data-theme=dark] .top-bar .brand-logo--on-light {
  display: none;
}

[data-theme=dark] .top-bar .brand-logo--on-dark {
  display: block;
}

/* Nav area in top-bar */
.top-bar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.top-bar-nav .nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.top-bar-nav .nav-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.top-bar-nav .nav-breadcrumb a:hover {
  color: var(--text-primary);
}

.top-bar-nav .nav-breadcrumb .separator {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

/* Light mode (default): show moon icon — clicking switches to dark */
:root .theme-toggle .icon-moon {
  display: inline;
}

:root .theme-toggle .icon-sun {
  display: none;
}

/* Dark mode: show sun icon — clicking switches to light */
[data-theme=dark] .theme-toggle .icon-moon {
  display: none;
}

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

/* ── Main Content ────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  animation: content-enter var(--duration-slow) var(--ease-out);
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ── Card Grid (Demo Catalog) ────────────────────────────────────────────── */
.catalog-header {
  margin-bottom: var(--space-2xl);
}

.catalog-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.catalog-header .subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  font-weight: 400;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.demo-card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

.demo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, var(--brand-subtle), transparent 60%);
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.demo-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transform: translateY(-2px);
}

.demo-card:hover::before {
  opacity: 1;
}

.demo-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.demo-card .category {
  font-size: var(--text-xs);
  color: var(--brand-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-card .description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
  flex: 1;
}

.demo-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.demo-card .tag {
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.demo-card .lock-icon {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Card entrance animation stagger */
.demo-card {
  animation: card-enter var(--duration-slow) var(--ease-out) backwards;
}

.demo-card:nth-child(1) {
  animation-delay: 0ms;
}

.demo-card:nth-child(2) {
  animation-delay: 60ms;
}

.demo-card:nth-child(3) {
  animation-delay: 120ms;
}

.demo-card:nth-child(4) {
  animation-delay: 180ms;
}

.demo-card:nth-child(5) {
  animation-delay: 240ms;
}

.demo-card:nth-child(6) {
  animation-delay: 300ms;
}

.demo-card:nth-child(7) {
  animation-delay: 360ms;
}

.demo-card:nth-child(8) {
  animation-delay: 420ms;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Skeleton loading state */
.skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.skeleton-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  height: 200px;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--bg-overlay) 25%, var(--bg-elevated) 50%, var(--bg-overlay) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line-xs {
  height: 12px;
  width: 30%;
  margin-bottom: var(--space-sm);
}

.skeleton-line-sm {
  height: 14px;
  width: 60%;
  margin-bottom: var(--space-sm);
}

.skeleton-line-md {
  height: 20px;
  width: 80%;
  margin-bottom: var(--space-md);
}

.skeleton-line-lg {
  height: 16px;
  width: 100%;
  margin-bottom: var(--space-sm);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
/* ── Detail Page ─────────────────────────────────────────────────────────── */
.demo-detail {
  max-width: 800px;
}

.demo-detail h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.demo-detail .meta {
  font-size: var(--text-sm);
  color: var(--brand-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
}

.demo-detail .instructions {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.demo-detail .instructions h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.demo-detail .instructions p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.demo-detail .prerequisites {
  margin-bottom: var(--space-lg);
}

.demo-detail .prerequisites h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.demo-detail .prerequisites li {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

.demo-detail .prerequisites li::marker {
  color: var(--brand-text);
}

/* ── Password Gate ───────────────────────────────────────────────────────── */
.password-prompt {
  max-width: 420px;
  margin: var(--space-3xl) auto;
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: gate-enter var(--duration-slow) var(--ease-spring);
}

@keyframes gate-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.password-prompt h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.password-prompt p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

.password-prompt .lock-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-lg);
  background: var(--brand-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-xl);
}

.password-prompt input {
  display: block;
  width: 100%;
  padding: 0.875rem var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-body);
  background: var(--bg-overlay);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-align: center;
  letter-spacing: 0.15em;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.password-prompt input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.password-prompt input::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
}

.password-prompt .error {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--danger-subtle);
  border-radius: var(--radius-sm);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.4;
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Back Link ───────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--duration-fast);
}

.back-link:hover {
  color: var(--brand-text);
}

/* ── Coming Soon ─────────────────────────────────────────────────────────── */
.coming-soon {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-secondary);
}

.coming-soon h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

/* ── Admin Page ──────────────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-lg);
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-overlay);
}

.admin-table td {
  font-size: var(--text-sm);
}

.admin-table input[type=text],
.admin-table input[type=date] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  width: 100%;
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.toggle {
  cursor: pointer;
  font-size: var(--text-xs);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.toggle.active {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* ── Wizard ──────────────────────────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.wizard-step-indicator {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-normal) var(--ease-out);
}

.wizard-step-indicator.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: 0 0 12px var(--brand-glow);
}

.wizard-step-indicator.completed {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ── Signature ───────────────────────────────────────────────────────────── */
.signature-container {
  max-width: 600px;
}

.signature-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
}

.signature-tab {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border-default);
  background: var(--bg-overlay);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.signature-tab:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.signature-tab:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.signature-tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.signature-canvas {
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: crosshair;
  display: block;
}

.signature-preview {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.signature-preview img {
  max-width: 100%;
  max-height: 150px;
}

.font-picker {
  display: flex;
  gap: 0.75rem;
  margin: var(--space-md) 0;
}

.font-option {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-raised);
  font-size: var(--text-lg);
  color: var(--text-primary);
  transition: all var(--duration-fast);
}

.font-option.selected {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.typed-name-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  margin-bottom: var(--space-md);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* ── Legal Terms ─────────────────────────────────────────────────────────── */
.legal-terms {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.legal-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.legal-checkbox input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

/* ── PDF Select ──────────────────────────────────────────────────────────── */
.pdf-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.pdf-option {
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
  color: var(--text-primary);
}

.pdf-option:hover {
  border-color: var(--brand);
}

.pdf-option.selected {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

/* ── Validation ──────────────────────────────────────────────────────────── */
.validation-errors {
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.validation-errors ul {
  margin: 0;
  padding-left: var(--space-lg);
}

.validation-errors li {
  color: var(--danger);
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
}

/* PDF viewer container */
.pdf-viewer-container {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 700px;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.validation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: overlay-enter var(--duration-fast) var(--ease-out);
}

@keyframes overlay-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.validation-modal {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modal-enter var(--duration-normal) var(--ease-spring);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.validation-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--brand-text);
  font-weight: 600;
}

.validation-modal-close {
  background: none;
  border: none;
  font-size: var(--text-xl);
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--duration-fast);
}

.validation-modal-close:hover {
  color: var(--text-primary);
}

.validation-modal-list {
  padding: var(--space-md) var(--space-lg) var(--space-md) 2.5rem;
  margin: 0;
}

.validation-modal-list li {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.validation-modal-footer {
  padding: 0.75rem var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  text-align: right;
}

/* ── Confirmation ────────────────────────────────────────────────────────── */
.confirmation-card {
  max-width: 500px;
  margin: var(--space-xl) auto;
  padding: var(--space-2xl);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.confirmation-card .check-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: var(--space-md);
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ── Settings Editor ─────────────────────────────────────────────────────── */
.settings-editor {
  max-width: 900px;
}

.settings-section {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem var(--space-md);
  background: var(--bg-overlay);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
  color: var(--text-primary);
  transition: background var(--duration-fast);
}

.settings-section-header:hover {
  background: var(--bg-elevated);
}

.settings-section-body {
  padding: var(--space-md);
}

.settings-section-body.collapsed {
  display: none;
}

.settings-field {
  margin-bottom: var(--space-md);
}

.settings-field label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.settings-field input,
.settings-field textarea,
.settings-field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  background: var(--bg-overlay);
  color: var(--text-primary);
  transition: border-color var(--duration-fast);
}

.settings-field input:focus,
.settings-field textarea:focus,
.settings-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.settings-field textarea {
  min-height: 100px;
  resize: vertical;
}

.settings-field textarea.json-editor {
  min-height: 300px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.rule-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.rule-row select {
  width: 150px;
  flex-shrink: 0;
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.5rem;
  font-size: var(--text-sm);
}

.rule-row input {
  flex: 1;
  min-width: 120px;
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.5rem;
  font-size: var(--text-sm);
}

.rule-row .btn-remove {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.rule-row .btn-remove:hover {
  background: var(--danger);
  color: white;
}

.btn-add-row {
  background: none;
  border: 1px dashed var(--border-default);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--brand-text);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  margin-top: var(--space-sm);
  transition: all var(--duration-fast);
}

.btn-add-row:hover {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.json-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

.json-error {
  color: var(--danger);
  font-size: var(--text-xs);
  margin-top: var(--space-sm);
}

/* Upload area */
.upload-area {
  display: block;
  position: relative;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  margin-top: var(--space-md);
  cursor: pointer;
  transition: all var(--duration-fast);
  color: var(--text-secondary);
}

.upload-area:hover {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.upload-area input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.settings-summary {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-md);
}

.settings-summary h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.settings-summary .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.settings-summary .summary-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.save-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.save-result {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
}

.save-result .link-row {
  margin-top: 0.75rem;
}

/* ===== File Requests Demo ===== */
.fr-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
  gap: 0;
}

.fr-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration-fast);
  font-size: var(--text-sm);
}

.fr-tab:hover {
  color: var(--text-primary);
}

.fr-tab.active {
  color: var(--brand-text);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* KPI Cards */
.fr-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: var(--space-lg);
}

.fr-kpi {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border-left: 3px solid var(--brand);
  transition: all var(--duration-fast);
}

.fr-kpi:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}

.fr-kpi-label {
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fr-kpi-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-xs);
  font-family: var(--font-heading);
}

.fr-kpi-trend {
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

.fr-kpi-trend.up {
  color: var(--success);
}

.fr-kpi-trend.down {
  color: var(--danger);
}

.fr-kpi-trend.flat {
  color: var(--text-muted);
}

/* Tables */
.fr-table-container {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.fr-table-header {
  padding: 0.75rem var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fr-table-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
}

.fr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.fr-table thead {
  background: var(--bg-overlay);
}

.fr-table th {
  padding: 0.625rem var(--space-md);
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fr-table td {
  padding: 0.625rem var(--space-md);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.fr-table .name {
  font-weight: 500;
}

.fr-table .email {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Status badges */
.fr-badge {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.fr-badge.pending {
  background: var(--warning-subtle);
  color: var(--warning);
}

.fr-badge.completed {
  background: var(--success-subtle);
  color: var(--success);
}

.fr-badge.overdue {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* Progress bar */
.fr-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fr-progress-bar {
  background: var(--border-default);
  border-radius: 3px;
  height: 6px;
  width: 80px;
}

.fr-progress-fill {
  border-radius: 3px;
  height: 6px;
  transition: width 0.3s;
}

.fr-progress-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Filter buttons */
.fr-filters {
  display: flex;
  gap: 0.375rem;
}

.fr-filter-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.fr-filter-btn:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}

.fr-filter-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* Charts */
.fr-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.fr-chart-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.fr-chart-title {
  font-weight: 600;
  margin-bottom: var(--space-md);
  font-family: var(--font-heading);
  color: var(--text-primary);
}

/* Host container for Syncfusion charts inside a FR panel */
.fr-chart-host {
  height: 260px;
  width: 100%;
}

.fr-horiz-bars {
  display: grid;
  gap: 0.75rem;
}

.fr-horiz-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.fr-horiz-bar-track {
  background: var(--border-default);
  border-radius: 3px;
  height: 6px;
}

.fr-horiz-bar-fill {
  border-radius: 3px;
  height: 6px;
}

/* Bottom grid */
.fr-bottom-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-md);
}

/* Notification log */
.fr-notif-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.fr-notif-panel .fr-table-header {
  border-bottom: 1px solid var(--border-subtle);
}

.fr-notif-list {
  max-height: 350px;
  overflow-y: auto;
}

.fr-notif-item {
  padding: 0.75rem var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  transition: background var(--duration-fast);
}

.fr-notif-item:hover {
  background: var(--bg-overlay);
}

.fr-notif-icon {
  font-size: var(--text-sm);
  margin-top: 2px;
}

.fr-notif-body {
  flex: 1;
}

.fr-notif-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.fr-notif-detail {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.fr-notif-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Create request panel */
.fr-create-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  animation: overlay-enter var(--duration-fast) var(--ease-out);
}

.fr-create-panel {
  background: var(--bg-base);
  width: 480px;
  max-width: 90vw;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-lg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  animation: slide-in-right var(--duration-normal) var(--ease-out);
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
.fr-create-panel h2 {
  margin-bottom: var(--space-lg);
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.fr-create-panel label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.fr-create-panel input, .fr-create-panel textarea, .fr-create-panel select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.fr-create-panel textarea {
  resize: vertical;
  min-height: 60px;
}

.fr-doc-checklist {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.fr-doc-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-overlay);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.fr-doc-check:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.fr-doc-check .name {
  font-weight: 500;
  color: var(--text-primary);
}

.fr-doc-check .rules {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.fr-doc-check input[type=checkbox] {
  accent-color: var(--brand);
}

/* Upload portal */
.fr-upload-portal {
  max-width: 700px;
  margin: 0 auto;
}

.fr-upload-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.fr-upload-header .from {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.fr-upload-header h2 {
  margin: var(--space-xs) 0;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.fr-demo-selector {
  background: var(--bg-overlay);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.75rem var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fr-demo-selector .label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.fr-demo-selector select {
  flex: 1;
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.375rem;
}

.fr-upload-cards {
  display: grid;
  gap: var(--space-md);
}

.fr-upload-card {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color var(--duration-fast);
}

.fr-upload-card.verified {
  border-color: var(--success);
}

.fr-upload-card.warning {
  border-color: var(--warning);
}

.fr-upload-card.failed {
  border-color: var(--danger);
}

.fr-upload-card-header {
  padding: var(--space-md) 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fr-upload-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fr-upload-card-title .icon {
  font-size: 1.25rem;
}

.fr-upload-card-title .name {
  font-weight: 600;
  color: var(--text-primary);
}

.fr-upload-card-meta {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.fr-upload-card-rules {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

.fr-dropzone {
  margin: 0 1.25rem 1.25rem;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  background: var(--bg-overlay);
  transition: all var(--duration-fast);
}

.fr-dropzone:hover {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.fr-dropzone .icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.fr-dropzone .text {
  color: var(--text-secondary);
}

.fr-dropzone .formats {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.fr-verification {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.fr-verification.pass {
  background: var(--success-subtle);
}

.fr-verification.warning {
  background: var(--warning-subtle);
}

.fr-verification.fail {
  background: var(--danger-subtle);
}

.fr-verification-title {
  font-weight: 500;
  font-size: var(--text-sm);
  margin-bottom: 0.375rem;
}

.fr-verification-title.pass {
  color: var(--success);
}

.fr-verification-title.warning {
  color: var(--warning);
}

.fr-verification-title.fail {
  color: var(--danger);
}

.fr-verification-details {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.fr-verification-details div {
  margin-bottom: 0.125rem;
}

.fr-overall-progress {
  margin-top: var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Analyzing spinner */
.fr-analyzing {
  padding: var(--space-xl);
  text-align: center;
}

.fr-analyzing .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
}

/* Toast notifications */
.fr-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fr-toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 0.75rem var(--space-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: fr-toast-in 0.3s var(--ease-out);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  min-width: 280px;
  color: var(--text-primary);
}

.fr-toast .dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-base);
}

@keyframes fr-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Detail panel */
.fr-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  animation: overlay-enter var(--duration-fast) var(--ease-out);
}

.fr-detail-panel {
  background: var(--bg-base);
  width: 560px;
  max-width: 90vw;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-lg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  animation: slide-in-right var(--duration-normal) var(--ease-out);
}

/* ===== PDF Builder Settings Improvements ===== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
}

.field-sidebar {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-md));
  max-height: calc(100vh - var(--topbar-height) - var(--space-xl));
  overflow-y: auto;
}

.field-sidebar h4 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.field-sidebar .field-count {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.field-sidebar .field-name {
  padding: 0.375rem 0.5rem;
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
  word-break: break-all;
  color: var(--text-secondary);
}

.field-sidebar .field-name:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.field-sidebar .field-name.copied {
  background: var(--success-subtle);
  color: var(--success);
}

/* Duplicate warning banner */
.duplicate-warning {
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 0.75rem var(--space-md);
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--text-primary);
}

.duplicate-warning .icon {
  font-size: 1.1rem;
}

.duplicate-warning strong {
  color: var(--danger);
}

/* Duplicate fix modal */
.duplicate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: overlay-enter var(--duration-fast) var(--ease-out);
}

.duplicate-modal {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modal-enter var(--duration-normal) var(--ease-spring);
}

.duplicate-modal h3 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.duplicate-modal ul {
  margin: 0.75rem 0;
  padding-left: var(--space-lg);
  color: var(--text-secondary);
}

.duplicate-modal .actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Regex template selector */
.regex-template-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: 0.375rem;
}

.regex-template-row select {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.regex-template-label {
  font-size: var(--text-xs);
  color: var(--success);
  margin-bottom: var(--space-xs);
}

/* Linked fields editor */
.linked-group {
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: 0.75rem;
}

.linked-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.linked-targets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.375rem;
  margin-top: var(--space-sm);
}

.linked-target-check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.linked-target-check input[type=checkbox] {
  accent-color: var(--brand);
}

/* Refresh button */
.btn-refresh {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.btn-refresh:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}

/* ===== PDF Signing Field Validation Styles ===== */
.pdf-viewer-container input.fr-invalid-field,
.pdf-viewer-container textarea.fr-invalid-field {
  border: 2px solid var(--danger) !important;
  background-color: var(--danger-subtle);
}

.pdf-viewer-container input[readonly],
.pdf-viewer-container textarea[readonly] {
  border: none !important;
  background: transparent !important;
}

/* ===== Knowledge Base Chat Demo ===== */
.kb-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - var(--space-3xl));
  max-height: 800px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kb-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.75rem var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-overlay);
}

.kb-header-topic {
  flex: 1;
  max-width: 400px;
}

.kb-header-topic label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.kb-header-topic select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.kb-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;
}

.kb-stream-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.kb-stream-toggle input {
  margin: 0;
  accent-color: var(--brand);
}

.kb-new-chat-btn {
  padding: 0.5rem var(--space-md);
  background: transparent;
  color: var(--brand-text);
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.kb-new-chat-btn:hover {
  background: var(--brand);
  color: white;
}

.kb-new-chat-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Messages area */
.kb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
}

/* Welcome card */
.kb-welcome {
  max-width: 500px;
  margin: auto;
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-overlay);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.kb-welcome h3 {
  margin-bottom: var(--space-sm);
  color: var(--brand-text);
  font-family: var(--font-heading);
}

.kb-welcome p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.kb-example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-md);
}

.kb-chip {
  padding: 0.375rem 0.875rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.kb-chip:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}

/* Message bubbles */
.kb-msg {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  gap: var(--space-xs);
}

.kb-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.kb-msg.assistant, .kb-msg.error {
  align-self: flex-start;
  align-items: flex-start;
}

.kb-bubble {
  padding: 0.75rem var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.kb-msg.user .kb-bubble {
  background: var(--brand);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.kb-msg.assistant .kb-bubble {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--radius-sm);
}

.kb-msg.error .kb-bubble {
  background: var(--danger-subtle);
  color: var(--text-primary);
  border: 1px solid var(--danger);
  border-bottom-left-radius: var(--radius-sm);
}

.kb-msg.error .kb-bubble::before {
  content: "⚠";
  color: var(--danger);
  font-weight: 700;
}

.kb-timestamp {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 0 var(--space-xs);
}

.kb-retry-btn {
  margin-top: var(--space-sm);
  padding: 0.25rem 0.75rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.kb-retry-btn:hover {
  background: var(--danger);
  color: white;
}

/* Typing indicator */
.kb-typing {
  align-self: flex-start;
  display: flex;
  gap: var(--space-xs);
  padding: 0.75rem var(--space-md);
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-top-left-radius: var(--radius-sm);
}

.kb-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: kb-typing-bounce 1.4s infinite ease-in-out;
}

.kb-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.kb-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes kb-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}
/* Sources panel */
.kb-sources {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 100%;
}

.kb-sources h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.kb-source-card {
  padding: var(--space-sm) 0.75rem;
  border-left: 3px solid var(--brand);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  transition: background var(--duration-fast);
}

.kb-source-card:last-child {
  margin-bottom: 0;
}

.kb-source-title {
  font-weight: 600;
  color: var(--text-primary);
}

.kb-source-snippet {
  color: var(--text-secondary);
  margin: var(--space-xs) 0;
  font-size: var(--text-sm);
}

.kb-source-url {
  font-size: var(--text-xs);
}

.kb-source-url a {
  color: var(--brand-text);
  text-decoration: none;
}

.kb-source-url a:hover {
  text-decoration: underline;
}

/* Follow-up chips */
.kb-followups {
  margin-top: 0.75rem;
}

.kb-followups h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.kb-followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Input area */
.kb-input-area {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  padding: 0.75rem var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-overlay);
}

.kb-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-body);
  background: var(--bg-raised);
  color: var(--text-primary);
  resize: none;
  line-height: 1.5;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.kb-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.kb-input:disabled {
  background: var(--bg-overlay);
  color: var(--text-muted);
  cursor: not-allowed;
}

.kb-send-btn {
  padding: 0.5rem 1.25rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.kb-send-btn:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: var(--shadow-glow);
}

.kb-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kb-input-hint {
  padding: 0.75rem var(--space-md);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== Knowledge Base — Citations, Artifacts, AI Details ===== */
.kb-citation {
  display: inline-block;
  color: var(--brand-text);
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  transition: background var(--duration-fast);
}

.kb-citation:hover {
  background: var(--brand-subtle);
  text-decoration: underline;
}

.kb-source-highlight {
  animation: kb-source-pulse 1.5s ease-out;
}

@keyframes kb-source-pulse {
  0% {
    background: var(--brand-subtle);
    box-shadow: 0 0 0 2px var(--brand);
  }
  100% {
    background: var(--bg-overlay);
    box-shadow: 0 0 0 0 transparent;
  }
}
/* Artifacts panel */
.kb-artifacts {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 100%;
}

.kb-artifacts h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.kb-artifact {
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
}

.kb-artifact:last-child {
  margin-bottom: 0;
}

.kb-artifact-type {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--info);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.kb-artifact-content {
  margin: 0;
  padding: var(--space-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text-primary);
}

.kb-artifact-content code {
  background: none;
  padding: 0;
  color: inherit;
}

/* AI Details (collapsible) */
.kb-details {
  margin-top: 0.75rem;
  max-width: 100%;
}

.kb-details-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color var(--duration-fast);
}

.kb-details-toggle:hover {
  border-color: var(--brand);
}

.kb-details-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: var(--space-sm);
}

.kb-details-hint span {
  margin-right: var(--space-xs);
}

.kb-details-body {
  margin-top: var(--space-sm);
  padding: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.kb-detail-section {
  margin-bottom: 0.75rem;
}

.kb-detail-section:last-child {
  margin-bottom: 0;
}

.kb-detail-section h5 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.kb-detail-text {
  padding: var(--space-sm);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
}

.kb-tool {
  padding: var(--space-sm);
  background: var(--bg-overlay);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  margin-bottom: 0.375rem;
}

.kb-tool:last-child {
  margin-bottom: 0;
}

.kb-tool-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--info);
  margin-bottom: var(--space-xs);
}

.kb-tool-section {
  margin-top: var(--space-xs);
}

.kb-tool-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.125rem;
}

.kb-tool-json {
  margin: 0;
  padding: var(--space-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-primary);
}

.kb-tool-json code {
  background: none;
  padding: 0;
  color: inherit;
}

.kb-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.375rem;
}

.kb-token-item {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem var(--space-sm);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.kb-token-label {
  color: var(--text-secondary);
}

.kb-token-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Source card header with score */
.kb-source-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.kb-source-score {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-text);
  background: var(--brand-subtle);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.kb-source-meta {
  margin-top: 0.375rem;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.kb-source-meta-label {
  margin-right: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kb-source-meta code {
  background: var(--bg-raised);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
}

/* === Customer Service demo === */
.cs-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 56px);
  min-height: 640px;
  color: var(--text-primary);
}

.cs-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-default);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.cs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-brand__logo {
  height: 28px;
  color: var(--text-primary);
}

.cs-brand__names {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.cs-brand__company {
  font-weight: 600;
  font-size: 14px;
}

.cs-brand__product {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-header__center {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: center;
}

.cs-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-picker__label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-picker__select {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-body);
}

.cs-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  transition: all var(--duration-fast);
}

.cs-btn:hover:not(:disabled) {
  background: var(--bg-overlay);
  border-color: var(--border-strong);
}

.cs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cs-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.cs-btn--primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.cs-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.cs-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
}

.cs-toggle input {
  accent-color: var(--brand);
}

.cs-mode-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid var(--border-default);
  border-radius: 3px;
  color: var(--text-secondary);
}

.cs-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  background: var(--bg-base);
}

.cs-panes--with-rail {
  grid-template-columns: 1fr 1fr 320px;
}

.cs-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border-default);
  background: var(--bg-raised);
}

.cs-pane:last-child {
  border-right: none;
}

.cs-pane--copilot {
  background: var(--bg-overlay);
}

.cs-pane__empty {
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.cs-rail {
  width: 320px;
  background: var(--bg-root);
  border-left: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cs-rail__empty {
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.cs-endstate {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

.cs-endstate__label {
  color: var(--brand-text);
  font-weight: 600;
  font-size: 14px;
}

/* Customer Service — chat pane */
.cs-pane__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-persona {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-persona__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
}

.cs-persona__initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.cs-persona__name {
  font-weight: 600;
  font-size: 14px;
}

.cs-persona__sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.cs-pane__title {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-bubble {
  max-width: 78%;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.cs-bubble--customer {
  align-self: flex-end;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-right-radius: 3px;
}

.cs-bubble--ai {
  align-self: flex-start;
  background: var(--brand);
  color: #fff;
  border-bottom-left-radius: 3px;
}

.cs-bubble--system {
  align-self: center;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 12px;
  border: 1px solid var(--border-subtle);
}

.cs-bubble__text {
  white-space: pre-wrap;
}

.cs-bubble__citations {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cs-citation {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
}

.cs-typing {
  display: flex;
  gap: 4px;
}

.cs-typing span {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.5;
  animation: cs-typing 1.2s infinite;
}

.cs-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.cs-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes cs-typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.cs-action {
  align-self: flex-start;
  max-width: 90%;
  background: var(--bg-overlay);
  border: 1px dashed var(--brand);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-action__header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand-text);
}

.cs-action__prompt {
  font-size: 14px;
  color: var(--text-primary);
}

.cs-action__kv {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-default);
  padding-top: 4px;
}

.cs-action__kv code {
  background: var(--bg-base);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.cs-action__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cs-composer {
  border-top: 1px solid var(--border-default);
  padding: 10px 16px;
}

.cs-composer--disabled {
  opacity: 0.5;
}

.cs-composer__input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
}

/* Customer Service — rep copilot */
.cs-copilot__live {
  color: var(--success);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-copilot__idle {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-copilot__empty {
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  max-width: 320px;
  margin: auto;
}

.cs-copilot {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-copilot__section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-copilot__section-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.cs-copilot__summary {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.cs-copilot__meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.cs-sugg__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cs-sugg__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.cs-sugg__conf {
  font-size: 11px;
  color: var(--text-secondary);
}

.cs-sugg__detail {
  font-size: 13px;
  color: var(--text-primary);
}

.cs-sugg__why {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--bg-base);
  padding: 8px;
  border-left: 3px solid var(--brand);
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cs-sugg__why-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.cs-sugg__apply {
  align-self: flex-start;
}

.cs-copilot__tone {
  display: flex;
  gap: 6px;
}

.cs-tone {
  font-size: 11px;
  padding: 4px 10px;
}

.cs-tone--active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.cs-copilot__composer {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  resize: vertical;
}

.cs-copilot__nba {
  margin: 0;
  padding-left: 18px;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-copilot__context {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-ctx {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cs-ctx__kind {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 3px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cs-ctx__title {
  font-size: 13px;
  color: var(--text-primary);
}

.cs-ctx__detail {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Customer Service — transparency rail */
.cs-rail__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.cs-rail__section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-rail__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.cs-rail__empty {
  font-size: 12px;
  color: var(--text-muted);
}

.cs-rail__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.cs-sentiment {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-sentiment__bar {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.cs-sentiment__fill {
  height: 100%;
}

.cs-sentiment__fill--good {
  background: var(--success);
}

.cs-sentiment__fill--warn {
  background: var(--warning);
}

.cs-sentiment__fill--bad {
  background: var(--danger);
}

.cs-sentiment__num {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

.cs-sentiment__spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
}

.cs-sentiment__spark span {
  width: 4px;
  background: var(--brand);
  border-radius: 1px;
}

.cs-tce {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px;
  font-size: 11px;
}

.cs-tce__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cs-tce__tool {
  font-family: var(--font-mono);
  color: var(--brand-text);
}

.cs-tce__latency {
  color: var(--text-muted);
}

.cs-tce__group {
  margin-top: 4px;
}

.cs-tce__label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cs-tce__kv {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  gap: 6px;
  color: var(--text-secondary);
}

.cs-tce__kv code {
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-base);
  padding: 1px 4px;
  border-radius: 2px;
  word-break: break-all;
}

.cs-guardrails {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Customer Service — admin settings */
.admin-section-head {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.admin-cs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.admin-cs__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.admin-cs__scenarios {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-cs__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-cs__saved {
  color: var(--success);
  font-size: 12px;
  margin-left: 12px;
}

/* ===== Executive Dashboard ===== */
.ed-root {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  /* Numerals should line up in tables and KPI values */
  font-variant-numeric: tabular-nums;
}

.ed-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-default);
  padding: 16px 24px;
  position: relative;
}

/* Subtle brand keyline under the topbar — signals "executive" without shouting */
.ed-topbar::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent 30%);
  pointer-events: none;
}

.ed-topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ed-topbar-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ed-accent {
  color: var(--brand-text);
  font-size: 18px;
  line-height: 1;
}

/* KPI Strip */
.ed-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border-default);
  margin: 20px 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.ed-kpi {
  background: var(--bg-raised);
  padding: 18px 20px;
  transition: background var(--duration-fast) var(--ease-out);
}

.ed-kpi:hover {
  background: var(--bg-overlay);
}

.ed-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.ed-kpi-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ed-kpi-trend {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

.ed-kpi-green {
  color: var(--success);
}

.ed-kpi-yellow {
  color: var(--warning);
}

.ed-kpi-red {
  color: var(--brand-text);
}

/* Main Grid */
.ed-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 0 24px 24px;
}

/* Domain Card Grid */
.ed-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.ed-card {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  cursor: pointer;
  padding: 18px;
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast), box-shadow var(--duration-fast);
  position: relative;
}

.ed-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px transparent inset;
  transition: box-shadow var(--duration-fast);
  pointer-events: none;
}

.ed-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ed-card:hover::after {
  box-shadow: 0 0 0 1px var(--brand-subtle) inset;
}

.ed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ed-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.ed-card-drill {
  font-size: 11px;
  color: var(--text-muted);
}

.ed-card-metrics {
  display: flex;
  gap: 16px;
  padding: 10px 0;
}

.ed-card-metric {
  text-align: center;
  flex: 1;
}

.ed-card-metric-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.ed-card-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.ed-mini-chart {
  display: flex;
  align-items: flex-end;
  height: 60px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 2px;
}

.ed-mini-bar {
  flex: 1;
  background: var(--success);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height var(--duration-normal) var(--ease-out);
}

.ed-card-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  border-top: 1px solid var(--border-default);
  padding-top: 8px;
}

.ed-card-status-warn {
  color: var(--warning);
}

.ed-card-status-critical {
  color: var(--brand-text);
}

/* Alerts Panel */
.ed-alerts-panel {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.ed-alerts-header {
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-default);
  padding: 14px 16px;
}

.ed-alerts-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.ed-alerts-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ed-alert {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.ed-alert:hover {
  background: var(--bg-overlay);
}

.ed-alert:last-child {
  border-bottom: none;
}

.ed-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ed-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ed-alert-dot-critical {
  background: var(--brand);
}

.ed-alert-dot-warning {
  background: var(--warning);
}

.ed-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ed-alert-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-left: 16px;
}

.ed-alert-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-left: 16px;
}

.ed-tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ed-tag-root {
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.ed-tag-cascading {
  background: var(--warning-subtle);
  color: var(--warning);
}

.ed-tag-projected {
  background: var(--warning-subtle);
  color: var(--warning);
}

.ed-tag-independent {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.ed-tag-domain {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* Detail Panel */
.ed-detail {
  padding: 0 20px;
}

.ed-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  margin: 16px 0;
  transition: all var(--duration-fast);
  font-family: var(--font-body);
}

.ed-back-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-overlay);
}

.ed-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-family: var(--font-heading);
}

.ed-connected-alerts {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.ed-connected-alerts-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 8px;
}

.ed-connected-alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  padding: 4px 0;
}

.ed-section {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.ed-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

.ed-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Tables */
.ed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ed-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-default);
  font-weight: 700;
}

.ed-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.ed-table tr:hover td {
  background: var(--bg-overlay);
}

.ed-badge {
  display: inline-block;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.ed-badge-green {
  background: var(--success-subtle);
  color: var(--success);
  border-color: var(--success-subtle);
}

.ed-badge-yellow {
  background: var(--warning-subtle);
  color: var(--warning);
  border-color: var(--warning-subtle);
}

.ed-badge-red {
  background: var(--brand-subtle);
  color: var(--brand-text);
  border-color: var(--brand-subtle);
}

.ed-badge-gray {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

/* Flagged row: a left-rail brand indicator is more scannable than tinting every cell */
.ed-row-flagged td {
  color: var(--text-primary);
  background: var(--brand-subtle);
}

.ed-row-flagged td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.ed-row-flagged td strong {
  color: var(--brand-text);
}

/* Charts & Gauges */
.ed-gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.ed-chart {
  height: 300px;
  width: 100%;
}

.ed-chart-sm {
  height: 200px;
  width: 100%;
}

/* ===== Truepoint — Property Management demo ===== */
.tp-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--topbar-height));
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

/* ── Login ───────────────────────────────────────────────────────────── */
.tp-app:has(.tp-login),
.tp-app:has(.tp-resident) {
  grid-template-columns: 1fr;
}

.tp-login {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 24px;
  min-height: 70vh;
}

.tp-login-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
  max-width: 860px;
  width: 100%;
}

.tp-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tp-login-mark {
  color: var(--brand);
  font-size: 28px;
}

.tp-login-name {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tp-login-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.tp-login-copy {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.tp-login-personas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.tp-login-persona {
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-overlay);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.tp-login-persona:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tp-login-persona-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.tp-login-persona-name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
}

.tp-login-persona-title {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tp-login-persona-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.tp-sidebar {
  background: #18171a;
  color: #e8e4db;
  padding: 18px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
}

.tp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}

.tp-brand-mark {
  color: var(--brand);
  font-size: 20px;
}

.tp-brand-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tp-me {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.tp-me-name {
  font-weight: 600;
  font-size: 13px;
}

.tp-me-role {
  font-size: 11px;
  color: #bbb3a6;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tp-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: #d6d0c4;
  text-align: left;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.tp-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.tp-nav-item.is-active {
  background: var(--brand);
  color: #fff;
}

.tp-nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
}

.tp-nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.tp-nav-item.is-active .tp-nav-badge {
  background: rgba(0, 0, 0, 0.2);
}

.tp-nav-footer {
  margin-top: auto;
  padding: 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tp-linkbtn {
  background: none;
  border: none;
  color: var(--brand-hover);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
}

.tp-linkbtn:hover {
  text-decoration: underline;
}

.tp-sidebar .tp-linkbtn {
  color: #d6d0c4;
}

.tp-sidebar .tp-linkbtn:hover {
  color: #fff;
}

/* ── Main area ───────────────────────────────────────────────────────── */
.tp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tp-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-crumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.tp-page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.tp-date-chip {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--brand-subtle);
  color: var(--brand-text);
  border-radius: 999px;
  font-weight: 600;
}

.tp-viewtoggle {
  display: inline-flex;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg-overlay);
}

.tp-viewtoggle button {
  background: transparent;
  border: none;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
}

.tp-viewtoggle button:hover:not(:disabled) {
  color: var(--text-primary);
}

.tp-viewtoggle button.is-active {
  background: var(--brand);
  color: #fff;
}

.tp-viewtoggle button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tp-content {
  padding: 20px 28px 36px;
}

/* ── Panels / modules ────────────────────────────────────────────────── */
.tp-module {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.tp-panel-tight {
  padding: 14px 20px;
}

.tp-panel-callout {
  background: linear-gradient(180deg, var(--brand-subtle) 0%, var(--bg-raised) 70%);
}

.tp-panel-callout h2 {
  margin: 4px 0 12px;
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.tp-panel-training {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.tp-panel-span {
  grid-column: 1/-1;
}

.tp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.tp-panel-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

.tp-panel-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.tp-callout-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-text);
}

.tp-callout-copy {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 80ch;
  margin: 4px 0 0;
}

.tp-callout-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.tp-dash {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* KPIs */
.tp-kpis {
  display: grid;
  gap: 1px;
  background: var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.tp-kpis-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tp-kpis-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tp-kpis-5 {
  grid-template-columns: repeat(5, 1fr);
}

.tp-kpi {
  background: var(--bg-raised);
  padding: 14px 16px;
  border: none;
  text-align: left;
  font-family: inherit;
}

.tp-kpi-clickable {
  cursor: pointer;
  transition: background var(--duration-fast);
}

.tp-kpi-clickable:hover {
  background: var(--bg-overlay);
}

.tp-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.tp-kpi-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tp-warn {
  color: var(--warning);
}

.tp-bad {
  color: var(--danger);
}

.tp-good {
  color: var(--success);
}

.tp-pos {
  color: var(--success);
}

.tp-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.tp-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.tp-delta {
  font-size: 11px;
  color: var(--warning);
  margin-left: 6px;
}

.tp-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

/* PM cards on Director dashboard */
.tp-pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tp-pm-card {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-pm-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.tp-pm-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-pm-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.tp-pm-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Metrics strip — number on top anchors the baseline; labels are free to wrap below.
   Dashed rules above + below give the strip visual identity within the card;
   hairline dividers between cells give the tabular financial-report feel. */
.tp-pm-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2px 0;
  padding: 10px 0;
  border-top: 1px dashed var(--border-subtle);
  border-bottom: 1px dashed var(--border-subtle);
}

.tp-pm-metric-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 0 14px;
  min-width: 0;
  border-right: 1px solid var(--border-subtle);
}

.tp-pm-metric-cell:first-child {
  padding-left: 2px;
}

.tp-pm-metric-cell:last-child {
  border-right: none;
  padding-right: 2px;
}

.tp-pm-metric-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: 0;
  transition: color var(--duration-fast);
}

.tp-pm-metric-value.is-attention {
  color: var(--warning);
}

.tp-pm-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  line-height: 1.25;
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

.tp-pm-kt {
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.tp-pm-kt-value {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}

.tp-pm-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

/* tone cards */
.tp-tone-ok {
  box-shadow: inset 4px 0 0 var(--success);
}

.tp-tone-warn {
  box-shadow: inset 4px 0 0 var(--warning);
}

.tp-tone-bad {
  box-shadow: inset 4px 0 0 var(--danger);
}

/* Building cards */
.tp-bldg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tp-bldg-card {
  text-align: left;
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--duration-fast);
  font-family: inherit;
}

.tp-bldg-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tp-bldg-code {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tp-bldg-name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin: 2px 0 4px;
}

.tp-bldg-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.tp-bldg-flags {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-bldg-flags li {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-overlay);
  border-radius: 999px;
  color: var(--text-secondary);
}

.tp-bldg-footer {
  font-size: 11px;
  color: var(--text-muted);
}

.tp-bldg-detail-head {
  padding: 4px 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-bldg-detail-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tp-bldg-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Tabs */
.tp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-default);
  padding: 0 2px;
}

.tp-tab {
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tp-tab:hover {
  color: var(--text-primary);
}

.tp-tab.is-active {
  color: var(--brand-text);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

.tp-tab-count {
  font-size: 11px;
  margin-left: 4px;
  color: var(--text-muted);
}

.tp-tab-body {
  padding: 16px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tables */
.tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tp-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-default);
}

.tp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.tp-table tbody tr:hover {
  background: var(--bg-overlay);
}

.tp-table-sticky thead {
  position: sticky;
  top: calc(var(--topbar-height) + 62px);
  z-index: 2;
}

.tp-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tp-row-warn {
  background: rgba(166, 100, 0, 0.05);
}

.tp-row-bad {
  background: rgba(176, 42, 27, 0.05);
}

.tp-row-muted {
  opacity: 0.6;
}

.tp-row-emph {
  font-weight: 700;
}

.tp-row-emph td {
  border-top: 2px solid var(--border-strong);
  padding-top: 12px;
}

.tp-row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.tp-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-src {
  max-width: 280px;
}

.tp-inline-warn {
  display: block;
  font-size: 11px;
  color: var(--warning);
  margin-top: 4px;
  font-weight: 600;
}

/* Pills + tags */
.tp-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  margin-right: 4px;
}

.tp-pill-ok {
  background: var(--success-subtle);
  color: var(--success);
}

.tp-pill-warn {
  background: var(--warning-subtle);
  color: var(--warning);
}

.tp-pill-bad {
  background: var(--danger-subtle);
  color: var(--danger);
}

.tp-pill-info {
  background: var(--info-subtle);
  color: var(--info);
}

.tp-pill-muted {
  background: var(--bg-overlay);
  color: var(--text-muted);
}

.tp-pill-note {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.tp-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-right: 6px;
}

/* Buttons */
.tp-btn {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--duration-fast);
}

.tp-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-text);
}

.tp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tp-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tp-btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  color: #fff;
  border-color: var(--brand-hover);
}

.tp-btn-subtle {
  background: var(--bg-overlay);
}

/* Close strip (shared on chargebacks, arrears, compliance, print-mail) */
.tp-close-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  align-items: center;
}

.tp-close-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  grid-column: -3/-1;
  flex-wrap: wrap;
}

.tp-flash {
  background: var(--success-subtle);
  color: var(--success);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.tp-close-copy {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.tp-closebar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Risk / ladder lists */
.tp-risk-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-risk-list li {
  padding: 10px 12px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-default);
}

.tp-risk-list li.tp-tone-bad {
  border-left-color: var(--danger);
}

.tp-risk-list li.tp-tone-warn {
  border-left-color: var(--warning);
}

.tp-risk-list li.tp-tone-ok {
  border-left-color: var(--success);
}

.tp-risk-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.tp-risk-title {
  font-weight: 600;
  flex: 1;
}

.tp-risk-bldg {
  font-size: 12px;
  color: var(--text-muted);
}

.tp-risk-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Ladder (arrears escalation) */
.tp-ladder {
  list-style: none;
  counter-reset: lad;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-ladder li {
  padding: 8px 12px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  font-size: 13px;
}

.tp-ladder-date {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Progress bar */
.tp-progress {
  background: var(--bg-elevated);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.tp-progress-lg {
  height: 10px;
}

.tp-progress-bar {
  height: 100%;
  background: var(--success);
  transition: width var(--duration-normal);
}

/* Renovation cards */
.tp-reno-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.tp-reno-card {
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--duration-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-reno-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tp-reno-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.tp-reno-bldg {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

.tp-reno-scope {
  font-size: 13px;
  color: var(--text-secondary);
}

.tp-reno-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.tp-reno-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Doc slots */
.tp-doc-slots {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-doc-slots li {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
}

.tp-doc-slots li.is-done {
  background: var(--success-subtle);
  border-color: var(--success);
}

.tp-slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-slot-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.is-done .tp-slot-indicator {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.tp-slot-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-slot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* Steps */
.tp-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-step {
  padding: 10px 12px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-default);
}

.tp-step.is-active {
  border-left-color: var(--brand);
  background: var(--brand-subtle);
}

.tp-step.is-done {
  border-left-color: var(--success);
}

.tp-step.is-muted {
  opacity: 0.55;
}

.tp-step-name {
  font-weight: 700;
  font-size: 13px;
}

.tp-step-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Filters / chips */
.tp-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tp-filters-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tp-chip {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
}

.tp-chip:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}

.tp-chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tp-spacer {
  flex: 1;
}

.tp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tp-toggle input {
  accent-color: var(--brand);
}

/* Definition list */
.tp-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 13px;
}

.tp-dl > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.tp-dl dt {
  color: var(--text-muted);
  font-size: 12px;
}

.tp-dl dd {
  margin: 0;
}

/* Search */
.tp-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-overlay);
  font-size: 14px;
  font-family: inherit;
}

.tp-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.tp-search-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.tp-results {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-results li {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
}

.tp-result-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.tp-result-snippet {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tp-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

/* Chain (approvals) */
.tp-chain {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tp-chain-step {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  border-left: 3px solid var(--border-default);
  min-width: 120px;
  font-size: 11px;
}

.tp-chain-step.is-done {
  border-left-color: var(--success);
  background: var(--success-subtle);
}

.tp-chain-step.is-active {
  border-left-color: var(--brand);
  background: var(--brand-subtle);
}

.tp-chain-step.is-blocked {
  border-left-color: var(--warning);
  background: var(--warning-subtle);
}

.tp-chain-role {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-size: 10px;
}

.tp-chain-person {
  font-weight: 600;
  font-size: 12px;
  margin-top: 2px;
}

.tp-chain-action {
  color: var(--text-muted);
  margin-top: 2px;
  font-size: 11px;
}

/* Letter preview — intentional paper tone regardless of app theme */
.tp-letter {
  background: #fffdf7;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 22px 28px;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.55;
  color: #2a2520;
  max-width: 680px;
  box-shadow: var(--shadow-sm);
}

.tp-letter p {
  margin: 0 0 10px;
}

.tp-letter p:last-child {
  margin-bottom: 0;
}

/* Settings rows */
.tp-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.tp-setting-row:last-child {
  border-bottom: none;
}

.tp-setting-title {
  font-weight: 700;
  font-size: 14px;
}

.tp-setting-copy {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 4px 0 0;
}

.tp-setting-note {
  background: var(--brand-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--brand-text);
  margin-top: 12px;
}

.tp-integrations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.tp-integrations li {
  padding: 6px 10px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
}

.tp-reasons {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-kt-big {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-top: 8px;
}

.tp-tip {
  font-size: 11px;
  color: var(--brand-text);
  background: var(--brand-subtle);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-width: 280px;
  line-height: 1.35;
}

.tp-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Resident portal ──────────────────────────────────────────────────── */
.tp-resident {
  padding: 24px 28px 48px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tp-resident-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tp-resident-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.tp-resident-brand em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.tp-resident-hero h2 {
  margin: 2px 0 4px;
  font-family: var(--font-heading);
  font-size: 22px;
}

.tp-resident-sub {
  color: var(--text-secondary);
  font-size: 13px;
}

.tp-resident-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tp-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.tp-chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  max-width: 85%;
  font-size: 13px;
  line-height: 1.45;
}

.tp-chat-user {
  background: var(--bg-elevated);
  align-self: flex-end;
}

.tp-chat-bot {
  background: var(--brand-subtle);
  color: var(--brand-text);
  align-self: flex-start;
}

.tp-chat-bot strong {
  color: var(--danger);
}

.tp-chat-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tp-chat-input {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.tp-chat-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  font-family: inherit;
  font-size: 13px;
}

.tp-chat-citation {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.tp-chat-caveat {
  margin-top: 6px;
  font-size: 11px;
  color: var(--warning);
}

.tp-chat-disclaimer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ── Resident portal — contact banner & onboarding ───────────────────── */
.tp-contact-banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--info-subtle);
  border: 1px solid rgba(140, 90, 35, 0.25);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-md);
}

.tp-contact-banner.is-overdue {
  background: var(--warning-subtle);
  border-color: rgba(166, 100, 0, 0.35);
  border-left-color: var(--warning);
}

.tp-contact-banner-body {
  flex: 1 1 320px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tp-contact-banner-body strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
  font-size: 14px;
}

.tp-contact-banner-body em {
  font-style: normal;
  color: var(--text-primary);
  font-weight: 600;
}

.tp-contact-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-onboarding {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-qr-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-raised);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

.tp-qr-placeholder {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.1em;
}

.tp-qr-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-overlay);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  margin-top: 4px;
  word-break: break-all;
}

.tp-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-stepper li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-overlay);
  border-left: 3px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.tp-stepper li.is-active {
  border-left-color: var(--brand);
  background: var(--brand-subtle);
}

.tp-stepper li.is-done {
  border-left-color: var(--success);
}

.tp-step-dot {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tp-stepper li.is-active .tp-step-dot {
  border-color: var(--brand);
  color: var(--brand-text);
}

.tp-stepper li.is-done .tp-step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.tp-step-label {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.tp-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-checklist li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
}

.tp-checklist li:last-child {
  border-bottom: none;
}

.tp-checklist li.is-done {
  color: var(--text-muted);
}

.tp-checklist li.is-done .tp-check-label {
  text-decoration: line-through;
}

.tp-check-box {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.tp-checklist li.is-done .tp-check-box {
  color: var(--success);
}

.tp-check-label {
  flex: 1;
}

/* ── DOB History timeline ─────────────────────────────────────────────── */
.tp-dob {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-timeline-item {
  border-left: 2px solid var(--border-default);
  padding-left: 16px;
  position: relative;
}

.tp-timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--border-strong);
}

.tp-timeline-item.is-open {
  border-left-color: var(--brand);
}

.tp-timeline-item.is-open::before {
  background: var(--brand);
  border-color: var(--brand);
}

.tp-timeline-head {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.tp-timeline-head:hover {
  background: var(--bg-overlay);
}

.tp-timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.tp-timeline-title {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.tp-timeline-title strong {
  font-weight: 600;
}

.tp-timeline-body {
  padding: 10px 14px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  margin: 4px 0 6px;
  line-height: 1.5;
}

.tp-timeline-body p {
  margin: 0 0 8px;
}

.tp-timeline-body p:last-child {
  margin-bottom: 0;
}

.tp-timeline-body strong {
  color: var(--text-primary);
}

.tp-highlights {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Doc Search — building tiles ──────────────────────────────────────── */
.tp-building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.tp-building-tile {
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: all var(--duration-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-building-tile:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.tp-building-tile.is-active {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.tp-building-tile-all {
  background: var(--bg-overlay);
  border-style: dashed;
}

.tp-building-tile-all.is-active {
  background: var(--brand-subtle);
  border-style: solid;
}

.tp-tile-code {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-tile-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

.tp-tile-kind {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Renovations — rule sets + escrow + confirm row ───────────────────── */
.tp-ruleset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.tp-ruleset-card {
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-ruleset-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-subtle);
}

.tp-ruleset-head strong {
  font-family: var(--font-heading);
  font-size: 14px;
}

.tp-dl-compact > div {
  grid-template-columns: 160px 1fr;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: none;
}

.tp-dl-compact dt {
  font-size: 11px;
}

.tp-escrow-dl > div {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: baseline;
}

.tp-escrow-dl dd {
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: right;
}

.tp-escrow-dl .tp-row-emph {
  padding-top: 8px;
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
}

.tp-escrow-dl .tp-row-emph dt {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
}

.tp-escrow-dl .tp-row-emph dd {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.tp-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--brand-subtle);
  border: 1px solid rgba(227, 59, 37, 0.25);
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-primary);
}

.tp-confirm span {
  flex: 1 1 auto;
}

/* ── Wrapper containers (module-style flex columns) ───────────────────── */
.tp-abatement,
.tp-contracts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Generic callouts (info + success variants) ───────────────────────── */
.tp-callout {
  padding: 12px 16px;
  background: var(--brand-subtle);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.tp-callout strong {
  color: var(--text-primary);
}

.tp-callout-ok {
  background: var(--success-subtle);
  border-left-color: var(--success);
}

/* ── Email preview (Arrears) ──────────────────────────────────────────── */
.tp-panel-email-preview {
  background: var(--bg-overlay);
  border: 1px dashed var(--border-strong);
}

.tp-email-meta {
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.tp-email-meta strong {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

.tp-email-body {
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
}

.tp-email-body p {
  margin: 0 0 10px;
}

.tp-email-body p:last-child {
  margin-bottom: 0;
}

.tp-email-body strong {
  color: var(--text-primary);
}

.tp-table-compact {
  font-size: 12px;
  margin: 8px 0;
}

.tp-table-compact th, .tp-table-compact td {
  padding: 6px 8px;
}

/* ── Ladder body (Arrears escalation) ─────────────────────────────────── */
.tp-ladder-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}

.tp-ladder-body strong {
  color: var(--brand-text);
  margin-right: 4px;
}

/* ── Print & Mail: PDF overlay (theme-aware chrome, paper stays paper) ── */
.tp-pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 12, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  z-index: 9999;
  overflow: auto;
}

.tp-pdf-toolbar {
  background: var(--bg-raised);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  width: 760px;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-default);
}

.tp-pdf-page {
  background: #ffffff;
  color: #151617;
  width: 760px;
  max-width: 100%;
  min-height: 980px;
  padding: 72px;
  font-family: var(--font-body);
  line-height: 1.55;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.tp-pdf-page p {
  margin: 0 0 12px;
}

.tp-pdf-page strong {
  color: #151617;
}

/* Letter header — split address-left, date-right, shared by .tp-letter and .tp-pdf-page */
.tp-letter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 16px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.4;
}

.tp-letter .tp-letter-header {
  border-bottom-color: rgba(227, 59, 37, 0.6);
}

.tp-letter-date {
  text-align: right;
  color: #555;
  white-space: nowrap;
  font-size: 12px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .tp-pdf-page, .tp-pdf-page * {
    visibility: visible;
  }
  .tp-pdf-overlay {
    position: static;
    background: transparent;
    padding: 0;
  }
  .tp-pdf-toolbar, .tp-print-hide {
    display: none !important;
  }
  .tp-pdf-page {
    box-shadow: none;
    padding: 0;
  }
}
/* ── Dark-mode tuning ─────────────────────────────────────────────────── */
[data-theme=dark] .tp-letter {
  border-color: rgba(42, 37, 32, 0.45); /* softer edge against paper tone */
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

[data-theme=dark] .tp-row-warn {
  background: rgba(232, 181, 71, 0.08);
}

[data-theme=dark] .tp-row-bad {
  background: rgba(229, 92, 70, 0.1);
}

[data-theme=dark] .tp-contact-banner {
  background: rgba(201, 147, 95, 0.12);
  border-color: rgba(201, 147, 95, 0.3);
}

[data-theme=dark] .tp-contact-banner.is-overdue {
  background: rgba(232, 181, 71, 0.12);
  border-color: rgba(232, 181, 71, 0.35);
}

[data-theme=dark] .tp-confirm {
  border-color: rgba(227, 59, 37, 0.4);
}

@media (max-width: 1100px) {
  .tp-app {
    grid-template-columns: 1fr;
  }
  .tp-sidebar {
    position: static;
    height: auto;
  }
  .tp-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .tp-nav-item {
    flex: 1 1 auto;
  }
  .tp-dash-split, .tp-resident-grid {
    grid-template-columns: 1fr;
  }
  .tp-kpis-4, .tp-kpis-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* ============================================================================
   AI-READY WEBSITE DEMO — Serenity Cove spa site + agent/inspector panels
   Spa branding is fictional-client (warm cream / charcoal / clay) and is
   scoped under .spa-site. Demo chrome (landing, panels) uses Attain tokens.
   ========================================================================= */
.spa-site {
  --sc-bg: #faf6f0;
  --sc-surface: #ffffff;
  --sc-ink: #2b2a28;
  --sc-muted: #7a736a;
  --sc-accent: #c96f4a;
  --sc-accent-dark: #a8542f;
  --sc-border: #e8e0d4;
  background: var(--sc-bg);
  color: var(--sc-ink);
  font-family: "Inter", sans-serif;
  min-height: 100vh;
}
.spa-site h1, .spa-site h2, .spa-site h3 {
  font-family: "Cormorant Garamond", "Encode Sans", serif;
  font-weight: 600;
}
.spa-site .spa-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
}
.spa-site .spa-nav .spa-logo {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  font-weight: 700;
}
.spa-site .spa-nav a {
  color: var(--sc-ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.spa-site .spa-nav a:hover, .spa-site .spa-nav a.active {
  color: var(--sc-accent);
}
.spa-site .spa-nav .spa-nav-spacer {
  flex: 1;
}
.spa-site .spa-persona-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 2rem;
  background: #efe7da;
  font-size: 0.85rem;
}
.spa-site .spa-persona-bar select {
  border: 1px solid var(--sc-border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
}
.spa-site .spa-hero {
  padding: 4rem 2rem;
  text-align: center;
}
.spa-site .spa-hero h1 {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
}
.spa-site .spa-hero .spa-tagline {
  color: var(--sc-muted);
  font-size: 1.2rem;
}
.spa-site .spa-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem;
}
.spa-site .spa-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.spa-site .spa-card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.spa-site .spa-card .spa-card-meta {
  color: var(--sc-muted);
  font-size: 0.85rem;
}
.spa-site .spa-card .spa-price {
  font-weight: 600;
  color: var(--sc-accent-dark);
}
.spa-site .spa-card .spa-card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
}
.spa-site .spa-btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  background: var(--sc-accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
}
.spa-site .spa-btn:hover {
  background: var(--sc-accent-dark);
}
.spa-site .spa-btn.spa-btn-outline {
  background: transparent;
  color: var(--sc-accent-dark);
  border: 1px solid var(--sc-accent);
}
.spa-site .spa-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.spa-site .spa-faq details {
  border-bottom: 1px solid var(--sc-border);
  padding: 0.75rem 0;
}
.spa-site .spa-faq summary {
  cursor: pointer;
  font-weight: 600;
}
.spa-site .spa-faq p {
  color: var(--sc-muted);
  margin-top: 0.5rem;
}
.spa-site .spa-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}
.spa-site .spa-form-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.spa-site .spa-form-row label select, .spa-site .spa-form-row label input {
  padding: 0.45rem;
  border: 1px solid var(--sc-border);
  border-radius: 6px;
}
.spa-site .spa-slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.spa-site .spa-slot-grid .spa-slot {
  border: 1px solid var(--sc-accent);
  background: transparent;
  color: var(--sc-accent-dark);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.spa-site .spa-slot-grid .spa-slot:hover, .spa-site .spa-slot-grid .spa-slot.selected {
  background: var(--sc-accent);
  color: #fff;
}
.spa-site .spa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.spa-site .spa-table th, .spa-site .spa-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--sc-border);
}
.spa-site .spa-table .cancelled {
  color: var(--sc-muted);
  text-decoration: line-through;
}
.spa-site .spa-confirmation {
  background: #eef5ec;
  border: 1px solid #c9dcc4;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}
.spa-site .spa-error {
  background: #f8e9e4;
  border: 1px solid #e0b7a8;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.spa-site .spa-footer {
  padding: 2rem;
  text-align: center;
  color: var(--sc-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--sc-border);
  margin-top: 3rem;
}

/* ── Demo chrome: floating panel toggles + slide-over panels ──────────────── */
.aiweb-panel-toggles {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.aiweb-panel-toggles button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  background: var(--color-ink, #151617);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.aiweb-panel-toggles button:hover {
  background: #e33b25;
}

.aiweb-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  z-index: 70;
  background: var(--color-surface, #fff);
  color: var(--color-ink, #151617);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.aiweb-panel .aiweb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.aiweb-panel .aiweb-panel-head h3 {
  margin: 0;
  font-size: 1rem;
}
.aiweb-panel .aiweb-panel-head button {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}
.aiweb-panel .aiweb-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
}
.aiweb-panel .aiweb-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1.1rem 0;
}
.aiweb-panel .aiweb-tabs button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
}
.aiweb-panel .aiweb-tabs button.active {
  border-bottom-color: #e33b25;
  font-weight: 600;
}
.aiweb-panel pre {
  background: #151617;
  color: #e8e6e3;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ── Scripted agent chat ──────────────────────────────────────────────────── */
.aiweb-agent .agent-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.aiweb-agent .agent-controls select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem;
}
.aiweb-agent .agent-chat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.aiweb-agent .agent-bubble {
  max-width: 88%;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font-size: 0.88rem;
}
.aiweb-agent .agent-bubble.user {
  align-self: flex-end;
  background: #e33b25;
  color: #fff;
}
.aiweb-agent .agent-bubble.agent {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.06);
}
.aiweb-agent .agent-bubble.typing {
  align-self: flex-start;
  color: #888;
  font-style: italic;
}
.aiweb-agent .agent-toolcall {
  align-self: stretch;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 3px solid #e33b25;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}
.aiweb-agent .agent-toolcall .tc-name {
  font-weight: 700;
}
.aiweb-agent .agent-toolcall .tc-io {
  color: #777;
  word-break: break-all;
}
.aiweb-agent .agent-result {
  align-self: stretch;
  background: #eef5ec;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
}

/* ── Activity feed + landing page ─────────────────────────────────────────── */
.aiweb-landing .pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.aiweb-landing .pillar {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 1.1rem;
}
.aiweb-landing .pillar h3 {
  margin-top: 0;
}
.aiweb-landing .endpoint-card {
  background: #151617;
  color: #e8e6e3;
  border-radius: 10px;
  padding: 1.1rem;
  margin: 1.5rem 0;
}
.aiweb-landing .endpoint-card code, .aiweb-landing .endpoint-card pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}
.aiweb-landing .endpoint-card pre {
  background: rgba(255, 255, 255, 0.07);
  padding: 0.6rem;
  border-radius: 6px;
  overflow-x: auto;
}

.aiweb-activity .activity-entry {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 0.82rem;
}
.aiweb-activity .activity-entry .chip {
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.aiweb-activity .activity-entry .chip.mcp {
  background: #e33b25;
}
.aiweb-activity .activity-entry .chip.webmcp {
  background: #8a4fbf;
}
.aiweb-activity .activity-entry .chip.agent {
  background: #c96f4a;
}
.aiweb-activity .activity-entry .chip.site {
  background: #6b6b6b;
}
.aiweb-activity .activity-entry .tool {
  font-family: "JetBrains Mono", monospace;
}
.aiweb-activity .activity-entry .result {
  color: #777;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 30rem;
}
.aiweb-activity .activity-entry.failed .tool {
  color: #b3261e;
}
.aiweb-activity .activity-empty {
  color: #888;
  font-style: italic;
  padding: 1rem 0;
}

/* ===== Syncfusion Theme Overrides ===== */
/* SfChart/SfCircularGauge are pinned to the Bootstrap5Dark theme, which bakes
   light-grey label fills and gridline strokes into the SVG via inline attrs.
   Replace them with design tokens so the chrome reads correctly in BOTH modes
   (tokens re-resolve per mode automatically — no [data-theme] scope needed).
   !important is required to beat Syncfusion's inline style="fill:..." rules.

   Data-series fills and gauge range/pointer colors are NOT touched here —
   they're already tuned to read in both modes. */
.e-chart text,
.e-chart tspan,
.e-accumulationchart text,
.e-accumulationchart tspan,
.e-circulargauge text,
.e-circulargauge tspan {
  fill: var(--text-secondary) !important;
}

.e-chart .e-title,
.e-chart .e-title tspan,
.e-chart .e-subtitle,
.e-chart .e-subtitle tspan {
  fill: var(--text-primary) !important;
}

/* Axis lines, gridlines, tick marks */
.e-chart .e-gridline,
.e-chart .e-axis-line,
.e-chart .e-majortick-line,
.e-chart .e-minortick-line,
.e-chart path[id*=GridLine],
.e-chart path[id*=AxisLine],
.e-chart line[id*=GridLine],
.e-chart line[id*=AxisLine] {
  stroke: var(--border-default) !important;
  opacity: 1;
}

/* Legend icons sometimes render as paths/rects with inline stroke */
.e-chart .e-legend-icon {
  stroke: var(--border-default) !important;
}

/* Tooltip: Syncfusion renders an HTML div with inline bg; force readable fill */
.e-tooltip-wrap {
  background: var(--bg-raised) !important;
  border: 1px solid var(--border-default) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-md) !important;
}

.e-tooltip-wrap text,
.e-tooltip-wrap tspan {
  fill: var(--text-primary) !important;
}

/* Circular gauge — axis labels sit outside the ring */
.e-circulargauge .e-label {
  fill: var(--text-secondary) !important;
}

/* ===== Responsive Breakpoints ===== */
/* Tablet */
@media (max-width: 1024px) {
  .demo-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .fr-charts-row {
    grid-template-columns: 1fr;
  }
  .fr-bottom-grid {
    grid-template-columns: 1fr;
  }
  .ed-main {
    grid-template-columns: 1fr;
  }
  .ed-kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .ed-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ed-detail-grid {
    grid-template-columns: 1fr;
  }
  .cs-panes--with-rail {
    grid-template-columns: 1fr 1fr;
  }
  .cs-rail {
    display: none;
  }
}
/* Mobile */
@media (max-width: 768px) {
  :root {
    --topbar-height: 56px;
  }
  .top-bar {
    padding: 0 var(--space-md);
  }
  .top-bar .brand-logo {
    height: 24px;
  }
  .content {
    padding: var(--space-md);
  }
  .catalog-header h1 {
    font-size: var(--text-2xl);
  }
  .demo-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .demo-detail {
    max-width: 100%;
  }
  .password-prompt {
    margin: var(--space-xl) var(--space-md);
    padding: var(--space-lg);
  }
  .wizard-steps {
    gap: var(--space-xs);
  }
  .wizard-step-indicator {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .field-sidebar {
    position: static;
    max-height: none;
  }
  .fr-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .fr-create-panel,
  .fr-detail-panel {
    width: 100%;
    max-width: 100vw;
  }
  .ed-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .ed-card-grid {
    grid-template-columns: 1fr;
  }
  .cs-panes {
    grid-template-columns: 1fr;
  }
  .cs-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cs-header__center,
  .cs-header__right {
    justify-self: start;
  }
  .kb-msg {
    max-width: 90%;
  }
}
/* Small mobile */
@media (max-width: 480px) {
  .fr-kpi-row {
    grid-template-columns: 1fr;
  }
  .ed-kpi-strip {
    grid-template-columns: 1fr;
  }
  .font-picker {
    flex-direction: column;
  }
}
/* ===== Accessibility ===== */
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .demo-card:hover {
    transform: none;
  }
  .btn-primary:hover {
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
/* High contrast */
@media (forced-colors: active) {
  .demo-card {
    border: 2px solid CanvasText;
  }
  .btn-primary {
    border: 2px solid ButtonText;
  }
  .wizard-step-indicator.active {
    border: 2px solid Highlight;
  }
}
/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ============================================================================
   ATTAIN DEMOS — Design System
   ============================================================================
   Light-first design with dark mode via [data-theme="dark"].
   Brand accent: #e33b25 (Attain red).
   Fonts: Encode Sans (headings), Inter (body), JetBrains Mono (code).

   Compiled by sass (MSBuild BeforeBuild target) to wwwroot/css/app.css.
   Do NOT edit wwwroot/css/app.css directly — edit the SCSS partials.
   ========================================================================= */
