/**
 * Neo ERP Design System
 * A warm, editorial-inspired design system with distinctive typography and refined interactions.
 * Inspired by Linear, Notion, Stripe, and premium SaaS applications.
 */

/* =============================================================================
   CSS Variables - Design Tokens
   ============================================================================= */

:root {
  /* Primary Colors - Rich Indigo with warm undertones */
  --color-primary-50: #f0f1ff;
  --color-primary-100: #e4e6ff;
  --color-primary-200: #cdcffe;
  --color-primary-300: #a8abfc;
  --color-primary-400: #7c7ff7;
  --color-primary-500: #5856eb;
  --color-primary-600: #4a3ddf;
  --color-primary-700: #3f2fc5;
  --color-primary-800: #3528a0;
  --color-primary-900: #2e267f;
  --color-primary-950: #1b1650;

  /* Neutral Colors - Warmer slate tones */
  --color-gray-50: #fafaf9;
  --color-gray-100: #f5f4f2;
  --color-gray-200: #e8e6e3;
  --color-gray-300: #d6d3cf;
  --color-gray-400: #a8a29e;
  --color-gray-500: #78716c;
  --color-gray-600: #57534e;
  --color-gray-700: #44403c;
  --color-gray-800: #292524;
  --color-gray-900: #1c1917;
  --color-gray-950: #0c0a09;

  /* Accent Colors for visual interest */
  --color-amber: #f59e0b;
  --color-amber-soft: #fef3c7;
  --color-teal: #14b8a6;
  --color-teal-soft: #ccfbf1;
  --color-rose: #f43f5e;
  --color-rose-soft: #ffe4e6;

  /* Semantic Colors */
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;

  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;

  --color-error-50: #fef2f2;
  --color-error-100: #fee2e2;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;
  --color-error-700: #b91c1c;

  --color-info-50: #eff6ff;
  --color-info-100: #dbeafe;
  --color-info-500: #3b82f6;
  --color-info-600: #2563eb;

  /* Spacing Scale */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Typography - Distinctive Font Pairing */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --font-arabic: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  --tracking-tighter: -0.03em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* Shadows - Softer, more refined with optional color tints */
  --shadow-xs: 0 1px 2px 0 rgb(28 25 23 / 0.04);
  --shadow-sm: 0 1px 3px 0 rgb(28 25 23 / 0.06), 0 1px 2px -1px rgb(28 25 23 / 0.06);
  --shadow-md: 0 4px 8px -2px rgb(28 25 23 / 0.08), 0 2px 4px -2px rgb(28 25 23 / 0.04);
  --shadow-lg: 0 12px 24px -4px rgb(28 25 23 / 0.1), 0 4px 8px -2px rgb(28 25 23 / 0.04);
  --shadow-xl: 0 24px 48px -12px rgb(28 25 23 / 0.18);
  --shadow-2xl: 0 32px 64px -16px rgb(28 25 23 / 0.24);
  --shadow-inner: inset 0 2px 4px 0 rgb(28 25 23 / 0.04);

  /* Colored shadows for emphasis */
  --shadow-primary: 0 4px 16px -4px rgb(88 86 235 / 0.35);
  --shadow-success: 0 4px 16px -4px rgb(16 185 129 / 0.35);
  --shadow-warning: 0 4px 16px -4px rgb(245 158 11 / 0.35);
  --shadow-error: 0 4px 16px -4px rgb(239 68 68 / 0.35);

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  /* The scale is four steps: chip, control, card, dialog. Anything else
     makes two cards on the same page look like two products. */
  --radius-card: 0.625rem;   /* 10px */
  --radius-dialog: 0.875rem; /* 14px */
  --radius-full: 9999px;

  /* Transitions - Smooth, natural easing */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --header-height: 64px;
  --content-max-width: 1400px;
}

/* Dark Mode Variables */
.dark {
  --color-gray-50: #18181b;
  --color-gray-100: #27272a;
  --color-gray-200: #3f3f46;
  --color-gray-300: #52525b;
  --color-gray-400: #71717a;
  --color-gray-500: #a1a1aa;
  --color-gray-600: #d4d4d8;
  --color-gray-700: #e4e4e7;
  --color-gray-800: #f4f4f5;
  --color-gray-900: #fafafa;
  --color-gray-950: #ffffff;
}

/* =============================================================================
   Base Styles
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
}

[dir="rtl"] body {
  font-family: var(--font-arabic), var(--font-sans);
}

/* Letter-spacing breaks the joined Arabic script, and a 10px micro-label is
   unreadable in it, whichever template hard-codes them. */
[dir="rtl"] .tracking-wider,
[dir="rtl"] .tracking-widest,
[dir="rtl"] .tracking-\[1\.5px\] {
  letter-spacing: 0;
}

[dir="rtl"] .text-\[10px\] {
  font-size: var(--text-xs);
}

