/* Publyra — design system v2
   Mood: glassmorphism doux, gradients mesh, animations micro.
   Palette: indigo-500 → fuchsia-500 → amber-400 sur canvas slate-50.
   Typography: Inter (ui) + JetBrains Mono (data) + Instrument Serif (accents). */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --accent-400: #e879f9;
  --accent-500: #d946ef;
  --warm-400: #fbbf24;

  --ink-100: #f1f5f9;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-500: #64748b;
  --ink-700: #334155;
  --ink-800: #1e293b;

  --canvas: #f6f7fb;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-border-soft: rgba(148, 163, 184, 0.18);

  --shadow-glass: 0 8px 32px -4px rgba(79, 70, 229, 0.12), inset 0 1px 0 0 rgba(255,255,255,0.7);
  --shadow-lift: 0 18px 48px -16px rgba(79, 70, 229, 0.28);
  --shadow-press: 0 2px 8px -2px rgba(79, 70, 229, 0.2);

  --grad-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #d946ef 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(217,70,239,0.9));
  --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-success: linear-gradient(135deg, #10b981 0%, #22d3ee 100%);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;

  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 480ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── DaisyUI theme "publyra" ─────────────────────────────────── */
[data-theme="publyra"] {
  --p: 239 84% 67%;
  --pf: 244 75% 57%;
  --pc: 0 0% 100%;
  --s: 292 88% 60%;
  --sf: 292 88% 50%;
  --sc: 0 0% 100%;
  --a: 38 92% 50%;
  --af: 32 95% 44%;
  --ac: 0 0% 100%;
  --n: 217 33% 17%;
  --nc: 210 40% 98%;
  --b1: 210 40% 98%;
  --b2: 210 40% 96%;
  --b3: 214 32% 91%;
  --bc: 222 47% 11%;
  --in: 199 89% 48%;
  --su: 160 84% 39%;
  --wa: 38 92% 50%;
  --er: 0 84% 60%;
  --rounded-btn: 0.75rem;
  --rounded-box: 1rem;
  --btn-text-case: none;
  --animation-btn: 0.25s;
}

/* ── Base ────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  background: var(--canvas);
  color: var(--ink-800);
  min-height: 100vh;
  overflow-x: hidden;
}

code, pre, .font-mono, kbd {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: 'ss01', 'ss02';
}

h1, h2, h3, h4 {
  letter-spacing: -0.022em;
  font-weight: 600;
}

/* ── Mesh backdrop ───────────────────────────────────────────── */
.app-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--canvas);
}
.app-backdrop .mesh {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.app-backdrop .mesh-1 {
  top: -10%;
  left: -8%;
  background: radial-gradient(circle at 30% 30%, #a5b4fc 0%, transparent 70%);
}
.app-backdrop .mesh-2 {
  top: 30%;
  right: -12%;
  background: radial-gradient(circle at 50% 50%, #f0abfc 0%, transparent 70%);
  animation-delay: -6s;
}
.app-backdrop .mesh-3 {
  bottom: -15%;
  left: 20%;
  background: radial-gradient(circle at 50% 50%, #fde68a 0%, transparent 70%);
  animation-delay: -12s;
  opacity: 0.4;
}
.app-backdrop .noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: overlay;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33% { transform: translateY(-30px) translateX(20px) scale(1.05); }
  66% { transform: translateY(20px) translateX(-25px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .app-backdrop .mesh { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Navigation — glass pill ─────────────────────────────────── */
.nav-glass {
  border-radius: var(--radius-2xl);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.nav-glass:hover {
  box-shadow: var(--shadow-lift);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.375rem 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink-800);
  border-radius: var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.nav-brand:hover { transform: translateY(-1px); }
.nav-brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad-brand);
  background-size: 200% 200%;
  box-shadow: 0 0 12px rgba(99,102,241,0.55), inset 0 0 4px rgba(255,255,255,0.4);
  animation: gradient-pan 6s ease infinite;
}
@keyframes gradient-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.nav-brand-text {
  background: var(--grad-brand);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 10s ease infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.5rem;
}
.nav-links li { list-style: none; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-700);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-link:hover {
  color: var(--brand-700);
  background: rgba(99, 102, 241, 0.08);
}
.nav-link.is-active {
  color: var(--brand-700);
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(217,70,239,0.08));
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.18);
}
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 25%; right: 25%;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

/* User chip */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border-soft);
  border-radius: 999px;
  color: var(--ink-700);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.user-chip:hover {
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-glass);
  transform: translateY(-1px);
}
.user-chip-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1), 0 0 0 2px rgba(255,255,255,0.6);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--glass-border-soft);
  color: var(--ink-700);
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.icon-btn:hover {
  background: rgba(255,255,255,0.85);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glass);
}

