/* ==========================================
   Multietools — Global Styles v3.0
   Soft Violet Modern Theme + Dark Mode
   ========================================== */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Primary palette */
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.15);

  /* Secondary / accent */
  --secondary: #ec4899;
  --secondary-light: #f472b6;
  --accent: #8b5cf6;

  /* Neutrals — Light Mode (default) */
  --bg: #faf9ff;
  --bg-alt: #f5f3ff;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #475569;
  --muted: #64748b;
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* Feedback */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows — purple-tinted for softness */
  --shadow-xs: 0 1px 2px rgba(124, 58, 237, 0.04);
  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.06);
  --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.08);
  --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.10);
  --shadow-xl: 0 16px 48px rgba(124, 58, 237, 0.12);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration: 0.3s;
  --duration-slow: 0.5s;
}

/* ---------- Dark Mode ---------- */
body.dark {
  --bg: #0f0e1a;
  --bg-alt: #1a1830;
  --surface: #1e1c2e;
  --text: #e2e8f0;
  --text-light: #a1a1b5;
  --muted: #8888a0;
  --border: #2d2b42;
  --border-light: #252340;
  --primary-glow: rgba(124,58,237,0.2);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.35);
}

/* ---------- Global Navbar ---------- */
.global-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,255,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
body.dark .global-nav { background: rgba(15,14,26,0.88); }
.global-nav.scrolled { box-shadow: var(--shadow-md); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 800; font-size: 1.25rem;
  text-decoration: none; color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}
.nav-brand i {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-size: 1.35rem;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.92rem;
  transition: all 0.25s ease;
  font-family: 'Inter', system-ui, sans-serif;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-glow); }
.nav-links a.active { color: var(--primary); background: var(--primary-glow); }
.nav-right { display: flex; align-items: center; gap: 0.4rem; }
.nav-theme-toggle {
  width: 2.2rem; height: 2.2rem; border-radius: var(--radius-full);
  display: grid; place-items: center; cursor: pointer;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.95rem;
  transition: all 0.25s ease;
}
.nav-theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.nav-mobile-btn {
  display: none; background: none; border: none;
  font-size: 1.3rem; color: var(--text); cursor: pointer;
  padding: 0.4rem; border-radius: var(--radius-sm);
}

/* Social link icons in nav */
.nav-social {
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.nav-social a {
  width: 2.2rem; height: 2.2rem; border-radius: var(--radius-full);
  display: grid; place-items: center;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.nav-social a:hover {
  color: var(--primary); border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .nav-links {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(250,249,255,0.97); backdrop-filter: blur(20px);
    flex-direction: column; justify-content: center; align-items: center;
    gap: 0.5rem; z-index: 200;
  }
  body.dark .nav-links { background: rgba(15,14,26,0.97); }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.15rem; padding: 0.7rem 1.5rem; }
  .nav-mobile-btn { display: block; z-index: 300; }
  .nav-social a { width: 2rem; height: 2rem; font-size: 0.85rem; }
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-28px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.05); }
}

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

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

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

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%  { transform: rotate(-3deg); }
  75%  { transform: rotate(3deg); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.3); }
  50%      { box-shadow: 0 0 20px 4px rgba(124,58,237,0.15); }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--border); }
  50%      { border-color: var(--primary-light); }
}

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

@keyframes morphBg {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* ---------- Scroll Animation Utilities ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease-bounce);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger delays */
.stagger > .animate-on-scroll:nth-child(1)  { transition-delay: 0.05s; }
.stagger > .animate-on-scroll:nth-child(2)  { transition-delay: 0.10s; }
.stagger > .animate-on-scroll:nth-child(3)  { transition-delay: 0.12s; }
.stagger > .animate-on-scroll:nth-child(4)  { transition-delay: 0.16s; }
.stagger > .animate-on-scroll:nth-child(5)  { transition-delay: 0.20s; }
.stagger > .animate-on-scroll:nth-child(6)  { transition-delay: 0.24s; }
.stagger > .animate-on-scroll:nth-child(7)  { transition-delay: 0.28s; }
.stagger > .animate-on-scroll:nth-child(8)  { transition-delay: 0.32s; }
.stagger > .animate-on-scroll:nth-child(9)  { transition-delay: 0.36s; }
.stagger > .animate-on-scroll:nth-child(10) { transition-delay: 0.40s; }
.stagger > .animate-on-scroll:nth-child(11) { transition-delay: 0.44s; }
.stagger > .animate-on-scroll:nth-child(12) { transition-delay: 0.48s; }

