/* -----------------------------
      Fracton Motion Utilities
      (safe, consistent, mobile-aware)
    -------------------------------- */

/* Toolbar fallback to keep nav visible if utility CSS fails to load */
:where(.site-nav) {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 10, 10, .9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
}

:where(.site-nav .nav-container) {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 0.75rem;
}

:where(.site-nav .nav-mobile),
:where(.site-nav .nav-desktop) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  :where(.site-nav .nav-mobile) {
    display: none;
  }

  :where(.site-nav .nav-desktop) {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
  }
}

@media (max-width: 1023px) {
  :where(.site-nav .nav-desktop) {
    display: none;
  }
}

.brand-logo {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: block;
}

.brand-logo--lg {
  width: 32px;
  height: 32px;
}

/* Hero redesign */
.hero-section {
  background: #0A0A0A;
}

.hero-noise {
  position: absolute;
  inset: 0;
  background-image: url('https://grainy-gradients.vercel.app/noise.svg');
  opacity: 0.12;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 520px at 78% -10%, rgba(239, 68, 68, .18), transparent 60%),
    radial-gradient(700px 520px at 8% 10%, rgba(239, 68, 68, .08), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 3rem;
  align-items: start;
}

.hero-copy {
  max-width: 42rem;
}

.hero-title {
  font-size: clamp(2.4rem, 3.2vw + 1rem, 4.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-typed {
  display: block;
  margin-top: 0.35rem;
  white-space: nowrap;
  font-size: 0.95em;
}

.typed-text {
  color: #ef4444;
}

.typed-cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.85em;
  background: #ef4444;
  margin-left: 0.08em;
  transform: translateY(0.12em);
}

.hero-subcopy {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.hero-cta {
  border-radius: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero-cta--primary {
  background: #ef4444;
  border: 1px solid #dc2626;
}

.hero-cta--primary:hover {
  background: #dc2626;
}

.hero-cta--secondary {
  background: rgba(10, 10, 10, .65);
}

.hero-visual {
  position: relative;
  min-height: 700px;
  max-height: none;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .1);
  background:
    linear-gradient(140deg, rgba(10, 10, 10, .9), rgba(10, 10, 10, .6));
  overflow: visible;
  align-self: center;
}

.hero-visual--open {
  border: 0;
  background: transparent;
}

.hero-visual--open .hero-visual__inner {
  opacity: 0;
  background: none;
  display: none;
}

.hero-copy--lifted {
  margin-top: 56px;
}

@media (max-width: 1023px) {
  .hero-copy--lifted {
    margin-top: 48px;
  }
}

.hero-card-stack {
  transform: scale(0.92);
  transform-origin: top center;
}

@media (max-width: 1023px) {
  .hero-card-stack {
    transform: scale(0.95);
  }
}

.hero-visual__inner {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 280px at 20% 20%, rgba(239, 68, 68, .18), transparent 60%),
    radial-gradient(520px 340px at 80% 70%, rgba(249, 115, 22, .12), transparent 65%),
    linear-gradient(0deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  opacity: 0.8;
}

.hero-preview {
  position: relative;
  z-index: 1;
  margin: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(10, 10, 10, .78);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 12px;
}

.hero-preview.hero-preview--open {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-preview__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-preview__title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.hero-preview__count {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(10, 10, 10, .7);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
}

.hero-preview__actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.hero-preview__action {
  padding: 6px 10px;
  border-radius: 10px;
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-preview__action--ghost {
  background: rgba(10, 10, 10, .6);
  border-color: rgba(255, 255, 255, .2);
  color: #e5e7eb;
}

.hero-preview__panel {
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 10, 10, .55);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.hero-preview__search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-preview__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.hero-preview__icon-svg {
  width: 14px;
  height: 14px;
}

.hero-preview__input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, .7);
  background: rgba(10, 10, 10, .7);
  color: #94a3b8;
  font-size: 11px;
}

.hero-preview__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hero-preview__label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b7280;
}

.hero-preview__pill-btn {
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #9ca3af;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-preview__pill-btn.is-active {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .6);
  color: #fecaca;
}

.hero-preview__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-preview__stat {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 10, 10, .55);
  display: grid;
  gap: 6px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-preview__stat strong {
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.hero-preview__stat strong.is-alert {
  color: #fca5a5;
}

.hero-preview__stat strong.is-ok {
  color: #86efac;
}

.hero-preview__stat small {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #6b7280;
  text-transform: uppercase;
}

.hero-preview__list {
  display: grid;
  gap: 6px;
}

.hero-preview__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 10, 10, .45);
}

