/**
 * PROJECT PHOENIX: MOTION ENGINE STYLESHEET
 * Hardware-accelerated physical motion, spring curves, squash-and-stretch,
 * SVG stroke drawing, and fluid micro-interactions.
 */

:root {
  --spring-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-gentle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --spring-squash: cubic-bezier(0.2, 0.8, 0.2, 1.2);
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   1. TOP SCROLL-LINKED READING PROGRESS INDICATOR
   ========================================================= */
#phoenix-scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: var(--brand-gradient, linear-gradient(90deg, #f43f5e, #6366f1, #06b6d4));
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

/* =========================================================
   2. SIGNATURE FILE UPLOAD: PHYSICAL JUMP & CAPSULE
   ========================================================= */

/* Drop zone anticipation & hover states */
.upload-area, .drop-box, #drop-zone {
  position: relative;
  transition: transform 0.28s var(--ease-cinematic), border-color 0.25s ease, box-shadow 0.28s ease !important;
}

.upload-area.phoenix-anticipate,
.drop-box.phoenix-anticipate,
#drop-zone.phoenix-anticipate {
  transform: translateY(-4px) scale(1.008) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 16px 36px -8px rgba(244, 63, 94, 0.28), 0 0 0 1px var(--primary-border) !important;
}

/* Drop zone shockwave on file impact */
@keyframes dropShockwave {
  0% { transform: scale(0.985); }
  45% { transform: scale(1.012); }
  75% { transform: scale(0.996); }
  100% { transform: scale(1); }
}

.upload-area.phoenix-impact,
.drop-box.phoenix-impact,
#drop-zone.phoenix-impact {
  animation: dropShockwave 0.42s var(--spring-gentle) both;
}

/* Lift & Ambient animation on upload icon */
.upload-area .upload-icon,
.drop-box .upload-icon {
  transition: transform 0.32s var(--spring-snappy), color 0.25s ease;
  animation: uploadIdlePulse 4s ease-in-out infinite alternate;
}

@keyframes uploadIdlePulse {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.03); }
}

.upload-area:hover .upload-icon,
.drop-box:hover .upload-icon,
.upload-area.phoenix-anticipate .upload-icon {
  animation: none;
  transform: translateY(-8px) scale(1.12);
  color: var(--primary);
}

/* Physical Jumping File Capsule */
.phoenix-file-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-surface-elevated, #141c2e);
  border: 1px solid var(--border-elevated, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-lg, 16px);
  padding: 12px 18px;
  margin: 12px auto;
  max-width: 620px;
  width: 100%;
  box-shadow: var(--shadow-lg, 0 12px 28px rgba(0, 0, 0, 0.3)), var(--surface-sheen, inset 0 1px 0 rgba(255,255,255,0.1));
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  transform-origin: center bottom;
}

/* Parabolic Jump Keyframes with Anticipation Squash & Landing Stretch */
@keyframes phoenixFileJump {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.85, 0.7);
  }
  25% {
    opacity: 1;
    transform: translateY(-24px) scale(0.94, 1.08); /* Upward stretch */
  }
  55% {
    transform: translateY(6px) scale(1.06, 0.92); /* Landing impact squash */
  }
  75% {
    transform: translateY(-3px) scale(0.98, 1.02); /* Rebound */
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1, 1); /* Settled */
  }
}

.phoenix-file-capsule.entering,
.file-item-row,
.file-item,
.file-card-box,
.file-preview-card {
  animation: phoenixFileJump 0.54s cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
}

/* Stagger delay utility for multiple files */
.phoenix-file-capsule[data-stagger="1"], .file-item-row:nth-child(1), .file-item:nth-child(1) { animation-delay: 0.04s; }
.phoenix-file-capsule[data-stagger="2"], .file-item-row:nth-child(2), .file-item:nth-child(2) { animation-delay: 0.08s; }
.phoenix-file-capsule[data-stagger="3"], .file-item-row:nth-child(3), .file-item:nth-child(3) { animation-delay: 0.12s; }
.phoenix-file-capsule[data-stagger="4"], .file-item-row:nth-child(4), .file-item:nth-child(4) { animation-delay: 0.16s; }
.phoenix-file-capsule[data-stagger="5"], .file-item-row:nth-child(5), .file-item:nth-child(5) { animation-delay: 0.20s; }

/* Capsule Left Info */
.phoenix-capsule-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.phoenix-capsule-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light, rgba(244, 63, 94, 0.14));
  border: 1px solid var(--primary-border, rgba(244, 63, 94, 0.3));
  color: var(--primary, #f43f5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.25s var(--spring-snappy);
}

.phoenix-file-capsule:hover .phoenix-capsule-icon {
  transform: scale(1.1) rotate(-5deg);
}

.phoenix-capsule-details {
  min-width: 0;
  flex: 1;
}

