/* Critical CSS for the pre-React loading skeleton.
   Visually mirrors <LandingPageLoading /> (the React Suspense fallback used
   on the marketing surface) so the inline-HTML → React → page handoff is
   invisible. Without this mirror, users saw two completely different
   loading screens fight each other on the first paint.
   DO NOT add global CSS resets - Tailwind handles that. */

/* Minimal body styling - matches app light theme.
   IMPORTANT: this is an UNLAYERED rule loaded via <link> in index.html, so it
   wins the cascade over Tailwind's layered `body { @apply bg-background }`.
   It therefore MUST match the app's --background token (src/index.css :root,
   `--background: 44 40% 96%` = warm sepia #f7f3e9). If you change --background,
   update this hex too so the body canvas does not diverge after React mounts
   and the skeleton fades out. */
body {
  margin: 0;
  min-height: 100vh;
  background: #f7f3e9;
  font-family:
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

/* Visually hidden but accessible to screen readers (WCAG compliance) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   PRE-REACT WORKFLOW LOADER — visual twin of <LandingPageLoading />
   Full-color relay pipeline: 5 STAGE_TOKEN nodes (取込→分類→照合→集計→申告),
   each with its own color, SVG icon, and label. Active relay advances every
   480 ms via inline JS. Ambient brand halo behind the card.
   ============================================================================ */

/* 3-row flex column: header (chrome) | body (centered card) | footer (chrome).
   Background matches warm sepia --background token (#f7f3e9). */
#loading-skeleton {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  flex-direction: column;
  background: #f7f3e9;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

@media (prefers-color-scheme: dark) {
  #loading-skeleton {
    background: #0c1829;
  }
}

#loading-skeleton.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Dual-tone brand+AI halo behind the assembly — matches the React
   component's radial-gradient ambient backdrop. Breathes very slowly
   (transform only) so the wait feels alive, never strobing. */
#loading-skeleton::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 560px;
  height: 300px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background:
    radial-gradient(
      ellipse at 34% 50%,
      rgba(16, 185, 129, 0.09) 0%,
      transparent 62%
    ),
    radial-gradient(
      ellipse at 70% 46%,
      rgba(124, 58, 237, 0.07) 0%,
      transparent 58%
    );
  pointer-events: none;
  animation: skeletonHaloBreathe 7s ease-in-out infinite;
  will-change: transform;
}

@keyframes skeletonHaloBreathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Dot-grid wash — same canvas texture MarketingShell paints, so the
   skeleton → React loader → landing page reads as one continuous surface. */
#loading-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  /* ::after would otherwise paint above the card content — keep it behind. */
  z-index: -1;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(15, 23, 42, 0.14) 0.6px,
    transparent 0.6px
  );
  background-size: 28px 28px;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  #loading-skeleton::after {
    background-image: radial-gradient(
      circle at 1px 1px,
      rgba(255, 255, 255, 0.08) 0.6px,
      transparent 0.6px
    );
  }
}

/* ── Body wrapper — flex:1, centers the relay card vertically ── */
.skeleton-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ── Chrome header — mirrors marketing-nav lockup (decorative, aria-hidden) ── */
.skeleton-chrome-top {
  flex: none;
  width: 100%;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(247, 243, 233, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-top {
    background: rgba(12, 24, 41, 0.88);
    border-bottom-color: rgba(255, 255, 255, 0.07);
  }
}

.skeleton-chrome-mark {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #111827;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-mark {
    color: #f3f4f6;
  }
}

.skeleton-chrome-sbc {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #6b7280;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-sbc {
    color: #9ca3af;
  }
}

/* Ghost nav — decorative only, no hover state */
.skeleton-chrome-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .skeleton-chrome-nav {
    display: flex;
  }
}

.skeleton-chrome-nav span {
  font-size: 0.8125rem;
  color: #9ca3af;
  pointer-events: none;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-nav span {
    color: #4b5563;
  }
}

/* ── Chrome footer — copyright + system status dot ── */
.skeleton-chrome-bottom {
  flex: none;
  width: 100%;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-bottom {
    border-top-color: rgba(255, 255, 255, 0.06);
  }
}

.skeleton-chrome-copy {
  font-size: 0.6875rem;
  color: #9ca3af;
  letter-spacing: 0.01em;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-copy {
    color: #4b5563;
  }
}