/* Glass dropdown menu */
.glass-menu {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 24px 60px -12px rgba(30, 27, 75, 0.25), inset 0 1px 0 rgba(255,255,255,0.7) !important;
  list-style: none;
  z-index: 50;
}
.glass-menu li { list-style: none; }
.glass-menu-item {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.88rem;
  color: var(--ink-700) !important;
  transition: all var(--dur-fast) var(--ease-out);
}
.glass-menu-item:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(217,70,239,0.06)) !important;
  color: var(--brand-700) !important;
  transform: translateX(2px);
}
.glass-menu-item.is-active {
  background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(217,70,239,0.08)) !important;
  color: var(--brand-700) !important;
  font-weight: 600;
}
.glass-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #b91c1c !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-gradient {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  background: var(--grad-brand);
  background-size: 200% auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: all var(--dur-base) var(--ease-spring);
  overflow: hidden;
  isolation: isolate;
}
.btn-gradient::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
  z-index: -1;
}
.btn-gradient:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px -8px rgba(99, 102, 241, 0.7);
  background-position: right center;
}
.btn-gradient:hover::before { transform: translateX(120%); }
.btn-gradient:active { transform: translateY(0) scale(0.99); }

.btn-ghost-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-700);
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-md);
  transition: all var(--dur-fast) var(--ease-out);
}
.btn-ghost-pill:hover {
  background: rgba(255,255,255,0.85);
  color: var(--brand-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glass);
}

/* DaisyUI btn override — global soft styling */
.btn {
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  transition: all var(--dur-fast) var(--ease-spring);
}
.btn-primary {
  background: var(--grad-brand);
  background-size: 200% auto;
  border: none;
  color: white;
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.45);
}
.btn-primary:hover {
  background-position: right center;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(99, 102, 241, 0.65);
}
.btn-primary:active { transform: translateY(0); }

/* ── Cards ───────────────────────────────────────────────────── */
.card, .glass-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.card:hover, .glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.card-body { padding: 1.25rem 1.5rem; }
.card-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* DaisyUI stat override */
.stat {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: all var(--dur-base) var(--ease-out);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.stat-title { color: var(--ink-500); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.stat-value {
  font-weight: 700;
  letter-spacing: -0.035em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-desc { color: var(--ink-500); font-size: 0.82rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.input, .textarea, .select {
  background: rgba(255,255,255,0.6) !important;
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border-soft) !important;
  border-radius: var(--radius-md) !important;
  transition: all var(--dur-fast) var(--ease-out);
}
.input:focus, .textarea:focus, .select:focus {
  background: rgba(255,255,255,0.95) !important;
  border-color: var(--brand-400) !important;
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px -2px rgba(99, 102, 241, 0.2) !important;
}

.label-text { color: var(--ink-700); font-weight: 500; font-size: 0.85rem; }

/* ── Toasts ──────────────────────────────────────────────────── */
.toast-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  font-size: 0.9rem;
  animation: toastIn 0.45s var(--ease-spring) both;
}
.toast-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
  animation: pulseGlow 1.8s ease-in-out infinite;
}
.toast-success .toast-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.22); }
.toast-error   .toast-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.22); }
.toast-warning .toast-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,0.22); }
.toast-msg { color: var(--ink-800); flex: 1; }

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,0.22); }
  50% { box-shadow: 0 0 0 8px rgba(99,102,241,0.05); }
}

