:root {
  /* Colors - Refined Light Premium Palette */
  --brand-primary: #f8fafc;
  --brand-accent: #4f46e5;
  --brand-accent-glow: rgba(79, 70, 229, 0.15);
  --brand-active: #4338ca;
  --brand-light: #ffffff;
  --brand-neon: #6366f1;

  --bg-body: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-input: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-light: rgba(203, 213, 225, 0.8);
  --border-glass: rgba(255, 255, 255, 0.6);
  --border-focus: var(--brand-accent);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  /* Shadows - Subtle & Clean */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px var(--brand-accent-glow);

  /* Utils */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --glass-blur: 24px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Three.js Background Container */
#three-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  pointer-events: none;
}

/* AI Aura Blobs - Refined for Light Mode */
.ai-aura-blob {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  filter: blur(100px);
  z-index: -1;
  top: -300px;
  right: -300px;
  pointer-events: none;
  animation: aura-float 25s infinite alternate ease-in-out;
}

.ai-aura-blob--2 {
  top: auto;
  bottom: -400px;
  left: -300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  animation-delay: -8s;
}

@keyframes aura-float {
  0% {
    transform: translate(0, 0) scale(1.0);
  }

  50% {
    transform: translate(100px, 150px) scale(1.2);
  }

  100% {
    transform: translate(-50px, 100px) scale(1.1);
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  min-height: 80px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.app-header__content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-sub {
  color: var(--brand-neon);
  /* Neon for better visibility */
  font-weight: 500;
  opacity: 1;
  /* Full opacity for sub-text */
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-active));
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--brand-accent-glow), inset 0 0 10px rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.app-header__logo:hover .logo-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 30px var(--brand-accent);
}

.app-nav-details {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
}

.app-nav-toggle {
  margin-left: auto;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.app-nav-details>summary {
  list-style: none;
}

.app-nav-details>summary::-webkit-details-marker {
  display: none;
}

.app-nav-toggle:hover {
  border-color: var(--brand-active);
  color: var(--brand-active);
}

.app-nav {
  display: flex;
  gap: 1.75rem;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.app-header__actions form {
  margin: 0;
}

.impersonation-banner {
  background: var(--warning-bg);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.impersonation-banner__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.impersonation-banner__content form {
  margin: 0;
}

.impersonation-banner__text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
  min-width: 220px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0.25rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-accent);
  transition: var(--transition);
  box-shadow: 0 0 10px var(--brand-accent-glow);
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.user-pill--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.user-pill--link:hover {
  background: var(--bg-card);
  border-color: var(--brand-accent);
  box-shadow: 0 0 15px var(--brand-accent-glow);
  transform: translateY(-1px);
}

@media (min-width: 900px) {
  .app-nav-toggle {
    display: none;
  }

  /* Ensure nav is visible even if details isn't "open" (override UA rule). */
  details.app-nav-details:not([open])>nav.app-nav {
    display: flex;
  }
}

@media (max-width: 899px) {
  .app-nav-details {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
  }

  .app-nav {
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.5rem 1.25rem;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--shadow-lg);
  }

  details.app-nav-details[open]>nav.app-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 1500;
  }

  .nav-link {
    padding: 0.85rem 0.5rem;
  }

  .nav-link.active::after {
    display: none;
  }

  .user-pill {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-header__logo {
    font-size: 1.1rem;
  }

  .logo-sub {
    display: none;
  }
}

.page {
  min-height: calc(100vh - 72px);
  padding: 4rem 1.5rem;
  background: transparent;
}

* {
  box-sizing: border-box;
}

/* Layout */
.page {
  min-height: 100vh;
  padding: 3rem 1.5rem;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent),
    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.03), transparent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin-top: 0;
}

h1 {
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--text-primary);
}

h2 {
  font-weight: 600;
  font-size: 1.5rem;
}

h3 {
  font-weight: 600;
  font-size: 1.25rem;
}