.skeleton-chrome-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #9ca3af;
  user-select: none;
}

.skeleton-chrome-status::before {
  content: "";
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .skeleton-chrome-status {
    color: #4b5563;
  }
}

/* ── Card ── */
.skeleton-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 30rem;
  width: 100%;
}

/* Wordmark row — identical lockup to marketing-nav */
.skeleton-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.skeleton-eyebrow {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #111827;
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .skeleton-eyebrow {
    color: #f3f4f6;
  }
}

.skeleton-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #6b7280;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .skeleton-badge {
    color: #9ca3af;
  }
}

.skeleton-tagline {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0.375rem 0 0;
}

@media (prefers-color-scheme: dark) {
  .skeleton-tagline {
    color: #9ca3af;
  }
}

/* ── Pipeline ── */

.skeleton-pipeline {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  max-width: 26rem;
  margin-top: 2.25rem;
}

/* Base track — quiet grey line behind the nodes */
.skeleton-rail-base,
.skeleton-rail-fill {
  position: absolute;
  top: 1.5rem; /* centers on 3rem nodes */
  left: 1.5rem; /* insets match node radius so rail doesn't poke out */
  right: 1.5rem;
  height: 1px;
  border-radius: 9999px;
}

.skeleton-rail-base {
  background: rgba(15, 23, 42, 0.1);
}

@media (prefers-color-scheme: dark) {
  .skeleton-rail-base {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Brand-tinted fill — scaleX set by relay JS in lockstep with active node.
   Eased over 0.7s with the brand curve so the line *travels* between nodes
   rather than snapping; this is the primary progress narration. */
.skeleton-rail-fill {
  background: linear-gradient(to right, #10b981, rgba(16, 185, 129, 0.45));
  transform-origin: left center;
  transform: scaleX(0.2);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Each stage column: node + label stacked */
.skeleton-stage-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* Node base */
.skeleton-node {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  /* Cosmetic glide: the active node eases up over ~0.55s on the brand curve
     instead of snapping, so the relay reads as a calm hand-off, not a jump. */
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.5s ease,
    opacity 0.5s ease;
  opacity: 0.6;
}

/* ── STAGE_TOKEN color palette ── */
/* 取込 (amber / warning) */
.sn-1 {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 251, 235, 0.9);
}
/* 分類 (violet / AI) */
.sn-2 {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(245, 243, 255, 0.9);
}
/* 照合 (blue / info) */
.sn-3 {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(239, 246, 255, 0.9);
}
/* 集計 (emerald / brand) */
.sn-4 {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.4);
  background: rgba(240, 253, 244, 0.9);
}
/* 申告 (slate) */
.sn-5 {
  color: #374151;
  border-color: rgba(55, 65, 81, 0.3);
  background: rgba(249, 250, 251, 0.9);
}

@media (prefers-color-scheme: dark) {
  .sn-1 {
    background: rgba(78, 40, 0, 0.65);
    border-color: rgba(217, 119, 6, 0.55);
  }
  .sn-2 {
    background: rgba(49, 22, 95, 0.65);
    border-color: rgba(124, 58, 237, 0.55);
  }
  .sn-3 {
    background: rgba(17, 43, 90, 0.65);
    border-color: rgba(37, 99, 235, 0.55);
  }
  .sn-4 {
    background: rgba(4, 58, 40, 0.65);
    border-color: rgba(5, 150, 105, 0.55);
  }
  .sn-5 {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.35);
    color: #9ca3af;
  }
}

/* Icon inside each node */
.sn-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

/* Pulsing halo — child of .skeleton-node, visible only when .sn-active */
.sn-halo {
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
}

.sn-1 .sn-halo {
  background: rgba(217, 119, 6, 0.16);
}
.sn-2 .sn-halo {
  background: rgba(124, 58, 237, 0.16);
}
.sn-3 .sn-halo {
  background: rgba(37, 99, 235, 0.16);
}
.sn-4 .sn-halo {
  background: rgba(5, 150, 105, 0.16);
}
.sn-5 .sn-halo {
  background: rgba(55, 65, 81, 0.1);
}

/* ── Active relay state ── */
.skeleton-node.sn-active {
  transform: translateY(-4px) scale(1.14);
  opacity: 1;
}

.sn-1.sn-active {
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.24);
}
.sn-2.sn-active {
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.24);
}
.sn-3.sn-active {
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.24);
}
.sn-4.sn-active {
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.24);
}
.sn-5.sn-active {
  box-shadow: 0 6px 18px rgba(55, 65, 81, 0.16);
}