.phoenix-capsule-name {
  font-family: var(--font-display, inherit);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.phoenix-capsule-size {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
}

/* Capsule Progress Ring & Status */
.phoenix-capsule-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.phoenix-progress-ring {
  width: 32px;
  height: 32px;
  transform: rotate(-90deg);
}

.phoenix-ring-bg {
  stroke: var(--border-elevated, rgba(255, 255, 255, 0.1));
}

.phoenix-ring-fill {
  stroke: var(--primary, #f43f5e);
  stroke-dasharray: 88;
  stroke-dashoffset: 88;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s ease-out;
}

/* Animated SVG Checkmark on Success */
.phoenix-success-check {
  width: 30px;
  height: 30px;
  stroke: #10b981;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

.phoenix-check-circle {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: drawCircle 0.4s var(--ease-cinematic) forwards;
}

.phoenix-check-tick {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawTick 0.3s 0.25s var(--ease-cinematic) forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

/* Rejection Shake for Invalid Files */
@keyframes phoenixRejectShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(8px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.phoenix-reject {
  animation: phoenixRejectShake 0.48s var(--spring-snappy) both !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35) !important;
}

/* Smooth Spatial Collapse on Removal */
.phoenix-file-capsule.exiting,
.file-item-row.exiting,
.file-item.exiting,
.file-card-box.exiting,
.file-preview-card.exiting {
  transition: all 0.32s var(--ease-cinematic) !important;
  opacity: 0 !important;
  transform: scale(0.88) translateY(-10px) !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Dismiss Button */
.phoenix-btn-remove {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.phoenix-btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: rotate(90deg) scale(1.15);
}

/* =========================================================
   3. ICON PERSONALITIES & MORPHING
   ========================================================= */

/* Morphing Hamburger Menu Lines */
.mobile-menu-btn svg line {
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: transform 0.28s var(--ease-cinematic), opacity 0.2s ease;
}

.mobile-menu-btn.active svg line:nth-child(1),
.mobile-menu-btn.is-open svg line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active svg line:nth-child(2),
.mobile-menu-btn.is-open svg line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active svg line:nth-child(3),
.mobile-menu-btn.is-open svg line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Accordion Chevron 180° Spring Flip */
.seo-faq-summary svg,
.faq-question svg,
.megamenu-trigger-btn svg.chevron,
.how-faq-q svg {
  transition: transform 0.32s var(--spring-snappy) !important;
}

[open] > .seo-faq-summary svg,
.faq-item.active svg,
.megamenu-trigger-btn.active svg.chevron,
.how-faq-item.active svg {
  transform: rotate(180deg) !important;
  color: var(--primary);
}

/* Theme Pack 360° Flip */
.theme-toggle-btn #theme-active-icon {
  display: inline-block;
  transition: transform 0.45s var(--spring-bounce);
}

.theme-toggle-btn.is-switching #theme-active-icon {
  transform: rotate(360deg) scale(1.25);
}

/* Copy-to-Clipboard Icon Spring Transformation */
.btn-copy, .guide-copy-btn, [data-copy-btn] {
  position: relative;
  transition: transform 0.2s var(--spring-snappy), background-color 0.2s ease !important;
}

.btn-copy:active, .guide-copy-btn:active {
  transform: scale(0.93);
}

.btn-copy.copied, .guide-copy-btn.copied {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #10b981 !important;
  animation: copySuccessPop 0.36s var(--spring-gentle) both;
}

@keyframes copySuccessPop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Download Action Downward Kinetic Cue */
.btn-download-big, .btn-download, a[download] {
  position: relative;
  overflow: hidden;
}

.btn-download-big svg, .btn-download svg, a[download] svg {
  transition: transform 0.24s var(--spring-snappy);
}

.btn-download-big:hover svg, .btn-download:hover svg, a[download]:hover svg {
  transform: translateY(3px);
}

.btn-download-big:active svg, .btn-download:active svg, a[download]:active svg {
  animation: downloadArrowBounce 0.42s var(--spring-snappy) both;
}

@keyframes downloadArrowBounce {
  0% { transform: translateY(0); }
  40% { transform: translateY(7px); }
  75% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* =========================================================
   4. BUTTON MICRO-PHYSICS & SPECULAR WAVE
   ========================================================= */

/* Primary Action Buttons: Specular Light Wave */
.btn-select, .btn-primary, .action-btn, .hero-launchpad .launchpad-chip.featured-chip {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s var(--ease-cinematic), box-shadow 0.22s ease !important;
}

.btn-select::after, .btn-primary::after, .action-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  transition: none;
}

.btn-select:hover::after, .btn-primary:hover::after, .action-btn:hover::after {
  left: 130%;
  transition: left 0.75s ease-in-out;
}

/* Processing Button Kinetic Pulse */
.btn.is-processing, button.is-processing {
  pointer-events: none;
  opacity: 0.85;
  animation: buttonPulse 1.2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.97); }
}

/* Active Press Spring Compression */
button:active, .btn:active, .cat-pill:active, .launchpad-chip:active, .dock-item:active {
  transform: scale(0.95) !important;
}

/* =========================================================
   5. SEARCH INPUT & COMMAND PALETTE EXPANSION
   ========================================================= */
.nav-search-wrap {
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.nav-search-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18), 0 8px 24px rgba(15, 23, 42, 0.12) !important;
  border-color: var(--primary) !important;
}

.nav-search-wrap:focus-within .nav-search-icon {
  transform: translateY(-50%) rotate(15deg) scale(1.1);
  color: var(--primary);
  transition: transform 0.28s var(--spring-snappy), color 0.2s ease;
}

.nav-search-wrap:focus-within .nav-search-shortcut {
  transform: translateY(-50%) scale(1.08);
  border-color: var(--primary);
  color: var(--primary);
  transition: transform 0.24s var(--spring-gentle);
}

/* =========================================================
   6. 3D PERSPECTIVE VECTOR TILT & SPECULAR SHEEN
   ========================================================= */
.tool-card, .story-card, .preset-card, .step-feature-card {
  position: relative;
  transition: transform 0.28s var(--ease-cinematic), box-shadow 0.28s ease, border-color 0.22s ease;
  will-change: transform;
}

.tool-card::before, .preset-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(350px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(255, 255, 255, 0.08), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.tool-card:hover::before, .preset-card:hover::before {
  opacity: 1;
}

/* =========================================================
   7. MODAL & TOAST KINETIC ENTRANCES
   ========================================================= */
.modal-box, .auth-modal-box, .safety-modal-box {
  animation: modalKineticIn 0.36s var(--spring-snappy) both;
}

@keyframes modalKineticIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(18px);
  }
  70% {
    transform: scale(1.015) translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.toast.show, #toast-container .toast.show {
  animation: toastKineticIn 0.4s var(--spring-snappy) forwards;
}

.toast:not(.show) {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  animation: none !important;
}