/* A mono uppercase span is the micro-label pattern, never a number. */
[dir="rtl"] .font-mono.uppercase {
  font-family: var(--font-arabic), var(--font-sans);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--color-primary-100);
  color: var(--color-primary-900);
}

/* =============================================================================
   Typography Utilities
   ============================================================================= */

/* Display headings - Use serif display font for editorial feel */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
}

/* Page titles - Serif for important headings */
.text-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  color: var(--color-gray-900);
}

/* Section headers - Sans-serif for UI elements */
.text-heading {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

/* Gradient text effect */
.text-gradient {
  background: var(--color-primary-600);
}

/* Dark mode typography */
.dark .text-display,
.dark .text-title,
.dark .text-title-sm {
  color: var(--color-gray-50);
}

.dark .text-heading,
.dark .text-subheading {
  color: var(--color-gray-100);
}

.dark .text-subtitle {
  color: var(--color-gray-400);
}

.dark .text-label {
  color: var(--color-gray-300);
}

/* =============================================================================
   Button Styles - Enhanced with micro-interactions
   ============================================================================= */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.25;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
  white-space: nowrap;
  user-select: none;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

/* Primary Button - Rich gradient with glow */
.btn-primary {
  background: var(--color-primary-500);
  color: white;
  box-shadow: var(--shadow-sm),
              inset 0 1px 0 rgb(255 255 255 / 0.15),
              0 2px 8px -2px rgb(88 86 235 / 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-400);
  box-shadow: var(--shadow-md),
              inset 0 1px 0 rgb(255 255 255 / 0.2),
              0 8px 20px -4px rgb(88 86 235 / 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-xs),
              inset 0 2px 4px rgb(0 0 0 / 0.1);
}

/* Secondary Button - Clean with subtle border */
.btn-secondary {
  background: white;
  color: var(--color-gray-700);
  border-color: var(--color-gray-200);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  background: var(--color-gray-100);
}

.dark .btn-secondary {
  background: var(--color-gray-800);
  color: var(--color-gray-200);
  border-color: var(--color-gray-700);
}

.dark .btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
}

/* Ghost Button - Minimal */
.btn-ghost {
  background: transparent;
  color: var(--color-gray-600);
}

.dark .btn-ghost {
  color: var(--color-gray-400);
}

.dark .btn-ghost:hover:not(:disabled) {
  background: var(--color-gray-800);
  color: var(--color-gray-100);
}

/* Danger Button - With warning glow */
.btn-danger {
  background: var(--color-error-500);
  color: white;
  box-shadow: var(--shadow-sm), 0 2px 8px -2px rgb(239 68 68 / 0.3);
}

/* Success Button - With positive glow */
.btn-success {
  background: var(--color-success-500);
  color: white;
  box-shadow: var(--shadow-sm), 0 2px 8px -2px rgb(16 185 129 / 0.3);
}

.btn-success:hover:not(:disabled) {
  box-shadow: var(--shadow-md), 0 8px 20px -4px rgb(16 185 129 / 0.4);
}

.btn-success:active:not(:disabled) {
  transform: translateY(0);
}

/* Warning/Amber Button */
.btn-warning {
  background: var(--color-warning-500);
  color: white;
  box-shadow: var(--shadow-sm), 0 2px 8px -2px rgb(245 158 11 / 0.3);
}

.btn-warning:hover:not(:disabled) {
  box-shadow: var(--shadow-md), 0 8px 20px -4px rgb(245 158 11 / 0.4);
}

/* Icon Button */
.btn-icon {
  padding: var(--space-2);
  aspect-ratio: 1;
}

.btn-icon.btn-sm {
  padding: 0.375rem;
}

/* Icon hover animation */
.btn-icon:hover:not(:disabled) svg {
  transition: transform var(--transition-fast);
}

/* Loading state for buttons */
.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}

/* =============================================================================
   Card Styles - Refined with subtle depth
   ============================================================================= */

