@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* Unii Glassmorphic Design System & Landing Page Styles */

:root {
  --canvas: #f6f7fa;
  --surface: #ffffff;
  --ink: #252a3c;
  --muted: #626b7e;
  --line: #e4e7ef;
  --iris: #6250b8;
  --iris-soft: #eeebf7;
  --teal: #237565;
  --teal-soft: #e7f3ee;
  --focus: #6250b8;
  --radius: 0.625rem;
}

.dark {
  --canvas: #0b0d13;
  --surface: #141721;
  --ink: #f0f3fa;
  --muted: #949db1;
  --line: #222736;
  --iris: #8572e8;
  --iris-soft: rgba(133, 114, 232, 0.16);
  --teal: #2ea892;
  --teal-soft: rgba(46, 168, 146, 0.16);
  --focus: #8572e8;
}

html,
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background-color: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

/* Material Symbols */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  max-width: 1em;
  max-height: 1em;
  overflow: hidden;
  vertical-align: middle;
  flex-shrink: 0;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  user-select: none;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* Explicit size locks to prevent layout shift before webfont load */
.material-symbols-outlined[class*="text-[12px]"] {
  width: 12px;
  height: 12px;
}
.material-symbols-outlined[class*="text-[13px]"] {
  width: 13px;
  height: 13px;
}
.material-symbols-outlined[class*="text-[14px]"] {
  width: 14px;
  height: 14px;
}
.material-symbols-outlined[class*="text-[15px]"] {
  width: 15px;
  height: 15px;
}
.material-symbols-outlined[class*="text-[16px]"] {
  width: 16px;
  height: 16px;
}
.material-symbols-outlined[class*="text-[17px]"] {
  width: 17px;
  height: 17px;
}
.material-symbols-outlined[class*="text-[18px]"] {
  width: 18px;
  height: 18px;
}
.material-symbols-outlined[class*="text-[20px]"] {
  width: 20px;
  height: 20px;
}
.material-symbols-outlined[class*="text-[22px]"] {
  width: 22px;
  height: 22px;
}
.material-symbols-outlined[class*="text-[24px]"] {
  width: 24px;
  height: 24px;
}
.material-symbols-outlined[class*="text-[26px]"] {
  width: 26px;
  height: 26px;
}

/* Glassmorphism Surfaces */
.glass-pill {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 4px 20px -2px rgba(37, 42, 60, 0.05),
    0 0 0 1px rgba(228, 231, 239, 0.6);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.dark .glass-pill {
  background: rgba(20, 23, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 20px -2px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.glass-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 10px 30px -4px rgba(98, 80, 184, 0.05),
    0 1px 3px 0 rgba(37, 42, 60, 0.04);
  transition:
    transform 0.25s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1),
    border-color 0.25s ease,
    background-color 0.2s ease;
}

.dark .glass-card {
  background: rgba(20, 23, 33, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 30px -4px rgba(0, 0, 0, 0.4),
    0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 36px -4px rgba(98, 80, 184, 0.1),
    0 2px 6px 0 rgba(37, 42, 60, 0.06);
  border-color: rgba(98, 80, 184, 0.35);
}

.dark .glass-card:hover {
  box-shadow:
    0 16px 36px -4px rgba(133, 114, 232, 0.18),
    0 2px 6px 0 rgba(0, 0, 0, 0.4);
  border-color: rgba(133, 114, 232, 0.45);
}

#delete-doc-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(30rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow:
    0 24px 64px -16px rgb(11 13 19 / 24%),
    0 8px 24px -8px rgb(11 13 19 / 12%);
}

#delete-doc-modal::backdrop {
  background: rgb(11 13 19 / 38%);
  backdrop-filter: blur(2px);
}

#playground-layout {
  overflow-wrap: anywhere;
}

#grounding-inspector {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-height: 650px;
  overflow: hidden;
}