@keyframes toastKineticIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  70% {
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   6. ARCHITECTURE STAT COUNTERS GLOW
   ========================================================= */
.stat-value.phoenix-counting {
  color: var(--primary, #f43f5e) !important;
  text-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
  transition: color 0.3s ease;
}

/* =========================================================
   7. ACCORDION SMOOTH HEIGHT EXPANSION
   ========================================================= */
.seo-faq-body, .faq-accordion-detail {
  transition: max-height 0.32s var(--ease-cinematic), opacity 0.28s ease;
}

/* =========================================================
   8. KINETIC HYDRAULIC COMPRESSION CHAMBER (PHYSICS ENGINE)
   ========================================================= */
.phoenix-hydraulic-chamber {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 220px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  overflow: visible;
}

/* Structural guide rails */
.chamber-rails {
  position: absolute;
  inset: 10px 40px;
  border-left: 2px dashed var(--border-color, rgba(148, 163, 184, 0.3));
  border-right: 2px dashed var(--border-color, rgba(148, 163, 184, 0.3));
  pointer-events: none;
  opacity: 0.6;
}

/* Hydraulic Pistons (Jaws) */
.chamber-jaw {
  position: absolute;
  width: 180px;
  height: 28px;
  background: linear-gradient(180deg, #334155, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  will-change: transform;
}

[data-theme="dark"] .chamber-jaw,
[data-theme="cyberpunk"] .chamber-jaw {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border-color: rgba(244, 63, 94, 0.4);
}

.chamber-jaw.top {
  top: 15px;
  animation: hydraulicPressTop 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: center top;
}

.chamber-jaw.top::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 60%;
  height: 4px;
  background: var(--primary, #f43f5e);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--primary, #f43f5e);
}

.chamber-jaw.bottom {
  bottom: 15px;
  animation: hydraulicPressBottom 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: center bottom;
}

.chamber-jaw.bottom::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 60%;
  height: 4px;
  background: var(--primary, #f43f5e);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--primary, #f43f5e);
}

/* Floating PDF Document Core */
.chamber-doc-core {
  position: relative;
  width: 90px;
  height: 110px;
  background: #ffffff;
  border-radius: 10px;
  border: 2px solid var(--primary, #f43f5e);
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.25), 0 0 20px -2px rgba(244, 63, 94, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  animation: docSquashStretch 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: center center;
  will-change: transform, filter;
}

[data-theme="dark"] .chamber-doc-core {
  background: #1e293b;
}

.chamber-doc-badge {
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.chamber-doc-lines {
  width: 65%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chamber-doc-lines span {
  display: block;
  height: 3.5px;
  background: var(--gray-300, #cbd5e1);
  border-radius: 2px;
}

.chamber-doc-lines span:last-child {
  width: 60%;
}

/* Pressure Shockwave Rings */
.chamber-shockwave {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 2px solid var(--primary, #f43f5e);
  border-radius: 50%;
  pointer-events: none;
  animation: shockwavePulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  z-index: 0;
}

/* Live Telemetry Progress Readout */
.chamber-telemetry-container {
  width: 100%;
  max-width: 460px;
  margin: 18px auto 0;
  background: var(--bg-surface-elevated, rgba(15, 23, 42, 0.04));
  border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.04));
}

[data-theme="dark"] .chamber-telemetry-container {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

.chamber-telemetry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.chamber-telemetry-stage {
  color: var(--primary, #f43f5e);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chamber-telemetry-percent {
  color: var(--text-main, #334155);
  font-variant-numeric: tabular-nums;
}

.chamber-meter-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--gray-200, rgba(203, 213, 225, 0.5));
  border-radius: 999px;
  overflow: hidden;
}

[data-theme="dark"] .chamber-meter-track {
  background: rgba(255, 255, 255, 0.1);
}

.chamber-meter-bar {
  position: relative;
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #f43f5e, #6366f1);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.chamber-meter-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: telemetryScanline 1.4s ease-in-out infinite;
}

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

@keyframes hydraulicPressTop {
  0%, 100% { transform: translateY(0); }
  22% { transform: translateY(-4px); }
  34% { transform: translateY(22px); }
  44% { transform: translateY(18px); }
  60% { transform: translateY(20px); }
  78% { transform: translateY(0); }
}

@keyframes hydraulicPressBottom {
  0%, 100% { transform: translateY(0); }
  22% { transform: translateY(4px); }
  34% { transform: translateY(-22px); }
  44% { transform: translateY(-18px); }
  60% { transform: translateY(-20px); }
  78% { transform: translateY(0); }
}

@keyframes docSquashStretch {
  0%, 100% {
    transform: scale(1, 1) translateY(0);
  }
  22% {
    transform: scale(0.92, 1.1) translateY(-6px);
  }
  34% {
    transform: scale(1.28, 0.62) translateY(0);
    filter: brightness(1.25) drop-shadow(0 0 14px rgba(244, 63, 94, 0.6));
  }
  44% {
    transform: scale(1.18, 0.72) translateY(0);
  }
  60% {
    transform: scale(1.24, 0.66) translateY(0);
  }
  78% {
    transform: scale(0.96, 1.05) translateY(-2px);
  }
}

@keyframes shockwavePulse {
  0%, 28% {
    transform: scale(0.2);
    opacity: 0;
  }
  34% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  68% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* =========================================================
   9. KINETIC REJECTION & ERROR CARD
   ========================================================= */
.phoenix-error-card {
  max-width: 520px;
  margin: 20px auto;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid #f87171;
  border-radius: 16px;
  padding: clamp(20px, 4vw, 32px);
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.16);
  text-align: center;
  animation: phoenixRejectShake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

[data-theme="dark"] .phoenix-error-card {
  background: #141c2e;
  border-color: #ef4444;
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.28);
}

@keyframes phoenixRejectShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-12px) rotate(-1.5deg); }
  30% { transform: translateX(10px) rotate(1.2deg); }
  45% { transform: translateX(-7px) rotate(-0.8deg); }
  60% { transform: translateX(5px) rotate(0.5deg); }
  75% { transform: translateX(-3px) rotate(-0.2deg); }
  90% { transform: translateX(1px); }
}

.phoenix-reject-shake {
  animation: phoenixRejectShake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

.phoenix-error-icon {
  width: 60px;
  height: 60px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 0 0 8px rgba(254, 226, 226, 0.4);
  animation: errorIconGlow 2s ease-in-out infinite alternate;
}

[data-theme="dark"] .phoenix-error-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15);
}

@keyframes errorIconGlow {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

.phoenix-error-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 8px;
}

[data-theme="dark"] .phoenix-error-title {
  color: #f8fafc;
}

.phoenix-error-desc {
  font-size: 14px;
  color: var(--gray-600, #64748b);
  line-height: 1.5;
  margin-bottom: 22px;
}

[data-theme="dark"] .phoenix-error-desc {
  color: #94a3b8;
}

.phoenix-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Dynamic metric bounce */
.phoenix-metric-counted {
  animation: phoenixMetricPop 0.42s var(--spring-snappy) both;
}

@keyframes phoenixMetricPop {
  0% { transform: scale(0.85); opacity: 0.4; }
  65% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* =========================================================
   10. VIEW TRANSITION SHOCKWAVE (RADIAL THEME EXPANSION)
   ========================================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 99999;
}

/* =========================================================
   11. CURSOR SPOTLIGHT & LIVING AURORA MESH
   ========================================================= */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  transition: opacity 0.5s ease;
  background: radial-gradient(
    700px circle at var(--cursor-spotlight-x, -999px) var(--cursor-spotlight-y, -999px),
    var(--spotlight-color, rgba(225, 29, 72, 0.08)),
    transparent 65%
  );
  will-change: background;
}

[data-theme="dark"] body::before {
  --spotlight-color: rgba(244, 63, 94, 0.12);
}

[data-theme="cyberpunk"] body::before {
  --spotlight-color: rgba(6, 182, 212, 0.15);
}

[data-theme="emerald"] body::before {
  --spotlight-color: rgba(16, 185, 129, 0.14);
}

/* =========================================================
   12. HOLOGRAPHIC SPECULAR CARD RIM REFLECTION
   ========================================================= */
.tool-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.28s var(--ease-cinematic), box-shadow 0.28s ease, border-color 0.25s ease !important;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    280px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    var(--card-glow-color, rgba(244, 63, 94, 0.45)),
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.tool-card:hover::before {
  opacity: 1;
}

[data-theme="cyberpunk"] .tool-card {
  --card-glow-color: rgba(6, 182, 212, 0.7);
}

[data-theme="emerald"] .tool-card {
  --card-glow-color: rgba(52, 211, 153, 0.65);
}

[data-theme="light"] .tool-card {
  --card-glow-color: rgba(225, 29, 72, 0.35);
}

/* =========================================================
   13. SQUISHY JELLY BUTTONS & ELASTIC CATEGORY PILLS
   ========================================================= */
.btn-select, .btn-primary, .btn-download-big, .nav-guide-btn {
  transform-origin: center center;
  transition: transform 0.2s var(--spring-snappy), box-shadow 0.2s ease, background-color 0.2s ease !important;
  will-change: transform;
}

.btn-select:active, .btn-primary:active, .btn-download-big:active {
  transform: scale3d(0.92, 0.92, 1) !important;
  transition-duration: 0.08s !important;
}

.cat-pill {
  transition: transform 0.25s var(--spring-gentle), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
  transform-origin: center center;
}

.cat-pill:hover {
  transform: translateY(-2px) scale(1.03);
}

.cat-pill:active {
  transform: scale(0.94);
}

.cat-pill.active {
  animation: pillRubberSquash 0.38s var(--spring-squash) both;
}

@keyframes pillRubberSquash {
  0% { transform: scale3d(0.86, 1.16, 1); }
  45% { transform: scale3d(1.14, 0.88, 1); }
  75% { transform: scale3d(0.97, 1.03, 1); }
  100% { transform: scale3d(1, 1, 1); }
}

/* =========================================================
   14. HANDCRAFTED KINETIC ICON ENGINE (16 SUITE TOOLS)
   ========================================================= */
.toybox-icon-stage,
.tool-icon-box {
  position: relative;
  overflow: visible;
  transition: transform 0.32s var(--spring-snappy), box-shadow 0.32s ease !important;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout paint;
}

.tool-card:hover .tool-icon-box,
.tool-card:hover .toybox-icon-stage {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 10px 24px -4px rgba(244, 63, 94, 0.28);
}

.phoenix-kinetic-icon {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  overflow: visible;
  transform-origin: center center;
  vector-effect: non-scaling-stroke;
  contain: layout paint;
}

/* =========================================================
   15. LIVING KINETIC TOYBOX ICONS: CONTINUOUS HOVER CYCLES
   Every tool icon performs a smooth, continuous, rhythmic mechanical motion on card hover.
   All animations are strictly bounded, GPU-accelerated (transform/opacity only), and zero-jitter.
   ========================================================= */

/* Base transitions for all kinetic icon sub-elements */
.phoenix-kinetic-icon * {
  transition: transform 0.28s var(--spring-snappy), opacity 0.24s ease, filter 0.24s ease, stroke-dashoffset 0.32s var(--ease-cinematic);
  transform-origin: center center;
}

/* --- 1. Hydraulic Vise (Compress PDF): Continuous Hydraulic Compression Loop --- */
.tool-card:hover .icon-vise .part-vise-top {
  animation: kineticHydraulicSquish 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.tool-card:hover .icon-vise .part-vise-paper {
  animation: kineticPaperSquash 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.tool-card:hover .icon-vise .part-spark-l {
  animation: kineticSparkBurstL 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.tool-card:hover .icon-vise .part-spark-r {
  animation: kineticSparkBurstR 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes kineticHydraulicSquish {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(3.5px); }
  50% { transform: translateY(3.5px); }
  75% { transform: translateY(-0.8px); }
}
@keyframes kineticPaperSquash {
  0%, 100% { transform: scale(1, 1); transform-origin: center bottom; }
  35% { transform: scale(1.18, 0.55); transform-origin: center bottom; }
  50% { transform: scale(1.18, 0.55); transform-origin: center bottom; }
  75% { transform: scale(0.96, 1.05); transform-origin: center bottom; }
}
@keyframes kineticSparkBurstL {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  35% { opacity: 1; transform: translate(-3px, -2px) scale(1.3); }
  60% { opacity: 0; transform: translate(-4px, -3px) scale(0.8); }
}
@keyframes kineticSparkBurstR {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  35% { opacity: 1; transform: translate(3px, -2px) scale(1.3); }
  60% { opacity: 0; transform: translate(4px, -3px) scale(0.8); }
}

/* --- 2. Calligraphy Nib (Fill & Sign): Continuous Drawing & Ink Pulse --- */
.tool-card:hover .icon-fountain-nib .part-pen-nib {
  animation: kineticNibGlide 1.6s ease-in-out infinite;
}
.tool-card:hover .icon-fountain-nib .part-signature-line {
  stroke-dasharray: 48;
  animation: kineticSigStroke 1.6s ease-in-out infinite;
}
.tool-card:hover .icon-fountain-nib .part-ink-bloom {
  animation: kineticInkPulse 1.6s ease-in-out infinite;
}

@keyframes kineticNibGlide {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  30% { transform: translate(3px, 1.5px) rotate(6deg); }
  60% { transform: translate(1px, 2px) rotate(-3deg); }
  85% { transform: translate(2px, 0.5px) rotate(3deg); }
}
@keyframes kineticSigStroke {
  0% { stroke-dashoffset: 48; opacity: 0.3; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 48; opacity: 0.3; }
}
@keyframes kineticInkPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.3; }
  40% { transform: scale(1.4); opacity: 1; filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.6)); }
  70% { transform: scale(1.1); opacity: 0.7; }
}

/* --- 3. Forensic Censor Scanner (Redact): Continuous Sweeping Laser Beam --- */
.tool-card:hover .icon-redact-scanner .part-laser-sweep {
  animation: kineticLaserSweepLoop 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-redact-scanner .part-censor-strip {
  animation: kineticCensorPulse 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-redact-scanner .part-lock-shackle {
  animation: kineticScannerLock 1.2s ease-in-out infinite;
}

@keyframes kineticLaserSweepLoop {
  0% { transform: translateY(-4px); opacity: 0; }
  20% { opacity: 1; }
  50% { transform: translateY(14px); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-4px); opacity: 0; }
}
@keyframes kineticCensorPulse {
  0%, 100% { filter: drop-shadow(0 0 1px #f43f5e); opacity: 0.8; }
  50% { filter: drop-shadow(0 0 5px #f43f5e); opacity: 1; }
}
@keyframes kineticScannerLock {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.5px); }
}

/* --- 4. Precision Guillotine Shear (Split PDF): Continuous Scissor Snip --- */
.tool-card:hover .icon-split-shear .part-sheet-left {
  animation: kineticPageFlapL 1.1s ease-in-out infinite;
}
.tool-card:hover .icon-split-shear .part-sheet-right {
  animation: kineticPageFlapR 1.1s ease-in-out infinite;
}
.tool-card:hover .icon-split-shear .part-scissor-blade-top {
  animation: kineticScissorBladeTop 1.1s ease-in-out infinite;
  transform-origin: 14px 12px;
}
.tool-card:hover .icon-split-shear .part-scissor-blade-bot {
  animation: kineticScissorBladeBot 1.1s ease-in-out infinite;
  transform-origin: 14px 12px;
}

@keyframes kineticScissorBladeTop {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(14deg); }
  60% { transform: rotate(-3deg); }
  75% { transform: rotate(0deg); }
}
@keyframes kineticScissorBladeBot {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-14deg); }
  60% { transform: rotate(3deg); }
  75% { transform: rotate(0deg); }
}
@keyframes kineticPageFlapL {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  45% { transform: translate(-2px, 0.5px) rotate(-3deg); }
  80% { transform: translate(-0.5px, 0) rotate(-1deg); }
}
@keyframes kineticPageFlapR {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  45% { transform: translate(2px, 0.5px) rotate(3deg); }
  80% { transform: translate(0.5px, 0) rotate(1deg); }
}

/* --- 5. Magnetic Snapper (Merge PDF): Continuous Magnetic Flux Attraction --- */
.tool-card:hover .icon-merge-magnet .part-card-a {
  animation: kineticMagnetPulseL 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-merge-magnet .part-card-b {
  animation: kineticMagnetPulseR 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-merge-magnet .part-magnet-field {
  animation: kineticFieldGlow 1.2s ease-in-out infinite;
}

@keyframes kineticMagnetPulseL {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(2.5px); }
  65% { transform: translateX(2.5px); }
  85% { transform: translateX(-0.5px); }
}
@keyframes kineticMagnetPulseR {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-2.5px); }
  65% { transform: translateX(-2.5px); }
  85% { transform: translateX(0.5px); }
}
@keyframes kineticFieldGlow {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  45% { opacity: 1; transform: scale(1.3); filter: drop-shadow(0 0 4px #06b6d4); }
  75% { opacity: 0.6; transform: scale(1.05); }
}

/* --- 6. Card Dealer Shuffle (Organize Pages): Continuous 3-Way Card Fan --- */
.tool-card:hover .icon-dealer-shuffle .part-tile-nw {
  animation: kineticShuffleCardA 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-dealer-shuffle .part-tile-se {
  animation: kineticShuffleCardB 1.2s ease-in-out infinite;
}

@keyframes kineticShuffleCardA {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  35% { transform: translate(2.5px, -2.5px) rotate(6deg) scale(1.08); }
  65% { transform: translate(-1px, 1px) rotate(-2deg) scale(0.96); }
}
@keyframes kineticShuffleCardB {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  35% { transform: translate(-2.5px, 2.5px) rotate(-6deg) scale(0.94); }
  65% { transform: translate(1px, -1px) rotate(2deg) scale(1.04); }
}

/* --- 7. Rotating Gyroscope (Rotate PDF): Continuous 360° Orbit Loop --- */
.tool-card:hover .icon-rotate-gyro .part-orbit-arrow {
  animation: kineticGyroSpin 2.0s linear infinite;
  transform-origin: 14px 14px;
}
.tool-card:hover .icon-rotate-gyro .part-center-doc {
  animation: kineticGyroDocBalance 2.0s ease-in-out infinite;
  transform-origin: 14px 14px;
}

@keyframes kineticGyroSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes kineticGyroDocBalance {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(15deg) scale(1.05); }
  50% { transform: rotate(-15deg) scale(1.05); }
  75% { transform: rotate(10deg) scale(0.97); }
}

/* --- 8. Vault Tumbler Lock (Protect PDF): Continuous Tumbler Wheel Turns --- */
.tool-card:hover .icon-vault-lock .part-lock-shackle {
  animation: kineticShackleRhythm 1.4s ease-in-out infinite;
}
.tool-card:hover .icon-vault-lock .part-tumbler-dial {
  animation: kineticTumblerClicks 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  transform-origin: 14px 19px;
}

@keyframes kineticShackleRhythm {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(2.5px); }
  70% { transform: translateY(2.5px); }
  85% { transform: translateY(-0.5px); }
}
@keyframes kineticTumblerClicks {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

/* --- 9. Unchained Vault (Unlock PDF): Continuous Freedom Pulse --- */
.tool-card:hover .icon-vault-unlock .part-shackle-popped {
  animation: kineticUnlockedSpring 1.2s ease-in-out infinite;
  transform-origin: 8px 13px;
}
.tool-card:hover .icon-vault-unlock .part-freedom-beams {
  animation: kineticFreedomRadiance 1.2s ease-in-out infinite;
}

@keyframes kineticUnlockedSpring {
  0%, 100% { transform: translateY(-2px) rotate(-16deg); }
  50% { transform: translateY(-4px) rotate(-24deg); }
  75% { transform: translateY(-1.5px) rotate(-12deg); }
}
@keyframes kineticFreedomRadiance {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.2); filter: drop-shadow(0 0 3px #10b981); }
}

/* --- 10. AI Stylus Typography (Font Editor): Continuous Stylus Flourish --- */
.tool-card:hover .icon-ai-stylus .part-stylus-wand {
  animation: kineticStylusOrbit 1.5s ease-in-out infinite;
}
.tool-card:hover .icon-ai-stylus .part-sparkle-star {
  animation: kineticStarTwinkle 1.5s ease-in-out infinite;
  transform-origin: 21px 7px;
}

@keyframes kineticStylusOrbit {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  35% { transform: translate(2px, 2px) rotate(6deg); }
  70% { transform: translate(-1px, 1px) rotate(-3deg); }
}
@keyframes kineticStarTwinkle {
  0%, 100% { transform: rotate(0deg) scale(0.9); opacity: 0.6; }
  50% { transform: rotate(180deg) scale(1.3); opacity: 1; filter: drop-shadow(0 0 4px #06b6d4); }
}

/* --- 11. Aperture Shutter (PDF to JPG): Continuous Lens Breathing --- */
.tool-card:hover .icon-photo-aperture .part-aperture-sun {
  animation: kineticSunbeamSweep 1.3s ease-in-out infinite;
}
.tool-card:hover .icon-photo-aperture .part-camera-lens {
  animation: kineticAperturePulse 1.3s ease-in-out infinite;
}

@keyframes kineticSunbeamSweep {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-2.5px); opacity: 1; }
}
@keyframes kineticAperturePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}

/* --- 12. Slipcover Dossier (JPG to PDF): Continuous Slide Insertion --- */
.tool-card:hover .icon-slip-dossier .part-photo-insert {
  animation: kineticDossierGlide 1.3s ease-in-out infinite;
}

@keyframes kineticDossierGlide {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(3.5px); }
  75% { transform: translateY(3.5px); }
  90% { transform: translateY(-0.5px); }
}

/* --- 13. Sizing Calipers (Reduce Image): Continuous Precision Measurement --- */
.tool-card:hover .icon-sizing-calipers .part-corner-nw {
  animation: kineticCaliperJawsNW 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-sizing-calipers .part-corner-se {
  animation: kineticCaliperJawsSE 1.2s ease-in-out infinite;
}
.tool-card:hover .icon-sizing-calipers .part-framed-img {
  animation: kineticFramedImgBreathe 1.2s ease-in-out infinite;
  transform-origin: 14px 14px;
}

@keyframes kineticCaliperJawsNW {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(2px, 2px); }
  75% { transform: translate(2px, 2px); }
}
@keyframes kineticCaliperJawsSE {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(-2px, -2px); }
  75% { transform: translate(-2px, -2px); }
}
@keyframes kineticFramedImgBreathe {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(0.85); }
  75% { transform: scale(0.85); }
}