.skeleton-node.sn-active .sn-halo {
  animation: snHaloPulse 2.2s ease-in-out infinite;
}

@keyframes snHaloPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.55);
  }
}

/* Past nodes — brand-tinted to show progress */
.skeleton-node.sn-past {
  opacity: 0.88;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Stage label */
.sn-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9ca3af;
  transition:
    color 0.45s ease,
    font-weight 0.45s ease;
  pointer-events: none;
}

/* Label color tracks active / past state via CSS sibling selectors */
.sn-1.sn-active ~ .sn-label {
  color: #d97706;
  font-weight: 700;
}
.sn-2.sn-active ~ .sn-label {
  color: #7c3aed;
  font-weight: 700;
}
.sn-3.sn-active ~ .sn-label {
  color: #2563eb;
  font-weight: 700;
}
.sn-4.sn-active ~ .sn-label {
  color: #059669;
  font-weight: 700;
}
.sn-5.sn-active ~ .sn-label {
  color: #374151;
  font-weight: 700;
}
.skeleton-node.sn-past ~ .sn-label {
  color: #10b981;
}

/* ── Status copy ── */

.skeleton-status {
  margin-top: 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.skeleton-title {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
  min-height: 1.5em;
}

@media (prefers-color-scheme: dark) {
  .skeleton-title {
    color: #f3f4f6;
  }
}

/* Fixed-height row so active-stage text doesn't cause layout shift */
.skeleton-subtitle-row {
  position: relative;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  min-width: 12rem;
  overflow: hidden;
}

.skeleton-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    color 0.4s ease;
}

/* ── Sweep progress bar ── */

.skeleton-progress-track {
  margin-top: 1.5rem;
  width: 16rem;
  height: 2px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .skeleton-progress-track {
    background: rgba(255, 255, 255, 0.08);
  }
}

.skeleton-progress-bar {
  height: 100%;
  width: 5.5rem;
  background: linear-gradient(to right, transparent, #10b981, transparent);
  border-radius: 9999px;
  animation: skeletonProgress 1.2s ease-in-out infinite;
  will-change: transform;
}

/* Step counter — mirrors the React loader's `01 / 05` readout */
.skeleton-step-count {
  margin: 0.75rem 0 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(107, 114, 128, 0.7);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .skeleton-step-count {
    color: rgba(156, 163, 175, 0.7);
  }
}

@keyframes skeletonProgress {
  0% {
    transform: translateX(-200%);
  }
  100% {
    transform: translateX(430%);
  }
}

/* Hide skeleton the moment React mounts ANYTHING into #root.
   The CSS rule wins instantly via display:none; the .fade-out class set by
   inline JS only matters as a fallback if a future change ever decouples
   the skeleton from being a sibling of #root. */
#root:not(:empty) + #loading-skeleton,
#root:not(:empty) ~ #loading-skeleton {
  display: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #loading-skeleton::before {
    animation: none;
  }
  .skeleton-node {
    animation: none;
  }
  .skeleton-node.sn-active {
    transform: none;
  }
  .skeleton-node.sn-active .sn-halo {
    animation: none;
    opacity: 0.4;
  }
  .skeleton-rail-fill {
    transition: none;
  }
  .skeleton-progress-bar {
    animation: none;
    width: 100%;
    opacity: 0.35;
  }
}

/* ============================================================================
   ERROR STATE — calm design-system advisor palette (Pre-React Fallback).
   Uses the same chrome header/footer from Phase 1 so the error screen is
   a properly framed page, not a jarring red overlay.
   Matches BeautifulErrorPage's warm-gradient, system-font, and emerald CTA.
   ============================================================================ */

/* Suppress the loader halo + dot grid so the error page has its own
   ambient gradient */
#loading-skeleton.error-state::before,
#loading-skeleton.error-state::after {
  display: none;
}

