:root {
  --bg: #ffffff;
  --card: #ffffff;
  --accent: #7c5cff;
  --accent-hover: #6a45f0;
  --accent-dark: #5b3ce0;
  --secondary: #e7e5e4;
  --text: #0f172a;
  --muted: #64748b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 2rem;
}

:root {
  --topbar-height: 60px;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: -2rem -2rem 2rem -2rem;
  width: calc(100% + 4rem);
  min-height: var(--topbar-height);
  box-sizing: border-box;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15,23,42,0.08);
  padding: 0.85rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.site-topbar-brand {
  justify-self: start;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.site-topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-self: center;
}

.site-topbar-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s;
}

.site-topbar-nav a:hover {
  color: var(--accent-hover);
}

/* Homepage-only topbar polish — scoped so every other page keeps the plain nav. */
.home-body .site-topbar {
  background: rgba(255,255,255,0.78);
  box-shadow: 0 1px 0 rgba(15,23,42,0.03), 0 10px 30px -16px rgba(15,23,42,0.12);
}

.home-body .site-topbar-brand {
  background: linear-gradient(135deg, #0f172a 30%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-body .site-topbar-nav a {
  position: relative;
  padding-bottom: 3px;
}

.home-body .site-topbar-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.2s ease;
}

.home-body .site-topbar-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.home-body .site-topbar-nav a:last-child {
  background: var(--accent);
  color: var(--text) !important;
  font-weight: 700;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-body .site-topbar-nav a:last-child:hover {
  background: var(--accent-hover);
  color: var(--text) !important;
  transform: translateY(-1px);
}

.home-body .site-topbar-nav a:last-child::after {
  display: none;
}

@media (max-width: 700px) {
  .site-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .site-topbar-brand,
  .site-topbar-nav {
    justify-self: unset;
  }
}

@media (max-width: 600px) {
  .site-topbar-nav {
    gap: 0.9rem;
  }
  .site-topbar-nav a {
    font-size: 0.8rem;
  }
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

p.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 2.5rem;
}

/* ---- Home page ---- */

html {
  scroll-behavior: smooth;
}

body.home-body {
  position: relative;
  background:
    radial-gradient(ellipse 80% 55% at 15% 8%, rgba(79,198,95,0.38), transparent 62%),
    radial-gradient(ellipse 65% 50% at 88% 4%, rgba(45,150,190,0.30), transparent 60%),
    radial-gradient(ellipse 70% 45% at 50% 22%, rgba(65,174,102,0.20), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

body.home-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.home-body > .site-topbar,
body.home-body > .home-hero,
body.home-body > .home-layout,
body.home-body > .home-footer {
  position: relative;
  z-index: 1;
}

.home-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  width: 100%;
  max-width: 1400px;
}

.home-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 2rem);
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 18px;
  padding: 1.1rem 0.85rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home-sidebar-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0.15rem 0 0.65rem 0.7rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sidebar-link:hover {
  background: rgba(15,23,42,0.04);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(79, 198, 95, 0.1);
  color: var(--accent-hover);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
}

@media (max-width: 960px) {
  .home-sidebar {
    display: none;
  }
}

.home-wrap {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  flex: 1;
}

.home-hero {
  position: relative;
  text-align: center;
  margin: 0 auto 3rem;
  width: 100%;
  max-width: 1120px;
  padding: 4rem 2rem 4.5rem;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, #5b3ce0, #7c5cff, #2e1065, #7c5cff, #5b3ce0);
  background-size: 300% 300%;
  animation: heroGradientShift 18s ease infinite;
  box-shadow: 0 24px 60px -12px rgba(91, 60, 224, 0.4);
}

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

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.home-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  pointer-events: none;
  animation: heroOrbFloat 10s ease-in-out infinite;
}

@keyframes heroOrbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-24px, 24px); }
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

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

.home-hero .home-badge { animation: fadeSlideUp 0.6s ease both; }
.home-hero h1 { animation: fadeSlideUp 0.6s ease 0.1s both; }
.home-hero p.subtitle { animation: fadeSlideUp 0.6s ease 0.2s both; }
.home-hero .home-search { animation: fadeSlideUp 0.6s ease 0.3s both; }

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.12);
  color: #ecfdf5;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 0.4rem 1rem 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.home-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,0.3);
  flex-shrink: 0;
  animation: badgeDotPulse 2s ease-in-out infinite;
}