.card {
  background: white;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.dark .card {
  background: var(--color-gray-800);
  border-color: var(--color-gray-700);
}

.dark .card-header {
  border-color: var(--color-gray-700);
}

.dark .card-header-title {
  color: var(--color-gray-100);
}

.dark .card-footer {
  border-color: var(--color-gray-700);
  background: var(--color-gray-900);
}

/* Elevated Card - Premium floating look */
.card-elevated {
  border: 1px solid var(--color-gray-100);
  box-shadow: var(--shadow-lg);
}

.dark .card-elevated {
  border-color: var(--color-gray-700);
  box-shadow: 0 12px 24px -4px rgb(0 0 0 / 0.3);
}

/* Interactive Card - Lift on hover */
.card-interactive {
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.dark .card-interactive:hover {
  border-color: var(--color-primary-700);
  box-shadow: 0 16px 32px -8px rgb(0 0 0 / 0.4);
}

/* Card with accent border */
.card-accent {
  border-left: 3px solid var(--color-primary-500);
}

/* Glass card effect */
.card-glass {
  background: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgb(255 255 255 / 0.3);
}

.dark .card-glass {
  background: rgb(41 37 36 / 0.8);
  border: 1px solid rgb(255 255 255 / 0.1);
}

/* Card with gradient border */
.card-gradient-border {
  position: relative;
  background: white;
  border: none;
}

/* =============================================================================
   Form Styles - Refined with better focus states
   ============================================================================= */

.form-group {
  margin-bottom: var(--space-5);
}

.dark .form-label {
  color: var(--color-gray-300);
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
  background: var(--color-gray-800);
  border-color: var(--color-gray-600);
  color: var(--color-gray-100);
}

.dark .form-input::placeholder {
  color: var(--color-gray-500);
}

.dark .form-input:hover:not(:disabled):not(:focus) {
  border-color: var(--color-gray-500);
}

.dark .form-input:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgb(88 86 235 / 0.2);
}

/* Input Sizes */
.form-input-sm {
  padding: 0.375rem var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

/* Input States */
.form-input-error {
  border-color: var(--color-error-400);
  background: rgb(254 242 242 / 0.5);
}

.dark .form-input-error {
  background: rgb(254 242 242 / 0.05);
}

/* Help Text */
.form-help {
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  line-height: var(--leading-relaxed);
}

/* Input with Icon */
.input-group {
  position: relative;
}

/* Floating label variant */
.form-floating {
  position: relative;
}

/* Checkbox & Radio refined */
.form-checkbox,
.form-radio {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-gray-300);
  background: white;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.dark .form-checkbox,
.dark .form-radio {
  background: var(--color-gray-700);
  border-color: var(--color-gray-500);
}

/* =============================================================================
   Table Styles - Clean, refined with hover effects
   ============================================================================= */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-gray-200);
  background: white;
}

.dark .table-container {
  border-color: var(--color-gray-700);
  background: var(--color-gray-800);
}

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

.table th {
  padding: 0.875rem var(--space-4);
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-gray-500);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  white-space: nowrap;
}

[dir="rtl"] .table th {
  text-align: right;
  letter-spacing: 0;
}

.dark .table th {
  background: var(--color-gray-900);
  color: var(--color-gray-400);
  border-color: var(--color-gray-700);
}

.table td {
  padding: 0.875rem var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  color: var(--color-gray-700);
  vertical-align: middle;
}

.dark .table td {
  border-color: var(--color-gray-700);
  color: var(--color-gray-300);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--color-gray-50);
}

.dark .table tbody tr:hover {
  background: var(--color-gray-700);
}

/* Table row clickable */
.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover {
  background: rgb(88 86 235 / 0.04);
}

.dark .table tbody tr.clickable:hover {
  background: rgb(88 86 235 / 0.1);
}

/* Selected row */
.table tbody tr.selected {
  background: rgb(88 86 235 / 0.06);
}

.dark .table tbody tr.selected {
  background: rgb(88 86 235 / 0.15);
}

/* Sortable Headers */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.table th.sortable:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

.dark .table th.sortable:hover {
  background: var(--color-gray-800);
  color: var(--color-gray-300);
}

.table th.sorted {
  color: var(--color-primary-600);
}

/* Sticky Header */
.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--color-gray-200);
}

.dark .table-sticky thead th {
  box-shadow: 0 1px 0 var(--color-gray-700);
}

/* A list wider than its card scrolls inside the card, never the page, and keeps its last column (the row's
   actions) in view. Positioned so an absolute child (an sr-only label) cannot widen the page past it. */
.table-scroll {
  position: relative;
  overflow-x: auto;
  max-width: 100%;
}

.table-scroll > table > :is(thead, tbody, tfoot) > tr > :last-child:not([colspan]) {
  position: sticky;
  inset-inline-end: 0;
  z-index: 1;
  background-color: var(--card);
}

.table-scroll > table > thead > tr > :last-child:not([colspan]),
.table-scroll > table > tbody > tr:hover > :last-child:not([colspan]) {
  background-color: var(--surface);
}

.dark .table-scroll > table > :is(thead, tbody, tfoot) > tr > :last-child:not([colspan]) {
  background-color: var(--dark-card);
}

.dark .table-scroll > table > thead > tr > :last-child:not([colspan]),
.dark .table-scroll > table > tbody > tr:hover > :last-child:not([colspan]) {
  background-color: color-mix(in srgb, var(--dark-line) 50%, var(--dark-card));
}