/* --- 14. Ink Stamper (Add Image): Continuous Rhythmic Stamp Down & Up --- */
.tool-card:hover .icon-ink-stamper .part-stamp-tool {
  animation: kineticStampRhythm 1.1s ease-in-out infinite;
}
.tool-card:hover .icon-ink-stamper .part-plus-wheel {
  animation: kineticPlusWheelSpin 2.0s linear infinite;
  transform-origin: 21px 5px;
}

@keyframes kineticStampRhythm {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(3px); }
  55% { transform: translateY(3px); }
  75% { transform: translateY(-0.8px); }
}
@keyframes kineticPlusWheelSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- 15. Archival Rosette (PDF Standards PDF/A): Continuous Gold Seal Spin --- */
.tool-card:hover .icon-archival-rosette .part-seal-ribbons {
  animation: kineticRibbonSwaying 1.8s ease-in-out infinite;
  transform-origin: 14px 15px;
}
.tool-card:hover .icon-archival-rosette .part-rosette-stars {
  animation: kineticRosetteSpinning 4.0s linear infinite;
  transform-origin: 14px 10px;
}

@keyframes kineticRibbonSwaying {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(4deg); }
  70% { transform: rotate(-4deg); }
}
@keyframes kineticRosetteSpinning {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- 16. Soundwave Spool (Extract Audio from Video): Continuous Cassette Spin & Dancing EQ --- */
.tool-card:hover .icon-soundwave-spool .part-audio-spool {
  animation: kineticTapeSpoolSpin 1.4s linear infinite;
  transform-origin: 9px 15px;
}
.tool-card:hover .icon-soundwave-spool .part-audio-spool-r {
  animation: kineticTapeSpoolSpin 1.4s linear infinite;
  transform-origin: 19px 15px;
}
.tool-card:hover .icon-soundwave-spool .part-eq-bar-1 {
  animation: kineticEQDance1 0.95s ease-in-out infinite;
  transform-origin: bottom center;
}
.tool-card:hover .icon-soundwave-spool .part-eq-bar-2 {
  animation: kineticEQDance2 1.1s ease-in-out infinite;
  transform-origin: bottom center;
}
.tool-card:hover .icon-soundwave-spool .part-eq-bar-3 {
  animation: kineticEQDance3 1.0s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes kineticTapeSpoolSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes kineticEQDance1 {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.5); }
}
@keyframes kineticEQDance2 {
  0%, 100% { transform: scaleY(1.3); }
  50% { transform: scaleY(0.55); }
}
@keyframes kineticEQDance3 {
  0%, 100% { transform: scaleY(0.85); }
  50% { transform: scaleY(1.6); }
}