/* ── Tables ──────────────────────────────────────────────────── */
.table {
  background: transparent;
}
.table thead th {
  background: transparent;
  color: var(--ink-500);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border-soft);
}
.table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}
.table tbody tr:hover {
  background: rgba(99,102,241,0.04);
}
.table tbody td { border-bottom: 1px solid var(--glass-border-soft); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  border: 1px solid transparent;
}
.badge-primary {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(217,70,239,0.08));
  color: var(--brand-700);
  border-color: rgba(99,102,241,0.25);
}
.badge-success {
  background: rgba(16,185,129,0.12);
  color: #047857;
  border-color: rgba(16,185,129,0.25);
}
.badge-warning {
  background: rgba(245,158,11,0.14);
  color: #b45309;
  border-color: rgba(245,158,11,0.3);
}
.badge-error {
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
  border-color: rgba(239,68,68,0.28);
}

/* ── Shimmer (skeletons / loading) ───────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, rgba(226,232,240,0.4) 0%, rgba(226,232,240,0.8) 50%, rgba(226,232,240,0.4) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Check stroke animation (used after save) ────────────────── */
.check-stroke path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: checkStroke 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes checkStroke {
  to { stroke-dashoffset: 0; }
}

/* ── HTMX transitions ────────────────────────────────────────── */
.htmx-swapping {
  opacity: 0;
  transform: translateY(4px);
  transition: all 180ms var(--ease-out);
}
.htmx-settling {
  opacity: 0;
  transform: translateY(-4px);
}
[hx-swap-oob] {
  animation: fadeUp 0.35s var(--ease-out) both;
}
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 180ms;
}
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Swap icon / spinner pendant une requête htmx (sur la cible directe ou un parent) */
.htmx-indicator-show { display: none; }
.htmx-request .htmx-indicator-show,
.htmx-request.htmx-indicator-show { display: inline-flex; }
.htmx-request .htmx-indicator-hide,
.htmx-request.htmx-indicator-hide { display: none !important; }

/* Force la lisibilité du texte sur les boutons primary même disabled (pendant htmx) */
.btn.btn-primary[disabled],
.btn.btn-primary:disabled,
.btn.btn-primary.btn-disabled {
  color: #fff !important;
  opacity: 0.85;
}

/* ── Section titles ──────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  color: var(--ink-800);
  margin-bottom: 1.25rem;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--grad-brand);
  background-size: 200% 200%;
  animation: gradient-pan 6s ease infinite;
  transform: translateY(3px);
}
.section-title .font-display {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Misc utilities ──────────────────────────────────────────── */
.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.25), transparent);
  border: none;
  margin: 1.5rem 0;
}

.glow-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22);
}

::selection {
  background: rgba(99,102,241,0.25);
  color: var(--ink-900, #0f172a);
}

/* Scrollbar — subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); background-clip: padding-box; border: 2px solid transparent; }

/* ════════════════════════════════════════════════════════════════
   Mobile app shell — P0 UX improvements
   ════════════════════════════════════════════════════════════════ */

/* Nav badge on desktop nav-link */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  background: var(--grad-brand);
  border-radius: 999px;
  box-shadow: 0 2px 6px -1px rgba(99,102,241,0.45);
}

/* Command palette trigger */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.7rem 0.38rem 0.6rem;
  font-size: 0.8rem;
  color: var(--ink-500);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 999px;
  transition: all var(--dur-fast) var(--ease-out);
}
.cmdk-trigger:hover { background: rgba(255,255,255,0.85); color: var(--ink-700); }
.cmdk-trigger kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 1px 6px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 5px;
  color: var(--brand-700);
}

/* Safe-area aware bottom nav */
:root {
  --bottom-nav-height: 62px;
  --bottom-nav-safe: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}