/* Grid System */
.grid {
  display: grid;
  gap: 2rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), var(--shadow-lg);
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.4);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
  opacity: 0.3;
  transition: var(--transition);
}

.card:hover::before {
  opacity: 1;
  height: 4px;
}

/* Customer Portal & Portal Hero */
.customer-portal {
  padding-bottom: 5rem;
}

.portal-hero {
  margin-bottom: 3rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.portal-hero h1 {
  font-size: 3rem;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.portal-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.portal-grid {
  margin-top: 2rem;
  gap: 2rem;
}

/* Timeline & Lists */
.timeline,
.task-list,
.message-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.timeline-item,
.task-row,
.message-row {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.timeline-item:hover,
.task-row:hover,
.message-row:hover {
  background: #ffffff;
  border-color: var(--brand-accent);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.timeline-title,
.task-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.timeline-meta,
.task-meta,
.message-meta {
  font-size: 0.85rem;
  color: var(--brand-neon);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.timeline-body,
.message-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.status-description {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-style: italic;
  border-left: 4px solid var(--brand-accent);
}

.status-description:empty {
  display: none;
}

.portal-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* Primary Button - Neon Overhaul */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--brand-accent);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-family: var(--font-heading);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.primary-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.primary-button:hover {
  background: var(--brand-active);
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

.primary-button:hover::after {
  opacity: 1;
  transform: translate(20%, 20%);
}

.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  color: #334155;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid #dbe5f2;
  font-size: 0.85rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-white:hover {
  background: #f8fbff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: #475569;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.secondary-button:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

/* Collapsible Card (details/summary) */
details.card.collapsible-card {
  padding: 0;
}

details.card.collapsible-card>summary {
  list-style: none;
}

details.card.collapsible-card>summary::-webkit-details-marker {
  display: none;
}

.collapsible-card__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding: 2rem 2.5rem;
}

.collapsible-card__summary:focus-visible {
  outline: 2px solid var(--brand-active);
  outline-offset: 3px;
  border-radius: var(--radius-lg);
}

.collapsible-card__title {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.collapsible-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.collapsible-card__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.collapsible-card[open] .collapsible-card__chevron {
  transform: rotate(180deg);
  border-color: var(--brand-active);
  color: var(--brand-active);
}

.collapsible-card__body {
  padding: 1.75rem 2.5rem 2.5rem;
  border-top: 1px solid var(--border-light);
}

@media (max-width: 640px) {
  .collapsible-card__summary {
    padding: 1.5rem 1.5rem;
  }

  .collapsible-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
  }
}

/* Form Styles */
.claims-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Form Elements - Global Revolution */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 1.125rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) hue-rotate(170deg) brightness(1.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
  transform: scale(1.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 1.25rem;
  padding-right: 3.5rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--brand-accent);
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.field label,
.field span {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-neon);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.8;
}

.field input[type="file"] {
  padding: 0.875rem 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.field input[type="file"]::file-selector-button {
  background: var(--brand-accent);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  margin-right: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 15px var(--brand-accent-glow);
}

.field input[type="file"]:hover::file-selector-button {
  background: var(--brand-active);
  transform: scale(1.02);
}

.permalink-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.permalink-link {
  flex: 1;
  min-width: 12rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--brand-light);
  color: var(--text-primary);
  text-decoration: none;
  word-break: break-word;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  transition: var(--transition);
}

.permalink-link:hover {
  background: white;
  border-color: var(--brand-accent);
}

.permalink-link.is-empty {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-sans);
}

/* Buttons */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--brand-accent);
  color: #ffffff;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.primary-button:hover {
  background: var(--brand-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-button:disabled:hover {
  background: var(--brand-primary);
  transform: none;
  box-shadow: none;
}

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

/* Document Cards */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  gap: 1rem;
  background: #fbfcfe;
  transition: var(--transition);
}

.doc-card:hover {
  border-color: var(--brand-active);
  background: white;
}

.doc-select-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  cursor: pointer;
}

.doc-toggle {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.doc-meta {
  display: flex;
  flex-direction: column;
}

.doc-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Legacy status-description removed in favor of portal-specific styles */

.doc-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.doc-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.doc-link:hover {
  background: var(--brand-light);
}

.relevant-pages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.relevant-pages-header h4 {
  margin: 0;
}

.relevant-pages-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.relevant-page-card {
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: zoom-in;
}

.relevant-page-card img {
  width: 100%;
  height: auto;
  display: block;
}

.relevant-page-meta {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.relevant-page-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.secondary-button.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.secondary-button.is-loading .lucide-loader-2,
.status-pill[data-state="loading"] .lucide-loader-2 {
  animation: icon-spin 1s linear infinite;
  transform-origin: 50% 50%;
}

.relevant-pages-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.relevant-pages-modal.is-open {
  display: flex;
}

.relevant-pages-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.relevant-pages-modal-content {
  position: relative;
  z-index: 1;
  max-width: min(1400px, 96vw);
  max-height: 94vh;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: auto;
}

.relevant-pages-modal-content img {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.relevant-pages-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 1px solid var(--border-glass);
  background: #ffffff;
  color: var(--text-primary);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.relevant-pages-modal-caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .relevant-pages-list {
    grid-template-columns: 1fr;
  }
}

/* Suggestions */
.field-with-suggestions {
  position: relative;
}

.address-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.suggestion-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 0.5rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.suggestion-list.active {
  display: flex;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9375rem;
}

.suggestion-item:hover {
  background: #f1f5f9;
}

/* Status & Summary */
.claims-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.claims-summary-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fbfcfe;
  padding: 1rem;
}

.claims-summary-card--conclusion {
  grid-column: 1 / -1;
  border-color: rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.claims-summary-card--wide {
  grid-column: span 2;
}

.claims-summary-card h4 {
  margin-bottom: 0.65rem;
}

.claims-summary-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.claims-summary-text--strong {
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.claims-summary-list {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

.claims-summary-list li.empty {
  list-style: none;
  margin-left: -1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

.claims-summary-list--ordered {
  padding-left: 1.2rem;
}

.claims-doc-label {
  font-weight: 600;
  color: var(--text-primary);
}

.claims-page-highlight {
  background: rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-weight: 700;
  color: #7a4b00;
}

.retry-analysis-btn {
  margin-top: 0.75rem;
}

@media (max-width: 1100px) {
  .claims-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .claims-summary-card--wide {
    grid-column: span 2;
  }

  .claims-summary-card--conclusion {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .claims-summary {
    grid-template-columns: 1fr;
  }

  .claims-summary-card--wide {
    grid-column: span 1;
  }

  .claims-summary-card--conclusion {
    grid-column: span 1;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.progress-container {
  width: 100%;
  height: 8px;
  background-color: var(--brand-light);
  border-radius: var(--radius-full);
  margin-top: 1rem;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-active));
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
  box-shadow: 0 0 10px var(--brand-accent-glow);
}

.status-pill[data-state="loading"] {
  background: var(--bg-card);
  color: var(--brand-neon);
  border-color: var(--brand-accent);
  box-shadow: 0 0 15px var(--brand-accent-glow);
}

.status-pill[data-state="success"] {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill[data-state="error"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill[data-state="warning"] {
  background: var(--warning-bg);
  color: var(--warning);
}

/* AI Output Styling */
.claims-output-container {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.claims-output-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 70%);
  pointer-events: none;
}

.markdown-content {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.markdown-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--brand-light);
  padding-bottom: 0.75rem;
  font-family: var(--font-heading);
}

.markdown-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  font-family: var(--font-heading);
}

.markdown-content p {
  margin-bottom: 1.25rem;
}

.markdown-content strong {
  color: var(--text-primary);
}

.markdown-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.markdown-content th,
.markdown-content td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.markdown-content th {
  background: var(--brand-light);
  font-weight: 600;
  color: var(--brand-primary);
  font-family: var(--font-heading);
}

.markdown-content tr:last-child td {
  border-bottom: none;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.5rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

/* Case Tabs */
.case-tabs {
  margin-top: 1.75rem;
}

.case-tabs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.case-tabs__list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.case-tabs__list::-webkit-scrollbar {
  display: none;
}

.case-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.case-tab:hover {
  border-color: var(--brand-active);
  color: var(--brand-active);
  transform: translateY(-1px);
}

.case-tab.is-active,
.case-tab[aria-selected="true"] {
  background: #333;
  border-color: #333;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.case-tab .lucide {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.case-tabs__actions {
  flex-shrink: 0;
}

.case-tabs__panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-panel[hidden] {
  display: none;
}

.claims-section+.claims-section {
  margin-top: 1.5rem;
}

.missing-docs {
  border: 1px dashed rgba(239, 68, 68, 0.35);
  background: rgba(254, 242, 242, 0.55);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.missing-docs h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.missing-docs-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

/* Complaint Modal */
.complaint-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.complaint-modal.is-open {
  display: flex;
}

.complaint-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.complaint-modal-content {
  position: relative;
  z-index: 1;
  width: min(1400px, 96vw);
  max-height: 92vh;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 1.25rem 1.25rem 1.5rem;
  overflow: auto;
}

.complaint-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.complaint-modal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.complaint-modal-title-row h3 {
  margin: 0.25rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.complaint-modal-close {
  border: 1px solid var(--border-glass);
  background: #ffffff;
  color: var(--text-primary);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.complaint-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.25rem;
  align-items: start;
}

.complaint-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.complaint-text p {
  margin: 0 0 1rem;
}

.claim-highlight {
  background: rgba(245, 158, 11, 0.14);
  border-radius: 6px;
  padding: 0 0.18rem;
  border-bottom: 2px solid rgba(245, 158, 11, 0.35);
  cursor: pointer;
  transition: var(--transition);
}

.claim-highlight:hover {
  background: rgba(59, 130, 246, 0.12);
  border-bottom-color: rgba(59, 130, 246, 0.35);
}

.claim-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.15);
  color: var(--brand-active);
  border: 1px solid rgba(59, 130, 246, 0.25);
  vertical-align: text-top;
}

.complaint-sources {
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.complaint-sources-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.complaint-sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-card {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  transition: var(--transition);
}

.source-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.source-kind-pill {
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--brand-active);
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

.source-card p {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.source-popover {
  position: fixed;
  z-index: 2200;
  max-width: min(520px, 92vw);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  padding: 0.85rem 0.9rem;
  pointer-events: none;
}

.source-popover__title {
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.source-popover__body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .complaint-modal-body {
    grid-template-columns: 1fr;
  }

  .complaint-sources {
    position: static;
  }
}

/* Debug Section */
.debug-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-muted);
}

.debug-content {
  display: none;
  margin-top: 1rem;
}

.debug-content.active {
  display: block;
}

pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  overflow-x: auto;
  line-height: 1.5;
}

/* Admin */
.admin-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  border-bottom: 1px solid var(--border-glass);
  padding: 4rem 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.admin-hero h1 {
  font-size: 3rem;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.admin-hero p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.admin-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.admin-last-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.admin-stat {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.admin-stat:hover {
  border-color: var(--brand-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.admin-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-stat .stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.25rem;
  font-family: var(--font-heading);
}

.case-tabs.admin-tabs {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  padding: 0.1rem 0.9rem;
  border-radius: var(--radius-md);
  min-width: 280px;
  flex: 1;
  transition: var(--transition);
}

.admin-search:focus-within {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.admin-search input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0.65rem 0 !important;
}

.admin-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Form cleanup */
.admin-filters select {
  width: auto;
}

/* Secondary button consolidated above */

.secondary-button.is-disabled,
.secondary-button[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.primary-button.is-disabled,
.primary-button[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.admin-table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  background: var(--bg-card);
}

.admin-table th,
.admin-table td {
  padding: 1.25rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
  font-size: 0.95rem;
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  border-bottom: 2px solid var(--border-glass);
}

.admin-row--running {
  background: rgba(99, 102, 241, 0.05);
  border-left: 4px solid var(--brand-accent);
}

.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.admin-job-id {
  font-weight: 600;
  color: var(--text-primary);
}

.admin-subtle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-files {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  word-break: break-word;
}

.admin-error {
  color: var(--danger);
  font-size: 0.85rem;
  max-width: 320px;
  word-break: break-word;
}

.admin-link {
  color: var(--brand-neon);
  font-weight: 600;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-action {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.admin-role-select {
  min-width: 160px;
  font-size: 0.85rem;
  padding: 0.45rem 2.25rem 0.45rem 0.75rem;
  background-position: right 0.6rem center;
  background-size: 1rem;
}

@media (max-width: 1024px) {
  .admin-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    align-items: stretch;
  }

  .admin-search {
    min-width: 100%;
  }
}

/* Auth */
.auth-page {
  display: flex;
  justify-content: center;
  padding-top: 3rem;
}

.auth-card {
  max-width: 420px;
  width: 100%;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Admin extensions */
.admin-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: #f3f6fb;
  color: #334155;
  border: 1px solid #dbe5f2;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.75rem;
}

.demo-guide {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  margin: 1rem 0;
}

.demo-guide__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--brand-neon);
  margin-bottom: 0.25rem;
}

.demo-switcher {
  position: relative;
}

.demo-switcher>summary {
  list-style: none;
}

.demo-switcher>summary::-webkit-details-marker {
  display: none;
}

.demo-switcher__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.6rem;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 50;
}

.demo-switcher__menu a {
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.demo-switcher__menu a:hover {
  background: rgba(99, 102, 241, 0.12);
}

.demo-hub {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  color: var(--text-primary);
}

.demo-hub-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.demo-hub-hero h1 {
  color: var(--text-primary);
}

.demo-hub h1,
.demo-hub h2,
.demo-hub h3,
.demo-hub h4 {
  color: var(--text-primary);
}

.demo-hub p,
.demo-hub .status-note,
.demo-case-meta__label {
  color: var(--text-secondary);
}

.demo-case-meta__value {
  color: var(--text-primary);
}

.demo-case-picker {
  display: grid;
  gap: 1rem;
}

.demo-case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.demo-case-meta__item {
  min-width: 160px;
}

.demo-case-meta__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.demo-case-meta__value {
  font-size: 1rem;
  font-weight: 600;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.demo-role-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.demo-role-card__header h4 {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
}

.demo-role-card__header p {
  margin: 0;
  color: var(--text-secondary);
}

.demo-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-controls {
  display: grid;
  gap: 0.75rem;
}

.demo-controls__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-login-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.quick-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: grid;
  gap: 0.5rem;
}

/* Handler */
.handler-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.handler-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.25rem;
}

.handler-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.handler-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.dashboard-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.35rem;
}

.handler-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.handler-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.handler-list .case-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-list-item {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
}

.case-list-item:hover {
  border-color: var(--brand-active);
}

.case-list-item.is-active {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.case-list-title {
  font-weight: 600;
}

.case-list-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.case-list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.handler-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.case-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.case-meta-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.case-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.case-sub {
  color: var(--text-secondary);
}

.case-actions {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.case-brief {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--bg-glass);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 1rem;
}

.case-brief__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.case-brief__header h4 {
  margin: 0;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.case-brief__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.case-brief__sections {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .case-brief__sections {
    grid-template-columns: 1fr;
  }
}

.case-brief__section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--bg-card);
}

.case-brief__section h5 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.case-brief__section .markdown-content {
  font-size: 0.95rem;
  line-height: 1.6;
}

.case-assessments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.assessment-list {
  display: grid;
  gap: 0.75rem;
}

.case-split {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.task-list,
.message-list,
.decision-list,
.payment-list,
.flag-list,
.timeline {
  display: grid;
  gap: 0.75rem;
}

/* Legacy rows consolidated into portal styles */
.decision-row,
.payment-row,
.flag-row {
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.inline-form input,
.inline-form select,
.inline-form textarea {
  flex: 1;
  min-width: 160px;
}

.case-ai {
  display: grid;
  gap: 0.75rem;
}

.ai-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.case-ai textarea {
  width: 100%;
  min-height: 120px;
}

/* Customer portal */
.customer-portal {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.portal-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.25rem;
}

.portal-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.portal-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .handler-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  .handler-hero,
  .portal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Claims Process Flow */
.process-flow {
  margin-top: 3.5rem;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f7f9ff 0%, #eef3ff 100%);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.process-flow__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.process-flow__eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.process-flow__lede {
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  max-width: 640px;
}

.process-flow__muted {
  color: var(--text-muted);
  font-weight: 500;
}

.process-flow__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.process-flow__lang-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.process-flow__lang-btn.is-active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.process-flow__lang-btn:focus-visible {
  outline: 2px solid var(--brand-active);
  outline-offset: 2px;
}

.process-flow__body {
  margin-top: 2rem;
  display: grid;
  gap: 2rem;
}

.process-flow__start {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.process-flow__tag {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--brand-light);
  color: var(--brand-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.process-flow__phases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.process-phase {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.process-phase__header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.process-phase__index {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.process-phase__header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.process-phase__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.process-phase__list strong {
  color: var(--text-primary);
}

.process-sublist {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.process-decision {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.process-rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin-left: -1.1rem;
}

.decision-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.decision-yes {
  color: var(--success);
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.3);
}

.decision-no {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
}

.decision-if {
  color: var(--brand-primary);
  background: var(--brand-light);
  border-color: rgba(31, 59, 115, 0.2);
}

.process-flow__rules {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.process-flow__rules h3 {
  margin-top: 0;
}

.process-flow__table-wrap {
  overflow-x: auto;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rules-table th,
.rules-table td {
  border: 1px solid var(--border-light);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
}

.rules-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
}

.process-flow__notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.note-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.note-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.note-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .process-flow {
    padding: 2rem 1.5rem;
  }

  .process-flow__phases {
    grid-template-columns: 1fr;
  }

  .process-flow__notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .process-flow__header {
    align-items: flex-start;
  }

  .process-flow__lang {
    width: 100%;
    justify-content: center;
  }
}

/* Demo Tools Marker */
.demo-marked-area {
  position: relative;
  overflow: hidden;
  background-image: repeating-linear-gradient(45deg,
      rgba(79, 70, 229, 0.03) 0px,
      rgba(79, 70, 229, 0.03) 2px,
      transparent 2px,
      transparent 12px) !important;
  border: 1px dashed var(--brand-accent) !important;
}

.demo-marked-area::after {
  content: "DEMO ONLY CONTENT";
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--brand-accent);
  letter-spacing: 0.1em;
  opacity: 0.5;
  pointer-events: none;
  z-index: 10;
}

.demo-hidden {
  display: none !important;
}

.demo-toggle-container {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.demo-toggle-container:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

.demo-toggle-switch {
  width: 32px;
  height: 18px;
  background: #e2e8f0;
  border-radius: 999px;
  position: relative;
  transition: var(--transition);
}

.demo-toggle-container.is-active .demo-toggle-switch {
  background: var(--brand-accent);
}

.demo-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.demo-toggle-container.is-active .demo-toggle-switch::after {
  transform: translateX(14px);
}