@keyframes badgeDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74,222,128,0.3); }
  50% { box-shadow: 0 0 0 7px rgba(74,222,128,0.12); }
}

.home-hero h1 {
  font-size: 3.4rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.12);
}

.home-hero p.subtitle {
  font-size: 1.1rem;
  max-width: 34rem;
  min-height: 3.1rem;
  margin: 0 auto 2.25rem;
  color: rgba(255,255,255,0.82);
}

.subtitle.typewriter-active::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: middle;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

.home-search {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.home-search::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  background: linear-gradient(90deg, transparent, rgba(79,198,95,0.5), transparent);
  background-size: 200% 100%;
  z-index: -1;
  opacity: 0.7;
  animation: searchGlowSweep 4s linear infinite;
  pointer-events: none;
}

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

.home-search input {
  width: 100%;
  background-color: rgba(255,255,255,0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1.05rem center;
  background-size: 18px;
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.1);
  border-radius: 14px;
  padding: 1.05rem 1.2rem 1.05rem 2.9rem;
  font-size: 0.98rem;
  font-family: inherit;
  box-shadow: 0 8px 30px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(79,198,95,0.18), 0 0 0 4px rgba(79,198,95,0.12);
}

@media (max-width: 600px) {
  .home-hero h1 {
    font-size: 2.3rem;
  }
  .home-hero p.subtitle {
    font-size: 1rem;
  }
  .home-search input {
    padding-left: 2.6rem;
    font-size: 0.9rem;
  }
}

.tool-category {
  margin-bottom: 3.25rem;
}

.category-heading {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(15,23,42,0.07);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(65,174,102,0.28);
}

.category-heading-text {
  display: flex;
  flex-direction: column;
}

.category-subtitle {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.category-count {
  background: rgba(15,23,42,0.06);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
  display: none;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.tool-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border-radius: 14px;
  padding: 1.4rem;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.05);
  box-shadow: 0 4px 14px rgba(15,23,42,0.055), 0 1px 3px rgba(15,23,42,0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card:hover {
  transform: translateY(-6px);
  background: #ffffff;
  border-color: rgba(79,198,95,0.45);
  box-shadow: 0 24px 50px rgba(15,23,42,0.16), 0 4px 12px rgba(15,23,42,0.06), 0 0 0 1px rgba(79,198,95,0.1);
}

/* Scroll-reveal: JS adds .reveal-pending progressively, so content stays
   visible by default if JS fails to load or run. */
.tool-category.reveal-pending {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tool-category.reveal-pending.in-view {
  opacity: 1;
  transform: translateY(0);
}

.tool-category.reveal-pending .tool-card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-category.reveal-pending.in-view .tool-card {
  opacity: 1;
  transform: translateY(0);
}

.tool-category.reveal-pending.in-view .tool-card:nth-child(1) { transition-delay: 0.05s; }
.tool-category.reveal-pending.in-view .tool-card:nth-child(2) { transition-delay: 0.1s; }
.tool-category.reveal-pending.in-view .tool-card:nth-child(3) { transition-delay: 0.15s; }
.tool-category.reveal-pending.in-view .tool-card:nth-child(4) { transition-delay: 0.2s; }
.tool-category.reveal-pending.in-view .tool-card:nth-child(n+5) { transition-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .home-hero,
  .home-hero::after,
  .home-badge::before,
  .home-search::after,
  .home-hero .home-badge,
  .home-hero h1,
  .home-hero p.subtitle,
  .home-hero .home-search {
    animation: none;
  }
  .subtitle.typewriter-active::after {
    animation: none;
    opacity: 0;
  }
  .tool-category.reveal-pending,
  .tool-category.reveal-pending .tool-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.tool-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: rgba(79,198,95,0.1);
  border: 1px solid rgba(79,198,95,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 0.95rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.tool-card:hover .tool-icon {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.06);
}

.tool-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-size: 0.98rem;
}

.tool-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  width: fit-content;
  margin-top: auto;
  transition: background 0.15s ease;
}

.tool-card:hover .tool-cta {
  background: var(--accent-hover);
}

.home-footer {
  width: 100%;
  max-width: 1400px;
  margin: 4rem auto 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(15,23,42,0.08);
  text-align: center;
}

.home-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}

.brand-mark {
  flex-shrink: 0;
  border-radius: 7px;
  box-shadow: 0 2px 6px -1px rgba(91, 60, 224, 0.45);
}

.home-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin-bottom: 1.1rem;
}