.hero-preview__service {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.hero-preview__meta {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 4px;
}

.hero-preview__badge {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-preview__badge--alert {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .12);
  color: #fca5a5;
}

.hero-preview__badge--ok {
  border-color: rgba(16, 185, 129, .4);
  background: rgba(16, 185, 129, .12);
  color: #86efac;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-visual {
    min-height: 520px;
  }
}

:root {
  --fx-ease: cubic-bezier(.2, .8, .2, 1);
  --fx-fast: 160ms var(--fx-ease);
  --fx-med: 220ms var(--fx-ease);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {

  .fx-scale,
  .fx-float,
  .fx-reveal>.fx-reveal__more,
  .fx-fill,
  .fx-iconfill,
  .fx-glow {
    transition: none !important;
    transform: none !important;
  }
}

/* 1) Scale (primary actions) */
.fx-scale {
  transition: transform var(--fx-fast), filter var(--fx-fast);
  transform: translateZ(0);
}

.fx-scale:hover,
.fx-scale:focus-visible {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.fx-scale:active {
  transform: scale(0.99);
}

/* 2) Float (explore / cards) */
.fx-float {
  transition: transform var(--fx-med), box-shadow var(--fx-med), border-color var(--fx-med);
  transform: translateZ(0);
}

.fx-float:hover,
.fx-float:focus-visible {
  transform: translateY(-6px) scale(1.02);
}

.fx-float:active {
  transform: translateY(-2px);
}

/* 3) Reveal (progressive disclosure) */
.fx-reveal {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
}

.fx-reveal>.fx-reveal__more {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity var(--fx-med), transform var(--fx-med);
}

.fx-reveal:hover>.fx-reveal__more,
.fx-reveal:focus-visible>.fx-reveal__more {
  opacity: 1;
  transform: translateY(0);
}

/* 4) Fill text (danger / irreversible) */
.fx-fill {
  color: rgba(239, 68, 68, .7);
  /* Visible by default with transparency */
  transition: color var(--fx-fast);
}

.fx-fill:hover,
.fx-fill:focus-visible {
  color: rgba(239, 68, 68, .95);
}

.fx-fill:active {
  color: rgba(239, 68, 68, .85);
}

/* Safer "brand fill" variant for non-danger headlines */
.fx-fill-brand {
  color: transparent;
  -webkit-text-stroke: 1px rgba(239, 68, 68, .95);
  /* primary */
  transition: color var(--fx-fast), -webkit-text-stroke-color var(--fx-fast);
}

.fx-fill-brand:hover,
.fx-fill-brand:focus-visible {
  color: rgba(239, 68, 68, .95);
}

/* 5) Icon fill (toggles / state) */
.fx-iconfill {
  transition: transform var(--fx-fast), filter var(--fx-fast);
}

.fx-iconfill:hover,
.fx-iconfill:focus-visible {
  transform: scale(1.06);
  filter: brightness(1.1);
}

.fx-iconfill:active {
  transform: scale(0.98);
}

/* 6) Subtle glow (premium emphasis without shouting) */
.fx-glow {
  transition: box-shadow var(--fx-med), transform var(--fx-med);
}

.fx-glow:hover,
.fx-glow:focus-visible {
  box-shadow: 0 10px 30px rgba(239, 68, 68, .18);
}



/* Glassmorphism panel */
.glass-panel {
  background: linear-gradient(140deg, rgba(10, 10, 10, .75), rgba(10, 10, 10, .35));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}

/* Tag chips */
.tag-chip {
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #9ca3af;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  transition: border-color var(--fx-fast), color var(--fx-fast), background var(--fx-fast), transform var(--fx-fast);
}

.tag-chip:hover {
  border-color: rgba(239, 68, 68, .6);
  color: #e5e7eb;
}

.tag-chip.is-active {
  background: rgba(239, 68, 68, .2);
  border-color: rgba(239, 68, 68, .7);
  color: #fecaca;
  transform: translateY(-1px);
}

/* Stepper */
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #374151;
  border: 1px solid #4b5563;
  transition: background var(--fx-fast), border-color var(--fx-fast), transform var(--fx-fast);
}

.step-dot.is-active {
  background: #ef4444;
  border-color: rgba(239, 68, 68, .9);
  transform: scale(1.1);
}

.step-dot.is-done {
  background: #f97316;
  border-color: rgba(249, 115, 22, .9);
}

.step-line {
  height: 2px;
  flex: 1;
  background: #374151;
  border-radius: 9999px;
}

.step-line.is-done {
  background: rgba(249, 115, 22, .7);
}

/* Status badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-logged {
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5);
  border-color: hsl(var(--border));
}

.status-sent {
  color: #60a5fa; /* blue-400 - works in both modes */
  background: rgba(59, 130, 246, .15);
  border-color: rgba(59, 130, 246, .35);
}