#grounding-excerpt {
  max-height: clamp(8rem, 28dvh, 14rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#grounding-trace {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#grounding-trace-steps {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.glass-cta {
  background: linear-gradient(
    135deg,
    rgba(98, 80, 184, 0.94) 0%,
    rgba(79, 62, 158, 0.98) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 20px 40px -10px rgba(98, 80, 184, 0.35),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.dark .glass-cta {
  background: linear-gradient(
    135deg,
    rgba(82, 65, 160, 0.95) 0%,
    rgba(59, 45, 122, 0.98) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
}

/* Ambient glow orbs */
.ambient-glow-iris {
  position: absolute;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(98, 80, 184, 0.22) 0%,
    rgba(98, 80, 184, 0) 70%
  );
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.dark .ambient-glow-iris {
  background: radial-gradient(
    circle,
    rgba(133, 114, 232, 0.28) 0%,
    rgba(133, 114, 232, 0) 70%
  );
}

.ambient-glow-teal {
  position: absolute;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(35, 117, 101, 0.18) 0%,
    rgba(35, 117, 101, 0) 70%
  );
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 14s ease-in-out infinite alternate-reverse;
}

.dark .ambient-glow-teal {
  background: radial-gradient(
    circle,
    rgba(46, 168, 146, 0.22) 0%,
    rgba(46, 168, 146, 0) 70%
  );
}

/* Animated Heading */
.heading-animated {
  background: linear-gradient(
    135deg,
    #1d2130 0%,
    #252a3c 40%,
    #6250b8 65%,
    #252a3c 85%,
    #1d2130 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 7s linear infinite;
}

.dark .heading-animated {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #e2e8f0 35%,
    #a799fa 65%,
    #e2e8f0 85%,
    #ffffff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes textShimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(25px, -18px) scale(1.08);
  }
  100% {
    transform: translate(-18px, 20px) scale(0.96);
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  background-color: var(--iris-soft);
  color: var(--iris);
}

.badge-teal {
  background-color: var(--teal-soft);
  color: var(--teal);
}

/* Avatar Badge */
.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: var(--iris-soft);
  color: var(--iris);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(98, 80, 184, 0.25);
  flex-shrink: 0;
}

.dark .avatar-badge {
  background-color: var(--iris-soft);
  color: var(--iris);
  border-color: rgba(133, 114, 232, 0.35);
}

/* Danger Button */
.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: scale(0.98);
}

.dark .btn-danger {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

.dark .btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Dark mode overrides for colored badges and icon boxes */
.dark .bg-purple-50 {
  background-color: rgba(147, 51, 234, 0.15) !important;
  color: #c084fc !important;
}
.dark .bg-blue-50 {
  background-color: rgba(37, 99, 235, 0.15) !important;
  color: #60a5fa !important;
}
.dark .bg-amber-50 {
  background-color: rgba(217, 119, 6, 0.15) !important;
  color: #fbbf24 !important;
}
.dark .bg-emerald-50 {
  background-color: rgba(5, 150, 105, 0.15) !important;
  color: #34d399 !important;
}

/* Suppress transitions during theme change to prevent smearing */
.theme-transitioning,
.theme-transitioning * {
  transition: none !important;
}

/* HTMX Swapping Micro-Animations */
@keyframes microFadeIn {
  from {
    opacity: 0.3;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.htmx-settling {
  animation: microFadeIn 200ms cubic-bezier(0.2, 0, 0, 1);
}

/* ==========================================================================
   Server Action Indicators: Spinners, Skeletons, and Top Loading Bar
   ========================================================================== */

/* Keyframe animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

@keyframes progressPulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Global Top Progress Bar */
#server-action-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--iris), var(--teal));
  box-shadow: 0 0 10px rgba(98, 80, 184, 0.45);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition:
    width 250ms ease-out,
    opacity 180ms ease-in-out;
}

#server-action-progress.active {
  opacity: 1;
  animation: progressPulse 1.2s ease-in-out infinite;
}

/* Spinner Component */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

.spinner-xs {
  width: 0.75rem;
  height: 0.75rem;
  border-width: 1.5px;
}

.spinner-sm {
  width: 0.875rem;
  height: 0.875rem;
  border-width: 2px;
}

.spinner-md {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2.5px;
}

.spinner-lg {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 3px;
}

.spinner-iris {
  color: var(--iris);
}

.spinner-teal {
  color: var(--teal);
}

/* Button Loading State */
button.is-loading,
button[disabled].is-loading,
a.is-loading,
.is-loading,
.btn-loading {
  position: relative !important;
  pointer-events: none;
  opacity: 0.82;
}

button.is-loading .btn-text-content,
a.is-loading .btn-text-content,
.is-loading .btn-text-content,
.btn-loading .btn-text-content,
.is-loading > :not(.btn-spinner-overlay),
.btn-loading > :not(.btn-spinner-overlay) {
  visibility: hidden;
}

button.is-loading .btn-spinner-overlay,
a.is-loading .btn-spinner-overlay,
.is-loading .btn-spinner-overlay,
.btn-loading .btn-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: inherit;
  visibility: visible;
  white-space: nowrap;
  border-radius: inherit;
}

/* HTMX Indicator utilities */
.htmx-indicator {
  display: none !important;
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex !important;
  opacity: 1;
}

.htmx-request .hide-on-request,
.hide-on-request.is-hidden {
  display: none !important;
}

/* Skeleton Loading Surfaces & Shimmers */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.09) 37%,
    rgba(0, 0, 0, 0.04) 63%
  );
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 300% 100%;
}

.skeleton-text {
  height: 0.75rem;
  border-radius: 0.25rem;
  margin-bottom: 0.375rem;
}

