@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* === LIGHT THEME === */
  --bg-base: #ffffff;
  --bg-surface: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-overlay: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-sidebar: #f1f5f9;
  --bg-sidebar-hover: #e2e8f0;
  --bg-sidebar-active: rgba(244, 98, 42, 0.08);

  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-default: rgba(15, 23, 42, 0.18);
  --border-strong: rgba(15, 23, 42, 0.25);
  --border-accent: rgba(244, 98, 42, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #F4622A;
  --text-on-accent: #ffffff;
  --text-on-sidebar: #0f172a;
  --text-muted-sidebar: #64748b;

  --accent: #F4622A;
  --accent-hover: #d95221;
  --accent-subtle: rgba(244, 98, 42, 0.1);
  --accent-subtle-hover: rgba(244, 98, 42, 0.16);
  --accent-warm: #ff8a5c;
  --accent-deep: #c74012;

  --amber: #f59e0b;
  --amber-subtle: rgba(245, 158, 11, 0.12);

  --status-todo-bg: rgba(100, 116, 139, 0.1);
  --status-todo: #64748b;
  --status-inprogress-bg: rgba(244, 98, 42, 0.1);
  --status-inprogress: #F4622A;
  --status-done-bg: rgba(16, 185, 129, 0.1);
  --status-done: #10b981;
  --status-blocked-bg: rgba(239, 68, 68, 0.1);
  --status-blocked: #ef4444;

  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #64748b;

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-accent: 0 0 20px rgba(244, 98, 42, 0.25), 0 4px 12px rgba(244, 98, 42, 0.15);
  --shadow-sidebar: 1px 0 0 var(--border-subtle);

  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth: cubic-bezier(0.25,0.46,0.45,0.94);
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 380ms;

  --pulse-color: rgba(244, 98, 42, 0.2);
  --pulse-color-peak: rgba(244, 98, 42, 0.08);
}

[data-theme="dark"] {
  --bg-base: #020617;
  --bg-surface: #0f172a;
  --bg-elevated: #1e293b;
  --bg-overlay: #1e293b;
  --bg-hover: #334155;
  --bg-sidebar: #020617;
  --bg-sidebar-hover: #0f172a;
  --bg-sidebar-active: rgba(244, 98, 42, 0.15);

  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.15);
  --border-accent: rgba(255, 138, 92, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #ff8a5c;
  --text-on-sidebar: #f8fafc;
  --text-muted-sidebar: #94a3b8;

  --accent: #F4622A;
  --accent-hover: #ff8a5c;
  --accent-subtle: rgba(244, 98, 42, 0.15);
  --accent-subtle-hover: rgba(244, 98, 42, 0.25);
  --accent-warm: #ffb599;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 20px rgba(244, 98, 42, 0.3);
  --shadow-sidebar: 1px 0 0 rgba(255,255,255,0.05);

  --pulse-color: rgba(244, 98, 42, 0.25);
  --pulse-color-peak: rgba(244, 98, 42, 0.1);

  --status-done: #10b981;
  --success: #10b981;
  --status-inprogress: #ff8a5c;
  --text-accent: #ff8a5c;
}

/* === RESET === */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

input, textarea, select { font-family: inherit; }

img, svg { display: block; }

/* === KEYFRAMES === */

@keyframes transcriptPulse {
  0%   { box-shadow: 0 0 0 0 var(--pulse-color); }
  40%  { box-shadow: 0 0 36px 14px var(--pulse-color); }
  100% { box-shadow: 0 0 0 0 var(--pulse-color-peak); }
}

@keyframes warmShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulsingDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.2); opacity: 0.65; }
}

@keyframes doodleTrace {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes confettiFall {
  0%   { transform: translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx),var(--dy)) rotate(var(--dr)); opacity: 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes spinArc {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes checkDraw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.94); }
  60%  { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes countdownShrink {
  from { width: 100%; }
  to   { width: 0%; }
}

@keyframes ringFill {
  from { stroke-dashoffset: var(--ring-start); }
  to   { stroke-dashoffset: var(--ring-end); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(0.5deg); }
  66%       { transform: translateY(-4px) rotate(-0.5deg); }
}

@keyframes floatDelayed {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes glow {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.7; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes progressSweep {
  from { width: 0; }
  to   { width: var(--target-width); }
}

@keyframes adminPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 98, 42, 0.0); border-color: var(--border-accent); }
  50%       { box-shadow: 0 0 0 4px rgba(244, 98, 42, 0.10); border-color: var(--accent); }
}

/* === UTILITY === */

.ai-generated {
  border-left: 3px solid var(--accent-subtle);
  font-style: italic;
  padding-left: 12px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(244, 98, 42, 0.04) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: warmShimmer 1.8s infinite;
  border-radius: var(--radius-md);
}

.processing { animation: transcriptPulse 2s ease-in-out infinite; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.theme-transitioning *, .theme-transitioning *::before, .theme-transitioning *::after {
  transition: background-color 200ms ease, color 200ms ease, border-color 150ms ease !important;
}

::-webkit-scrollbar { width: 5px; height: 5px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }

::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

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

/* ============================================
   HIDE LEMMA DEFAULT UI COMPONENTS
   ============================================ */

/* Hide any Lemma sidebar/navigation components */

[data-lemma-sidebar],
[data-lemma-layout],
[data-lemma-nav],
nav[class*="lemma"],
aside[class*="lemma"],
div[class*="lemma-sidebar"],
div[class*="LemmaSidebar"] {
  display: none !important;
}

/* Ensure full app layout */

#root {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Override any Lemma layout constraints */

#root > * {
  max-width: 100% !important;
}