/* Sound Toggle Pill in Header */
.sound-toggle-btn {
  margin-left: 6px;
  transition: transform 0.2s var(--spring-snappy);
}

.sound-toggle-btn:hover {
  transform: scale(1.05);
}

/* =========================================================
   16. HUMAN HANDWRITING STUDIO (10 ARCHETYPES, WRITE BOX, SLANT & INK)
   ========================================================= */

.handwriting-studio-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 14px auto 16px;
  max-width: 1100px;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.25s var(--ease-cinematic), border-color 0.2s ease;
}

.handwriting-studio-card:focus-within {
  box-shadow: 0 8px 30px -4px rgba(37, 99, 235, 0.16);
  border-color: #3b82f6;
}

.hw-input-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.hw-studio-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main, #0f172a);
  background: var(--bg-surface-elevated, #f8fafc);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.hw-studio-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.hw-carousel-container {
  position: relative;
  margin: 12px 0 16px;
}

.hw-carousel-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.hw-carousel-grid {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.hw-carousel-grid::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Authentic Ruled Notebook Paper Texture */
.hw-notebook-paper,
.hw-archetype-card,
#hw-modal-preview-container {
  background-color: #fefef9 !important;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 23px,
    #e2e8f0 23px,
    #e2e8f0 24px
  ) !important;
  background-size: 100% 24px !important;
  line-height: 24px !important;
}