/* Background gradient: warm sepia → hint of brand emerald */
#loading-skeleton.error-state {
  background: linear-gradient(
    160deg,
    rgba(251, 243, 219, 0.9) 0%,
    #f7f3e9 40%,
    rgba(240, 253, 244, 0.6) 100%
  );
}

@media (prefers-color-scheme: dark) {
  #loading-skeleton.error-state {
    background: linear-gradient(
      160deg,
      rgba(30, 20, 10, 0.95) 0%,
      #0c1829 45%,
      rgba(4, 30, 20, 0.9) 100%
    );
  }
}

/* Ambient halo behind the error card */
.error-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 600px;
  height: 320px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: radial-gradient(
    ellipse at center,
    rgba(249, 115, 22, 0.06) 0%,
    rgba(16, 185, 129, 0.07) 55%,
    transparent 72%
  );
  pointer-events: none;
}

/* Content wrapper — centers error card between chrome header and footer */
.error-content-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

/* Error card */
.error-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 28rem;
  width: 100%;
  animation: errorFadeIn 0.4s ease-out;
}

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

/* Icon chip — amber/warning (calm, not alarming red) */
.error-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  .error-icon {
    background: rgba(78, 40, 0, 0.45);
    border-color: rgba(217, 119, 6, 0.4);
  }
}

.error-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #d97706;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

/* Title — system font, no serif */
.error-title {
  font-size: 1.375rem;
  font-weight: 400;
  color: #111827;
  letter-spacing: -0.01em;
  margin: 0 0 0.625rem;
}

@media (prefers-color-scheme: dark) {
  .error-title {
    color: #f3f4f6;
  }
}

/* Error code — neutral badge */
.error-code {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #6b7280;
  margin-bottom: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  .error-code {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
  }
}

/* Error messages */
.error-message {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.75;
  margin: 0 0 0.5rem;
  max-width: 22rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}

@media (prefers-color-scheme: dark) {
  .error-message {
    color: #9ca3af;
  }
}

.error-reassurance {
  color: #059669 !important;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .error-reassurance {
    color: #34d399 !important;
  }
}

/* Thin separator */
.error-separator {
  width: 3rem;
  height: 1px;
  background: rgba(15, 23, 42, 0.1);
  margin: 1.25rem auto;
}

@media (prefers-color-scheme: dark) {
  .error-separator {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Actions row */
.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Button base */
.error-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid;
  font-family: inherit;
}

/* Emerald primary — re-read this button */
.error-btn-retry {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.35);
  color: #059669;
}

.error-btn-retry:hover {
  background: rgba(5, 150, 105, 0.14);
  border-color: rgba(5, 150, 105, 0.55);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .error-btn-retry {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
  }
  .error-btn-retry:hover {
    background: rgba(5, 150, 105, 0.2);
    border-color: rgba(16, 185, 129, 0.55);
  }
}

/* Neutral secondary — home */
.error-btn-home {
  background: transparent;
  border-color: rgba(15, 23, 42, 0.12);
  color: #374151;
}

.error-btn-home:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.22);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .error-btn-home {
    border-color: rgba(255, 255, 255, 0.12);
    color: #9ca3af;
  }
  .error-btn-home:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
  }
}

/* Button icon */
.error-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Hint text */
.error-hint {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Floating ambient circles — brand-tinted, not alarming red */
.error-float {
  position: absolute;
  border-radius: 9999px;
  border: 1px solid;
  pointer-events: none;
  animation: errorFloat 5s ease-in-out infinite;
}
.error-float-1 {
  width: 56px;
  height: 56px;
  top: 18%;
  left: 8%;
  border-color: rgba(16, 185, 129, 0.14);
  animation-delay: 0s;
}
.error-float-2 {
  width: 38px;
  height: 38px;
  top: 28%;
  right: 12%;
  border-color: rgba(217, 119, 6, 0.12);
  animation-delay: 1.4s;
}
.error-float-3 {
  width: 46px;
  height: 46px;
  bottom: 18%;
  left: 18%;
  border-color: rgba(16, 185, 129, 0.1);
  animation-delay: 2.8s;
}

@keyframes errorFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-14px) scale(1.08);
    opacity: 0.75;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .error-card {
    animation: none;
  }
  .error-float {
    animation: none;
    opacity: 0.4;
  }
  .error-btn:hover {
    transform: none;
  }
}