.status-deleted {
  color: #4ade80; /* green-400 - works in both modes */
  background: rgba(16, 185, 129, .15);
  border-color: rgba(16, 185, 129, .35);
}

/* Overview cards */
.overview-card {
  background: radial-gradient(900px 240px at 10% 0%, rgba(239, 68, 68, .15), transparent 60%),
    rgba(10, 10, 10, .6);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  transition: transform var(--fx-med), border-color var(--fx-med);
}

.overview-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(239, 68, 68, 0.4);
}

.fragment-card {
  transition: transform var(--fx-med), border-color var(--fx-med), background var(--fx-med);
}

.fragment-card:hover {
  transform: translateY(-2px) scale(1.015);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}


.ai-insight {
  background: linear-gradient(145deg, rgba(10, 10, 10, .75), rgba(10, 10, 10, .45));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(12px);
}

.ai-insight--critical {
  border-color: rgba(239, 68, 68, .35);
}

.ai-insight--high {
  border-color: rgba(245, 158, 11, .35);
}

.ai-insight--low {
  border-color: rgba(16, 185, 129, .35);
}

.auth-locked {
  overflow: hidden;
}

.auth-locked #appShell {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.auth-mode-btn {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #e5e7eb;
  transition: border-color var(--fx-fast), background var(--fx-fast), transform var(--fx-fast);
}

.auth-mode-btn:hover {
  border-color: rgba(239, 68, 68, .6);
  transform: translateY(-1px);
}

.auth-mode-btn.is-active {
  border-color: rgba(239, 68, 68, .8);
  background: rgba(239, 68, 68, .15);
}

.auth-intent-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .6);
  color: #9ca3af;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color var(--fx-fast), color var(--fx-fast), background var(--fx-fast);
}

.auth-intent-btn:hover {
  color: #e5e7eb;
  border-color: rgba(239, 68, 68, .6);
}

.auth-intent-btn.is-active {
  color: #fecaca;
  border-color: rgba(239, 68, 68, .8);
  background: rgba(239, 68, 68, .15);
}

.auth-intent-btn.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #0A0A0A;
  accent-color: #ef4444;
}

/* Removed - using theme-aware select styles below */

/* Custom Utilities */
body.modal-open {
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
}

/* Scrollbar Polish */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #0A0A0A;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Risk Filter Buttons */
button.risk-filter-btn {
  background: hsl(var(--muted)) !important;
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--muted-foreground)) !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 0.375rem !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
}

button.risk-filter-btn:hover {
  background: hsl(var(--accent)) !important;
  color: hsl(var(--accent-foreground)) !important;
}

button.risk-filter-btn.is-active {
  background: hsl(var(--primary) / 0.15) !important;
  border-color: hsl(var(--primary) / 0.5) !important;
  color: hsl(var(--primary)) !important;
}