.hw-archetype-card {
  flex: 0 0 210px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.2s var(--spring-snappy), border-color 0.18s ease, box-shadow 0.2s ease, background 0.18s ease;
  user-select: none;
  position: relative;
}

.hw-archetype-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 6px 14px -3px rgba(37, 99, 235, 0.12);
}

.hw-archetype-card.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 6px 16px -2px rgba(37, 99, 235, 0.2) !important;
}

.hw-archetype-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.hw-archetype-card.active .hw-archetype-badge {
  background: #dbeafe;
  color: #1e40af;
}

.hw-archetype-preview {
  font-size: 19px;
  line-height: 1.3;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 28px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.hw-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.hw-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-ink-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-ink-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s var(--spring-snappy), box-shadow 0.18s ease;
}

.hw-ink-swatch:hover {
  transform: scale(1.15);
}

.hw-ink-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb;
}

.hw-slant-slider {
  width: 100px;
  height: 5px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  accent-color: #2563eb;
}

.hw-place-btn {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.18s var(--spring-snappy), box-shadow 0.2s ease, opacity 0.18s ease;
}

.hw-place-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37, 99, 235, 0.45);
}

.hw-place-btn:active {
  transform: scale(0.97);
}

/* Ubiquitous Back Nav Pill */
.btn-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  padding: 8px 18px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s var(--spring-gentle);
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1);
}