/* Numeric Columns */
.table td.numeric,
.table th.numeric {
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Amount Columns */
.amount {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Primary cell content */
.table td.primary {
  font-weight: 500;
  color: var(--color-gray-900);
}

.dark .table td.primary {
  color: var(--color-gray-100);
}

/* Secondary/muted cell content */
.table td.secondary {
  color: var(--color-gray-500);
  font-size: 0.8125rem;
}

/* Compact table variant */
.table-compact th,
.table-compact td {
  padding: 0.625rem var(--space-3);
}

/* Striped table */
.table-striped tbody tr:nth-child(even) {
  background: var(--color-gray-50);
}

.dark .table-striped tbody tr:nth-child(even) {
  background: var(--color-gray-900);
}

/* Borderless variant */
.table-borderless td {
  border-bottom: none;
}

/* Table with row dividers only */
.table-divided th {
  background: transparent;
  border-bottom: 2px solid var(--color-gray-200);
}

/* =============================================================================
   Badge Styles - Refined with subtle animations
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

/* Dark mode badges */
.dark .badge-gray {
  background: var(--color-gray-700);
  color: var(--color-gray-300);
}

.dark .badge-primary {
  background: rgb(88 86 235 / 0.2);
  color: var(--color-primary-400);
}

.dark .badge-success {
  background: rgb(16 185 129 / 0.2);
  color: var(--color-success-400);
}

.dark .badge-warning {
  background: rgb(245 158 11 / 0.2);
  color: var(--color-warning-400);
}

.dark .badge-error {
  background: rgb(239 68 68 / 0.2);
  color: var(--color-error-400);
}

/* Outlined badge variant */
.badge-outlined {
  background: transparent;
  border: 1px solid currentColor;
}

/* Dot Badge with pulse animation for active states */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Money — the {% money %} tag's markup.
   Symbol and digits must not break apart across a line, nor reorder with the text around them. */
.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

/* A symbol is the amount's unit, not part of its value, so it reads one step
   down from the digits. Same colour and weight: a muted symbol in a totals row
   hides what the figure is denominated in. */
.money-symbol {
  font-size: 0.78em;
}

/* Narrower than the space the symbol's own size would give it. */
.money-gap {
  font-size: 0.7em;
}

.money-symbol svg {
  height: 1em;
  width: auto;
  vertical-align: -0.1em;
  display: inline-block;
}

/* Navigation progress — static/js/loading.js drives it. Brand ink, so it reads
   on the light header (volt on white is 1.32:1) and turns volt on dark. */
.neo-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  z-index: 10000;
  height: 3px;
  width: 0;
  background: var(--brand-ink);
  opacity: 0;
  pointer-events: none;
  transition: width 200ms ease-out, opacity 150ms ease;
}

.neo-progress.is-active {
  opacity: 1;
}

.neo-progress.is-done {
  opacity: 0;
  transition: width 150ms ease-out, opacity 250ms ease 150ms;
}

/* The browser's date and time glyph is sized from the 14px control font; at that size it is hard to hit. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ---- Campaign hub (storefront/campaigns/hub) --------------------------------------------------------------
   The timeline is one grid per row: a sticky label column and a track the bars sit on. Positions are unitless
   day offsets in --s/--l over --n days, laid out with logical insets, so Arabic mirrors without a second rule. */
.ch, .ch-pill {
  --ch-card: var(--card); --ch-line: var(--line); --ch-line2: var(--line-strong); --ch-bg: var(--surface);
  --ch-ink: var(--carbon); --ch-ink2: var(--ink-2); --ch-muted: var(--fog); --ch-accent: var(--volt);
  --ch-on-accent: var(--carbon); --ch-past: var(--line); --ch-hover: #EEEEEA; --ch-accent-soft: #F1FAC4;
  --ch-alert: var(--alert); --ch-alert-soft: #FBECEC;
}
.dark .ch, .dark .ch-pill {
  --ch-card: var(--dark-card); --ch-line: var(--dark-line); --ch-line2: #454850; --ch-bg: #0C0D10;
  --ch-ink: var(--bone); --ch-ink2: #B4B6BB; --ch-muted: #9A9DA3; --ch-past: #2A2D33; --ch-hover: #24272D;
  --ch-accent-soft: #2B3212; --ch-alert: #E48E8E; --ch-alert-soft: #3A1B1B;
}

/* State pills (components/state_pill.html), also outside the hub: the shape and the words carry the state, not colour alone. */
.ch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 500; line-height: 18px; white-space: nowrap; border: 1.5px solid transparent; }
.ch-glyph { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.ch-st-draft { border-style: dashed; border-color: var(--ch-line2); color: var(--ch-ink2); background: var(--ch-card); }
.ch-st-draft .ch-glyph { border-style: dashed; }
.ch-st-awaiting { border-color: var(--ch-ink); color: var(--ch-ink);
  background: repeating-linear-gradient(135deg, var(--ch-card) 0 5px, var(--ch-line) 5px 8px); }
.ch-st-awaiting .ch-glyph { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.ch-st-upcoming { border-color: var(--ch-ink); color: var(--ch-ink); background: var(--ch-card); }
.ch-st-live { background: var(--ch-accent); color: var(--ch-on-accent); font-weight: 700; }
.ch-st-live .ch-glyph { background: currentColor; }
.ch-st-past, .ch-st-sent { background: var(--ch-past); color: var(--ch-muted); }
.ch-st-past .ch-glyph, .ch-st-sent .ch-glyph { border: 0; border-inline-start: 2px solid currentColor;
  border-bottom: 2px solid currentColor; border-radius: 0; width: 9px; height: 5px; transform: rotate(-45deg) translateY(-1px); }
.ch-st-paused, .ch-st-off { background: var(--ch-card); border-color: var(--ch-line2); color: var(--ch-ink2); }
.ch-st-paused .ch-glyph, .ch-st-off .ch-glyph { border: 0; border-inline: 2.5px solid currentColor; border-radius: 0; width: 8px; }
.ch-st-alert { background: var(--ch-alert-soft); border-color: var(--ch-alert); color: var(--ch-alert); }
.ch-st-alert .ch-glyph { border: 0; border-radius: 1px; width: 3px; height: 10px; background: currentColor; }

/* Filter chips. */
.ch-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--ch-line2); background: var(--ch-card); color: var(--ch-ink2); font-size: 13px; }
.ch-chip:hover { border-color: var(--ch-ink); }
.ch-chip[aria-current="true"] { background: var(--ch-ink); border-color: var(--ch-ink); color: var(--ch-card); }
.ch-chip .ch-count { font: 500 11px var(--font-mono); opacity: .75; }