.skeleton-title {
  height: 1.125rem;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.skeleton-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.skeleton-badge {
  width: 4rem;
  height: 1.125rem;
  border-radius: 9999px;
  display: inline-block;
}

.skeleton-button {
  height: 2.25rem;
  border-radius: 0.75rem;
}

.skeleton-card {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background-color: var(--surface);
}

/* ==========================================================================
   Sonner Toast Notification System
   ========================================================================== */

.sonner-toaster {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  list-style: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

@media (max-width: 640px) {
  .sonner-toaster {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

.sonner-toast {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  pointer-events: auto;
  user-select: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    transform 300ms cubic-bezier(0.2, 0, 0, 1),
    opacity 300ms cubic-bezier(0.2, 0, 0, 1),
    height 300ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 200ms ease;
  transform-origin: bottom center;
  touch-action: pan-y;
  cursor: default;
}

.dark .sonner-toast {
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
  background-color: rgba(20, 23, 33, 0.95);
}

/* Stacked States */
.sonner-toast[data-index="0"] {
  transform: translateY(0) scale(1);
  opacity: 1;
  z-index: 10;
}

.sonner-toast[data-index="1"] {
  transform: translateY(-12px) scale(0.95);
  opacity: 0.9;
  z-index: 9;
}

.sonner-toast[data-index="2"] {
  transform: translateY(-24px) scale(0.9);
  opacity: 0.75;
  z-index: 8;
}

.sonner-toast[data-index="3"],
.sonner-toast[data-index="4"],
.sonner-toast[data-index="5"] {
  transform: translateY(-36px) scale(0.85);
  opacity: 0;
  pointer-events: none;
  z-index: 7;
}

/* Expanded state on hover / focus */
.sonner-toaster:hover .sonner-toast,
.sonner-toaster.is-expanded .sonner-toast {
  transform: translateY(calc(var(--expanded-offset, 0px) * -1)) scale(1) !important;
  opacity: 1 !important;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.12),
    0 3px 10px rgba(0, 0, 0, 0.06);
}

.dark .sonner-toaster:hover .sonner-toast,
.dark .sonner-toaster.is-expanded .sonner-toast {
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Entrance & Exit Animations */
.sonner-toast.is-entering {
  transform: translateY(16px) scale(0.95);
  opacity: 0;
}

.sonner-toast.is-leaving {
  transform: translateY(12px) scale(0.95) !important;
  opacity: 0 !important;
  pointer-events: none;
}

.sonner-toast.is-swiped {
  transform: translateX(100%) !important;
  opacity: 0 !important;
  transition:
    transform 200ms ease-out,
    opacity 200ms ease-out !important;
}

/* Icon & Content */
.sonner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.sonner-icon-success {
  color: var(--teal);
}

.sonner-icon-error {
  color: #ef4444;
}

.sonner-icon-warning {
  color: #f59e0b;
}

.sonner-icon-info {
  color: var(--iris);
}

.sonner-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sonner-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.sonner-description {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 3px;
}

.sonner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.sonner-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
  cursor: pointer;
  border: none;
}

.sonner-button:active {
  transform: scale(0.96);
}

.sonner-button-primary {
  background-color: var(--iris);
  color: #ffffff;
}

.sonner-button-primary:hover {
  background-color: #5241a0;
}

.sonner-button-secondary {
  background-color: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.sonner-button-secondary:hover {
  color: var(--ink);
  background-color: rgba(0, 0, 0, 0.05);
}

.dark .sonner-button-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Close button */
.sonner-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition:
    opacity 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.sonner-toast:hover .sonner-close,
.sonner-toaster:hover .sonner-close {
  opacity: 1;
}

@media (hover: none) {
  .sonner-close {
    opacity: 1;
  }
}

.sonner-close:hover {
  color: var(--ink);
  background-color: rgba(0, 0, 0, 0.05);
}

.dark .sonner-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .heading-animated,
  .ambient-glow-iris,
  .ambient-glow-teal,
  .htmx-settling,
  .spinner,
  .skeleton,
  #server-action-progress,
  .sonner-toast {
    animation: none !important;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  input:not([type="hidden"]),
  select:not([type="hidden"]),
  textarea:not([type="hidden"]) {
    font-size: 16px;
  }
}

/* Decision Flow Canvas */
.flow-canvas-container {
  position: relative;
  width: 100%;
  height: 640px;
  background-color: var(--canvas);
  background-image: radial-gradient(#d1ccdf 1.25px, transparent 1.25px);
  background-size: 24px 24px;
  overflow: hidden;
  user-select: none;
  cursor: grab;
}

.dark .flow-canvas-container {
  background-image: radial-gradient(#262c3d 1.25px, transparent 1.25px);
}

.flow-canvas-container.is-panning {
  cursor: grabbing;
}

.flow-canvas-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.flow-node-card {
  position: absolute;
  width: 280px;
  min-height: 68px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: grab;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  user-select: none;
}

.flow-node-card:hover {
  border-color: #8b79c8;
  box-shadow: 0 4px 14px rgba(98, 80, 184, 0.08);
}

.flow-node-card.selected {
  border: 2px solid #6250b8;
  padding: 11px 13px;
  box-shadow:
    0 0 0 3px rgba(98, 80, 184, 0.2),
    0 4px 16px rgba(98, 80, 184, 0.12);
}

.flow-handle-target {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6250b8;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.flow-handle-source-next {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6250b8;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.flow-handle-source-fallback {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #817792;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