button.risk-filter-btn[data-risk-filter="all"].is-active {
  background: hsl(217 91% 60% / 0.15) !important;
  border-color: hsl(217 91% 60% / 0.5) !important;
  color: hsl(217 91% 60%) !important;
}

button.risk-filter-btn[data-risk-filter="low"].is-active {
  background: hsl(142 76% 36% / 0.15) !important;
  border-color: hsl(142 76% 36% / 0.5) !important;
  color: hsl(142 76% 36%) !important;
}

button.risk-filter-btn[data-risk-filter="medium"].is-active {
  background: hsl(38 92% 50% / 0.15) !important;
  border-color: hsl(38 92% 50% / 0.5) !important;
  color: hsl(38 92% 50%) !important;
}

button.risk-filter-btn[data-risk-filter="high"].is-active {
  background: hsl(0 84% 60% / 0.15) !important;
  border-color: hsl(0 84% 60% / 0.5) !important;
  color: hsl(0 84% 60%) !important;
}

button.risk-filter-btn[data-risk-filter="breached"].is-active {
  background: hsl(0 84% 60% / 0.2) !important;
  border-color: hsl(0 84% 60% / 0.6) !important;
  color: hsl(0 84% 60%) !important;
}

/* Status pills */
.status-pill {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(10, 10, 10, .6);
  color: #e5e7eb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill--warn {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .12);
  color: #fca5a5;
}

.status-pill--ok {
  border-color: rgba(16, 185, 129, .45);
  background: rgba(16, 185, 129, .12);
  color: #86efac;
}

.status-muted {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
  white-space: nowrap;
}

.status-stack {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b7280;
  white-space: nowrap;
}

/* Onboarding checklist */
.onboarding-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 10, 10, .5);
  color: #e5e7eb;
}

.onboarding-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(75, 85, 99, .8);
  background: rgba(10, 10, 10, .7);
  position: relative;
  margin-top: 2px;
}

.onboarding-item.is-complete .onboarding-check {
  background: #ef4444;
  border-color: #ef4444;
}

.onboarding-item.is-complete .onboarding-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.onboarding-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.onboarding-text {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Search highlight */
mark.search-highlight {
  background: rgba(239, 68, 68, .25);
  color: #fee2e2;
  padding: 0 2px;
  border-radius: 4px;
}

/* Fragment card selection */
.fragment-card.is-selected {
  border-color: rgba(239, 68, 68, .5) !important;
  background: rgba(239, 68, 68, .05) !important;
}

.fragment-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .fragment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fragment-card--compact {
  padding: 1rem;
  border-radius: 16px;
}

.fragment-card--compact h4 {
  font-size: 15px;
}

.fragment-card--compact .tag-chip {
  padding: 4px 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

button.view-toggle-btn {
  background: hsl(var(--muted)) !important;
  border: 1px solid hsl(var(--border)) !important;
  color: hsl(var(--muted-foreground)) !important;
  border-radius: 0.375rem !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
}

button.view-toggle-btn:hover {
  border-color: hsl(var(--primary) / 0.6) !important;
  color: hsl(var(--foreground)) !important;
  background: hsl(var(--accent)) !important;
}

button.view-toggle-btn.is-active,
button.view-toggle-btn.is-active:hover {
  background-color: hsl(217 91% 60% / 0.2) !important;
  background: hsl(217 91% 60% / 0.2) !important;
  border-color: hsl(217 91% 60%) !important;
  border-width: 2px !important;
  color: hsl(217 91% 60%) !important;
  font-weight: 700 !important;
}

.fragment-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #9ca3af;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fragment-checkbox:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.fragment-checkbox:checked {
  background: #ef4444;
  border-color: #ef4444;
}

.fragment-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Keyboard shortcut hints */
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(55, 65, 81, .8);
  border: 1px solid rgba(75, 85, 99, .8);
  border-radius: 4px;
  color: #d1d5db;
}