.has-mobile-nav { padding-bottom: var(--bottom-nav-safe); }
@media (min-width: 1024px) {
  .has-mobile-nav { padding-bottom: 0; }
}

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: 1fr 1fr 74px 1fr 1fr;
  align-items: end;
  height: var(--bottom-nav-safe);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 -8px 30px -12px rgba(15,23,42,0.15);
}
.bottom-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--bottom-nav-height);
  padding: 6px 4px 8px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-500);
  background: transparent;
  border: 0;
  transition: color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item span { line-height: 1; }
.bottom-nav-item svg { opacity: 0.75; transition: all var(--dur-base) var(--ease-spring); }
.bottom-nav-item:active svg { transform: scale(0.88); }
.bottom-nav-item.is-active {
  color: var(--brand-600);
}
.bottom-nav-item.is-active svg {
  opacity: 1;
  stroke: url(#bn-grad);
  filter: drop-shadow(0 2px 6px rgba(99,102,241,0.35));
}
.bottom-nav-item.is-active::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--grad-brand);
  border-radius: 999px;
}
.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.64rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #f43f5e, #d946ef);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px -1px rgba(217,70,239,0.55);
  border: 2px solid white;
}

/* FAB at center of bottom nav */
.bottom-nav-fab-form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--bottom-nav-height);
  padding-top: 0;
  margin: 0;
}
.bottom-nav-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  margin-top: -22px;
  color: white;
  background: var(--grad-brand);
  border: 4px solid white;
  border-radius: 999px;
  box-shadow: 0 10px 24px -6px rgba(99,102,241,0.6), 0 2px 6px -1px rgba(217,70,239,0.4);
  transition: all var(--dur-base) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-fab:active { transform: scale(0.92); box-shadow: 0 6px 14px -4px rgba(99,102,241,0.55); }
.bottom-nav-fab:disabled { opacity: 0.6; }

/* Hide Django-Debug-Toolbar above bottom nav on mobile */
@media (max-width: 1023px) {
  #djDebug { bottom: calc(var(--bottom-nav-safe) + 8px) !important; }
}

/* ── Mobile drawer (full-height, OPAQUE) ─────────────────────── */
.mobile-drawer {
  position: fixed; inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
}
.mobile-drawer[hidden] { display: none !important; }
.mobile-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: drawerBackdropIn 0.2s var(--ease-out) both;
}
.mobile-drawer-panel {
  position: relative;
  width: 100%;
  max-height: 88vh;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -24px 60px -12px rgba(15,23,42,0.35);
  animation: drawerPanelIn 0.28s var(--ease-spring) both;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer-handle {
  width: 44px; height: 4px;
  margin: 0 auto 10px;
  background: rgba(148,163,184,0.4);
  border-radius: 999px;
}
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.15);
  margin-bottom: 6px;
}
.mobile-drawer-list {
  display: flex;
  flex-direction: column;
}
.mobile-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-800);
  border-radius: 12px;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.mobile-drawer-item:active {
  background: rgba(99,102,241,0.08);
}
.mobile-drawer-item.is-active {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(217,70,239,0.07));
  color: var(--brand-700);
  font-weight: 600;
}
.mobile-drawer-item-danger {
  color: #b91c1c;
}
.mobile-drawer-divider {
  height: 1px;
  margin: 10px 8px;
  background: rgba(148,163,184,0.18);
}
.mobile-drawer-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  background: var(--grad-brand);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes drawerBackdropIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes drawerPanelIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

body.drawer-open { overflow: hidden; }

/* ── Swipe cards (file de validation) ─────────────────────────── */
.swipe-card {
  position: relative;
  touch-action: pan-y;
  transition: transform 0.28s var(--ease-spring);
  will-change: transform;
}
.swipe-card.swiping { transition: none; }
.swipe-card-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease-out);
  z-index: 2;
}
.swipe-card-hint.right {
  right: 22px;
  color: #047857;
}
.swipe-card-hint.left {
  left: 22px;
  color: #b45309;
}
.swipe-card[data-swipe="right"] .swipe-card-hint.right { opacity: 1; }
.swipe-card[data-swipe="left"]  .swipe-card-hint.left  { opacity: 1; }