/* Page entry */
.page-enter {
  animation: fadeInUp 0.5s var(--ease) both;
}

/* Hover micro-animations */
.hover-lift {
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--duration) var(--ease);
}
.hover-glow:hover {
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-md);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4s ease-in-out infinite;
}

/* Hover scale with bounce */
.hover-scale {
  transition: transform var(--duration) var(--ease-bounce);
}
.hover-scale:hover {
  transform: scale(1.05);
}

/* Card tilt on hover (CSS perspective) */
.card-tilt {
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
}
.card-tilt:hover {
  transform: perspective(800px) rotateY(-2deg) rotateX(2deg) translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Gradient button */
.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration) var(--ease), opacity var(--duration) var(--ease);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.btn-gradient:active {
  transform: translateY(0);
}

/* Glass card */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ---------- Dark Mode overrides for tool pages ---------- */
body.dark {
  background: var(--bg) !important;
  color: var(--text) !important;
}
body.dark .wrap,
body.dark .shell,
body.dark .container {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
body.dark header:not(.global-nav) {
  background: rgba(30,28,46,0.6) !important;
  border-color: var(--border) !important;
}
body.dark .panel,
body.dark .stat,
body.dark .output,
body.dark textarea,
body.dark input,
body.dark select {
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
body.dark .muted { color: var(--muted) !important; }
body.dark .back { color: var(--text) !important; }
body.dark h1, body.dark h2, body.dark h3 { color: var(--text) !important; }

/* ---------- Accessibility: Focus Styles ---------- */
*:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.nav-links a:focus-visible,
.nav-theme-toggle:focus-visible,
.nav-mobile-btn:focus-visible,
.btn-gradient:focus-visible,
button:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Share Button ---------- */
.share-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', system-ui, sans-serif;
}
.share-tool-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-glow);
}
.share-tool-btn i { font-size: 0.9rem; }

/* ---------- Recent Tools Bar ---------- */
.recent-tools-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 1rem auto 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}
.recent-tools-bar::-webkit-scrollbar { display: none; }
.recent-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.recent-chip {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.recent-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-glow);
}

/* ---------- Loading Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-light) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
}
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-box {
  height: 120px;
  border-radius: var(--radius-md);
}
.skeleton-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
}

/* ---------- Preconnect visual placeholder ---------- */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.loading-placeholder .spinner {
  width: 2rem; height: 2rem;
  border-width: 3px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.breadcrumb a:hover { opacity: 0.75; }
.breadcrumb .sep { color: var(--border); font-size: 0.7rem; }
.breadcrumb .current { color: var(--text); }

/* ---------- Tool Rating / Feedback ---------- */
.tool-feedback {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}
.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.feedback-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-glow); }
.feedback-btn.active { color: var(--primary); border-color: var(--primary); background: var(--primary-glow); }
.feedback-msg { font-size: 0.82rem; color: var(--success); font-weight: 600; display: none; }
.feedback-msg.show { display: inline; }

/* ---------- Related Tools ---------- */
.related-tools {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 2rem;
  position: relative;
  z-index: 1;
}
.related-tools h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}
.related-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.related-card i {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ---------- FAQ Section ---------- */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.faq-section h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.faq-question i {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.3s ease;
}
.faq-item.open .faq-question i { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 1.25rem 1rem;
}

/* ---------- Back to Top (Global) ---------- */
.global-back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.global-back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.global-back-top:hover { transform: translateY(-2px); }

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  background: var(--text);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease) both;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary); }
.toast.out { animation: toastOut 0.3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(0.95); } }

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
  animation: fadeInUp 0.4s ease both;
}
.cookie-banner p { max-width: 600px; line-height: 1.5; }
.cookie-accept {
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(124,58,237,0.2);
}
.cookie-accept:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,58,237,0.3); }

/* ---------- Responsive — Global Components ---------- */