/* Tutorial overlay */
.tutorial-overlay {
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(8px);
}

.tutorial-step {
  animation: tutorialPulse 2s ease-in-out infinite;
}

@keyframes tutorialPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Breach timestamp */
.breach-timestamp {
  font-size: 9px;
  color: #6b7280;
}

/* Mobile app chrome */
.mobile-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .75);
  color: #e5e7eb;
  transition: border-color var(--fx-fast), transform var(--fx-fast), background var(--fx-fast);
}

.mobile-icon-btn:hover {
  border-color: rgba(239, 68, 68, .6);
  transform: translateY(-1px);
}

.mobile-search-card {
  background: rgba(10, 10, 10, .7);
  border: 1px solid rgba(55, 65, 81, .9);
  border-radius: 18px;
  padding: 12px 14px;
}

.mobile-segmented {
  display: flex;
  gap: 6px;
  background: rgba(10, 10, 10, .7);
  border: 1px solid rgba(55, 65, 81, .9);
  border-radius: 16px;
  padding: 6px;
}

.mobile-segmented .risk-filter-btn,
.mobile-segmented .view-toggle-btn {
  flex: 1;
  border: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 6px;
  border-radius: 12px;
}

.mobile-action-btn {
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #e5e7eb;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 12px;
  transition: border-color var(--fx-fast), transform var(--fx-fast), background var(--fx-fast);
}

.mobile-action-btn:hover {
  border-color: rgba(239, 68, 68, .6);
  transform: translateY(-1px);
}

.mobile-metric-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.mobile-metric-tabs::-webkit-scrollbar {
  display: none;
}

.mobile-metric-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #9ca3af;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  transition: border-color var(--fx-fast), color var(--fx-fast), background var(--fx-fast);
}

.mobile-metric-tab.is-active {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .7);
  color: #fecaca;
}

.mobile-metric-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.mobile-metric-carousel::-webkit-scrollbar {
  display: none;
}

.mobile-metric-card {
  flex: 0 0 calc(100% - 48px);
  max-width: calc(100% - 48px);
  min-height: 90px;
  border-radius: 18px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: linear-gradient(140deg, rgba(10, 10, 10, .9), rgba(10, 10, 10, .5));
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  scroll-snap-align: center;
}

.mobile-metric-card span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9ca3af;
}

.mobile-metric-card strong {
  font-size: 22px;
  font-weight: 800;
  color: #f9fafb;
  line-height: 1.1;
}

.mobile-metric-card small {
  font-size: 11px;
  color: #94a3b8;
}

.mobile-menu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: linear-gradient(140deg, rgba(10, 10, 10, .8), rgba(10, 10, 10, .4));
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  transition: border-color var(--fx-fast), transform var(--fx-fast), box-shadow var(--fx-fast);
}

.mobile-menu-card:hover {
  border-color: rgba(239, 68, 68, .6);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

.mobile-pill-menu {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.mobile-pill-menu::-webkit-scrollbar {
  display: none;
}

.mobile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, .9);
  background: rgba(10, 10, 10, .7);
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color var(--fx-fast), color var(--fx-fast), background var(--fx-fast);
}

.mobile-pill.is-active {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .7);
  color: #fecaca;
}