/* ── Toast center (bottom, with undo) ─────────────────────────── */
#publyra-toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottom-nav-safe) + 14px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(92vw, 420px);
}
@media (min-width: 1024px) {
  #publyra-toast-host {
    left: auto; right: 22px; transform: none;
    bottom: 22px;
  }
}
.publyra-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, 0.94);
  color: white;
  font-size: 0.88rem;
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(15,23,42,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastPopIn 0.3s var(--ease-spring) both;
}
.publyra-toast.is-leaving { animation: toastPopOut 0.22s var(--ease-out) both; }
.publyra-toast-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}
.publyra-toast.success { border-left: 3px solid #10b981; }
.publyra-toast.success .publyra-toast-dot { color: #34d399; }
.publyra-toast.error   { border-left: 3px solid #ef4444; }
.publyra-toast.error .publyra-toast-dot   { color: #f87171; }
.publyra-toast.warning { border-left: 3px solid #f59e0b; }
.publyra-toast.warning .publyra-toast-dot { color: #fbbf24; }
.publyra-toast.info    { border-left: 3px solid #6366f1; }
.publyra-toast.info .publyra-toast-dot    { color: #818cf8; }
.publyra-toast-msg { flex: 1; min-width: 0; }
.publyra-toast-action {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #a5b4fc;
  background: transparent;
  border: 1px solid rgba(165,180,252,0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.publyra-toast-action:hover { background: rgba(165,180,252,0.12); color: white; }

@keyframes toastPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastPopOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

/* ── Skeletons ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,0.14) 25%, rgba(148,163,184,0.28) 50%, rgba(148,163,184,0.14) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Command palette modal ───────────────────────────────────── */
.cmdk-root {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: drawerBackdropIn 0.16s var(--ease-out) both;
}
.cmdk-root[hidden] { display: none !important; }
.cmdk-panel {
  width: 100%;
  max-width: 560px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(15,23,42,0.4);
  overflow: hidden;
  animation: cmdkPanelIn 0.22s var(--ease-spring) both;
}
@keyframes cmdkPanelIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cmdk-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.2);
}
.cmdk-search input {
  flex: 1;
  font-size: 0.98rem;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink-800);
}
.cmdk-search kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 2px 6px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 5px;
  color: var(--brand-700);
}
.cmdk-list {
  max-height: 56vh;
  overflow-y: auto;
  padding: 6px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--ink-700);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.cmdk-item:hover,
.cmdk-item[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(217,70,239,0.06));
  color: var(--brand-700);
}
.cmdk-item-shortcut {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  opacity: 0.55;
}
.cmdk-group-label {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
}
.cmdk-empty {
  padding: 22px 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-500);
}

/* Mobile polish: tighten cockpit widgets, card borders more subtle on dark backgrounds */
@media (max-width: 640px) {
  .card, .glass-card {
    border-radius: 16px;
  }
  h1 { font-size: 1.6rem; }
  .btn-gradient, .btn { min-height: 44px; }
  /* make DaisyUI primary buttons tap-friendly */
  .btn-primary, .btn-secondary, .btn-error, .btn-accent { min-height: 44px; font-size: 0.92rem; }
  /* Stack queue card actions on mobile */
  #queue-card .card-actions { flex-direction: column-reverse; align-items: stretch; }
  #queue-card .card-actions form, #queue-card .card-actions .btn { width: 100%; }
  #queue-card .card-actions .btn { min-height: 48px; }
}

/* Hidden SVG gradient def for bottom-nav icon stroke */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state-card {
  padding: 40px 22px 28px;
  text-align: center;
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(238,242,255,0.7));
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}
.empty-state-emoji {
  font-size: 2.6rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 10px rgba(99,102,241,0.15));
}
.empty-state-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.7rem;
  color: var(--ink-800);
  margin-bottom: 6px;
}
.empty-state-sub {
  font-size: 0.92rem;
  color: var(--ink-500);
  max-width: 420px;
  margin: 0 auto 6px;
}
.empty-state-links {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--ink-400);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.empty-state-links a {
  color: var(--brand-600);
  text-decoration: none;
}
.empty-state-links a:hover { text-decoration: underline; }

/* ── Swipe deck (stack of scraped post cards) ─────────────────── */
.swipe-deck {
  position: relative;
  min-height: 420px;
}
.swipe-deck .swipe-card {
  margin-bottom: 16px;
}
.swipe-scraped-card {
  touch-action: pan-y;
}
.swipe-scraped-card .scraped-note-form textarea {
  min-height: 80px;
}
@media (min-width: 1024px) {
  .swipe-scraped-card { touch-action: auto; }
}

/* Hint tooltip above swipe cards on first render (mobile) */
@media (max-width: 1023px) {
  #queue-card.swipe-card::after {
    content: '← Regénérer · Valider →';
    display: block;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-400);
    margin-top: 10px;
    opacity: 0.7;
  }
}