/* Tablets & small desktops */
@media (max-width: 1024px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phones landscape / small tablets */
@media (max-width: 768px) {
  .breadcrumb { padding: 0.5rem 1rem; font-size: 0.78rem; }
  .tool-feedback { flex-wrap: wrap; gap: 0.5rem; font-size: 0.82rem; }
  .feedback-btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
  .related-tools { padding: 0 1rem 1.5rem; margin-top: 1.5rem; }
  .related-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .related-card { padding: 0.7rem 0.85rem; font-size: 0.82rem; }
  .related-card i { width: 30px; height: 30px; font-size: 0.8rem; }
  .faq-section { padding: 1.5rem 1rem; }
  .faq-section h2 { font-size: 1.3rem; }
  .faq-question { padding: 0.85rem 1rem; font-size: 0.88rem; }
  .faq-answer { font-size: 0.85rem; }
  .cookie-banner { padding: 0.85rem 1rem; font-size: 0.82rem; gap: 0.65rem; }
  .cookie-banner p { font-size: 0.8rem; }
  .recent-tools-bar { padding: 0.6rem 1rem; gap: 0.45rem; margin: 0.75rem 1rem 0; }
  .recent-label { font-size: 0.78rem; }
  .recent-chip { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
  .global-back-top { width: 2.5rem; height: 2.5rem; font-size: 0.85rem; bottom: 1rem; right: 1rem; }
  .toast-container { bottom: 1rem; }
  .share-tool-btn { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
}

/* Phones portrait */
@media (max-width: 480px) {
  .breadcrumb { padding: 0.4rem 0.75rem; font-size: 0.75rem; gap: 0.25rem; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { padding: 0.65rem 0.8rem; }
  .faq-section h2 { font-size: 1.15rem; }
  .faq-question { padding: 0.75rem 0.85rem; font-size: 0.85rem; }
  .cookie-banner { flex-direction: column; text-align: center; padding: 0.75rem; }
  .cookie-banner p { text-align: center; }
  .global-back-top { bottom: 0.75rem; right: 0.75rem; width: 2.25rem; height: 2.25rem; font-size: 0.8rem; }
  .nav-inner { padding: 0.6rem 1rem; }
  .nav-brand { font-size: 1.1rem; }
}

/* Very small screens */
@media (max-width: 360px) {
  .nav-brand { font-size: 1rem; gap: 0.4rem; }
  .nav-brand i { font-size: 1.15rem; }
  .nav-theme-toggle { width: 2rem; height: 2rem; font-size: 0.85rem; }
}

/* ---------- Tool-page base responsive ---------- */
/* Targets common patterns (.wrap, header, main, .panel, .row, .options) used by 65+ tool pages */
@media (max-width: 768px) {
  body { padding: 1rem !important; }
  .wrap { border-radius: var(--radius-md); }
  .wrap > header { padding: 1.25rem; }
  .wrap > header h1 { font-size: 1.4rem; }
  .wrap > header .muted { font-size: 0.88rem; }
  .wrap > main { padding: 1.1rem; }
  .panel { padding: 1rem; }
  .row { gap: 0.5rem; }
  .options { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; }
  textarea { min-height: 140px; font-size: 0.85rem; padding: 0.85rem; }
}

@media (max-width: 480px) {
  body { padding: 0.5rem !important; }
  .wrap > header { padding: 1rem; }
  .wrap > header h1 { font-size: 1.2rem; }
  .wrap > header .back { font-size: 0.85rem; gap: 0.35rem; margin-bottom: 0.65rem; }
  .wrap > main { padding: 0.85rem; gap: 1rem; }
  .panel { padding: 0.85rem; border-radius: var(--radius-sm); }
  h3 { font-size: 0.92rem; }
  button { padding: 0.6rem 0.9rem; font-size: 0.85rem; }
  input[type=text], input[type=number], select { font-size: 0.88rem; padding: 0.55rem 0.75rem; }
  .options { grid-template-columns: 1fr 1fr; }
  textarea { min-height: 120px; }
  .pw-display { font-size: 1rem; padding: 1rem; }
}

@media (max-width: 360px) {
  .wrap > header h1 { font-size: 1.05rem; }
  .wrap > main { padding: 0.65rem; }
  .options { grid-template-columns: 1fr; }
}

/* ---------- Print Styles ---------- */
@media print {
  .global-nav, .bg-orbs, .scroll-top, .global-back-top,
  .share-tool-btn, .cookie-banner, .toast-container,
  .skip-link, .nav-mobile-btn { display: none !important; }
  body, body.dark {
    background: #fff !important;
    color: #000 !important;
  }
  .wrap, .shell, .container, .surface {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  a { color: #000 !important; text-decoration: underline !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  .btn-gradient, .use-tool-btn { background: #eee !important; color: #000 !important; box-shadow: none !important; }
}