.mobile-pill--metric {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 120px;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.mobile-pill--metric strong {
  font-size: 16px;
  color: #f9fafb;
  letter-spacing: 0;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: flex;
  gap: 6px;
  padding: 10px 10px 14px;
  background: rgba(10, 10, 10, .92);
  border-top: 1px solid rgba(55, 65, 81, .85);
  backdrop-filter: blur(16px);
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  padding: 6px 4px;
}

.mobile-tab-btn.is-active {
  color: #fca5a5;
}

.mobile-tab-btn--primary {
  background: #ef4444;
  color: #fff;
  border-radius: 18px;
  border: 1px solid #dc2626;
  box-shadow: 0 12px 28px rgba(239, 68, 68, .35);
  margin-top: -18px;
  padding: 10px 0;
}

.mobile-tab-btn--primary svg {
  margin-bottom: -2px;
}

.mobile-tab-btn--primary span {
  font-size: 8px;
  letter-spacing: 0.14em;
}

@media (max-width: 1023px) {
  #app {
    padding-top: 2.5rem;
    padding-bottom: 8rem;
  }

  #overview {
    padding-bottom: 8rem;
  }

  .mobile-hide {
    display: none !important;
  }

  #overview .overview-card {
    padding: 1rem;
    border-radius: 18px;
  }

  #overview .overview-card .h-72 {
    height: 210px;
  }

  #overview .overview-card .h-56 {
    height: 190px;
  }

  #overview .bg-\[\#0A0A0A\]\/50.border {
    padding: 1rem;
    border-radius: 18px;
  }

  #overview .bg-\[\#0A0A0A\]\/60.border {
    padding: 0.75rem;
    border-radius: 16px;
  }

  #addPanel {
    position: fixed;
    inset: 0;
    z-index: 105;
    border-radius: 0;
    padding-top: 4.5rem;
    padding-bottom: 6rem;
    overflow-y: auto;
    background: rgba(10, 10, 10, .96);
  }
}

/* ========================================
       ELECTRON CUSTOM TITLEBAR STYLES
       ======================================== */

/* Titlebar container */
.electron-titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.85) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
  display: none;
  /* Hidden by default */
  justify-content: space-between;
  align-items: center;
  z-index: 200;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Show titlebar only in Electron */
.electron-titlebar.electron-active {
  display: flex;
}

/* Drag region */
.electron-drag-region {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 16px;
  -webkit-app-region: drag;
  cursor: move;
}

/* Window controls container */
.electron-window-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

/* Control buttons */
.electron-control-btn {
  width: 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(156, 163, 175, 0.85);
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 100ms cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}

.electron-control-btn:hover {
  background: rgba(55, 65, 81, 0.5);
  color: rgba(255, 255, 255, 0.98);
}

.electron-control-btn:active {
  background: rgba(55, 65, 81, 0.7);
  transform: scale(0.95);
}

.electron-control-btn:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.5);
  outline-offset: -2px;
}

/* Close button special hover */
.electron-control-btn:last-child:hover {
  background: #ef4444;
  color: white;
}

.electron-control-btn:last-child:active {
  background: #dc2626;
  color: white;
}

/* Icon sizing */
.electron-control-btn svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

/* Adjust main navigation when titlebar is present (Electron only) */
.electron-titlebar.electron-active~* .app-nav {
  top: 36px;
}

/* Adjust body and layout when titlebar is present (Electron only) */
body.is-electron {
  padding-top: var(--titlebar-height, 0px);
}

.is-electron .fixed.inset-0:not(.electron-titlebar-react),
.is-electron .fixed.top-0:not(.electron-titlebar-react) {
  top: var(--titlebar-height, 0px);
}

.is-electron .fixed.h-svh,
.is-electron .fixed.h-screen {
  height: calc(100vh - var(--titlebar-height, 0px));
}

/* ================================
       Modern UI Enhancements
       ================================ */

/* Loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Pulse animation for loading states */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth fade-in for content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Improved focus states for accessibility - SCOPED TO LEGACY */
#legacy-root *:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.6);
  outline-offset: 2px;
}

#legacy-root input,
#legacy-root select,
#legacy-root textarea {
  background-color: #212121 !important;
  border-color: #404040 !important;
  color: #fff !important;
}

#legacy-root input::placeholder {
  color: #a3a3a3 !important;
}

/* Force dark mode background on autofill to avoid white flash - SCOPED TO LEGACY */
#legacy-root input:-webkit-autofill,
#legacy-root input:-webkit-autofill:hover,
#legacy-root input:-webkit-autofill:focus,
#legacy-root input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #212121 inset !important;
  -webkit-text-fill-color: white !important;
}

#legacy-root button:focus-visible,
#legacy-root a:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.8);
  outline-offset: 2px;
}

/* Smooth transitions for interactive elements - SCOPED TO LEGACY */
#legacy-root button,
#legacy-root a,
#legacy-root input,
#legacy-root select,
#legacy-root textarea {
  transition-property: background-color, border-color, color, transform, box-shadow;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Notification toast styles */