.home-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}

.home-footer-links a:hover {
  color: var(--accent-hover);
}

.home-footer-copy {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { color: var(--text); }

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

.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 3rem;
  width: 100%;
  max-width: 900px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  animation: panelFadeIn 0.45s ease both;
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  background: #f8fafc;
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,198,95,0.14);
}

input[type="file"] {
  color: var(--text);
  font-size: 1.05rem;
  margin: 1rem 0;
}

button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover, .btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79,198,95,0.3);
}

button:active, .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(79,198,95,0.25);
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

button:disabled:hover, .btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}

.stat-box {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  animation: panelFadeIn 0.4s ease both;
}

.stats-grid .stat-box:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-box:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-box:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-box:nth-child(4) { animation-delay: 0.2s; }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  animation: errorFadeIn 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .stat-box,
  .error {
    animation: none;
  }
  button, .btn {
    transition: background 0.2s ease;
  }
  button:hover, .btn:hover {
    transform: none;
    box-shadow: none;
  }
}

.hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* ---- All-tools grid modal ---- */

.all-tools-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.all-tools-btn-icon {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}

.all-tools-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}

.all-tools-overlay.visible {
  display: flex;
  opacity: 1;
}

.all-tools-modal {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(15,23,42,0.04);
  padding: 1.6rem 1.6rem 1.5rem;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.all-tools-modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #5b3ce0, #7c5cff, #2e1065);
}

.all-tools-overlay.visible .all-tools-modal {
  transform: scale(1) translateY(0);
}

.all-tools-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.all-tools-search {
  flex: 1;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.9rem center;
  background-size: 17px;
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.all-tools-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,198,95,0.12);
}

.all-tools-close {
  background: #f1f5f9;
  border: none;
  border-radius: 999px;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.2s ease;
}

.all-tools-close:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg);
}

.all-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

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

.all-tools-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  opacity: 0;
  animation: allToolsCardIn 0.32s ease forwards;
}

.all-tools-card:nth-child(6n+1) { animation-delay: 0.02s; }
.all-tools-card:nth-child(6n+2) { animation-delay: 0.04s; }
.all-tools-card:nth-child(6n+3) { animation-delay: 0.06s; }
.all-tools-card:nth-child(6n+4) { animation-delay: 0.08s; }
.all-tools-card:nth-child(6n+5) { animation-delay: 0.1s; }
.all-tools-card:nth-child(6n) { animation-delay: 0.12s; }

.all-tools-card:hover {
  border-color: var(--accent);
  background: rgba(79, 198, 95, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .all-tools-card {
    animation: none;
    opacity: 1;
  }
}

.all-tools-card-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.all-tools-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0 0.5rem;
}

@media (max-width: 600px) {
  .all-tools-btn span:not(.all-tools-btn-icon) {
    display: none;
  }
}

/* ---- WordPress-style admin layout ---- */

.wp-admin-body {
  align-items: stretch !important;
}

.wp-admin-layout {
  display: flex;
  width: calc(100% + 4rem);
  margin: 0 -2rem;
  min-height: calc(100vh - var(--topbar-height));
  align-items: stretch;
}

.wp-admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1d2327;
  color: #f0f0f1;
  padding: 1.25rem 0;
}

.wp-admin-sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c8f94;
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.wp-admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: #d3d4d5;
  text-decoration: none;
  font-size: 0.88rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.wp-admin-sidebar a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.wp-admin-sidebar a.active {
  background: var(--accent);
  color: #fff;
  border-left-color: #fff;
}

.wp-admin-sidebar-footer {
  padding: 1rem 1.25rem 0;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wp-admin-sidebar-footer a {
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: #8c8f94;
}

.wp-sidebar-logout {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: #8c8f94;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.wp-sidebar-logout:hover { color: #fff; }

.wp-admin-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  background: #f0f0f1;
}

.wp-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.wp-admin-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.wp-admin-key-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

.wp-admin-key-box input {
  border: none;
  outline: none;
  font-size: 0.82rem;
  width: 200px;
  font-family: inherit;
}

.wp-admin-key-box label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.wp-post-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.wp-post-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafafa;
}