.btn-back-nav:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateX(-2px);
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  #phoenix-scroll-indicator {
    display: none !important;
  }
  .phoenix-file-capsule.entering {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}




/* =========================================================
   PHOENIX FLOATING TACTILE TOOLTIP
   ========================================================= */
#phoenix-tooltip-bubble {
  position: fixed;
  z-index: 100000;
  pointer-events: none !important;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92) translateY(4px);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.18s ease;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 7px 13px 10px 13px;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: +0.25px;
  line-height: 1.35;
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.42), 0 3px 8px rgba(0, 0, 0, 0.22);
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
}

#phoenix-tooltip-bubble.phoenix-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none !important;
  transform: scale(1) translateY(0);
}

/* Tooltip Progress Countdown Timeline Bar (4.5s Lifespan) */
.phoenix-tooltip-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.14);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.phoenix-tooltip-timeline-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8), 0 0 3px rgba(6, 182, 212, 0.9);
  transform-origin: left center;
  transform: scaleX(1);
}

@keyframes phoenixTooltipCountdown {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

/* Tooltip Progress Countdown Timeline Bar (4.5s Lifespan) */
.phoenix-tooltip-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.14);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.phoenix-tooltip-timeline-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8), 0 0 3px rgba(6, 182, 212, 0.9);
  transform-origin: left center;
  transform: scaleX(1);
}

