/* Star-Scar Base Styles — v12 Nine Purple Noble Theme (九紫贵人) */
:root {
  --primary: #9070B0;
  --primary-hover: #7A5A9A;
  --primary-light: #B098C8;
  --primary-gradient: linear-gradient(135deg, #9070B0, #B098C8);
  --accent: #D8A080;
  --accent-glow: rgba(144,112,176,0.35);
  --bg: #F5F0F8;
  --bg-pattern: radial-gradient(ellipse at 20% 80%, rgba(144,112,176,0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 15%, rgba(216,160,128,0.08) 0%, transparent 50%);
  --surface: #FFFFFF;
  --surface-hover: #FAF5FF;
  --text: #4A3050;
  --text-muted: #8A7090;
  --border: #E0D8E8;
  --safe: #70B870;
  --warning: #D07070;
  --caution: #D8B050;
  --radius: 24px;
  --radius-btn: 50px;
  --radius-input: 16px;
  --shadow: 0 4px 16px rgba(74,48,80,0.1), 0 0 1px rgba(144,112,176,0.15);
  --shadow-hover: 0 8px 28px rgba(74,48,80,0.15), 0 0 16px rgba(144,112,176,0.1);
  --max-w: 1060px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  background-image: var(--bg-pattern);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar (matches homepage purple navbar with CSS bear logo) ── */
.navbar {
  background-color: var(--primary);
  padding: 15px 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  font-size: 1.8em;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
}

/* CSS Bear Logo */
.logo-bear {
  width: 45px;
  height: 45px;
  margin-right: 10px;
  position: relative;
  background-color: white;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px var(--warning);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
  animation: bear-wiggle 3s ease-in-out infinite;
}
.logo-bear::before, .logo-bear::after {
  content: '';
  position: absolute;
  background-color: var(--warning);
  border-radius: 50%;
  width: 15px;
  height: 15px;
  top: -5px;
}
.logo-bear::before { left: 5px; }
.logo-bear::after { right: 5px; }

.logo-bear-face {
  width: 25px;
  height: 25px;
  background-color: #F8F8F8;
  border-radius: 50%;
  border: 1px solid var(--accent);
  position: relative;
}
.logo-bear-cheeks {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #FFC0CB;
  border-radius: 50%;
  bottom: 4px;
}
.logo-bear-cheeks.left { left: 2px; }
.logo-bear-cheeks.right { right: 2px; }
.logo-bear-eyes {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: var(--text);
  border-radius: 50%;
  top: 7px;
}
.logo-bear-eyes.left { left: 7px; }
.logo-bear-eyes.right { right: 7px; }
.logo-bear-nose {
  position: absolute;
  width: 4px;
  height: 3px;
  background-color: var(--text);
  border-radius: 50% 50% 30% 30%;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes bear-wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-8deg) scale(1.05); }
  30% { transform: rotate(6deg); }
  45% { transform: rotate(-4deg); }
  60% { transform: rotate(3deg); }
  75% { transform: rotate(-2deg); }
}

.logo-bear:hover {
  animation: bear-spin 0.6s ease;
}

@keyframes bear-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  padding: 5px 10px;
  border-radius: 12px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.nav-links a:hover {
  background-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.nav-links a:active {
  transform: translateY(1px) scale(0.94);
  background-color: rgba(255,255,255,0.3);
  transition-duration: 0.05s;
}

/* Language dropdown */
.lang-dropdown {
  position: relative;
  margin-left: 8px;
}

.lang-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.7);
  transform: scale(1.08);
}

.lang-btn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(74,48,80,0.2), 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  min-width: 130px;
  z-index: 100;
}

.lang-menu.open {
  display: block;
  animation: lang-menu-in 0.15s ease;
}

@keyframes lang-menu-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

.lang-menu a:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

/* Tool name displayed in navbar */
.nav-tool-name {
  color: rgba(255,255,255,0.9);
  font-weight: 700;
  font-size: 1.05em;
  padding: 4px 14px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
}