/* Timeline. */
.ch-tl-wrap { position: relative; overflow-x: auto; max-width: 100%; }
.ch-tl { --lw: 200px; position: relative; min-width: calc(var(--lw) + var(--n) * 24px); }
.ch-tl--week { min-width: calc(var(--lw) + 7 * 96px); }
/* Below 1280 a month still fits beside the sidebar at 1024: narrower labels and days. */
@media (max-width: 1279px) {
  .ch-tl { --lw: 150px; min-width: calc(var(--lw) + var(--n) * 18px); }
  .ch-day b { font-size: 12px; }
  .ch-day.is-today b { padding: 0 2px; }
}
.ch-row { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); position: relative; }
.ch-label { position: sticky; inset-inline-start: 0; z-index: 3; background: var(--ch-card); border-inline-end: 1px solid var(--ch-line);
  padding-inline: 12px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ch-head { border-bottom: 1px solid var(--ch-line); background: var(--ch-card); }
.ch-head .ch-label { font: 600 10px var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--ch-muted); }
.ch-days { display: flex; }
.ch-day { flex: 1 1 0; min-width: 0; text-align: center; padding: 6px 0; font-size: 11px; line-height: 1.3; color: var(--ch-muted);
  border-inline-start: 1px solid var(--ch-line); }
.ch-day b { display: block; font: 500 13px var(--font-mono); color: var(--ch-ink); }
.ch-day.is-weekend { background: var(--ch-bg); }
.ch-day.is-today b { display: table; margin-inline: auto; padding: 0 5px; border-radius: 4px; background: var(--ch-ink); color: var(--ch-card); }
.ch-body { position: relative; }
.ch-grid { position: absolute; inset-block: 0; inset-inline: var(--lw) 0; display: flex; pointer-events: none; }
.ch-grid i { flex: 1 1 0; border-inline-start: 1px solid var(--ch-line); }
.ch-grid i.is-weekend { background: var(--ch-bg); }
.ch-now { position: absolute; inset-block: 0; width: 2px; background: var(--ch-ink); inset-inline-start: calc(var(--t) / var(--n) * 100%); z-index: 2; }
.ch-now span { position: absolute; top: 2px; inset-inline-start: 5px; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
  font: 700 10px var(--font-mono); background: var(--ch-ink); color: var(--ch-card); }