.wp-post-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.88rem;
  vertical-align: top;
}

.wp-post-table tr:last-child td {
  border-bottom: none;
}

.wp-post-title-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.wp-post-title-link:hover {
  color: var(--accent-hover);
}

.wp-row-actions {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.wp-row-actions a, .wp-row-actions button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-hover);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  text-decoration: none;
}

.wp-row-actions .danger { color: #dc2626; }

.wp-row-actions span.sep { color: rgba(15, 23, 42, 0.2); }

.wp-empty-state {
  background: #fff; border: 1px dashed rgba(15, 23, 42, 0.15); border-radius: 10px;
  padding: 3rem; text-align: center; color: var(--muted);
}

/* Post editor screen */

.wp-editor-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.wp-editor-main {
  flex: 1;
  min-width: 0;
}

.wp-title-input {
  width: 100%;
  font-size: 1.7rem;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.wp-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

.wp-editor-toolbar {
  display: flex;
  gap: 0.25rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem;
  flex-wrap: wrap;
}

.wp-editor-toolbar button {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.wp-editor-toolbar button:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
}

.wp-editor-content {
  min-height: 340px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0 0 8px 8px;
  padding: 1.25rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

.wp-editor-content:focus {
  outline: none;
  border-color: var(--accent);
}

.wp-editor-content p {
  margin: 0 0 1em;
}

.wp-editor-content:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.wp-editor-content img {
  cursor: pointer;
  outline-offset: 2px;
}

.wp-editor-content img:hover {
  outline: 2px solid var(--accent);
}

.wp-img-resize-toolbar {
  position: absolute;
  z-index: 1000;
  display: flex;
  gap: 0.25rem;
  background: #0f172a;
  padding: 0.35rem;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.wp-img-resize-toolbar button {
  background: #1e293b;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.wp-img-resize-toolbar button:hover {
  background: var(--accent);
}

.wp-img-resize-sep {
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0.15rem 0.15rem;
}

.wp-editor-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.wp-box {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.wp-box h3 {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.wp-box .field { margin-bottom: 0.8rem; }
.wp-box .field:last-child { margin-bottom: 0; }
.wp-box .field label { display:block; font-size:0.78rem; color:var(--muted); margin-bottom:0.25rem; }
.wp-box .field input, .wp-box .field textarea {
  width: 100%; border: 1px solid rgba(15,23,42,0.12); border-radius: 6px; padding: 0.5rem 0.6rem;
  font-family: inherit; font-size: 0.88rem; background: #f8fafc; color: var(--text);
}
.wp-box .field textarea { min-height: 70px; resize: vertical; }

.wp-publish-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.wp-publish-btn:hover { background: var(--accent-hover); }
.wp-publish-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.wp-delete-link {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  color: #dc2626;
  font-size: 0.82rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}

.wp-status-msg { font-size: 0.82rem; margin-top: 0.6rem; text-align: center; }
.wp-status-msg.ok { color: #16a34a; }
.wp-status-msg.err { color: #dc2626; }

@media (max-width: 900px) {
  .wp-admin-sidebar { display: none; }
  .wp-editor-layout { flex-direction: column; }
  .wp-editor-sidebar { width: 100%; }
}

.analytics-range {
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  font-size: 0.85rem;
  color: var(--text);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analytics-kpi {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
}

.analytics-kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.analytics-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.analytics-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.analytics-chart-box canvas {
  display: block;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
}

.admin-login-wrap {
  width: 100%;
  max-width: 380px;
  margin: 3rem auto;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.admin-login-brand .brand-mark {
  width: 32px;
  height: 32px;
}

.admin-login-box {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.admin-login-box h1 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

.admin-login-box .subtitle {
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}

.admin-login-field { margin-bottom: 1rem; }
.admin-login-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.admin-login-field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.admin-login-submit {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.4rem;
}

.admin-login-submit:hover { background: var(--accent-hover); }

.admin-login-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.admin-home-wrap {
  width: 100%;
  max-width: 900px;
}

.admin-home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-home-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.admin-home-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-3px);
}

.admin-home-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.admin-home-card h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.admin-home-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