/* ── Footer (matches homepage purple footer with bear) ── */
.site-footer {
  background-color: var(--primary);
  color: white;
  padding: 40px 0;
  text-align: center;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.site-footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  z-index: 10;
  position: relative;
}

.site-footer p { margin: 0; font-size: 1em; opacity: 0.9; }
.site-footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.site-footer a:hover { color: white; text-decoration: underline; }

/* Footer bear illustration */
.footer-bear-illustration {
  width: 100px;
  height: 100px;
  background-color: white;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px var(--warning);
  position: absolute;
  bottom: -30px;
  left: 5%;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotate(5deg);
  overflow: hidden;
}
.footer-bear-illustration::before, .footer-bear-illustration::after {
  content: '';
  position: absolute;
  background-color: var(--warning);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  top: -10px;
  z-index: -1;
}
.footer-bear-illustration::before { left: 10px; }
.footer-bear-illustration::after { right: 10px; }

.footer-bear-face-small {
  width: 50px; height: 50px;
  background-color: #F8F8F8;
  border-radius: 50%;
  border: 1px solid var(--accent);
  position: relative;
}
.footer-bear-cheeks-small {
  position: absolute; width: 15px; height: 15px;
  background-color: #FFC0CB; border-radius: 50%; bottom: 5px;
}
.footer-bear-cheeks-small.left { left: 5px; }
.footer-bear-cheeks-small.right { right: 5px; }
.footer-bear-eyes-small {
  position: absolute; width: 5px; height: 5px;
  background-color: var(--text); border-radius: 50%; top: 15px;
}
.footer-bear-eyes-small.left { left: 15px; }
.footer-bear-eyes-small.right { right: 15px; }
.footer-bear-nose-small {
  position: absolute; width: 7px; height: 5px;
  background-color: var(--text); border-radius: 50% 50% 30% 30%;
  top: 25px; left: 50%; transform: translateX(-50%);
}

/* Navbar + Footer mobile */
@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 12px;
  }
  .nav-links {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .logo { font-size: 1.5em; }
  .footer-bear-illustration {
    width: 80px; height: 80px; bottom: -20px; left: 2%;
  }
  .footer-bear-illustration::before, .footer-bear-illustration::after {
    width: 20px; height: 20px; top: -5px;
  }
  .footer-bear-face-small { width: 40px; height: 40px; }
  .footer-bear-cheeks-small { width: 12px; height: 12px; bottom: 4px; }
  .footer-bear-cheeks-small.left { left: 4px; }
  .footer-bear-cheeks-small.right { right: 4px; }
  .footer-bear-eyes-small { width: 4px; height: 4px; top: 12px; }
  .footer-bear-eyes-small.left { left: 12px; }
  .footer-bear-eyes-small.right { right: 12px; }
  .footer-bear-nose-small { width: 6px; height: 4px; top: 20px; }
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-switcher button,
.lang-switcher a {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s;
}

.lang-switcher button:hover,
.lang-switcher a:hover {
  transform: scale(1.06);
  border-color: var(--primary-light);
}

.lang-switcher button:active,
.lang-switcher a:active {
  transform: scale(0.95);
}

.lang-switcher button.active,
.lang-switcher a.active,
.lang-switcher button:hover,
.lang-switcher a:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Main content */
.main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  position: relative;
  z-index: 2;
}

/* Tool area */
.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.tool-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(74,111,165,0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 32px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 4px 16px rgba(144,112,176,0.35), 0 2px 4px rgba(0,0,0,0.1);
  letter-spacing: 0.02em;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(144,112,176,0.45), 0 4px 8px rgba(0,0,0,0.12);
}

.btn:active {
  transform: translateY(2px) scale(0.95);
  box-shadow: 0 1px 4px rgba(144,112,176,0.2), 0 1px 2px rgba(0,0,0,0.1);
  filter: brightness(0.92);
  transition-duration: 0.05s;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(144,112,176,0.2), 0 2px 6px rgba(0,0,0,0.08);
}

.btn-secondary:active {
  transform: translateY(2px) scale(0.95);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  filter: brightness(0.95);
  transition-duration: 0.05s;
}