.ch-track { position: relative; min-width: 0; }
.ch-camp { min-height: 44px; border-top: 1px solid var(--ch-line); }
.ch-camp .ch-label { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.ch-camp .ch-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ch-ink); }
.ch-camp .ch-dt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 11px var(--font-mono); color: var(--ch-muted); }
.ch-sub { height: 24px; }
.ch-sub .ch-label { font-size: 12px; color: var(--ch-muted); padding-inline-start: 20px; }
.ch-sub:last-child { margin-bottom: 6px; }
.ch-dates { height: 30px; }
.ch-dates .ch-label { font-size: 12px; color: var(--ch-muted); }
.ch-bar, .ch-seg, .ch-mk, .ch-dchip, .ch-out { position: absolute; inset-inline-start: calc(var(--s) / var(--n) * 100%); }
.ch-bar { top: 7px; height: 30px; width: calc(var(--l) / var(--n) * 100%); min-width: 16px; z-index: 1; display: flex; align-items: center;
  gap: 6px; padding: 0 10px; overflow: hidden; border-radius: 6px; border: 1.5px solid var(--ch-ink); font-size: 12px; white-space: nowrap;
  text-decoration: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.ch-bar b { flex: 0 1 auto; min-width: 4ch; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ch-bar em { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-style: normal; opacity: .85; }
.ch-bar.ch-st-draft { border-style: dashed; border-color: var(--ch-line2); }
.ch-bar.ch-st-past { border-color: transparent; }
.ch-bar.is-short { justify-content: center; padding: 0; }
.ch-bar.is-clip-start { border-start-start-radius: 0; border-end-start-radius: 0; }
.ch-bar.is-clip-end { border-start-end-radius: 0; border-end-end-radius: 0; }
.ch-bar[data-move="1"] { cursor: grab; }
.ch-bar.is-dragging { cursor: grabbing; z-index: 5; box-shadow: 0 12px 32px rgba(12, 13, 16, .14); }
.ch-bar:focus-visible { outline: 2px solid var(--ch-ink); outline-offset: 2px; }
.ch-grip { position: absolute; inset-block: 0; inset-inline-end: 0; width: 10px; cursor: ew-resize; }
.ch-grip::after { content: ""; position: absolute; inset-block: 8px; inset-inline-start: 4px; width: 2px; border-radius: 2px; background: currentColor; opacity: .45; }
.ch-out { top: 13px; display: flex; gap: 6px; align-items: center; padding-inline-start: 6px; font-size: 12px; white-space: nowrap;
  pointer-events: none; color: var(--ch-ink); }
/* A bar never draws narrower than 16px, so a name beside it starts past that. */
.ch-out:not(.is-before) { margin-inline-start: max(0px, calc(16px - var(--l) / var(--n) * 100%)); }
.ch-out.is-before { inset-inline-start: auto; inset-inline-end: calc(100% - var(--s) / var(--n) * 100%); padding-inline: 0 6px; }
.ch-out span { color: var(--ch-muted); }
.ch-seg { top: 4px; height: 16px; width: calc(var(--l) / var(--n) * 100%); min-width: 6px; overflow: hidden; padding-inline: 6px;
  border-radius: 4px; border: 1px solid var(--ch-line2); background: var(--ch-hover); color: var(--ch-ink2);
  font-size: 11px; line-height: 14px; white-space: nowrap; text-overflow: ellipsis; }
.ch-seg.ch-st-live { background: var(--ch-accent-soft); border-color: var(--ch-ink); color: var(--ch-ink); }
.ch-seg.ch-st-draft { border-style: dashed; background: none; }
.ch-seg.ch-st-past { border-color: transparent; background: var(--ch-past); color: var(--ch-muted); }
.ch-seg.ch-st-awaiting { border-color: var(--ch-ink2); background: repeating-linear-gradient(135deg, var(--ch-card) 0 5px, var(--ch-line) 5px 8px); }
.ch-mk { top: 7px; width: 10px; height: 10px; margin-inline-start: -5px; transform: rotate(45deg); z-index: 1;
  border: 1.5px solid var(--ch-ink); background: var(--ch-card); }
.ch-mk.is-sent { background: var(--ch-ink); }
.ch-mk.is-cancelled { border-style: dashed; border-color: var(--ch-muted); }
.ch-dchip { top: 5px; z-index: 1; padding-inline: 6px; border-radius: 4px; border: 1px solid var(--ch-line2); background: var(--ch-hover);
  font-size: 11px; line-height: 18px; white-space: nowrap; color: var(--ch-ink2); max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.ch-dchip.is-end { inset-inline-start: auto; inset-inline-end: calc(var(--e) / var(--n) * 100%); }
.ch-dchip.is-closed { background: var(--ch-alert-soft); border-color: var(--ch-alert); color: var(--ch-alert); }
.ch-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--ch-line);
  font-size: 12px; color: var(--ch-muted); }
.ch-legend .ch-mk { position: static; display: inline-block; margin: 0 4px; transform: rotate(45deg) scale(.85); }
.ch-empty { position: relative; padding: 32px 16px; text-align: center; color: var(--ch-muted); }

/* The composer's linked actions and the notes above a campaign. */
.ch-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ch-accent-soft);
  color: var(--ch-ink); font-size: 13px; }
.ch-note.is-plain { background: var(--ch-hover); }
.ch-note[hidden] { display: none; }
.ch-note.is-bad { background: var(--ch-alert-soft); }
.ch-act { border: 1px solid var(--ch-line); border-radius: 10px; background: var(--ch-card); }
.ch-act-h { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; }
.ch-act-ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 6px; background: var(--ch-hover); color: var(--ch-ink2); }
.ch-act-b { border-top: 1px solid var(--ch-line); padding: 16px 14px; }
.ch-act-b:empty { display: none; }
.ch-log { display: grid; gap: 10px; font-size: 13px; }
.ch-log > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; }
.ch-log time { font: 400 12px var(--font-mono); color: var(--ch-muted); }