.notification-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 20px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  z-index: 9999;
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.notification-toast.success {
  border-color: rgba(16, 185, 129, 0.5);
}

.notification-toast.error {
  border-color: rgba(239, 68, 68, 0.5);
}

.notification-toast.info {
  border-color: rgba(59, 130, 246, 0.5);
}

/* Skeleton loading for content */
.skeleton {
  background: linear-gradient(90deg,
      rgba(55, 65, 81, 0.2) 0%,
      rgba(55, 65, 81, 0.4) 50%,
      rgba(55, 65, 81, 0.2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

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

  100% {
    background-position: 200% 0;
  }
}

/* Improved scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  transition: background 200ms;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.6);
}

/* Dev mode indicator */
.dev-indicator {
  margin-left: 8px;
  padding: 2px 8px;
  background: #eab308;
  color: #0A0A0A;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}

/* FORCE OVERRIDE FOR LEGACY BACKGROUNDS - scoped to legacy elements only */
body[data-fracton-tab='map'] #legacy-root #app,
body[data-fracton-tab='overview'] #legacy-root #overview,
#legacy-root #app,
#legacy-root #overview {
  background-color: #0A0A0A !important;
}

/* Body background handled by React/Tailwind - removed !important override */
/* -----------------------------
      Guided Onboarding UI
    -------------------------------- */

.onboarding-overlay {
  transition: opacity 0.3s ease;
}

.onboarding-card {
  animation: onboarding-slide-up 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes onboarding-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.onboarding-progress-bar {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-btn-primary {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #ef4444 !important;
}

.onboarding-btn-primary:hover {
  background: #ef4444 !important;
}

.onboarding-btn-primary:hover {
  background: #dc2626 !important;
}

.glow-pulsate {
  animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.onboarding-card {
  background: #000 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.onboarding-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.onboarding-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* Native select and option styling for theme compatibility */
select {
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--input)) !important;
}

.dark select,
html.dark select {
  color-scheme: dark;
}

.light select,
html:not(.dark) select {
  color-scheme: light;
}

select option {
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
}

select option:checked {
  background-color: hsl(var(--primary) / 0.1) !important;
}

/* Force dark mode styling on select dropdowns */
.dark select option,
html.dark select option {
  background: #0a0a0a !important;
  color: #e5e7eb !important;
}

.light select option,
html:not(.dark) select option {
  background: #ffffff !important;
  color: #0a0a0a !important;
}

/* Sonner toast overrides for theme compatibility */
[data-sonner-toast],
[data-sonner-toast] > *,
[data-sonner-toast] li {
  background-color: hsl(var(--background)) !important;
  border: 1px solid hsl(var(--border)) !important;
  opacity: 1 !important;
}

.dark [data-sonner-toast],
.dark [data-sonner-toast] > *,
.dark [data-sonner-toast] li {
  background-color: #0a0a0a !important;
  border-color: #27272a !important;
}

html:not(.dark) [data-sonner-toast],
html:not(.dark) [data-sonner-toast] > *,
html:not(.dark) [data-sonner-toast] li {
  background-color: #ffffff !important;
  border-color: #e5e7eb !important;
}

[data-sonner-toast] {
  color: hsl(var(--foreground)) !important;
}

[data-sonner-toast]::before,
[data-sonner-toast]::after {
  display: none !important;
}

[data-sonner-toast] [data-title] {
  color: hsl(var(--foreground)) !important;
}

[data-sonner-toast] [data-description] {
  color: hsl(var(--muted-foreground)) !important;
}

[data-sonner-toast] [data-button] {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
}

[data-sonner-toast][data-type="success"] {
  border-color: hsl(142 76% 36% / 0.5) !important;
}

[data-sonner-toast][data-type="error"] {
  border-color: hsl(0 84% 60% / 0.5) !important;
}

/* Sonner wrapper/container */
[data-sonner-toaster] [data-sonner-toast] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