@keyframes phoenixTooltipCountdown {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

.phoenix-tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

#phoenix-tooltip-bubble[data-placement="top"] .phoenix-tooltip-arrow {
  bottom: -5px;
  border-top: none;
  border-left: none;
}

#phoenix-tooltip-bubble[data-placement="bottom"] .phoenix-tooltip-arrow {
  top: -5px;
  border-bottom: none;
  border-right: none;
}

#phoenix-tooltip-bubble[data-placement="left"] .phoenix-tooltip-arrow {
  right: -5px;
  border-left: none;
  border-bottom: none;
}

#phoenix-tooltip-bubble[data-placement="right"] .phoenix-tooltip-arrow {
  left: -5px;
  border-right: none;
  border-top: none;
}

/* Keyboard Shortcut Badge */
.phoenix-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 1.5px 5.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0;
  vertical-align: middle;
}

/* =========================================================
   PHOENIX MODERN ASYNC DIALOG & CONFIRMATION
   ========================================================= */
#phoenix-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease;
}

#phoenix-dialog-root.phoenix-dialog-open {
  opacity: 1;
  visibility: visible;
}

.phoenix-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.phoenix-dialog-card {
  position: relative;
  z-index: 1;
  width: min(100%, 450px);
  background: var(--bg-surface, #ffffff);
  color: var(--text-main, #0f172a);
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
  border-radius: 18px;
  padding: 24px 24px 20px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

[data-theme="dark"] .phoenix-dialog-card,
[data-theme="cyberpunk"] .phoenix-dialog-card,
[data-theme="emerald"] .phoenix-dialog-card {
  background: #1e293b;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#phoenix-dialog-root.phoenix-dialog-open .phoenix-dialog-card {
  transform: scale(1) translateY(0);
}

.phoenix-dialog-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.phoenix-dialog-close-btn:hover {
  background: rgba(148, 163, 184, 0.28);
  color: #0f172a;
  transform: scale(1.08);
}

[data-theme="dark"] .phoenix-dialog-close-btn {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .phoenix-dialog-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.phoenix-dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.phoenix-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.phoenix-dialog-icon.danger, .phoenix-dialog-icon.error {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}
[data-theme="dark"] .phoenix-dialog-icon.danger,
[data-theme="dark"] .phoenix-dialog-icon.error {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

.phoenix-dialog-icon.warning {
  background: #fffbeb;
  color: #f59e0b;
  border: 1px solid #fde68a;
}
[data-theme="dark"] .phoenix-dialog-icon.warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
}

.phoenix-dialog-icon.success {
  background: #f0fdf4;
  color: #10b981;
  border: 1px solid #bbf7d0;
}
[data-theme="dark"] .phoenix-dialog-icon.success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
}

.phoenix-dialog-icon.info, .phoenix-dialog-icon.prompt {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
[data-theme="dark"] .phoenix-dialog-icon.info,
[data-theme="dark"] .phoenix-dialog-icon.prompt {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.35);
}

.phoenix-dialog-title-wrap {
  flex: 1;
}

.phoenix-dialog-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 5px 0;
  color: inherit;
}

.phoenix-dialog-message {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
  margin: 0;
}
[data-theme="dark"] .phoenix-dialog-message {
  color: #94a3b8;
}

.phoenix-dialog-input-wrap {
  margin: 16px 0 6px;
}

.phoenix-dialog-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--bg-main, #f8fafc);
  color: var(--text-main, #0f172a);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
[data-theme="dark"] .phoenix-dialog-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}
.phoenix-dialog-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.phoenix-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.phoenix-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}
.phoenix-dialog-btn:hover {
  transform: translateY(-1px);
}
.phoenix-dialog-btn:active {
  transform: translateY(1px) scale(0.98);
}

.phoenix-dialog-btn-cancel {
  background: transparent;
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-color, #cbd5e1);
}
[data-theme="dark"] .phoenix-dialog-btn-cancel {
  color: #94a3b8;
  border-color: #334155;
}
.phoenix-dialog-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main, #0f172a);
}
[data-theme="dark"] .phoenix-dialog-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.phoenix-dialog-btn-confirm {
  background: var(--brand-gradient, linear-gradient(135deg, #e11d48, #be123c));
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(225, 29, 72, 0.35);
}
.phoenix-dialog-btn-confirm.danger, .phoenix-dialog-btn-confirm.error {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.35);
}
.phoenix-dialog-btn-confirm.success {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}
.phoenix-dialog-btn-confirm.info {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

/* =========================================================
   PHOENIX FLOATING TOAST NOTIFICATION STACK
   ========================================================= */
#phoenix-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100060;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: min(92vw, 400px);
}

.phoenix-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: phoenixToastSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.phoenix-toast.phoenix-toast-leaving {
  animation: phoenixToastSlideOut 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes phoenixToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes phoenixToastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
}

.phoenix-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.phoenix-toast-success .phoenix-toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.phoenix-toast-error .phoenix-toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.phoenix-toast-warning .phoenix-toast-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.phoenix-toast-info .phoenix-toast-icon {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.phoenix-toast-loading .phoenix-toast-icon {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.phoenix-toast-body {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #f1f5f9;
  word-break: break-word;
}

.phoenix-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.phoenix-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.phoenix-toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
}

.phoenix-toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transition: transform linear;
}

.phoenix-toast-success .phoenix-toast-progress-fill { background: #10b981; }
.phoenix-toast-error .phoenix-toast-progress-fill { background: #ef4444; }
.phoenix-toast-warning .phoenix-toast-progress-fill { background: #f59e0b; }
.phoenix-toast-info .phoenix-toast-progress-fill { background: #3b82f6; }
.phoenix-toast-loading .phoenix-toast-progress-fill { background: #8b5cf6; }

.phoenix-toast-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: phoenixSpin 0.65s linear infinite;
}

@keyframes phoenixSpin {
  to { transform: rotate(360deg); }
}