/* The move confirmation: a native dialog, so focus stays in it and Escape closes it. */
.ch-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--ch-line); border-radius: 14px;
  background: var(--ch-card); color: var(--ch-ink); box-shadow: 0 12px 32px rgba(12, 13, 16, .14); }
.ch-dialog::backdrop { background: var(--scrim); }
.ch-movebox { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.ch-movebox > div { border: 1px solid var(--ch-line); border-radius: 10px; padding: 10px 12px; }
.ch-movebox > div + div { border: 1.5px solid var(--ch-ink); }
@media (prefers-reduced-motion: no-preference) { .ch-chip, .ch-bar { transition: background-color .14s, border-color .14s; } }

/* Checks: a level tag (block, warn, pass) carries a mark and a word, never colour alone. */
.ch-muted { color: var(--ch-muted); }
.ch-line { border-color: var(--ch-line); }
.ch-tally { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-lv { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  line-height: 18px; white-space: nowrap; border: 1.5px solid transparent; }
.ch-lv-block { background: var(--ch-alert); color: #fff; }
.ch-lv-warn { background: var(--ch-accent); color: var(--ch-on-accent); border-color: var(--ch-ink); }
.ch-lv-pass { background: var(--ch-hover); color: var(--ch-ink2); }
.ch-checks { margin-top: 12px; display: grid; }
.ch-check { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--ch-line); }
.ch-check:first-child { border-top: 0; padding-top: 4px; }
.ch-check .ch-lv { justify-self: start; align-self: start; }
.ch-checks.is-stacked .ch-check { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ch-check h3 { font-size: 14px; font-weight: 600; color: var(--ch-ink); overflow-wrap: anywhere; }
.ch-check p { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ch-ink2); }
.ch-fix { display: inline-flex; margin-top: 6px; min-height: 32px; align-items: center; padding: 4px 10px; border: 1px solid var(--ch-line2);
  border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ch-ink); }
.ch-fix:hover { border-color: var(--ch-ink); }
.ch-checks-slot { min-height: 96px; }
.ch-checks-slot.htmx-request { opacity: .6; }
.ch-dialog--wide { width: min(720px, calc(100vw - 32px)); }
.ch-confirm { display: flex; flex-direction: column; max-height: 85vh; }
@media (max-width: 640px) { .ch-check { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* Playbooks: one-click cards on New campaign and the manage list. */
.ch-pbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.ch-pb { display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; padding: 12px 14px; text-align: start; border: 1px solid var(--ch-line);
  border-radius: 10px; background: var(--ch-card); color: var(--ch-ink); }
.ch-pb:hover, .ch-pb:focus-visible { border-color: var(--ch-ink); }
.ch-pb b { font-size: 14px; }
.ch-pb span { font-size: 12px; line-height: 1.45; color: var(--ch-muted); }
.ch-pb.is-hidden { opacity: .6; border-style: dashed; }

/* Rows that run outside any campaign: read-only bars on the timeline. */
.ch-outside { min-height: 30px; border-top: 1px solid var(--ch-line); }
.ch-outside .ch-label { font-size: 12px; color: var(--ch-muted); }
.ch-ob { position: absolute; inset-inline-start: calc(var(--s) / var(--n) * 100%); width: calc(var(--l) / var(--n) * 100%); min-width: 8px; top: 5px;
  height: 20px; display: flex; align-items: center; gap: 4px; padding-inline: 6px; overflow: hidden; white-space: nowrap; font-size: 11px;
  border-radius: 4px; border: 1px dashed var(--ch-line2); background: var(--ch-bg); color: var(--ch-ink2); text-decoration: none; }
.ch-ob:hover, .ch-ob:focus-visible { border-style: solid; border-color: var(--ch-ink); color: var(--ch-ink); }
.ch-ob.is-live { border-style: solid; }

/* Results: four figure cards, then order value by day as bars with the usual day as a line across each. */
.ch-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.ch-kpi { display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 14px 16px; border: 1px solid var(--ch-line);
  border-radius: 10px; background: var(--ch-card); }
.ch-kpi-l { font-size: 12px; line-height: 1.45; color: var(--ch-muted); overflow-wrap: anywhere; }
.ch-kpi-v { font: 700 24px/1.2 var(--font-mono); color: var(--ch-ink); overflow-wrap: anywhere; }
.ch-kpi.is-loading span, .ch-kpi.is-loading b { display: block; height: 12px; width: 70%; border-radius: 4px; background: var(--ch-hover); }
.ch-kpi.is-loading b { height: 28px; width: 45%; }
.ch-delta { display: inline-block; padding: 1px 6px; border-radius: 4px; font: 700 12px var(--font-mono); background: var(--ch-accent-soft);
  color: var(--ch-ink); }
.ch-delta.is-down { background: var(--ch-alert-soft); color: var(--ch-alert); }
.ch-legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ch-muted); }
.ch-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--ch-accent); border: 1.5px solid var(--ch-ink); }
.ch-sw.is-usual { width: 14px; height: 0; border: 0; border-top: 2px solid var(--ch-ink); border-radius: 0; margin-inline-start: 8px; }
.ch-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; margin-top: 12px; border-bottom: 1px solid var(--ch-line2); }
.ch-chart-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ch-chart-bar { display: block; width: min(46px, 60%); height: calc(var(--h) * 1%); min-height: 1px; border: 1.5px solid var(--ch-ink);
  border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--ch-accent); }