/* ────────────────────────────────────────────────────────
   Auth pages (login / signup / logout / MFA / password reset)
──────────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow:
    0 20px 60px -10px rgba(79, 70, 229, 0.18),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.7);
}
.auth-card h1,
.auth-card h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 8px 0 6px;
  color: #0f172a;
}
.auth-card p {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.55;
}
.auth-card a {
  color: #4f46e5;
  font-weight: 500;
}
.auth-card a:hover { text-decoration: underline; }
.auth-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .helptext,
.auth-card .form-text { font-size: 0.8rem; color: #64748b; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  color: #1e293b;
}
.auth-brand-dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #d946ef);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.auth-brand-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  font-style: italic;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}
.auth-input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.auth-input:focus,
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
.auth-help { font-size: 0.78rem; color: #64748b; margin-top: 2px; }
.auth-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: #334155;
}
.auth-check input { width: 18px; height: 18px; accent-color: #6366f1; }

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s, color 0.2s;
  text-decoration: none;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 60%, #d946ef 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px -8px rgba(139, 92, 246, 0.55);
}
.auth-btn-primary:hover {
  box-shadow: 0 14px 28px -8px rgba(139, 92, 246, 0.65);
  filter: brightness(1.04);
}
.auth-btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.35);
}
.auth-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}
.auth-btn-danger {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #ffffff;
  box-shadow: 0 10px 24px -8px rgba(244, 63, 94, 0.55);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  border: 1px solid transparent;
}
.auth-alert-error {
  background: rgba(254, 226, 226, 0.8);
  border-color: rgba(248, 113, 113, 0.4);
  color: #991b1b;
}
.auth-alert-success {
  background: rgba(220, 252, 231, 0.8);
  border-color: rgba(74, 222, 128, 0.4);
  color: #166534;
}
.auth-alert-info {
  background: rgba(224, 231, 255, 0.8);
  border-color: rgba(129, 140, 248, 0.4);
  color: #3730a3;
}
.auth-alert-warning {
  background: rgba(254, 243, 199, 0.8);
  border-color: rgba(251, 191, 36, 0.4);
  color: #92400e;
}

/* Allauth fallback: if any stray bootstrap class sneaks through */
.auth-card .btn { /* covers allauth defaults we didn't override */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.6);
  color: #334155;
  text-decoration: none;
}
.auth-card .btn-primary {
  background: linear-gradient(135deg, #6366f1, #d946ef);
  color: #fff;
  border-color: transparent;
}

/* ────────────────────────────────────────────────────────
   Profile
──────────────────────────────────────────────────────── */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #d946ef 100%);
  box-shadow: 0 12px 28px -8px rgba(139, 92, 246, 0.5);
  flex-shrink: 0;
}
.profile-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-decoration: none;
  color: #0f172a;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  backdrop-filter: blur(10px);
}
.profile-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -12px rgba(99, 102, 241, 0.28);
  background: rgba(255, 255, 255, 0.92);
}
.profile-tile-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(217, 70, 239, 0.12));
  color: #6366f1;
}
.profile-tile-icon svg { width: 20px; height: 20px; }
.profile-tile-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 6px;
}
.profile-tile-sub {
  font-size: 0.8rem;
  color: #64748b;
}
.profile-tile-danger .profile-tile-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(244, 63, 94, 0.12));
  color: #ef4444;
}
.profile-tile-danger:hover { box-shadow: 0 14px 32px -12px rgba(239, 68, 68, 0.28); }