/* Progress bar */
.progress-bar-wrap {
  display: none;
  position: relative;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-btn);
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 12px var(--accent-glow);
}

.progress-bear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  animation: bear-bounce 0.6s ease infinite alternate;
}

@keyframes bear-bounce {
  from { transform: translateY(-50%) rotate(-5deg); }
  to { transform: translateY(-60%) rotate(5deg); }
}

.btn-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

/* Sticky bottom action bar for mobile */
.action-bar-sticky {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: var(--surface);
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Output area */
.output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 60px;
  overflow-x: auto;
}

/* Ad placeholders */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-input);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-radius: var(--radius) var(--radius) 0 0;
}

.site-footer::before {
  content: '🐻';
  display: block;
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* SEO content block */
.seo-content {
  margin-top: 32px;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.seo-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.seo-content p, .seo-content li {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 600px) {
  .main { padding: 16px 12px; }
  .tool-card { padding: 16px; }
  .btn-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .site-header { padding: 12px 16px; }
  .site-logo { width: 48px; height: 48px; }
  .logo-link { font-size: 1.1rem; gap: 8px; }
  .lang-switcher button,
.lang-switcher a { padding: 4px 10px; font-size: 0.7rem; }
}

/* ── Progress Overlay Component ── */
.progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}
.progress-overlay.visible { opacity: 1; }

.progress-overlay-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 40px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.progress-spinner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.progress-bear-spin {
  font-size: 2.5rem;
  animation: bear-processing 1s linear infinite;
}

.progress-gear-spin {
  font-size: 2rem;
  animation: gear-rotate 1.5s linear infinite;
}

@keyframes gear-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.progress-pct-big {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 12px;
  font-family: 'Nunito', sans-serif;
}

@keyframes bear-processing {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.05); }
  50% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(10deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.progress-bar-outer {
  width: 100%;
  height: 24px;
  background: var(--border);
  border-radius: var(--radius-btn);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.progress-bar-inner {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-btn);
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 40px;
}

.progress-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.progress-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}

.progress-overlay-card.done .progress-bear-spin {
  animation: none;
  transform: scale(1.2);
}
.progress-overlay-card.done .progress-bar-inner {
  background: linear-gradient(135deg, #22C55E, #4ADE80);
}
.progress-overlay-card.done .progress-text {
  color: #22C55E;
}

/* ── FAQ Section ── */
.faq-section {
  margin-top: 24px;
}

.faq-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: var(--primary-light);
}

.faq-item summary {
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: background 0.15s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '\25B6';
  font-size: 0.65rem;
  color: var(--primary-light);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  transform: rotate(90deg);
}

.faq-item summary:hover {
  background: var(--surface-hover);
}