.ch-chart-mark { position: absolute; inset-inline: 0; margin-inline: auto; width: min(70px, 84%); bottom: calc(var(--m) * 1%);
  border-top: 2px solid var(--ch-ink); }
.ch-chart-days { display: flex; gap: 8px; margin-top: 6px; }
.ch-chart-days span { flex: 1 1 0; min-width: 0; overflow: hidden; text-align: center; white-space: nowrap; font: 400 11px var(--font-mono);
  color: var(--ch-muted); }

/* Layout designer: the preview drawn in the shop's saved theme (light, as the shop opens), the
   draft/live strip, the compare frames and the History drawer. Doubled class: wins over dark: utilities. */
.sf-themed { background: var(--t-bg, #fff); color: var(--t-ink, #111827); font-family: var(--t-font-sans, inherit); color-scheme: light; }
.sf-themed[lang="ar"] { font-family: var(--t-font-arabic, var(--t-font-sans, inherit)); }
.sf-themed.sf-themed :is(h2, h3, h4) { font-family: var(--t-sectionTitle-font, var(--t-font-display, inherit)); }
.sf-themed.sf-themed :is(.text-gray-900, .text-gray-800) { color: var(--t-ink, #111827); }
.sf-themed.sf-themed :is(.text-gray-700, .text-gray-600, .text-gray-500) { color: var(--t-muted, #6b7280); }
.sf-themed.sf-themed .text-gray-400 { color: var(--t-faint, #9ca3af); }
.sf-themed.sf-themed :is(.bg-gray-50, .bg-gray-100, .bg-gray-200) { background-color: var(--t-surface2, #f3f4f6); }
.sf-themed.sf-themed .bg-white { background-color: var(--t-surface, #fff); }
.sf-themed.sf-themed :is(.border-gray-200, .border-gray-300) { border-color: var(--t-border, #e5e7eb); }
.sf-themed.sf-themed .divide-gray-200 > * + * { border-color: var(--t-border, #e5e7eb); }
.sf-themed.sf-themed .rounded-xl { border-radius: var(--t-radius-card, .75rem); }
.sf-glyph { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 9999px;
  background: var(--t-tint-bg, #f3f4f6); box-shadow: inset 0 0 0 1.5px var(--t-accent, #9ca3af); }
.sf-fixed { border: 1px dashed var(--t-borderStrong, #d1d5db); border-radius: 10px; padding: 8px 12px; text-align: center;
  font-size: 11px; line-height: 1.35; color: var(--t-faint, #9ca3af); background: var(--t-canvas, #f9fafb); }
.sf-fixed-bar { margin: 0 12px 12px; }
#layout-state { min-height: 46px; }
.sf-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border: 1px solid; border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.45; }
.sf-state--draft { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.sf-state--live { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.dark .sf-state--draft { background: rgba(120, 53, 15, .3); border-color: #b45309; color: #fde68a; }
.dark .sf-state--live { background: rgba(20, 83, 45, .3); border-color: #166534; color: #86efac; }
.sf-compare-panes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; padding: 16px; overflow-y: auto; }
.sf-compare-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.sf-compare-cap { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sf-compare-cap--live { color: #15803d; }
.sf-compare-cap--other { color: #b45309; }
.dark .sf-compare-cap--live { color: #86efac; }
.dark .sf-compare-cap--other { color: #fcd34d; }
.sf-compare-pane iframe { width: 100%; height: min(68vh, 720px); border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.sf-drawer { position: absolute; inset-block: 0; inset-inline-end: 0; display: flex; flex-direction: column; width: min(440px, 100vw);
  background: #fff; box-shadow: 0 0 32px rgba(12, 13, 16, .2); }
.dark .sf-drawer { background: #1f2937; }
/* The Theme page keeps its preview beside the controls from 1024 up, so a change is seen while it is made. */
@media (min-width: 1024px) {
  .sf-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-theme-grid > .sf-theme-preview { position: sticky; top: 1rem; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .sf-theme-grid .md\:grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