/* ────────────────────────────────────────────────────────
   Manual scrape trigger (cockpit button)
──────────────────────────────────────────────────────── */
.scrape-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  border: 0;
  cursor: pointer;
  box-shadow: 0 10px 22px -8px rgba(14, 165, 233, 0.5);
  transition: transform 0.12s, box-shadow 0.2s;
}
.scrape-trigger-btn:hover { box-shadow: 0 14px 26px -8px rgba(14, 165, 233, 0.65); }
.scrape-trigger-btn:disabled { opacity: 0.6; cursor: progress; }
.scrape-trigger-btn svg { width: 16px; height: 16px; }

.scrape-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148,163,184,0.25);
  font-size: 0.85rem;
  color: #334155;
}
.scrape-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #94a3b8;
}
.scrape-status-running .scrape-status-dot,
.scrape-status-dot-pulse {
  background: #0ea5e9;
  box-shadow: 0 0 0 0 rgba(14,165,233,0.7);
  animation: scrape-pulse 1.4s infinite;
}
.scrape-status-success .scrape-status-dot { background: #10b981; }
.scrape-status-failed .scrape-status-dot,
.scrape-status-dot-error { background: #ef4444; }
@keyframes scrape-pulse {
  0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(14,165,233,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,165,233,0); }
}

/* Allauth manage pages — force modern inputs even when rendered by Django widgets */
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="url"],
.auth-field input[type="tel"],
.auth-field input[type="number"],
.auth-field select,
.auth-field textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  font-size: 0.95rem;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14,165,233,0.15);
  background: #fff;
}