.faq-item .faq-answer {
  padding: 0 18px 14px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Tool Page Decorative Elements ── */
/* Different from homepage flowers/vines/stars — uses butterflies, leaves, paw prints, bubbles, hearts */

.page-decorations {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.page-decorations .deco {
  position: absolute;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0;
  animation: deco-fade-in 1.5s ease forwards;
}

@keyframes deco-fade-in {
  to { opacity: var(--deco-opacity, 0.15); }
}

/* Butterfly — purple gradient wings */
.deco-butterfly {
  width: 56px; height: 56px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="35" cy="35" rx="25" ry="30" fill="%239070B0" opacity="0.7" transform="rotate(-20 35 35)"/><ellipse cx="65" cy="35" rx="25" ry="30" fill="%23B098C8" opacity="0.7" transform="rotate(20 65 35)"/><ellipse cx="38" cy="65" rx="18" ry="22" fill="%23D8A080" opacity="0.6" transform="rotate(-10 38 65)"/><ellipse cx="62" cy="65" rx="18" ry="22" fill="%23D8A080" opacity="0.6" transform="rotate(10 62 65)"/><line x1="50" y1="20" x2="50" y2="85" stroke="%234A3050" stroke-width="2"/><line x1="50" y1="20" x2="42" y2="8" stroke="%234A3050" stroke-width="1.5"/><line x1="50" y1="20" x2="58" y2="8" stroke="%234A3050" stroke-width="1.5"/></svg>');
  animation: deco-fade-in 1.5s ease forwards, deco-flutter 4s ease-in-out infinite;
}

@keyframes deco-flutter {
  0%, 100% { transform: rotate(var(--deco-rot, 0deg)) scaleX(1); }
  50% { transform: rotate(var(--deco-rot, 0deg)) scaleX(0.85); }
}

/* Leaf — green with curve */
.deco-leaf {
  width: 48px; height: 48px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 C20 30, 10 70, 50 90 C90 70, 80 30, 50 10Z" fill="%2370B870" opacity="0.6"/><path d="M50 20 L50 80" stroke="%23508050" stroke-width="2" fill="none"/><path d="M50 40 L38 32" stroke="%23508050" stroke-width="1.2" fill="none"/><path d="M50 55 L62 48" stroke="%23508050" stroke-width="1.2" fill="none"/><path d="M50 65 L40 60" stroke="%23508050" stroke-width="1.2" fill="none"/></svg>');
}

/* Paw print — warm plum */
.deco-paw {
  width: 38px; height: 38px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="50" cy="62" rx="22" ry="18" fill="%239070B0" opacity="0.5"/><circle cx="30" cy="38" r="10" fill="%239070B0" opacity="0.5"/><circle cx="50" cy="30" r="10" fill="%239070B0" opacity="0.5"/><circle cx="70" cy="38" r="10" fill="%239070B0" opacity="0.5"/></svg>');
}

/* Bubble — soft gradient circle */
.deco-bubble {
  width: 32px; height: 32px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="bg"><stop offset="0%25" stop-color="%23B098C8" stop-opacity="0.3"/><stop offset="100%25" stop-color="%23B098C8" stop-opacity="0.05"/></radialGradient></defs><circle cx="50" cy="50" r="45" fill="url(%23bg)" stroke="%23B098C8" stroke-opacity="0.3" stroke-width="2"/></svg>');
  animation: deco-fade-in 2s ease forwards, deco-float 6s ease-in-out infinite;
}

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

/* Heart — rose-gold */
.deco-heart {
  width: 36px; height: 36px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 88 C25 65, 0 45, 15 25 C25 12, 45 12, 50 30 C55 12, 75 12, 85 25 C100 45, 75 65, 50 88Z" fill="%23D8A080" opacity="0.5"/></svg>');
  animation: deco-fade-in 1.8s ease forwards, deco-pulse 3s ease-in-out infinite;
}

@keyframes deco-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Placement — each tool page uses different positions via nth-child */
.deco.d1 { top: 8%; left: 3%; --deco-opacity: 0.4; --deco-rot: 15deg; animation-delay: 0s; }
.deco.d2 { top: 25%; right: 4%; --deco-opacity: 0.35; --deco-rot: -20deg; animation-delay: 0.3s; }
.deco.d3 { top: 55%; left: 5%; --deco-opacity: 0.3; animation-delay: 0.6s; }
.deco.d4 { top: 70%; right: 6%; --deco-opacity: 0.4; --deco-rot: 30deg; animation-delay: 0.2s; }
.deco.d5 { top: 40%; left: 2%; --deco-opacity: 0.35; animation-delay: 0.5s; }
.deco.d6 { top: 15%; right: 8%; --deco-opacity: 0.3; animation-delay: 0.8s; }
.deco.d7 { top: 85%; left: 8%; --deco-opacity: 0.35; --deco-rot: -15deg; animation-delay: 0.4s; }
.deco.d8 { top: 45%; right: 2%; --deco-opacity: 0.25; animation-delay: 1s; }

/* ── Tool Page Hero Banner ── */
.tool-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #F5F0F8, #F0E8F5);
  padding: 20px 0;
  overflow: hidden;
  height: 200px;
}

.tool-hero-decos {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.tool-hero-deco {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.6;
}

/* Same SVG patterns as homepage */
.tool-hero-deco-flower {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><linearGradient id="pg" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" stop-color="%239070B0"/><stop offset="100%25" stop-color="%23D07070"/></linearGradient></defs><circle cx="50" cy="50" r="15" fill="url(%23pg)"/><circle cx="50" cy="20" r="12" fill="url(%23pg)"/><circle cx="20" cy="50" r="12" fill="url(%23pg)"/><circle cx="50" cy="80" r="12" fill="url(%23pg)"/><circle cx="80" cy="50" r="12" fill="url(%23pg)"/><circle cx="30" cy="30" r="12" fill="url(%23pg)"/><circle cx="70" cy="30" r="12" fill="url(%23pg)"/><circle cx="30" cy="70" r="12" fill="url(%23pg)"/><circle cx="70" cy="70" r="12" fill="url(%23pg)"/></svg>');
}

.tool-hero-deco-vine {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M10 90 C 30 50, 70 50, 90 10" stroke="%2370B870" stroke-width="4" fill="none"/><circle cx="10" cy="90" r="5" fill="%2370B870"/><circle cx="90" cy="10" r="5" fill="%2370B870"/><path d="M30 80 Q 40 70, 35 60" stroke="%2370B870" stroke-width="2" fill="none"/><path d="M70 20 Q 60 30, 65 40" stroke="%2370B870" stroke-width="2" fill="none"/></svg>');
}

.tool-hero-deco-star {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><polygon points="50,0 61.8,35.3 98.8,35.3 68.5,57.7 79.1,92.7 50,70.3 20.9,92.7 31.5,57.7 1.2,35.3 38.2,35.3" fill="%23D8A080"/></svg>');
  opacity: 0.7;
}

.tool-hero-deco-butterfly {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="35" cy="35" rx="25" ry="30" fill="%239070B0" opacity="0.7" transform="rotate(-20 35 35)"/><ellipse cx="65" cy="35" rx="25" ry="30" fill="%23B098C8" opacity="0.7" transform="rotate(20 65 35)"/><ellipse cx="38" cy="65" rx="18" ry="22" fill="%23D8A080" opacity="0.6" transform="rotate(-10 38 65)"/><ellipse cx="62" cy="65" rx="18" ry="22" fill="%23D8A080" opacity="0.6" transform="rotate(10 62 65)"/><line x1="50" y1="20" x2="50" y2="85" stroke="%234A3050" stroke-width="2"/></svg>');
}

.tool-hero-deco-heart {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 88 C25 65, 0 45, 15 25 C25 12, 45 12, 50 30 C55 12, 75 12, 85 25 C100 45, 75 65, 50 88Z" fill="%23D8A080" opacity="0.6"/></svg>');
}

.tool-hero-deco-leaf {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 C20 30, 10 70, 50 90 C90 70, 80 30, 50 10Z" fill="%2370B870" opacity="0.6"/><path d="M50 20 L50 80" stroke="%23508050" stroke-width="2" fill="none"/><path d="M50 40 L38 32" stroke="%23508050" stroke-width="1.2" fill="none"/><path d="M50 55 L62 48" stroke="%23508050" stroke-width="1.2" fill="none"/></svg>');
}

.tool-hero-deco-paw {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="50" cy="62" rx="22" ry="18" fill="%239070B0" opacity="0.6"/><circle cx="30" cy="38" r="10" fill="%239070B0" opacity="0.6"/><circle cx="50" cy="30" r="10" fill="%239070B0" opacity="0.6"/><circle cx="70" cy="38" r="10" fill="%239070B0" opacity="0.6"/></svg>');
}

.tool-hero-deco-sakura {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="35" r="14" fill="%23FFC0CB" opacity="0.7"/><circle cx="35" cy="50" r="14" fill="%23FFB0C0" opacity="0.6"/><circle cx="65" cy="50" r="14" fill="%23FFB0C0" opacity="0.6"/><circle cx="40" cy="68" r="14" fill="%23FFC0CB" opacity="0.7"/><circle cx="60" cy="68" r="14" fill="%23FFC0CB" opacity="0.7"/><circle cx="50" cy="52" r="6" fill="%23D07070" opacity="0.8"/></svg>');
}

@media (max-width: 640px) {
  .tool-hero-banner { height: 140px; padding: 10px 0; }
}