/* Tables — glass */
.auth-table-wrapper {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 18px;
  overflow: hidden;
}
.auth-table { width: 100%; border-collapse: collapse; }
.auth-table th,
.auth-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}
.auth-table th { font-weight: 600; color: #475569; background: rgba(241,245,249,0.5); }
.auth-table tr:last-child td { border-bottom: none; }
.auth-table tr:hover td { background: rgba(241,245,249,0.45); }

/* Badges */
.auth-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.auth-badge-success { background: #d1fae5; color: #065f46; }
.auth-badge-warning { background: #fef3c7; color: #92400e; }
.auth-badge-danger  { background: #fee2e2; color: #991b1b; }
.auth-badge-primary { background: #dbeafe; color: #1e40af; }
.auth-badge-secondary { background: #e2e8f0; color: #475569; }

/* Manage pages: spacing between forms/lists */
.allauth-manage form { margin-bottom: 1rem; }

/* Headings on manage pages */
[class*="max-w-3xl"] h1 { font-family: inherit; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
[class*="max-w-3xl"] h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; color: #334155; }

/* Forms rendered via allauth {% element form %} are already glass-card.
   Keep fieldsets styled for bare templates. */
[class*="max-w-3xl"] > fieldset {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 18px;
  padding: 1.5rem;
}

/* Manage pages spacing polish */
[class*="max-w-3xl"] > * + * { margin-top: 1.25rem; }
[class*="max-w-3xl"] section { padding: 1.5rem; border-radius: 18px; }
[class*="max-w-3xl"] .auth-field + .auth-field { margin-top: 1rem; }
[class*="max-w-3xl"] .auth-table-wrapper + form,
[class*="max-w-3xl"] form + .auth-table-wrapper { margin-top: 1.25rem; }
[class*="max-w-3xl"] .auth-btn { margin-top: 0.5rem; }
[class*="max-w-3xl"] p { color: #475569; line-height: 1.55; }

.auth-readonly { cursor: default; }

/* ============================================================
   Sources — tabs, glass data table, icon actions (#80)
   ============================================================ */

.sources-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.375rem;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  box-shadow: 0 8px 32px 0 rgba(79,70,229,0.08), inset 0 1px 0 0 rgba(255,255,255,0.6);
}
.sources-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: color .2s, background .2s, box-shadow .2s;
}
.sources-tab:hover { color: #1e293b; background: rgba(255,255,255,0.55); }
.sources-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 4px 16px -2px rgba(99,102,241,0.45);
}
.sources-tab.is-active:hover { color: #fff; }

/* Glass data table wrapper */
.data-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px -10px rgba(79,70,229,0.14), inset 0 1px 0 0 rgba(255,255,255,0.7);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  color: #1e293b;
}
.data-table thead th {
  background: rgba(241,245,249,0.6);
  color: #334155;
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.25);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.15);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover td { background: rgba(241,245,249,0.55); }

.data-table .sort-th { cursor: pointer; user-select: none; }
.data-table .sort-th a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
}
.data-table .sort-th a:hover { color: #4f46e5; }
.data-table .sort-th .sort-arrow { opacity: 0.35; transition: opacity .15s, transform .15s; }
.data-table .sort-th.is-active .sort-arrow { opacity: 1; color: #4f46e5; }
.data-table .sort-th.is-desc .sort-arrow { transform: rotate(180deg); }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.pill-success { background: #d1fae5; color: #065f46; }
.pill-muted   { background: #e2e8f0; color: #475569; }
.pill-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

/* Icon action buttons (row actions) */
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.icon-action:hover { color: #1e293b; background: rgba(241,245,249,0.9); border-color: rgba(148,163,184,0.25); }
.icon-action:active { transform: scale(0.94); }
.icon-action-danger:hover { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.icon-action-success:hover { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }

.actions-cell { display: inline-flex; gap: 0.35rem; align-items: center; }

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #64748b;
}

/* ============================================================
   Comment review modal (#82)
   ============================================================ */
.review-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.18s ease-out;
}
.review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.review-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.4);
  overflow: hidden;
  animation: fadeUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.review-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}
.review-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.review-original {
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(217,70,239,0.05));
  border: 1px solid rgba(99,102,241,0.15);
}
.review-original blockquote {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
  margin: 0.25rem 0 0.5rem;
}
.review-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6366f1;
  margin: 0 0 0.25rem;
}
.review-origin-link {
  font-size: 0.8rem;
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.review-form { display: flex; flex-direction: column; gap: 0.9rem; }
.review-textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.3);
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
}
.review-textarea:focus { outline: 2px solid #6366f1; outline-offset: 1px; }
.review-rationale {
  background: rgba(241,245,249,0.7);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #334155;
}
.review-rationale summary { cursor: pointer; font-weight: 600; color: #475569; }
.review-rationale p { margin: 0.5rem 0 0; line-height: 1.5; }
.review-modal-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148,163,184,0.15);
  padding-top: 0.9rem;
}
.review-empty { padding: 1.5rem; text-align: center; }

/* Close the modal when clicking the backdrop or close button */

/* ============================================================
   Calendar surface + published state (#83)
   ============================================================ */
.calendar-surface {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 20px;
  box-shadow: 0 10px 40px -10px rgba(79,70,229,0.14), inset 0 1px 0 0 rgba(255,255,255,0.7);
}
.calendar-action {
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255,255,255,0.25);
}
.calendar-action[data-status="published"] {
  background-image: linear-gradient(transparent, transparent) !important;
  position: relative;
  opacity: 0.75;
}
.calendar-action[data-status="published"]::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  background: rgba(255,255,255,0.9);
  color: #065f46;
  font-weight: 700;
  border-radius: 999px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.calendar-action[data-status="scheduled"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px 0 0 3px;
}
