:root {
  --paper: #f4f0e4;
  --ink: #18262d;
  --muted: #53646d;
  --panel: rgba(255, 252, 244, 0.88);
  --stroke: rgba(24, 38, 45, 0.14);
  --brand: #0a8d83;
  --brand-dark: #08635d;
  --accent: #e97f24;
  --good: #15643b;
  --bad: #8b1c1c;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --paper: #151d22;
  --ink: #e4e8eb;
  --muted: #9aabb6;
  --panel: rgba(30, 40, 48, 0.92);
  --stroke: rgba(200, 220, 230, 0.12);
  --brand: #12c4b8;
  --brand-dark: #0fa89e;
  --accent: #f0953e;
  --good: #2db866;
  --bad: #e05555;
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at 9% 11%, rgba(18, 196, 184, 0.12), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(18, 196, 184, 0.08), transparent 34%),
    linear-gradient(165deg, #101820, #151d22 55%, #1a2530);
}
[data-theme="dark"] .texture {
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
}
[data-theme="dark"] .spotlight-card,
[data-theme="dark"] .related-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .hero-stats div,
[data-theme="dark"] .hero-signal,
[data-theme="dark"] .checkbox-row,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .limit-card,
[data-theme="dark"] .preview-html,
[data-theme="dark"] .secondary-link,
[data-theme="dark"] .trust-pill,
[data-theme="dark"] .ad-slot,
[data-theme="dark"] .empty-state {
  background: rgba(30, 40, 48, 0.7);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(20, 30, 38, 0.95);
  color: var(--ink);
}
[data-theme="dark"] .lang-dropdown {
  background: #1e2830;
}
[data-theme="dark"] .secondary-link:hover {
  background: rgba(30, 40, 48, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 11%, rgba(247, 223, 128, 0.55), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(88, 214, 190, 0.38), transparent 34%),
    linear-gradient(165deg, #f7f3e6, #ece7d9 55%, #ece8db);
  padding: 18px;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 80%);
}

.site-header,
.site-footer,
.container {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}

.header-link {
  color: #fff;
  text-decoration: none;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.88rem;
}

.site-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  display: block;
  z-index: 1002;
}
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 76px;
  min-height: 38px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.lang-btn:hover,
.lang-btn:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 3px 12px rgba(10,141,131,0.14);
  outline: none;
}
.lang-globe svg {
  display: block;
  width: 15px;
  height: 15px;
}
.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.16);
  min-width: 220px;
  max-height: min(420px, calc(100vh - 96px));
  z-index: 1003;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
}
.lang-dropdown.open {
  display: block;
}
.lang-dropdown button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s;
}
.lang-dropdown button:hover,
.lang-dropdown button:focus-visible,
.lang-dropdown button.active {
  background: rgba(10,141,131,0.08);
  outline: none;
}
.lang-dropdown button.active {
  color: var(--brand-dark);
  font-weight: 800;
}
.lang-option-code {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-option-name {
  overflow-wrap: anywhere;
}
[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}
[dir="rtl"] .lang-dropdown button {
  text-align: right;
}
[data-theme="dark"] .lang-btn {
  background: rgba(30,40,48,0.95);
  border-color: rgba(200,220,230,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}
[data-theme="dark"] .lang-dropdown button.active,
[data-theme="dark"] .lang-dropdown button:hover,
[data-theme="dark"] .lang-dropdown button:focus-visible {
  background: rgba(18,196,184,0.12);
  color: var(--brand);
}

.container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 18px;
  max-width: 100%;
}
.hero.panel {
  overflow: visible; /* Was hidden — clipped search autocomplete dropdown */
  backdrop-filter: blur(4px);
  animation: rise 440ms ease both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 3.1rem);
  max-width: 100%;
  overflow-wrap: break-word;
}

.hero p {
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.55;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 18px;
  max-width: 100%;
  overflow: visible; /* Was hidden — clipped search autocomplete dropdown */
  align-items: start;
  word-break: break-word;
}
.hero-copy, .hero-signal { min-width: 0; overflow: hidden; }

.hero-copy,
.hero-signal {
  display: grid;
  gap: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.secondary-link {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.secondary-link:hover {
  background: rgba(255, 255, 255, 0.9);
}

.hero-kicker {
  margin: 0 0 8px;
  font-family: "Space Mono", monospace;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--brand-dark);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-stats div {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
}

.hero-stats span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero-stats strong {
  font-size: 1.06rem;
}

.hero-signal {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.hero-signal h2,
.tool-page-header h1 {
  margin-top: 0;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}
.hero-list a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.hero-list a:hover {
  text-decoration: underline;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-pill {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--stroke);
  font-size: 0.82rem;
  color: var(--ink);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.trust-card h2,
.section-heading h2 {
  margin: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.section-copy {
  margin: 0;
  color: var(--muted);
  max-width: 36ch;
  line-height: 1.55;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.spotlight-card {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.spotlight-card h3,
.spotlight-card p {
  margin: 0;
}

.spotlight-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.spotlight-card h3 a:hover {
  text-decoration: underline;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.related-card {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 16px;
  padding: 15px;
  display: grid;
  gap: 8px;
}

.related-card h3,
.related-card p {
  margin: 0;
}

.related-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.related-card h3 a:hover {
  text-decoration: underline;
}

.related-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1; /* Must stay BELOW search-autocomplete (z-index: 10000) */
}

.category-chip {
  width: auto;
  border-radius: 999px;
  border: 1px solid rgba(10, 141, 131, 0.22);
  background: rgba(10, 141, 131, 0.08);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}

.category-chip:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.category-chip.active {
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.category-chip-reset {
  background: rgba(233, 127, 36, 0.08);
  border-color: rgba(233, 127, 36, 0.22);
  color: #7a3809;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.83rem;
}

input,
textarea,
select,
button {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.95);
}

textarea {
  min-height: 180px;
  resize: vertical;
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
}

button {
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(8, 99, 93, 0.25);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  contain: layout style;
}

.tool-card {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 8px;
  animation: rise 560ms ease both;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}
/* Skip rendering off-screen tool cards for faster page loads */
.tool-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: var(--brand);
}
.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 2px;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tool-card h3 a,
a.tool-card h3 {
  color: var(--brand);
  text-decoration: none;
}

.tool-card h3 a:hover,
a.tool-card:hover h3 {
  text-decoration: underline;
}

a.tool-card {
  color: var(--ink);
  text-decoration: none;
  display: block;
}

/* ── Inline Suggestions (below tool result, next to sidebar) ── */
.inline-suggestions {
  margin-top: 16px;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.suggestions-label {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 4px;
  padding: 0;
}
a.suggestion-card {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  text-decoration: none !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  color: var(--ink);
}
a.suggestion-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(10,141,131,0.12);
  transform: translateY(-2px);
}
a.suggestion-card strong {
  font-size: 0.9rem;
  color: var(--brand);
  display: block;
}
a.suggestion-card span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  display: block;
}
@media (max-width: 640px) {
  .inline-suggestions { grid-template-columns: 1fr; }
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pill {
  justify-self: start;
  font-size: 0.73rem;
  border-radius: 999px;
  background: rgba(10, 141, 131, 0.12);
  color: var(--brand-dark);
  border: 1px solid rgba(10, 141, 131, 0.27);
  padding: 3px 8px;
}

.card-cta {
  justify-self: start;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(130deg, var(--accent), #bf5b14);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.83rem;
  font-weight: 700;
}

.empty-state,
.ad-slot {
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.ad-slot-live {
  border-style: solid;
  background: rgba(255, 255, 255, 0.82);
}

.ad-slot-label {
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.fasttool-ad {
  min-height: 120px;
}

.fasttool-ad-sidebar {
  min-height: 250px;
}

.site-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.site-footer-nav a,
.prose-content a {
  color: var(--brand-dark);
  text-decoration: none;
}

.site-footer-nav a:hover,
.prose-content a:hover {
  text-decoration: underline;
}

.prose-page h1 {
  margin-top: 0;
}

.prose-content {
  color: var(--muted);
  line-height: 1.65;
}

.prose-content h2 {
  color: var(--ink);
  margin-top: 1.4rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 320px;
  gap: 12px;
}

.tool-page-header {
  margin-bottom: 12px;
}

.tool-page-header p {
  color: var(--muted);
}

.workbench,
.result,
.sidebar {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px;
}
.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  contain: layout style;
}

.workbench {
  display: grid;
  gap: 10px;
}

.result {
  margin-top: 12px;
  contain: layout style;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px;
}

.checkbox-row input {
  width: auto;
}

.result-box {
  border-radius: 12px;
  padding: 12px;
  line-height: 1.45;
}

.result-box.info {
  background: rgba(8, 99, 93, 0.08);
  border: 1px solid rgba(8, 99, 93, 0.25);
}

.result-box.success {
  background: rgba(21, 100, 59, 0.1);
  border: 1px solid rgba(21, 100, 59, 0.26);
}

.result-box.error {
  background: rgba(139, 28, 28, 0.1);
  border: 1px solid rgba(139, 28, 28, 0.28);
}

.result-box pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
}

/* ── Key Features & FAQ Section ── */
/* These sections are below the fold; skip rendering until scrolled into view */
[data-tool-meta="static"] {
  display: grid; gap: 0;
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}
[data-tool-meta="static"] h2 {
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(10,141,131,0.15);
}
[data-tool-meta="static"] h2:first-child { margin-top: 0; }

[data-tool-meta="static"] ul {
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 6px;
}
[data-tool-meta="static"] li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(10,141,131,0.05);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.9rem;
}
[data-tool-meta="static"] li::before {
  content: "\2713";
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(10,141,131,0.15);
  color: var(--brand);
  font-size: 0.72rem; font-weight: 700;
}
[data-tool-meta="static"] li:hover {
  background: rgba(10,141,131,0.1);
  border-color: rgba(10,141,131,0.2);
}

[data-tool-meta="static"] details {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}
[data-tool-meta="static"] details:hover {
  border-color: var(--brand);
}
[data-tool-meta="static"] details[open] {
  border-color: var(--brand);
  background: rgba(10,141,131,0.03);
}
[data-tool-meta="static"] summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex; align-items: center; gap: 10px;
  list-style: none;
  transition: background 0.15s;
}
[data-tool-meta="static"] summary::-webkit-details-marker { display: none; }
[data-tool-meta="static"] summary::before {
  content: "+";
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 8px;
  background: rgba(10,141,131,0.12);
  color: var(--brand);
  font-size: 1rem; font-weight: 700;
  transition: transform 0.25s ease, background 0.2s;
}
[data-tool-meta="static"] details[open] summary::before {
  content: "\2212";
  background: var(--brand);
  color: #fff;
  transform: rotate(180deg);
}
[data-tool-meta="static"] summary:hover {
  background: rgba(10,141,131,0.06);
}
[data-tool-meta="static"] details p {
  padding: 0 16px 14px 50px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Pro Tips Box ── */
[data-tool-meta="static"] .pro-tips {
  background: linear-gradient(135deg, rgba(10,141,131,0.06) 0%, rgba(10,141,131,0.02) 100%);
  border: 1px solid rgba(10,141,131,0.15);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  padding: 20px 20px 12px;
  margin: 8px 0;
}
[data-tool-meta="static"] .pro-tips h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--brand);
}
[data-tool-meta="static"] .pro-tips ul {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
[data-tool-meta="static"] .pro-tips li {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(10,141,131,0.1);
}
[data-tool-meta="static"] .pro-tips li::before {
  content: "\1F4A1";
  margin-right: 8px;
}

/* ── Did You Know Box ── */
[data-tool-meta="static"] .did-you-know {
  background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(59,130,246,0.02) 100%);
  border: 1px solid rgba(59,130,246,0.15);
  border-left: 4px solid #3b82f6;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}
[data-tool-meta="static"] .did-you-know h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #3b82f6;
}
[data-tool-meta="static"] .did-you-know p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 8px;
  padding-left: 24px;
  position: relative;
}
[data-tool-meta="static"] .did-you-know p::before {
  content: "\2139\FE0F";
  position: absolute;
  left: 0;
}
[data-tool-meta="static"] .did-you-know p:last-child { margin-bottom: 0; }

/* ── Common Mistakes Box (Wave 9) ── */
[data-tool-meta="static"] .common-mistakes {
  background: linear-gradient(135deg, rgba(239,68,68,0.05) 0%, rgba(239,68,68,0.02) 100%);
  border: 1px solid rgba(239,68,68,0.15);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}
[data-tool-meta="static"] .common-mistakes h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #ef4444;
}
[data-tool-meta="static"] .common-mistakes ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
[data-tool-meta="static"] .common-mistakes li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 10px;
  padding-left: 26px;
  position: relative;
}
[data-tool-meta="static"] .common-mistakes li::before {
  content: "\26A0\FE0F";
  position: absolute;
  left: 0;
}
[data-tool-meta="static"] .common-mistakes li:last-child { margin-bottom: 0; }

/* ── When NOT to Use Box (Wave 9) ── */
[data-tool-meta="static"] .when-not-to {
  background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, rgba(245,158,11,0.02) 100%);
  border: 1px solid rgba(245,158,11,0.15);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}
[data-tool-meta="static"] .when-not-to h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #b45309;
}
[data-tool-meta="static"] .when-not-to > p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft, var(--ink));
  margin: 0 0 12px;
}
[data-tool-meta="static"] .when-not-to ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
[data-tool-meta="static"] .when-not-to li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 10px;
  padding-left: 26px;
  position: relative;
}
[data-tool-meta="static"] .when-not-to li::before {
  content: "\1F6D1";
  position: absolute;
  left: 0;
}
[data-tool-meta="static"] .when-not-to li:last-child { margin-bottom: 0; }

/* Dark mode overrides for Wave 9 boxes */
[data-theme="dark"] [data-tool-meta="static"] .common-mistakes {
  background: linear-gradient(135deg, rgba(239,68,68,0.12) 0%, rgba(239,68,68,0.04) 100%);
  border-color: rgba(239,68,68,0.28);
}
[data-theme="dark"] [data-tool-meta="static"] .when-not-to {
  background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.04) 100%);
  border-color: rgba(245,158,11,0.28);
}
[data-theme="dark"] [data-tool-meta="static"] .when-not-to h2 {
  color: #fbbf24;
}

/* ── Tool Examples ── */
[data-tool-meta="static"] .tool-examples {
  display: grid;
  gap: 12px;
  margin: 8px 0;
}
.tool-example {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
}
.tool-example summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.tool-example summary::-webkit-details-marker { display: none; }
.tool-example summary::before {
  content: "\25B6";
  font-size: 0.65rem;
  color: var(--brand);
  transition: transform 0.2s;
}
.tool-example[open] summary::before { transform: rotate(90deg); }
.tool-example[open] { border-color: var(--brand); }
.example-body {
  padding: 0 16px 14px;
}
.example-io {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}
.example-io .io-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.example-io .io-block {
  background: rgba(10,141,131,0.04);
  border: 1px solid rgba(10,141,131,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
.example-io .io-block.input-block {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.15);
}
.example-io .io-block.output-block {
  background: rgba(16,185,129,0.05);
  border-color: rgba(16,185,129,0.15);
}
.example-io .io-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--brand);
  padding-top: 18px;
}
.example-explanation {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
  margin: 0;
  padding-left: 4px;
  border-left: 2px solid rgba(10,141,131,0.2);
  padding: 4px 0 4px 12px;
}
@media (max-width: 640px) {
  .example-io {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .example-io .io-arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}
/* ── Tool Article / Deep Dive ── */
[data-tool-meta="static"] .tool-article {
  background: linear-gradient(135deg, rgba(139,92,246,0.04) 0%, rgba(139,92,246,0.01) 100%);
  border: 1px solid rgba(139,92,246,0.12);
  border-left: 4px solid #8b5cf6;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}
[data-tool-meta="static"] .tool-article h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #8b5cf6;
}
[data-tool-meta="static"] .tool-article p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 10px;
}
[data-tool-meta="static"] .tool-article p:last-child { margin-bottom: 0; }

/* Dark mode for examples & article */
[data-theme="dark"] .tool-example { border-color: var(--stroke); }
[data-theme="dark"] .tool-example[open] { border-color: var(--brand); }
[data-theme="dark"] .example-io .io-block { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .example-io .io-block.input-block { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.2); }
[data-theme="dark"] .example-io .io-block.output-block { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }
[data-theme="dark"] [data-tool-meta="static"] .tool-article {
  background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(139,92,246,0.03) 100%);
  border-color: rgba(139,92,246,0.2);
}

/* ── Comparison Table ── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  font-size: 0.85rem;
  margin: 8px 0;
}
.comparison-table thead {
  background: var(--brand);
  color: #fff;
}
.comparison-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke);
  line-height: 1.45;
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr:nth-child(even) { background: rgba(10,141,131,0.03); }
.comparison-table tbody tr:hover { background: rgba(10,141,131,0.06); }
.comparison-table td:first-child { font-weight: 500; }

/* ── Glossary / Key Concepts ── */
[data-tool-meta="static"] .glossary {
  display: grid;
  gap: 4px;
  margin: 0;
}
[data-tool-meta="static"] .glossary dt {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 12px 14px 0;
  margin: 0;
}
[data-tool-meta="static"] .glossary dd {
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--muted);
  padding: 4px 14px 12px;
  margin: 0;
  border-bottom: 1px solid var(--stroke);
}
[data-tool-meta="static"] .glossary dd:last-child { border-bottom: none; }

/* ── Ordered list styling for steps ── */
[data-tool-meta="static"] ol {
  padding: 0;
  margin: 0;
  counter-reset: step;
  list-style: none;
  display: grid;
  gap: 6px;
}
[data-tool-meta="static"] ol li {
  counter-increment: step;
  padding: 10px 12px 10px 44px;
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  display: block;
}
[data-tool-meta="static"] ol li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Dark mode adjustments for new sections ── */
[data-theme="dark"] [data-tool-meta="static"] .pro-tips {
  background: linear-gradient(135deg, rgba(10,141,131,0.12) 0%, rgba(10,141,131,0.04) 100%);
  border-color: rgba(10,141,131,0.25);
}
[data-theme="dark"] [data-tool-meta="static"] .pro-tips li {
  background: rgba(255,255,255,0.04);
  border-color: rgba(10,141,131,0.15);
}
[data-theme="dark"] [data-tool-meta="static"] .did-you-know {
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.04) 100%);
  border-color: rgba(59,130,246,0.25);
}
[data-theme="dark"] .comparison-table { border-color: var(--stroke); }
[data-theme="dark"] .comparison-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .comparison-table tbody tr:hover { background: rgba(10,141,131,0.1); }
[data-theme="dark"] [data-tool-meta="static"] ol li {
  background: rgba(255,255,255,0.04);
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.stat-card {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.67);
  padding: 9px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.stat-card strong {
  font-size: 1.05rem;
}

.limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.limit-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.limit-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.limit-card.good {
  border-color: rgba(21, 100, 59, 0.26);
  background: rgba(21, 100, 59, 0.08);
}

.limit-card.warn {
  border-color: rgba(233, 127, 36, 0.32);
  background: rgba(233, 127, 36, 0.08);
}

.limit-card.over {
  border-color: rgba(139, 28, 28, 0.3);
  background: rgba(139, 28, 28, 0.08);
}

.preview-html {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  margin: 8px 0;
  padding: 10px;
}

.preview-html p,
.preview-html ul,
.preview-html h1,
.preview-html h2,
.preview-html h3 {
  margin-top: 0;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.palette-block {
  min-height: 78px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  font-family: "Space Mono", monospace;
  color: #111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sidebar h2,
.sidebar h3 {
  margin-top: 0;
}

.sidebar ul {
  margin: 0;
  padding-left: 17px;
  line-height: 1.45;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) transparent;
}
.sidebar ul::-webkit-scrollbar { width: 5px; }
.sidebar ul::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 4px; }
.sidebar ul::-webkit-scrollbar-track { background: transparent; }

.sidebar a {
  color: var(--brand-dark);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 920px) {
  .filters,
  .hero-stats,
  .tool-layout,
  .checkbox-grid,
  .hero-layout,
  .trust-grid,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }
}

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

/* ── Theme Toggle ── */
.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-left: 4px;
}
.theme-toggle:hover { border-color: var(--brand); transform: none; box-shadow: none; }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--ink); }

/* ── Card Hover Effects ── */
.tool-card, .spotlight-card, .related-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.tool-card:hover, .spotlight-card:hover, .related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .tool-card:hover,
[data-theme="dark"] .spotlight-card:hover,
[data-theme="dark"] .related-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ── Focus Styles (WCAG AA) ── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
}

/* ── Button Press ── */
button:active { transform: translateY(1px) scale(0.98); box-shadow: none; }

/* ── Toast Notifications ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 12px;
  font-size: 0.88rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toast-in 300ms ease forwards;
  pointer-events: auto;
}
.toast.toast-out { animation: toast-out 250ms ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed; bottom: 24px; left: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(8,99,93,0.3);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 999; padding: 0;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(8,99,93,0.4); }
.back-to-top svg { width: 20px; height: 20px; }

/* ── Social Proof ── */
.social-proof { text-align: center; }
.proof-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.proof-stat { padding: 14px 8px; }
.proof-stat strong {
  display: block; font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--brand); font-weight: 800;
}
.proof-stat span { font-size: 0.84rem; color: var(--muted); }
.proof-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.proof-badge {
  background: linear-gradient(130deg, rgba(10,141,131,0.1), rgba(10,141,131,0.05));
  border: 1px solid rgba(10,141,131,0.2);
  border-radius: 999px; padding: 8px 16px;
  font-size: 0.84rem; font-weight: 600; color: var(--brand-dark);
}

/* ── Popularity Badges ── */
.badge-pill {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
  vertical-align: middle;
}
.badge-popular {
  background: linear-gradient(130deg, rgba(10,141,131,0.15), rgba(10,141,131,0.08));
  color: var(--brand-dark); border: 1px solid rgba(10,141,131,0.25);
}
.badge-new {
  background: linear-gradient(130deg, rgba(233,127,36,0.15), rgba(233,127,36,0.08));
  color: #93440c; border: 1px solid rgba(233,127,36,0.25);
}
.badge-trending {
  background: linear-gradient(130deg, rgba(139,92,246,0.15), rgba(139,92,246,0.08));
  color: #5b21b6; border: 1px solid rgba(139,92,246,0.25);
}
[data-theme="dark"] .badge-new { color: var(--accent); }
[data-theme="dark"] .badge-trending { color: #a78bfa; }
[data-theme="dark"] .category-chip-reset { color: #f0953e; }

/* ── Keyboard Hint ── */
.shortcut-hint {
  margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); opacity: 1;
}
.shortcut-hint kbd {
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 4px; padding: 1px 5px; font-size: 0.75rem;
  font-family: "Space Mono", monospace;
}

/* ── Mobile: 768px ── */
@media (max-width: 768px) {
  body { padding: 12px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .spotlight-grid, .related-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 14px; border-radius: 16px; }
  button, .card-cta, .header-link, .secondary-link, .lang-btn, .theme-toggle {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  input, textarea, select { min-height: 44px; font-size: 16px; }
  .sidebar ul { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
  .sidebar.expanded ul { max-height: 2000px; }
  .sidebar h2, .sidebar h3 { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
  .sidebar h2::after, .sidebar h3::after { content: "+"; font-size: 1.2rem; color: var(--muted); transition: transform 0.2s; }
  .sidebar.expanded h2::after, .sidebar.expanded h3::after { content: "\2212"; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile: 640px ── */
@media (max-width: 640px) {
  .spotlight-grid, .related-grid, .tool-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .header-link, .hero-actions .secondary-link { text-align: center; }
  .trust-strip { justify-content: center; flex-wrap: wrap; }
  .hero-copy h1 { font-size: 1.5rem; line-height: 1.25; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .category-chip-row { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .category-chip { flex-shrink: 0; }
  .actions { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .back-to-top { bottom: 16px; left: 16px; width: 38px; height: 38px; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { text-align: center; }
}

/* ── Small Mobile: 480px ── */
@media (max-width: 480px) {
  body { padding: 8px; }
  .container { overflow-x: hidden; }
  .hero h1, .hero-copy h1 { font-size: 1.25rem; line-height: 1.25; word-break: break-word; }
  .hero-copy p { font-size: 0.85rem; }
  .hero-kicker { font-size: 0.65rem; }
  .site-header { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .site-header .header-link { font-size: 0.82rem; padding: 6px 14px; }
  .hero-layout { gap: 12px; }
  .hero-signal { padding: 12px; }
  .hero-signal h2 { font-size: 1rem; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .hero-stats > div { padding: 8px; }
  .hero-stats span { font-size: 0.68rem; }
  .hero-stats strong { font-size: 1rem; }
  .hero-list { font-size: 0.85rem; padding-left: 16px; line-height: 1.5; }
  .trust-pill { font-size: 0.72rem; padding: 5px 8px; }
  .panel { padding: 12px; }
  .filters { gap: 8px; }
  .tool-card { padding: 12px; }
  .tool-card-icon { font-size: 1.6rem; }
  .tool-card h3 { font-size: 0.95rem; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .proof-number { font-size: 1.8rem; }
  .trust-grid { grid-template-columns: 1fr; }
  .history-panel { width: calc(100vw - 32px); right: 16px; }
  .cmd-palette { width: calc(100vw - 24px); }
  .cmd-hint { display: none; }
  .actions { grid-template-columns: 1fr; }
}

/* ── Command Palette (Cmd+K) ── */
.cmd-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 18vh;
  animation: cmd-fade-in 150ms ease;
}
.cmd-overlay.closing { animation: cmd-fade-out 120ms ease forwards; }
@keyframes cmd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmd-fade-out { from { opacity: 1; } to { opacity: 0; } }

.cmd-palette {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: cmd-slide-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmd-slide-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--stroke);
}
.cmd-input-wrap svg { width: 20px; height: 20px; stroke: var(--muted); flex-shrink: 0; }
.cmd-input {
  flex: 1; border: none; background: none; outline: none;
  font: inherit; font-size: 1.05rem; color: var(--ink);
}
.cmd-input::placeholder { color: var(--muted); }
.cmd-kbd {
  font-family: "Space Mono", monospace; font-size: 0.72rem;
  background: var(--stroke); border-radius: 4px;
  padding: 2px 6px; color: var(--muted);
}
.cmd-results {
  max-height: 340px; overflow-y: auto;
  padding: 6px;
}
.cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  cursor: pointer; transition: background 100ms;
  text-decoration: none; color: var(--ink);
}
.cmd-item:hover, .cmd-item.active {
  background: rgba(10,141,131,0.1);
}
.cmd-item-name { font-weight: 600; font-size: 0.95rem; }
.cmd-item-cat { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.cmd-item .badge-pill { font-size: 0.62rem; }
.cmd-empty {
  padding: 24px; text-align: center; color: var(--muted);
}
.cmd-footer {
  display: flex; gap: 14px; padding: 10px 18px;
  border-top: 1px solid var(--stroke);
  font-size: 0.75rem; color: var(--muted);
}
.cmd-footer kbd {
  background: var(--stroke); border-radius: 3px;
  padding: 1px 5px; font-family: "Space Mono", monospace;
}
.cmd-hint {
  position: fixed; bottom: 72px; left: 24px;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 10px; padding: 6px 12px;
  font-size: 0.78rem; color: var(--muted);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 998;
  animation: cmd-fade-in 500ms ease 2s both;
}
.cmd-hint kbd {
  background: var(--stroke); border-radius: 3px;
  padding: 1px 5px; font-family: "Space Mono", monospace; font-size: 0.72rem;
}

/* ── Session History Panel ── */
.history-toggle {
  position: fixed; bottom: 24px; right: 72px;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(130deg, var(--accent), #bf5b14);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(191,91,20,0.3);
  z-index: 999; padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.history-toggle:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(191,91,20,0.4); }
.history-toggle svg { width: 20px; height: 20px; }
.history-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--bad); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.history-panel {
  position: fixed; bottom: 80px; right: 24px;
  width: min(380px, 88vw); max-height: 420px;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  z-index: 9998; overflow: hidden;
  animation: cmd-slide-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.history-panel.hidden { display: none; }
.history-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--stroke);
  font-weight: 700;
}
.history-header button {
  width: auto; background: none; border: 1px solid var(--stroke);
  border-radius: 8px; padding: 4px 10px; font-size: 0.78rem;
  color: var(--muted); cursor: pointer;
}
.history-list {
  max-height: 340px; overflow-y: auto; padding: 8px;
}
.history-entry {
  display: grid; gap: 4px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer; transition: background 100ms;
  margin-bottom: 4px;
}
.history-entry:hover {
  background: rgba(10,141,131,0.06);
  border-color: var(--stroke);
}
.history-entry-tool {
  font-size: 0.78rem; font-weight: 700; color: var(--brand);
}
.history-entry-value {
  font-family: "Space Mono", monospace; font-size: 0.8rem;
  color: var(--ink); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}
.history-entry-time {
  font-size: 0.7rem; color: var(--muted);
}

/* ── Smart Paste Banner ── */
.smart-paste-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 10px 20px; border-radius: 14px;
  box-shadow: 0 8px 28px rgba(8,99,93,0.35);
  z-index: 10001; display: flex; align-items: center; gap: 12px;
  font-size: 0.9rem; font-weight: 600;
  animation: cmd-slide-in 250ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 92vw;
}
.smart-paste-banner a {
  color: #fff; text-decoration: underline; font-weight: 700;
}
.smart-paste-banner .close-btn {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; padding: 0;
}

/* ── Share Button ── */
.share-btn {
  width: auto; background: none; border: 1px solid var(--stroke);
  border-radius: 10px; padding: 6px 12px;
  color: var(--muted); font-size: 0.82rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); transform: none; box-shadow: none; }
.share-btn svg { width: 14px; height: 14px; }

/* ── Timer/Counter Stability ── */
.timer-display, .stopwatch-display, .countdown-display {
  font-family: "Space Mono", monospace !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  min-width: 8ch;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
}

/* ── Fullscreen Tool Mode ── */
.workbench-share-btn,
.fullscreen-btn {
  width: auto; background: none; border: 1px solid var(--stroke);
  border-radius: 10px; padding: 6px 12px;
  color: var(--muted); font-size: 0.82rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.workbench-share-btn:hover,
.fullscreen-btn:hover { border-color: var(--brand); color: var(--brand); transform: none; box-shadow: none; }
.workbench-share-btn svg,
.fullscreen-btn svg { width: 14px; height: 14px; }

body.tool-fullscreen .site-header,
body.tool-fullscreen .site-footer,
body.tool-fullscreen .tool-page-header,
body.tool-fullscreen .sidebar,
body.tool-fullscreen .related-tools,
body.tool-fullscreen .related-articles,
body.tool-fullscreen [data-tool-meta] {
  display: none !important;
}
body.tool-fullscreen .container { max-width: 100%; padding: 8px; }
body.tool-fullscreen .tool-layout { grid-template-columns: 1fr !important; }
body.tool-fullscreen .workbench { min-height: 80vh; }
body.tool-fullscreen .texture { display: none; }
body.tool-fullscreen { padding: 0; }

/* ── Twitter Share Button ── */
.twitter-share-btn {
  width: auto; background: #000; color: #fff;
  border: none; border-radius: 10px; padding: 8px 14px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  transition: background 0.15s, transform 0.12s;
}
.twitter-share-btn:hover { background: #1a1a1a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.twitter-share-btn svg { flex-shrink: 0; }

/* ── Rate Tool ── */
.rate-tool-wrap {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--stroke);
}
.rate-label {
  font-size: 0.82rem; color: var(--muted); font-weight: 600;
}
.rate-btn {
  width: auto; background: none; border: 1px solid var(--stroke);
  border-radius: 8px; padding: 5px 8px;
  cursor: pointer; display: inline-flex; align-items: center;
  color: var(--muted); transition: border-color 0.15s, color 0.15s;
}
.rate-btn:hover { border-color: var(--brand); color: var(--brand); transform: none; box-shadow: none; }
.rate-btn.voted { opacity: 0.5; cursor: default; }
.rate-btn.voted:hover { border-color: var(--stroke); color: var(--muted); }
.rate-count {
  font-size: 0.78rem; color: var(--muted); font-weight: 600; min-width: 1ch;
}

/* ── Share Friends Banner ── */
.share-friends-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(130deg, var(--accent), #bf5b14);
  color: #fff; padding: 12px 20px; border-radius: 14px;
  box-shadow: 0 8px 28px rgba(191,91,20,0.35);
  z-index: 10001; display: flex; align-items: center; gap: 12px;
  font-size: 0.9rem; font-weight: 600;
  animation: cmd-slide-in 250ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 92vw;
}
.share-friends-banner.closing { animation: cmd-fade-out 300ms ease forwards; }
.share-friends-btn {
  width: auto; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px; padding: 6px 14px; color: #fff;
  font-weight: 700; cursor: pointer; font-size: 0.82rem;
}
.share-friends-btn:hover { background: rgba(255,255,255,0.3); transform: none; box-shadow: none; }
.share-friends-banner .close-btn {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; padding: 0;
}

/* ── Blog Styles ── */
.prose-content h2 { margin-top: 1.8rem; }
.prose-content p { margin-bottom: 1rem; }

/* ── Monthly Users Counter ── */
.proof-users-note {
  font-size: 0.7rem; color: var(--muted); opacity: 1;
  display: block; margin-top: 2px;
}

/* ── Skip to Content (Accessibility) ── */
.skip-to-content {
  position: absolute; top: -100%; left: 16px;
  background: var(--brand); color: #fff;
  padding: 8px 16px; border-radius: 0 0 8px 8px;
  font-weight: 600; font-size: 0.9rem;
  z-index: 10000; text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

/* ── How It Works Section ── */
.how-it-works-section { text-align: center; }
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.hiw-step {
  position: relative;
  padding: 32px 24px 28px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hiw-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.hiw-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 8px;
  line-height: 1;
}
.hiw-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.hiw-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
.hiw-step p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ── Why Choose Section ── */
.why-choose-section { text-align: center; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
  text-align: left;
}
.why-card {
  padding: 28px 24px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  transition: transform 0.2s, box-shadow 0.2s;
}
.why-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.why-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}
.why-card p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* ── Testimonials Section ── */
.testimonials-section { text-align: center; }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
  text-align: left;
}
.testimonial-card {
  padding: 28px 24px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.testimonial-card blockquote {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink);
  font-style: italic;
}
.testimonial-card footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.testimonial-card footer strong {
  font-size: 0.9rem;
  color: var(--ink);
}
.testimonial-card footer span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 20px 24px;
  margin: 8px 0 24px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.stats-bar span[aria-hidden] {
  color: var(--muted);
  opacity: 0.5;
}

/* ── Dark mode for editorial sections ── */
[data-theme="dark"] .hiw-step,
[data-theme="dark"] .why-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .stats-bar {
  background: rgba(30, 40, 48, 0.7);
}
[data-theme="dark"] .hiw-step:hover,
[data-theme="dark"] .why-card:hover,
[data-theme="dark"] .testimonial-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ── Editorial sections responsive ── */
@media (max-width: 900px) {
  .hiw-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Last Updated Date ── */
.last-updated {
  font-size: 0.78rem;
  color: var(--muted);
  margin: -8px 0 12px;
}
.last-updated time { font-weight: 500; }

/* ── Contextual Links ── */
.contextual-links {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0.5rem;
}
.contextual-links a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contextual-links a:hover {
  color: var(--brand-dark);
}

/* ── Tool Tabs ── */
.tool-tabs { margin-top: 16px; }

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--stroke);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  width: auto;
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
  border-radius: 0;
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

@media (max-width: 640px) {
  .tab-btn { padding: 8px 14px; font-size: 0.82rem; }
}

/* ── Related Articles ── */
.related-articles {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}
.related-articles h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  font-weight: 600;
}
.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-articles li a {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.2s;
}
.related-articles li a:hover { opacity: 0.8; text-decoration: underline; }

/* ── Contact Form ── */
.contact-intro {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.contact-response-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 141, 131, 0.08);
  border: 1px solid rgba(10, 141, 131, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 2rem;
  font-size: 0.92rem;
  color: var(--ink);
}
.contact-response-icon {
  font-size: 1.2rem;
}
[data-theme="dark"] .contact-response-note {
  background: rgba(18, 196, 184, 0.1);
  border-color: rgba(18, 196, 184, 0.2);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
}

.contact-form-group label {
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink);
}

.contact-required {
  color: var(--bad);
}

.contact-form-group input,
.contact-form-group select,
.contact-form-group textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
[data-theme="dark"] .contact-form-group input,
[data-theme="dark"] .contact-form-group select,
[data-theme="dark"] .contact-form-group textarea {
  background: rgba(20, 30, 38, 0.95);
}

.contact-form-group input:focus,
.contact-form-group select:focus,
.contact-form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.12);
}

.contact-form-group textarea {
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
}

.contact-form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2353646d' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Validation error states */
.contact-error {
  display: block;
  font-size: 0.8rem;
  color: var(--bad);
  margin-top: 4px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 200ms ease, max-height 200ms ease;
}
.contact-error-visible {
  opacity: 1;
  max-height: 2rem;
}

.contact-invalid {
  border-color: var(--bad) !important;
  box-shadow: 0 0 0 3px rgba(139, 28, 28, 0.1) !important;
}
[data-theme="dark"] .contact-invalid {
  box-shadow: 0 0 0 3px rgba(224, 85, 85, 0.15) !important;
}

/* Submit button */
.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  align-self: flex-start;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.contact-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8, 99, 93, 0.3);
}
.contact-submit-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}
.contact-btn-icon {
  font-size: 1.1rem;
}
.contact-btn-success {
  background: linear-gradient(130deg, var(--good), #1a8a4a) !important;
}

.contact-form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.5rem;
  line-height: 1.5;
}

/* Divider */
.contact-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-divider::before,
.contact-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

/* Direct email section */
.contact-direct-email {
  text-align: center;
  margin-bottom: 2.5rem;
}
.contact-direct-email h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.contact-direct-email p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}
.contact-email-link {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  padding: 8px 20px;
  border: 2px solid var(--brand);
  border-radius: 10px;
  transition: background 200ms ease, color 200ms ease;
}
.contact-email-link:hover {
  background: var(--brand);
  color: #fff;
}

/* FAQ section */
.contact-faq {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--stroke);
}
.contact-faq h2 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.contact-faq > p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.contact-faq-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 200ms ease;
}
.contact-faq-item[open] {
  border-color: var(--brand);
}
.contact-faq-item summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-faq-item summary::-webkit-details-marker {
  display: none;
}
.contact-faq-item summary::before {
  content: '\25B6';
  font-size: 0.65rem;
  color: var(--brand);
  transition: transform 200ms ease;
}
.contact-faq-item[open] summary::before {
  transform: rotate(90deg);
}
.contact-faq-item p {
  padding: 0 18px 14px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}
.contact-faq-item a {
  color: var(--brand);
}

/* Responsive */
@media (max-width: 640px) {
  .contact-form-row {
    grid-template-columns: 1fr;
  }
  .contact-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Newsletter Section ── */
.newsletter-section {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, rgba(10,141,131,0.06), rgba(10,141,131,0.02));
  border-top: 1px solid var(--stroke);
  margin-top: 32px;
}
.newsletter-section h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.newsletter-section p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--panel);
  color: var(--ink);
}
.newsletter-form button {
  padding: 12px 24px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.newsletter-form button:hover { opacity: 0.9; }
@media (max-width: 500px) {
  .newsletter-form { flex-direction: column; }
}
[data-theme="dark"] .newsletter-section {
  background: linear-gradient(135deg, rgba(10,141,131,0.1), rgba(10,141,131,0.03));
}

/* ── Breadcrumb Navigation ── */
.breadcrumb {
  padding: 8px 0;
  margin-bottom: 4px;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
  font-size: 0.82rem;
}
.breadcrumb li + li::before {
  content: "\203A";
  margin-right: 4px;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] {
  color: var(--muted);
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Print Stylesheet ── */
@media print {
  .site-header, .site-footer, .sidebar, .ad-slot,
  .tab-nav, .skip-to-content, .skip-link, .breadcrumb, .related-tools, .related-articles,
  .share-banner, .power-features, .cookie-banner { display: none !important; }
  .tab-panel { display: block !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .tool-tabs { border: none; }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATION SYSTEMS & MICRO-INTERACTIONS
   Added: 2026-04-04
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Fade-In-Up Animation ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.6s ease-out both; }

/* ── 2. Tool Card Reveal (no stagger — avoids LCP delay) ── */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tool-grid .tool-card { animation: cardReveal 0.3s ease-out both; }

/* ── 3. Hero Section Animations ── */

/* Floating gradient orbs — desktop only, respects motion preference */
.hero.panel {
  position: relative;
  z-index: 1;
}
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  @keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(15px, -18px); }
  }
  .hero.panel::before,
  .hero.panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
    opacity: 0.3;
  }
  .hero.panel::before {
    width: 240px; height: 240px;
    top: -60px; left: -40px;
    background: radial-gradient(circle, var(--brand), transparent 70%);
    animation: floatOrb 10s ease-in-out infinite;
  }
  .hero.panel::after {
    width: 180px; height: 180px;
    bottom: -50px; right: -30px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    animation: floatOrb 13s ease-in-out infinite reverse;
  }
}

/* Hero h1 text reveal */
@keyframes heroTextReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-copy h1 {
  animation: heroTextReveal 0.4s ease-out forwards;
}

/* Hero kicker accent line — static to avoid constant repaints */
.hero-kicker {
  border-right: 2px solid var(--brand);
  padding-right: 4px;
}

/* CTA glow — runs once then stops to avoid constant compositing */
@keyframes ctaGlow {
  0%   { box-shadow: 0 0 0 0 rgba(10, 141, 131, 0.4); }
  50%  { box-shadow: 0 0 16px 3px rgba(10, 141, 131, 0.18); }
  100% { box-shadow: 0 2px 12px rgba(10, 141, 131, 0.2); }
}
.hero-actions .header-link {
  animation: ctaGlow 1.5s ease-out 0.3s both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-actions .header-link:hover {
  transform: translateY(-2px);
  animation: none;
  box-shadow: 0 8px 24px rgba(10, 141, 131, 0.3);
}

/* ── 4. Enhanced Tool Card Hover Effects ── */
.tool-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12),
              0 0 0 1px var(--brand),
              0 0 20px rgba(10, 141, 131, 0.08);
  border-color: var(--brand);
}
[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35),
              0 0 0 1px var(--brand),
              0 0 20px rgba(18, 196, 184, 0.1);
}
.tool-card-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.tool-card:hover .tool-card-icon {
  transform: scale(1.15);
}

/* ── 5. Scroll-Triggered Reveal Animations ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
.reveal-left  { animation: slideInLeft  0.6s ease-out both; }
.reveal-right { animation: slideInRight 0.6s ease-out both; }
.reveal-scale { animation: scaleIn      0.5s ease-out both; }

/* ── 6. Button Animations ── */

/* Ripple effect on click */
button {
  position: relative;
  overflow: hidden;
}
button::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
}
button:active::after {
  width: 300px; height: 300px;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0s;
}

/* Gradient shift on hover for header-link and primary buttons */
.header-link {
  background-size: 200% 100%;
  background-image: linear-gradient(130deg, var(--brand), var(--brand-dark), var(--brand));
  transition: background-position 0.4s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.header-link:hover {
  background-position: 100% 0;
}

/* Active state press-down */
button:active,
.header-link:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

/* ── 7. Loading / Skeleton Shimmer ── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.1) 37%,
    rgba(0, 0, 0, 0.06) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.06) 63%
  );
  background-size: 200% 100%;
}

/* ── 8. Result / Stat Card Animations ── */

/* Stat card entrance — no stagger for faster paint */
@keyframes statPop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.stat-card:not(#toolWorkbench .stat-card) {
  animation: statPop 0.3s ease-out both;
}

/* Success result flash (outside #toolWorkbench only) */
@keyframes successFlash {
  0%   { box-shadow: 0 0 0 0 rgba(21, 100, 59, 0.35); }
  40%  { box-shadow: 0 0 16px 4px rgba(21, 100, 59, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(21, 100, 59, 0); }
}
.result-box.success:not(#toolWorkbench .result-box) {
  animation: successFlash 1s ease-out;
}

/* Error result shake (outside #toolWorkbench only) */
@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  15%      { transform: translateX(-6px); }
  30%      { transform: translateX(5px); }
  45%      { transform: translateX(-4px); }
  60%      { transform: translateX(3px); }
  75%      { transform: translateX(-2px); }
}
.result-box.error:not(#toolWorkbench .result-box) {
  animation: errorShake 0.5s ease-out;
}

/* ── 9. Dark Mode Transition — scoped to theme toggle only ── */
/* Using class-based transition avoids constant transition overhead.
   The theme toggle JS adds .theme-transitioning to <html> briefly. */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

/* ── 10. Floating Particles — desktop only, reduced for perf ── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  @keyframes particleFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-20px); }
  }
  .particles::before {
    content: "";
    position: absolute;
    width: 2px; height: 2px;
    border-radius: 50%;
    opacity: 0.35;
    box-shadow:
      80px 120px 0 var(--brand),
      350px 200px 0 var(--brand),
      700px 260px 0 var(--brand),
      400px 400px 0 var(--accent),
      900px 180px 0 var(--brand);
    animation: particleFloat 14s ease-in-out infinite;
  }
}

/* ── 11. Glassmorphism — lighter blur for GPU perf ── */
.panel {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  border-color: rgba(10, 141, 131, 0.18);
}
[data-theme="dark"] .panel:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  border-color: rgba(18, 196, 184, 0.15);
}

/* ── 12. Scroll Progress Indicator ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   END ANIMATION SYSTEMS
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   TOOL PAGE VISUAL ENHANCEMENTS
   Added: 2026-04-04
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Tool Workbench ── */
#toolWorkbench {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
  contain: layout style;
}

/* ── 2. Input Field Focus Animations ── */
#toolWorkbench input,
#toolWorkbench textarea,
#toolWorkbench select {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
#toolWorkbench input:focus,
#toolWorkbench textarea:focus,
#toolWorkbench select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.15);
  outline: none;
}
[data-theme="dark"] #toolWorkbench input:focus,
[data-theme="dark"] #toolWorkbench textarea:focus,
[data-theme="dark"] #toolWorkbench select:focus {
  box-shadow: 0 0 0 3px rgba(18, 196, 184, 0.18), 0 2px 8px rgba(18, 196, 184, 0.1);
}

/* Float label pattern */
.float-label {
  position: relative;
}
.float-label label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
  padding: 0 4px;
}
.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label,
.float-label textarea:focus ~ label,
.float-label textarea:not(:placeholder-shown) ~ label {
  top: -2px;
  font-size: 0.72rem;
  color: var(--brand);
  background: var(--paper);
}

/* ── 3. Button Enhancements ── */

/* Primary button gradient shimmer on hover */
#toolWorkbench button {
  background-size: 200% 100%;
  background-image: linear-gradient(130deg, var(--brand), var(--brand-dark), var(--brand));
  transition: background-position 0.4s ease, transform 0.15s ease, box-shadow 0.3s ease;
}
#toolWorkbench button:hover {
  background-position: 100% 0;
  box-shadow: 0 4px 16px rgba(10, 141, 131, 0.3);
}
[data-theme="dark"] #toolWorkbench button:hover {
  box-shadow: 0 4px 16px rgba(18, 196, 184, 0.25);
}

/* Active press */
#toolWorkbench button:active {
  transform: scale(0.97);
  filter: brightness(0.92);
  transition-duration: 0.06s;
}

/* Loading spinner state */
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}
button.loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
  color: transparent !important;
}
button.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

/* ── 4. Stat Card Pop-In Animation ── */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  60%  { transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}
#toolWorkbench .stat-card {
  animation: popIn 0.4s ease-out both;
}
#toolWorkbench .stats-grid .stat-card:nth-child(1) { animation-delay: 0.0s; }
#toolWorkbench .stats-grid .stat-card:nth-child(2) { animation-delay: 0.07s; }
#toolWorkbench .stats-grid .stat-card:nth-child(3) { animation-delay: 0.14s; }
#toolWorkbench .stats-grid .stat-card:nth-child(4) { animation-delay: 0.21s; }
#toolWorkbench .stats-grid .stat-card:nth-child(5) { animation-delay: 0.28s; }
#toolWorkbench .stats-grid .stat-card:nth-child(6) { animation-delay: 0.35s; }

/* ── 5. Result Box Animations ── */

/* Success: slide-down + green left border pulse */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes greenPulse {
  0%, 100% { border-left-color: var(--good); }
  50%      { border-left-color: rgba(21, 100, 59, 0.4); }
}
#toolWorkbench .result-box.success {
  border-left: 4px solid var(--good);
  animation: slideDown 0.35s ease-out, greenPulse 2s ease-in-out 0.35s 2;
}

/* Error: shake + red left border */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  12%      { transform: translateX(-8px); }
  25%      { transform: translateX(7px); }
  37%      { transform: translateX(-5px); }
  50%      { transform: translateX(4px); }
  62%      { transform: translateX(-2px); }
  75%      { transform: translateX(1px); }
}
#toolWorkbench .result-box.error {
  animation: shakeError 0.5s ease-out;
  border-left: 4px solid var(--bad);
}

/* Warning: fade-in + amber left border */
@keyframes fadeInWarn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#toolWorkbench .result-box.info {
  animation: fadeInWarn 0.4s ease-out;
  border-left: 4px solid var(--accent);
}

/* ── 6. Sidebar Improvements ── */
.sidebar ul {
  scroll-behavior: smooth;
}
.sidebar a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.sidebar a:hover {
  background: rgba(10, 141, 131, 0.08);
  padding-left: 14px;
  color: var(--brand);
}
[data-theme="dark"] .sidebar a:hover {
  background: rgba(18, 196, 184, 0.1);
}
.sidebar li.active > a {
  background: rgba(10, 141, 131, 0.1);
  color: var(--brand);
  font-weight: 600;
  position: relative;
}
.sidebar li.active > a::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--brand);
  border-radius: 3px;
  animation: fadeInUp 0.3s ease-out both;
}

/* ── 7. Tab System Enhancement ── */
.tab-nav {
  position: relative;
}
.tab-btn {
  position: relative;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.tab-btn.active {
  text-shadow: 0 0 16px rgba(10, 141, 131, 0.15);
}
[data-theme="dark"] .tab-btn.active {
  text-shadow: 0 0 16px rgba(18, 196, 184, 0.2);
}

/* Tab content transition */
.tab-panel {
  animation: none;
}
.tab-panel.active {
  animation: tabFadeIn 0.35s ease-out both;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 8. Copy Button Feedback ── */
@keyframes copyFlash {
  0%   { background: #15643b; box-shadow: 0 0 0 0 rgba(21, 100, 59, 0.4); }
  50%  { box-shadow: 0 0 12px 4px rgba(21, 100, 59, 0.15); }
  100% { background: linear-gradient(130deg, var(--brand), var(--brand-dark)); box-shadow: none; }
}
button.copied {
  animation: copyFlash 1.2s ease-out;
}
button.copied::after {
  content: none !important;
}

/* ── 9. Responsive Improvements ── */
@media (max-width: 768px) {
  #toolWorkbench {
    padding: 18px 14px;
    border-radius: 12px;
  }
  #toolWorkbench .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #toolWorkbench button,
  #toolWorkbench input,
  #toolWorkbench select,
  #toolWorkbench textarea {
    min-height: 44px;
    font-size: 1rem;
  }
  #toolWorkbench .result-box {
    border-radius: 10px;
  }
}
@media (max-width: 480px) {
  #toolWorkbench {
    padding: 14px 10px;
  }
  #toolWorkbench .stats-grid {
    grid-template-columns: 1fr;
  }
  #toolWorkbench button {
    padding: 12px;
  }
}

/* ── 10. How-To-Use Steps Styling ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .step-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.step-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .step-card {
    padding: 24px 16px;
  }
}

/* ── 11. Stats Banner Styling ── */
section.stats-banner {
  display: flex !important;
  justify-content: space-around;
  align-items: center;
  padding: 40px 20px;
  margin: 32px 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  gap: 16px;
}
.stat-item {
  text-align: center;
}
.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 4px;
  display: block;
}
@media (max-width: 640px) {
  .stats-banner {
    flex-wrap: wrap;
    gap: 24px;
    padding: 28px 16px;
  }
  .stat-item {
    flex: 0 0 45%;
  }
  .stat-num {
    font-size: 2rem;
  }
}

/* ── 12. Beta Banner Styling Enhancement ── */
.beta-banner {
  position: relative;
}
.beta-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 8px;
  animation: betaPulse 2s infinite;
}
@keyframes betaPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.beta-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  padding: 4px 8px;
  min-height: auto;
  width: auto;
}
.beta-close:hover {
  opacity: 1;
}
.beta-close::after {
  content: none !important;
}

/* ── 13. Featured Categories Showcase ── */
.featured-categories { text-align: center; }
.featured-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.featured-cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-align: left;
}
.featured-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(10, 141, 131, 0.12);
  border-color: var(--brand);
}
[data-theme="dark"] .featured-cat-card:hover {
  box-shadow: 0 8px 28px rgba(18, 196, 184, 0.15);
}
.featured-cat-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10,141,131,0.1), rgba(10,141,131,0.04));
  border-radius: 12px;
}
[data-theme="dark"] .featured-cat-icon {
  background: linear-gradient(135deg, rgba(18,196,184,0.15), rgba(18,196,184,0.05));
}
.featured-cat-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}
.featured-cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.featured-cat-text { display: flex; flex-direction: column; }
@media (max-width: 900px) {
  .featured-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .featured-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .featured-cat-card { padding: 14px; gap: 10px; }
  .featured-cat-icon { font-size: 1.8rem; width: 40px; height: 40px; }
}
@media (max-width: 400px) {
  .featured-cat-grid { grid-template-columns: 1fr; }
}

/* ── 14. How-It-Works Hero (above tool grid) ── */
.how-it-works-hero { text-align: center; }
.how-it-works-hero h2 {
  margin-bottom: 24px;
  font-size: 1.5rem;
}
.how-it-works { text-align: center; }
.how-it-works h2 {
  margin-bottom: 24px;
  font-size: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   END TOOL PAGE VISUAL ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE POLISH
   Added: 2026-04-04
   Only appended — no existing rules modified.
   All selectors scoped with html:not([data-theme="dark"]) to
   avoid any conflict with dark-mode styles.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Light Mode Hero Gradient ── */
html:not([data-theme="dark"]) .hero.panel {
  background: linear-gradient(145deg, rgba(255,252,244,0.95), rgba(240,248,246,0.9));
  box-shadow: 0 4px 32px rgba(10,141,131,0.08);
}

/* ── 2. Light Mode Tool Cards ── */
html:not([data-theme="dark"]) .tool-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.02);
}
html:not([data-theme="dark"]) .tool-card:hover {
  box-shadow: 0 4px 16px rgba(10,141,131,0.12), 0 8px 32px rgba(0,0,0,0.06);
  border-color: rgba(10,141,131,0.2);
}

/* ── 3. Light Mode Stats Banner ── */
html:not([data-theme="dark"]) section.stats-banner {
  background: linear-gradient(135deg, #0a8d83 0%, #08635d 60%, #064e49 100%);
  box-shadow: 0 8px 32px rgba(10,141,131,0.18);
}
html:not([data-theme="dark"]) .stat-num {
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
html:not([data-theme="dark"]) .stat-label {
  opacity: 0.92;
}

/* ── 4. Light Mode Featured Category Cards ── */
html:not([data-theme="dark"]) .featured-cat-card {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
html:not([data-theme="dark"]) .featured-cat-card:hover {
  background: #fff;
  box-shadow: 0 6px 24px rgba(10,141,131,0.1), 0 2px 8px rgba(0,0,0,0.04);
  border-color: rgba(10,141,131,0.25);
}

/* ── 5. Light Mode Step Cards ── */
html:not([data-theme="dark"]) .step-card {
  background: linear-gradient(168deg, #fff 60%, rgba(240,252,250,0.6));
  border-color: rgba(10,141,131,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
html:not([data-theme="dark"]) .step-card:hover {
  box-shadow: 0 8px 28px rgba(10,141,131,0.1), 0 2px 8px rgba(0,0,0,0.04);
  border-color: rgba(10,141,131,0.18);
}

/* ── 6. Light Mode Input Fields ── */
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) select {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
}
html:not([data-theme="dark"]) #toolWorkbench input:focus,
html:not([data-theme="dark"]) #toolWorkbench textarea:focus,
html:not([data-theme="dark"]) #toolWorkbench select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10,141,131,0.1), inset 0 1px 3px rgba(10,141,131,0.06);
}

/* ── 7. Light Mode Panel ── */
html:not([data-theme="dark"]) .panel {
  background: rgba(255,252,244,0.94);
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}
html:not([data-theme="dark"]) .panel:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* ── 8. Light Mode Scroll Progress Bar ── */
html:not([data-theme="dark"]) .scroll-progress {
  height: 4px;
  background: linear-gradient(90deg, #0a8d83, #e97f24);
  box-shadow: 0 0 8px rgba(10,141,131,0.25);
}

/* ── 9. Light Mode CTA Section ── */
html:not([data-theme="dark"]) .header-link {
  background: linear-gradient(130deg, #0a8d83, #08635d);
  box-shadow: 0 2px 12px rgba(10,141,131,0.2);
}
html:not([data-theme="dark"]) .header-link:hover {
  box-shadow: 0 4px 18px rgba(10,141,131,0.3);
}
html:not([data-theme="dark"]) .secondary-link {
  border-color: rgba(10,141,131,0.25);
  color: var(--brand);
}
html:not([data-theme="dark"]) .secondary-link:hover {
  background: rgba(10,141,131,0.06);
  border-color: var(--brand);
}

/* ── 10. Theme Toggle Button Polish ── */
.theme-toggle {
  transition: border-color 0.25s ease, transform 0.35s ease, box-shadow 0.25s ease;
}
html:not([data-theme="dark"]) .theme-toggle {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
html:not([data-theme="dark"]) .theme-toggle:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(10,141,131,0.12);
}
[data-theme="dark"] .theme-toggle {
  background: rgba(30,40,48,0.95);
  border-color: rgba(200,220,230,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(18,196,184,0.2);
}
.theme-toggle svg {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-toggle:active svg {
  transform: rotate(180deg) scale(0.85);
}

/* ── 11. Light Mode Spotlight & Related Cards ── */
html:not([data-theme="dark"]) .spotlight-card,
html:not([data-theme="dark"]) .related-card {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
html:not([data-theme="dark"]) .spotlight-card:hover,
html:not([data-theme="dark"]) .related-card:hover {
  box-shadow: 0 6px 20px rgba(10,141,131,0.1), 0 2px 8px rgba(0,0,0,0.04);
  border-color: rgba(10,141,131,0.2);
}

/* ── 12. Light Mode Proof / Trust Badges ── */
html:not([data-theme="dark"]) .proof-badge {
  background: linear-gradient(130deg, rgba(10,141,131,0.07), rgba(10,141,131,0.02));
  border-color: rgba(10,141,131,0.15);
}
html:not([data-theme="dark"]) .trust-pill {
  background: rgba(255,255,255,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── 13. Light Mode Hero Stats ── */
html:not([data-theme="dark"]) .hero-stats div {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

/* ── 14. Light Mode Workbench ── */
html:not([data-theme="dark"]) #toolWorkbench {
  background: rgba(255,255,255,0.8);
  box-shadow: 0 2px 16px rgba(0,0,0,0.03);
}

/* ═══════════════════════════════════════════════════════════════
   END LIGHT MODE POLISH
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   CTA SECTION + FOOTER REDESIGN
   Added: 2026-04-04
   ═══════════════════════════════════════════════════════════════ */

/* ── 15. CTA Section ── */
.cta-section { text-align: center; padding: 60px 24px; margin: 48px 0 0; border-radius: 20px; background: linear-gradient(135deg, rgba(10,141,131,0.12), rgba(10,141,131,0.04)); border: 1px solid var(--stroke); }
.cta-section h2 { font-size: 2rem; margin-bottom: 12px; }
.cta-section p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-btn { padding: 14px 28px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 1rem; transition: transform 0.2s, box-shadow 0.2s; }
.cta-btn.primary { background: linear-gradient(130deg, var(--brand), var(--brand-dark)); color: #fff; }
.cta-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10,141,131,0.3); }
.cta-btn.secondary { background: var(--panel); border: 1px solid var(--stroke); color: var(--ink); }
.cta-btn.secondary:hover { border-color: var(--brand); transform: translateY(-2px); }

/* ── 16. Footer Redesign ── */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 48px 0 32px; border-top: 1px solid var(--stroke); }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 8px; max-width: 280px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.footer-links a { color: var(--ink); text-decoration: none; font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid var(--stroke); margin-top: 16px; }
.footer-bottom p { color: var(--muted); font-size: 0.82rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── Dark mode: CTA Section ── */
[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, rgba(18,196,184,0.1), rgba(18,196,184,0.03));
}
[data-theme="dark"] .cta-btn.secondary {
  background: rgba(30, 40, 48, 0.7);
}

/* ── Dark mode: Footer ── */
[data-theme="dark"] .footer-grid {
  border-top-color: var(--stroke);
}
[data-theme="dark"] .footer-links a {
  color: var(--ink);
}
[data-theme="dark"] .footer-links a:hover {
  color: var(--brand);
}
[data-theme="dark"] .footer-bottom {
  border-top-color: var(--stroke);
}

/* ── Dark mode: Stats Banner ── */
[data-theme="dark"] section.stats-banner {
  background: linear-gradient(135deg, rgba(18,196,184,0.2), rgba(15,168,158,0.12));
}

/* ── Dark mode: Step Cards ── */
[data-theme="dark"] .step-card {
  background: rgba(30, 40, 48, 0.7);
}

/* ── Dark mode: Beta Banner close button ── */
[data-theme="dark"] .beta-close {
  color: #fff;
  opacity: 0.8;
}
[data-theme="dark"] .beta-close:hover {
  opacity: 1;
}

/* ── Dark mode: Featured Category Cards ── */
[data-theme="dark"] .featured-cat-card {
  background: rgba(30, 40, 48, 0.7);
}

/* ═══════════════════════════════════════════════════════════════
   END CTA SECTION + FOOTER REDESIGN
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   MOBILE-SPECIFIC OPTIMIZATIONS & TOUCH IMPROVEMENTS
   Added: 2026-04-04
   Only appended — no existing rules modified.
   ═══════════════════════════════════════════════════════════════ */

/* ── M1. Smooth Scroll with reduced-motion respect ── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── M2. Safe Areas for Notched Devices ── */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-left: max(env(safe-area-inset-left), 8px);
    padding-right: max(env(safe-area-inset-right), 8px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .back-to-top {
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: calc(24px + env(safe-area-inset-left));
  }
  .history-toggle {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .toast-container {
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
  }
}

/* ── M3. Touch-Friendly Inputs (prevent iOS zoom on focus) ── */
@media (max-width: 768px) {
  input, textarea, select {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
  }
  select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2353646d' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
  }
  #toolWorkbench label {
    margin-bottom: 6px;
  }
  #toolWorkbench > * + * {
    margin-top: 12px;
  }
}

/* ── M4. Mobile Hero Section (< 640px) ── */
@media (max-width: 639px) {
  .hero.panel {
    padding: 16px 14px;
  }
  .hero h1,
  .hero-copy h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .header-link,
  .hero-actions .secondary-link {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px 16px;
  }
  /* Hide heavy animated orbs on mobile for performance */
  .hero.panel::before,
  .hero.panel::after {
    display: none;
  }
}

/* ── M5. Mobile Tool Cards (< 480px) ── */
@media (max-width: 479px) {
  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .tool-card {
    padding: 16px;
    min-height: 48px;
  }
  .tool-card-icon {
    font-size: 2.4rem;
  }
  .tool-card h3 {
    font-size: 1rem;
  }
  /* Ensure all tappable areas meet 48px minimum */
  .tool-card a,
  .tool-card button,
  .card-cta,
  .pill {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }
  .spotlight-card,
  .related-card {
    padding: 14px;
  }
}

/* ── M6. Mobile How-It-Works Steps ── */
@media (max-width: 639px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .step-card {
    padding: 20px 16px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }
  .step-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1.05rem;
    margin-bottom: 0;
  }
  .step-card h3 {
    margin-top: 0;
  }
  .hiw-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── M7. Mobile Stats Banner ── */
@media (max-width: 479px) {
  .stats-banner {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px 16px;
    text-align: center;
  }
  .stat-item {
    flex: unset;
  }
  .stat-num {
    font-size: 1.8rem;
  }
  .stat-label {
    font-size: 0.82rem;
  }
  .stats-bar {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    font-size: 0.9rem;
  }
  .stats-bar span[aria-hidden] {
    display: none;
  }
  .proof-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}
@media (max-width: 359px) {
  .stats-banner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stat-num {
    font-size: 1.6rem;
  }
}

/* ── M8. Mobile Featured Categories ── */
@media (max-width: 479px) {
  .featured-cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .featured-cat-card {
    padding: 12px 8px;
  }
  .featured-cat-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
  }
  .featured-cat-name {
    font-size: 0.84rem;
  }
  .featured-cat-count {
    font-size: 0.72rem;
  }
}

/* ── M9. Mobile Header (prevent overlap) ── */
@media (max-width: 479px) {
  .site-header {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }
  .site-header-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }
  .brand {
    width: 100%;
    text-align: center;
    font-size: 1.05rem;
  }
  .header-link {
    font-size: 0.8rem;
    padding: 8px 12px;
    min-height: 44px;
  }
  /* Hide Blog link on very small screens to save space */
  .site-header-actions a[href*="blog"] {
    display: none;
  }
}
@media (max-width: 359px) {
  .site-header-actions .header-link {
    font-size: 0.76rem;
    padding: 6px 10px;
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
  }
}

/* ── M10. Mobile Footer (stacked single column) ── */
@media (max-width: 479px) {
  .site-footer {
    text-align: center;
    gap: 12px;
  }
  .site-footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .site-footer-nav a {
    display: flex;
    padding: 6px 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 0 20px;
  }
  .footer-brand p {
    max-width: 100%;
  }
}

/* ── M11. Back-to-Top & FAB Mobile Position ── */
@media (max-width: 479px) {
  .back-to-top {
    bottom: 12px;
    left: auto;
    right: 12px;
    width: 44px;
    height: 44px;
    z-index: 999;
  }
  .history-toggle {
    bottom: 12px;
    right: 62px;
    width: 44px;
    height: 44px;
  }
  .history-panel {
    bottom: 68px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 60vh;
  }
  .cmd-hint {
    display: none;
  }
}

/* ── M12. Disable Hover Effects on Touch Devices ── */
@media (hover: none) and (pointer: coarse) {
  .tool-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--stroke);
  }
  .tool-card:hover::before {
    opacity: 0;
  }
  .tool-card:hover .tool-card-icon {
    transform: none;
  }
  .spotlight-card:hover,
  .related-card:hover {
    transform: none;
    box-shadow: none;
  }
  .step-card:hover {
    transform: none;
    box-shadow: none;
  }
  .featured-cat-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--stroke);
  }
  /* Active-state feedback for touch instead of hover */
  .tool-card:active {
    transform: scale(0.98);
    border-color: var(--brand);
  }
  .spotlight-card:active,
  .related-card:active {
    transform: scale(0.98);
  }
  .featured-cat-card:active {
    transform: scale(0.97);
    border-color: var(--brand);
  }
}

/* ── M13. Mobile Tool Page Workbench Spacing ── */
@media (max-width: 479px) {
  #toolWorkbench {
    padding: 12px 8px;
  }
  #toolWorkbench textarea {
    min-height: 100px;
  }
  #toolWorkbench .actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #toolWorkbench .actions button {
    width: 100%;
    min-height: 48px;
  }
  .tab-nav {
    gap: 2px;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 44px;
  }
  .cmd-palette {
    width: calc(100vw - 16px);
    border-radius: 12px;
  }
  .cmd-overlay {
    padding-top: 10vh;
  }
}

/* ═══════════════════════════════════════════════════════════════
   END MOBILE-SPECIFIC OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   CLS PREVENTION — Reserve space for dynamic / late-loading content
   ═══════════════════════════════════════════════════════════════ */

/* Hero panel: prevent shift when fonts load and content renders */
.hero.panel {
  min-height: 420px;
  contain: layout style;
}

/* Tool grid: reserve space for cards rendered by JS */
#toolGrid {
  min-height: 600px;
}

/* Beta banner: fixed height so dismissal doesn't cause shift */
.beta-banner {
  min-height: 48px;
  contain: layout style;
}

/* Stats banner: prevent shift from count-up animation */
section.stats-banner {
  min-height: 120px;
  contain: layout style;
}

/* Featured categories grid: reserve space for category cards */
.featured-cat-grid {
  min-height: 200px;
}

/* How it works section: reserve space */
.steps-grid {
  min-height: 120px;
}

/* Filter panel: prevent shift when category select populates */
.panel.filters {
  min-height: 80px;
}

/* Category chip row: prevent shift */
.category-chip-row {
  min-height: 44px;
}

/* Tool page workbench: reserve space for renderer output */
.workbench {
  min-height: 300px;
}

/* ═══════════════════════════════════════════════════════════════
   STATIC WORKBENCH SHELL (SEO hydration, Wave 3)
   Build-time HTML shell rendered by Python generator.
   Visible briefly before JS hydrates (idle callback wipes it).
   Googlebot sees rich, unique, keyword-dense content per tool.
   ═══════════════════════════════════════════════════════════════ */
.workbench[data-hydrated="pending"] {
  padding: 18px 20px;
}
.workbench-shell-intro {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.55;
}
.workbench-shell-intro strong {
  color: var(--brand);
}
.shell-label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}
.shell-input,
.shell-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.shell-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: "Space Mono", monospace;
}
.shell-range {
  width: 100%;
  margin: 8px 0;
}
.shell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.shell-btn {
  padding: 9px 16px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.shell-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.workbench-shell-drop {
  padding: 28px 20px;
  border: 2px dashed var(--stroke);
  border-radius: 10px;
  text-align: center;
  margin-bottom: 12px;
}
.shell-drop-hint {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}
.shell-drop-support {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.shell-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.shell-stat-card {
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shell-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.shell-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.workbench-shell-features {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}
.shell-features-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}
.shell-features-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.shell-features-list li {
  margin-bottom: 4px;
}
.shell-noscript {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(10, 141, 131, 0.08);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════
   REFERENCES & FEATURED-IN SECTIONS (Wave 3 SEO integration)
   ═══════════════════════════════════════════════════════════════ */
.references-section {
  margin-top: 20px;
}
.references-section h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.references-intro {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
}
.references-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.55;
}
.ref-item {
  margin-bottom: 10px;
}
.ref-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.ref-link:hover {
  text-decoration: underline;
}
.ref-source {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
}
.ref-context {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.featured-in-blogs {
  margin-top: 18px;
}
.featured-in-blogs h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.featured-blogs-intro {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
}
.featured-blogs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.featured-blog-item {
  display: block;
}
.featured-blog-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
}
.featured-blog-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ═══════════════════════════════════════════════════════════════
   DEEP CONTENT SECTION (Wave 3 — top 30 tool enrichment)
   In-depth guide: hero intro, why it matters, case studies,
   technical deep dive, expert pro tip. Only rendered for tools
   with an entry in scripts/seo_data/tool_deep_content.py.
   ═══════════════════════════════════════════════════════════════ */
.deep-content-section {
  margin-top: 24px;
}
.deep-content-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}
.deep-hero-intro {
  font-size: 1.03rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 16px;
}
.deep-subheading {
  margin: 22px 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  border-left: 3px solid var(--brand);
  padding-left: 12px;
}
.deep-content-section p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: var(--ink);
  font-size: 0.95rem;
}
.case-studies-list {
  margin: 0 0 12px;
  padding-left: 22px;
  line-height: 1.6;
}
.case-study-item {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.93rem;
}
.deep-technical {
  font-family: inherit;
  font-size: 0.93rem;
}
.deep-content-section code {
  background: rgba(10, 141, 131, 0.1);
  border: 1px solid rgba(10, 141, 131, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "Space Mono", monospace;
  font-size: 0.85em;
  color: var(--brand-dark);
}
.deep-content-section strong {
  color: var(--ink);
  font-weight: 700;
}
.deep-content-section em {
  color: var(--muted);
}
.pro-tip-box {
  margin-top: 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(10, 141, 131, 0.08), rgba(10, 141, 131, 0.03));
  border-left: 4px solid var(--brand);
  border-radius: 10px;
}
.pro-tip-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.pro-tip-box p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   AD SLOTS — CLS PREVENTION (Wave 2 — Task 3)
   Reserve space for AdSense <ins> before the script loads so layout
   does not shift when ads render.  Sizes tuned to Google ad units:
     • Leaderboard / in-content responsive ≈ 90px
     • In-content medium rectangle        ≈ 280px
     • Sidebar (300x250)                  ≈ 250px
   `contain: layout style` isolates the slot from outer reflow.
   Empty <ins> placeholders sometimes render a whitespace text node;
   `font-size: 0` on the <ins> itself prevents phantom line-height.
   ═══════════════════════════════════════════════════════════════ */
.ad-slot {
  min-height: 90px;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

/* Explicit slot height before ad loads — prevents jump on render */
.ad-slot .fasttool-ad,
.ad-slot ins.adsbygoogle {
  display: block;
  min-height: 120px;
  width: 100%;
  font-size: 0; /* kill whitespace text-node layout in empty <ins> */
  line-height: 0;
}

/* Sidebar variant reserves 300x250 medium-rectangle footprint */
.ad-slot .fasttool-ad-sidebar,
.ad-slot-sidebar ins.adsbygoogle {
  min-height: 250px;
  contain-intrinsic-size: auto 280px;
}

/* In-content / large mobile banner reservation */
.ad-slot-incontent,
.ad-slot-incontent ins.adsbygoogle {
  min-height: 280px;
  contain-intrinsic-size: auto 300px;
}

/* Tool workbench ad container (if renderer injects one) */
#toolWorkbench .ad-container,
#toolWorkbench .ad-slot {
  min-height: 250px;
  contain: layout style;
}

/* Mobile overrides — reduce reserved heights */
@media (max-width: 639px) {
  .hero.panel { min-height: auto; }
  #toolGrid { min-height: 400px; }
  section.stats-banner { min-height: 100px; }
  .featured-cat-grid { min-height: 150px; }
  .workbench { min-height: 200px; }
}

/* Content-visibility: auto for below-fold sections (reduces rendering work) */
.featured-categories,
.how-it-works,
.stats-banner,
.spotlight-section,
.related-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

/* ═══════════════════════════════════════════════════════════════
   ENGAGEMENT FEATURES — Trending, Search UX, Hover CTA, Social Proof
   ═══════════════════════════════════════════════════════════════ */

/* ── Trending Tools Section ── */
.trending-tools { margin-bottom: 16px; }
.trending-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.trending-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}
.trending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
  border-color: var(--brand);
}
.trending-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.trending-card:hover::before { opacity: 1; }
.trending-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.trending-card-body { flex: 1; }
.trending-card-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.trending-card-body h3 a {
  color: var(--brand);
  text-decoration: none;
}
.trending-card-body h3 a:hover { text-decoration: underline; }
.trending-card-body p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.trending-card .card-cta {
  align-self: flex-start;
  margin-top: 8px;
}
[data-theme="dark"] .trending-card {
  background: rgba(30, 40, 48, 0.7);
}

/* ── Search UX Enhancements ── */
.search-wrapper {
  position: relative;
  z-index: 9999; /* Must be ABOVE everything — category chips, tool grid, panels, footer */
}
.search-wrapper input {
  width: 100%;
  padding-right: 90px;
}
.search-shortcut-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.search-shortcut-hint kbd {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-family: "Space Mono", monospace;
}
.search-wrapper input:focus ~ .search-shortcut-hint {
  opacity: 0;
}

.search-result-count {
  display: none;
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.recent-searches {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.recent-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.recent-search-chip {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.recent-search-chip:hover {
  border-color: var(--brand);
  background: rgba(10, 141, 131, 0.08);
}

/* ── No Results State ── */
.no-results-state {
  text-align: center;
  padding: 32px 20px;
}
.no-results-state p { margin: 6px 0; }
.no-results-hint {
  color: var(--muted);
  font-size: 0.9rem;
}
.no-results-suggestions {
  font-size: 0.88rem;
  margin-top: 12px;
}
.no-results-suggestions a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.no-results-suggestions a:hover { text-decoration: underline; }

/* ── Tool Card Hover CTA Overlay ── */
.card-hover-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(to top, rgba(10, 141, 131, 0.95), rgba(10, 141, 131, 0.85));
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}
.tool-card:hover .card-hover-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ── Social Proof Banner ── */
.social-proof-banner {
  margin: 24px 0;
}
.social-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}
.social-proof-item {
  padding: 24px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.social-proof-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.social-proof-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.social-proof-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}
[data-theme="dark"] .social-proof-item {
  background: rgba(30, 40, 48, 0.7);
}

/* ── Trending / Social Proof responsive ── */
@media (max-width: 768px) {
  .trending-grid {
    grid-template-columns: 1fr 1fr;
  }
  .social-proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 479px) {
  .trending-grid {
    grid-template-columns: 1fr;
  }
  .social-proof-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .social-proof-num {
    font-size: 1.6rem;
  }
  .card-hover-cta {
    /* Always visible on mobile since no hover */
    opacity: 0;
  }
}

/* ── Share Bar ── */
.share-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.share-label { font-size: 0.85rem; color: var(--muted); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--panel); border: 1px solid var(--stroke); color: var(--ink); text-decoration: none; transition: all 0.2s; cursor: pointer; font-size: 0; }
.share-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.share-twitter:hover { background: #1DA1F2; border-color: #1DA1F2; }
.share-linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.share-copy.copied { background: var(--good); color: #fff; border-color: var(--good); }

/* ── Favorites & Recently Used ── */
.fav-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; margin-left: 8px; transition: color 0.2s, transform 0.2s; vertical-align: middle; display: inline-flex; align-items: center; }
.fav-btn:hover { color: #e05555; transform: scale(1.15); }
.fav-btn.fav-active { color: #e05555; }
.favorites-row, .recent-row { display: flex; gap: 16px; overflow-x: auto; padding: 8px 0 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.favorites-row .tool-card, .recent-row .tool-card { flex: 0 0 260px; scroll-snap-align: start; }
.favorites-row::-webkit-scrollbar, .recent-row::-webkit-scrollbar { height: 6px; }
.favorites-row::-webkit-scrollbar-thumb, .recent-row::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 3px; }
.ft-overflow-hidden { display: none; }
.toggle-show-all { background: none; border: 1px solid var(--stroke); color: var(--brand); cursor: pointer; padding: 6px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; transition: background 0.2s, color 0.2s; white-space: nowrap; }
.toggle-show-all:hover { background: var(--brand); color: #fff; }
.ft-favorites-section .section-heading, .ft-recent-section .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Accessibility fixes
   WCAG 2.1 AA ACCESSIBILITY FIXES
   Audit date: 2026-04-04
*/

/* ── A1. Color Contrast Improvements ──
   --muted (#53646d) on --panel (~#fffcf4) = ~4.6:1 (passes AA normal text)
   --muted dark (#9aabb6) on dark panel (~#1e2830) = ~5.1:1 (passes AA)
   Placeholder text and secondary labels need boost for AA compliance. */

/* Boost placeholder contrast — native placeholders often too light */
::placeholder {
  color: var(--muted);
  opacity: 0.72;
}
[data-theme="dark"] ::placeholder {
  opacity: 0.78;
}

/* Ensure .hero-kicker text passes 3:1 on its background */
.hero-kicker {
  color: var(--brand);
}

/* ad-slot-label needs better contrast */
.ad-slot-label {
  opacity: 1;
}

/* ── A2. Focus Indicators — Universal & Component-Specific ──
   Every interactive element must show a visible ring on :focus-visible */

/* Buttons: the default button has border:0 which hides focus ring.
   Restore outline-based focus for all buttons. */
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(10, 141, 131, 0.18);
}

/* Links: ensure all link types show focus ring */
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header links (pill-shaped) */
.header-link:focus-visible,
.secondary-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Tool cards — the entire card should show focus ring */
.tool-card:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.2);
}
a.tool-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Category chips */
.category-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(10, 141, 131, 0.15);
}

/* Card CTA buttons */
.card-cta:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Tab buttons — override the border-radius:0 that clips outline */
.tab-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 4px 4px 0 0;
}

/* Details/summary elements */
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Share buttons */
.share-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Suggestion cards */
a.suggestion-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}

/* Related cards */
.related-card:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.2);
}

/* Featured category cards */
.featured-cat-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Trending cards */
.trending-card:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.15);
}

/* Spotlight cards */
.spotlight-card:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.15);
}

/* Sidebar links */
.sidebar a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-radius: 4px;
}

/* Breadcrumb links */
.breadcrumb a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Footer links */
.site-footer-nav a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip-to-content: enhance visibility when focused */
.skip-to-content:focus {
  outline: 3px solid var(--accent);
  outline-offset: 0;
}

/* Beta banner close button */
.beta-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Favorites row buttons */
.fav-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.toggle-show-all:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Dark mode: ensure focus rings are visible */
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] summary:focus-visible {
  box-shadow: 0 0 0 4px rgba(18, 196, 184, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   HOMEPAGE UX IMPROVEMENTS — Autocomplete, Recently Added, Stats
   ═══════════════════════════════════════════════════════════════ */

/* ── Search Autocomplete Dropdown ── */
.search-autocomplete {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 99999;
  max-height: 340px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  margin: 0 auto;
  max-width: 640px;
  width: calc(100% - 48px);
}
[data-theme="dark"] .search-autocomplete {
  background: rgba(30, 40, 48, 0.95);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.autocomplete-active {
  background: rgba(10, 141, 131, 0.08);
}
[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-item.autocomplete-active {
  background: rgba(18, 196, 184, 0.12);
}
.autocomplete-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.autocomplete-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.autocomplete-name mark {
  background: rgba(10, 141, 131, 0.15);
  color: var(--brand);
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="dark"] .autocomplete-name mark {
  background: rgba(18, 196, 184, 0.2);
}
.autocomplete-cat {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
}
[data-theme="dark"] .autocomplete-cat {
  background: rgba(255,255,255,0.06);
}
.autocomplete-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Recently Added Section ── */
.recently-added-section {
  margin-bottom: 12px;
}
.recently-added-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recently-added-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.recently-added-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border-color: var(--brand);
}
[data-theme="dark"] .recently-added-item {
  background: rgba(30, 40, 48, 0.7);
}
[data-theme="dark"] .recently-added-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.recently-added-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10,141,131,0.1), rgba(10,141,131,0.04));
  border-radius: 10px;
}
.recently-added-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recently-added-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.recently-added-cat {
  font-size: 0.78rem;
  color: var(--muted);
}
.recently-added-arrow {
  font-size: 1.1rem;
  color: var(--brand);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.recently-added-item:hover .recently-added-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Recently Added responsive ── */
@media (max-width: 479px) {
  .recently-added-item {
    padding: 10px 12px;
  }
  .recently-added-icon {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
  .recently-added-name {
    font-size: 0.85rem;
  }
}

/* ── Recently Added focus styles ── */
.recently-added-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── A3. Screen Reader Only Utility ──
   Visually hidden but accessible to assistive technology. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── A4. Reduced Motion — supplement existing rule ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  .hero.panel {
    animation: none !important;
  }
  .fade-in-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .tab-panel.active {
    animation: none !important;
  }
  .tool-card {
    animation: none !important;
  }
  .toast {
    animation: none !important;
    opacity: 1 !important;
  }
  .beta-dot {
    animation: none !important;
  }
}

/* ── A5. High Contrast Mode Support ── */
@media (forced-colors: active) {
  .tab-btn.active {
    border-bottom: 3px solid LinkText;
  }
  .skip-to-content:focus {
    outline: 3px solid LinkText;
  }
  button,
  .card-cta,
  .header-link {
    border: 1px solid ButtonText;
  }
  .tool-card:focus-within,
  .related-card:focus-within {
    outline: 2px solid LinkText;
  }
}

/* ── A6. Tab Panel Visibility for Screen Readers ──
   Hidden tab panels should be truly hidden from AT */
.tab-panel:not(.active) {
  display: none;
}

/* ── A7. Improved Touch Targets (WCAG 2.5.8 Target Size) ──
   Minimum 44x44px for interactive elements on touch */
@media (pointer: coarse) {
  .share-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .tab-btn {
    min-height: 44px;
  }
  .category-chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .site-footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ── Code Formatter Tools (JSON / XML / YAML) ── */
.fmt-editor-wrap {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  margin: 8px 0;
}
.fmt-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--stroke);
  flex-wrap: wrap;
}
[data-theme="dark"] .fmt-toolbar { background: rgba(255,255,255,0.03); }
.fmt-toolbar select,
.fmt-toolbar label {
  font-size: 0.82rem;
}
.fmt-toolbar select {
  padding: 4px 8px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
}
.fmt-code-area {
  display: flex;
  overflow: auto;
  max-height: 420px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  tab-size: 2;
}
.fmt-line-nums {
  padding: 12px 8px 12px 12px;
  text-align: right;
  color: var(--muted);
  user-select: none;
  border-right: 1px solid var(--stroke);
  background: rgba(0,0,0,0.015);
  min-width: 38px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .fmt-line-nums { background: rgba(255,255,255,0.02); }
.fmt-code-content {
  padding: 12px;
  flex: 1;
  overflow-x: auto;
  white-space: pre;
}
.fmt-code-content .hl-key { color: #2563eb; }
.fmt-code-content .hl-str { color: #16a34a; }
.fmt-code-content .hl-num { color: #ea580c; }
.fmt-code-content .hl-bool { color: #9333ea; }
.fmt-code-content .hl-null { color: #6b7280; }
.fmt-code-content .hl-bracket { color: #64748b; }
.fmt-code-content .hl-tag { color: #2563eb; }
.fmt-code-content .hl-attr { color: #16a34a; }
.fmt-code-content .hl-val { color: #ea580c; }
.fmt-code-content .hl-comment { color: #9ca3af; font-style: italic; }
.fmt-code-content .hl-punct { color: #94a3b8; }
.fmt-code-content .hl-yaml-key { color: #2563eb; }
.fmt-code-content .hl-yaml-str { color: #16a34a; }
.fmt-code-content .hl-yaml-num { color: #ea580c; }
.fmt-code-content .hl-yaml-bool { color: #9333ea; }
.fmt-code-content .hl-yaml-null { color: #6b7280; }
.fmt-code-content .hl-yaml-comment { color: #9ca3af; font-style: italic; }
[data-theme="dark"] .fmt-code-content .hl-key { color: #60a5fa; }
[data-theme="dark"] .fmt-code-content .hl-str { color: #4ade80; }
[data-theme="dark"] .fmt-code-content .hl-num { color: #fb923c; }
[data-theme="dark"] .fmt-code-content .hl-bool { color: #c084fc; }
[data-theme="dark"] .fmt-code-content .hl-null { color: #9ca3af; }
[data-theme="dark"] .fmt-code-content .hl-tag { color: #60a5fa; }
[data-theme="dark"] .fmt-code-content .hl-attr { color: #4ade80; }
[data-theme="dark"] .fmt-code-content .hl-val { color: #fb923c; }
[data-theme="dark"] .fmt-code-content .hl-yaml-key { color: #60a5fa; }
[data-theme="dark"] .fmt-code-content .hl-yaml-str { color: #4ade80; }
[data-theme="dark"] .fmt-code-content .hl-yaml-num { color: #fb923c; }
[data-theme="dark"] .fmt-code-content .hl-yaml-bool { color: #c084fc; }

/* CSS / JS / HTML syntax highlighting */
.fmt-code-content .hl-selector { color: #2563eb; font-weight: 500; }
.fmt-code-content .hl-prop { color: #16a34a; }
.fmt-code-content .hl-kw { color: #2563eb; font-weight: 600; }
.fmt-code-content .hl-func { color: #9333ea; }
[data-theme="dark"] .fmt-code-content .hl-selector { color: #60a5fa; }
[data-theme="dark"] .fmt-code-content .hl-prop { color: #4ade80; }
[data-theme="dark"] .fmt-code-content .hl-kw { color: #60a5fa; }
[data-theme="dark"] .fmt-code-content .hl-func { color: #c084fc; }
[data-theme="dark"] .fmt-code-content .hl-comment { color: #6b7280; }

/* HTML live preview iframe */
.html-preview-frame { border: 1px solid var(--stroke); border-radius: 8px; width: 100%; min-height: 200px; background: #fff; margin: 6px 0; }
[data-theme="dark"] .html-preview-frame { background: #1e1e1e; border-color: rgba(255,255,255,0.08); }

/* JSON Tree View */
.json-tree { padding: 12px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 0.82rem; line-height: 1.6; overflow: auto; max-height: 420px; }
.json-tree ul { list-style: none; margin: 0; padding-left: 20px; }
.json-tree > ul { padding-left: 0; }
.json-tree li { position: relative; }
.jt-toggle { cursor: pointer; user-select: none; display: inline-block; width: 16px; text-align: center; color: var(--muted); font-size: 0.75rem; }
.jt-toggle:hover { color: var(--brand); }
.jt-key { color: #2563eb; font-weight: 500; }
.jt-str { color: #16a34a; }
.jt-num { color: #ea580c; }
.jt-bool { color: #9333ea; }
.jt-null { color: #6b7280; font-style: italic; }
.jt-bracket { color: #64748b; }
.jt-collapsed > ul { display: none; }
.jt-path { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 6px 14px; border-radius: 8px; font-size: 0.78rem; font-family: monospace; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.jt-path.visible { opacity: 1; }
[data-theme="dark"] .jt-key { color: #60a5fa; }
[data-theme="dark"] .jt-str { color: #4ade80; }
[data-theme="dark"] .jt-num { color: #fb923c; }
[data-theme="dark"] .jt-bool { color: #c084fc; }

/* Error highlight line */
.fmt-error-line { background: rgba(239,68,68,0.1); display: block; border-left: 3px solid #ef4444; margin-left: -12px; padding-left: 9px; }
[data-theme="dark"] .fmt-error-line { background: rgba(239,68,68,0.15); }

/* File upload zone */
.fmt-upload-zone {
  border: 2px dashed var(--stroke);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
  margin: 6px 0;
}
.fmt-upload-zone:hover,
.fmt-upload-zone.drag-over {
  border-color: var(--brand);
  background: rgba(10,141,131,0.04);
}
.fmt-upload-zone input[type="file"] { display: none; }

/* ── Special Tools Badge ── */
.badge-special {
  background: linear-gradient(130deg, rgba(234,179,8,0.18), rgba(234,179,8,0.08));
  color: #92400e;
  border: 1px solid rgba(234,179,8,0.35);
}
[data-theme="dark"] .badge-special {
  background: linear-gradient(130deg, rgba(250,204,21,0.18), rgba(250,204,21,0.08));
  color: #fbbf24;
  border-color: rgba(250,204,21,0.3);
}

/* ── Special Tools Section (Homepage) ── */
.special-tools-section {
  margin-bottom: 16px;
}
.special-tools-section .section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}
.special-tools-section .section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}
.special-tools-section .section-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 2px 0 0;
}
.special-view-all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.special-view-all:hover { text-decoration: underline; }

.special-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) transparent;
}
.special-scroll::-webkit-scrollbar { height: 6px; }
.special-scroll::-webkit-scrollbar-track { background: transparent; }
.special-scroll::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 3px;
}

.special-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(234,179,8,0.25);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.special-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(234,179,8,0.12);
  border-color: rgba(234,179,8,0.45);
}
.special-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(234,179,8,0.08), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s;
}
.special-card:hover::before { opacity: 1; }

.special-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.special-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.special-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0;
  color: inherit;
}
.special-card-name a {
  color: inherit;
  text-decoration: none;
}
.special-card-name a:hover { color: var(--brand); }
.special-card-cat {
  font-size: 0.75rem;
  color: var(--muted);
}
.special-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.special-card .card-cta {
  margin-top: auto;
  align-self: flex-start;
}

[data-theme="dark"] .special-card {
  background: rgba(30, 40, 48, 0.7);
  border-color: rgba(250,204,21,0.2);
}
[data-theme="dark"] .special-card:hover {
  box-shadow: 0 8px 24px rgba(250,204,21,0.08);
  border-color: rgba(250,204,21,0.35);
}

/* ── Special Tool badge on tool page ── */
.special-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(130deg, rgba(234,179,8,0.18), rgba(234,179,8,0.08));
  color: #92400e;
  border: 1px solid rgba(234,179,8,0.35);
  vertical-align: middle;
  margin-left: 8px;
}
[data-theme="dark"] .special-tool-badge {
  background: linear-gradient(130deg, rgba(250,204,21,0.18), rgba(250,204,21,0.08));
  color: #fbbf24;
  border-color: rgba(250,204,21,0.3);
}

/* ── Special Tools Landing Page ── */
.special-landing-hero {
  text-align: center;
  padding: 40px 20px 24px;
}
.special-landing-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  margin: 0 0 8px;
}
.special-landing-hero .count-badge {
  display: inline-block;
  background: linear-gradient(130deg, rgba(234,179,8,0.18), rgba(234,179,8,0.08));
  color: #92400e;
  border: 1px solid rgba(234,179,8,0.35);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
}
[data-theme="dark"] .special-landing-hero .count-badge {
  background: linear-gradient(130deg, rgba(250,204,21,0.18), rgba(250,204,21,0.08));
  color: #fbbf24;
  border-color: rgba(250,204,21,0.3);
}
.special-landing-hero p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.special-group {
  margin-bottom: 32px;
}
.special-group h2 {
  font-size: 1.15rem;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
}
.special-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Special card in tool-card context (grid) ── */
.tool-card.is-special {
  border-color: rgba(234,179,8,0.2);
}
.tool-card.is-special:hover {
  border-color: rgba(234,179,8,0.4);
}
[data-theme="dark"] .tool-card.is-special {
  border-color: rgba(250,204,21,0.15);
}
[data-theme="dark"] .tool-card.is-special:hover {
  border-color: rgba(250,204,21,0.3);
}

@media (max-width: 639px) {
  .special-card { flex: 0 0 220px; padding: 14px 16px; }
  .special-tools-section .section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .special-group-grid { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .special-card { flex: 0 0 200px; }
}

/* ── Global Code/Pre Dark Mode Fix ── */
[data-theme="dark"] pre,
[data-theme="dark"] code,
[data-theme="dark"] .result-box pre,
[data-theme="dark"] textarea {
  color: #e2e8f0;
}

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

/* ── Tool Workbench: ensure all generated content visible in dark mode ── */
#toolWorkbench pre,
#toolWorkbench code {
  color: var(--ink, #e2e8f0);
}

[data-theme="dark"] #toolWorkbench pre {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="dark"] #toolWorkbench textarea {
  color: #e2e8f0;
  background: #0f172a;
  border-color: rgba(255,255,255,0.12);
}

/* ── Fullscreen button visibility fix ── */
#toolWorkbench button[style*="fullscreen"],
#toolWorkbench button:has(> span:only-child) {
  background: var(--brand, #0a8d83);
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Copy/Share link button visibility ── */
.share-tool a,
.share-tool button,
.share-bar a,
.share-bar button {
  opacity: 1;
}

[data-theme="dark"] .share-tool a,
[data-theme="dark"] .share-tool button,
[data-theme="dark"] .share-bar a,
[data-theme="dark"] .share-bar button {
  border-color: rgba(255,255,255,0.2);
  color: #e2e8f0;
}

[data-theme="dark"] .share-tool a:hover,
[data-theme="dark"] .share-tool button:hover,
[data-theme="dark"] .share-bar a:hover,
[data-theme="dark"] .share-bar button:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--brand, #0a8d83);
}

/* ── Fav button: move to share row, proper styling ── */
.share-tool .fav-btn,
.share-bar .fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1.5px solid var(--stroke, #ddd);
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #666);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}
.share-tool .fav-btn:hover,
.share-bar .fav-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}
.share-tool .fav-btn.fav-active,
.share-bar .fav-btn.fav-active {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}

/* ── Global tool workbench: ensure inputs/buttons visible in BOTH themes ── */
#toolWorkbench input[type="text"],
#toolWorkbench input[type="number"],
#toolWorkbench input[type="url"],
#toolWorkbench input[type="email"],
#toolWorkbench select,
#toolWorkbench textarea {
  color: var(--ink, #1a1a2e);
  background: var(--surface, #fff);
  border: 1.5px solid var(--stroke, #d1d5db);
}

[data-theme="dark"] #toolWorkbench input[type="text"],
[data-theme="dark"] #toolWorkbench input[type="number"],
[data-theme="dark"] #toolWorkbench input[type="url"],
[data-theme="dark"] #toolWorkbench input[type="email"],
[data-theme="dark"] #toolWorkbench select,
[data-theme="dark"] #toolWorkbench textarea {
  color: #e2e8f0;
  background: #0f172a;
  border-color: rgba(255,255,255,0.15);
}

/* ── Tool workbench buttons: always visible (skip gradient/color swatch buttons) ── */
#toolWorkbench button:not([style*="linear-gradient"]):not([style*="background: rgb("]):not([style*="background:rgb("]):not([style*="height: 48"]):not([style*="height:48"]) {
  color: var(--ink, #1a1a2e);
  border: 1.5px solid var(--stroke, #d1d5db);
  background: var(--surface, #f8fafc);
}

#toolWorkbench button:not([style*="linear-gradient"]):not([style*="height: 48"]):hover {
  border-color: var(--brand, #0a8d83);
  background: rgba(10,141,131,0.06);
}

[data-theme="dark"] #toolWorkbench button:not([style*="linear-gradient"]):not([style*="background: rgb("]):not([style*="background:rgb("]):not([style*="height: 48"]):not([style*="height:48"]) {
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
}

[data-theme="dark"] #toolWorkbench button:not([style*="linear-gradient"]):not([style*="height: 48"]):hover {
  border-color: var(--brand, #0a8d83);
  background: rgba(10,141,131,0.15);
}

/* ── Primary action buttons stay brand-colored ── */
#toolWorkbench button.primary-btn {
  color: #fff !important;
}

/* ── Labels always visible ── */
#toolWorkbench label,
#toolWorkbench .label {
  color: var(--ink, #1a1a2e);
  font-weight: 600;
}

[data-theme="dark"] #toolWorkbench label,
[data-theme="dark"] #toolWorkbench .label {
  color: #e2e8f0;
}

/* ── Slider value labels ── */
#toolWorkbench span,
#toolWorkbench small {
  color: var(--muted, #64748b);
}

[data-theme="dark"] #toolWorkbench span,
[data-theme="dark"] #toolWorkbench small {
  color: #94a3b8;
}

/* ══════════════════════════════════════════════════ */
/* ── MASTER VISIBILITY FIX: All tool workbench UI ── */
/* ══════════════════════════════════════════════════ */

/* Preset/grid buttons — ALWAYS readable */
#toolWorkbench div[style*="grid"] > div,
#toolWorkbench div[style*="flex"] > div,
#toolWorkbench div[style*="grid"] > button,
#toolWorkbench div[style*="flex"] > button {
  color: var(--ink, #1a1a2e) !important;
}
[data-theme="dark"] #toolWorkbench div[style*="grid"] > div,
[data-theme="dark"] #toolWorkbench div[style*="flex"] > div,
[data-theme="dark"] #toolWorkbench div[style*="grid"] > button,
[data-theme="dark"] #toolWorkbench div[style*="flex"] > button {
  color: #e2e8f0 !important;
}

/* Text inside any tool-generated element */
#toolWorkbench div:not([style*="background-image"]) {
  color: var(--ink, #1a1a2e);
}
[data-theme="dark"] #toolWorkbench div:not([style*="background-image"]) {
  color: #e2e8f0;
}

/* Ensure all paragraphs, headings, spans in workbench are visible */
#toolWorkbench p,
#toolWorkbench h3,
#toolWorkbench h4,
#toolWorkbench strong,
#toolWorkbench em {
  color: var(--ink, #1a1a2e);
}
[data-theme="dark"] #toolWorkbench p,
[data-theme="dark"] #toolWorkbench h3,
[data-theme="dark"] #toolWorkbench h4,
[data-theme="dark"] #toolWorkbench strong,
[data-theme="dark"] #toolWorkbench em {
  color: #e2e8f0;
}

/* Range/slider labels */
#toolWorkbench input[type="range"] + span,
#toolWorkbench input[type="range"] ~ span,
#toolWorkbench input[type="range"] ~ small {
  color: var(--ink, #1a1a2e) !important;
}
[data-theme="dark"] #toolWorkbench input[type="range"] + span,
[data-theme="dark"] #toolWorkbench input[type="range"] ~ span,
[data-theme="dark"] #toolWorkbench input[type="range"] ~ small {
  color: #94a3b8 !important;
}

/* Clickable preset cards/chips */
#toolWorkbench [style*="cursor: pointer"],
#toolWorkbench [style*="cursor:pointer"] {
  border: 1.5px solid var(--stroke, #d1d5db) !important;
}
#toolWorkbench [style*="cursor: pointer"]:hover,
#toolWorkbench [style*="cursor:pointer"]:hover {
  border-color: var(--brand, #0a8d83) !important;
}

/* Fix color pickers always visible */
#toolWorkbench input[type="color"] {
  width: 40px;
  height: 34px;
  border: 2px solid var(--stroke, #d1d5db);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}

/* Generated CSS code blocks — always dark bg with light text */
#toolWorkbench pre {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow-x: auto;
}

/* Table cells in tool workbench */
#toolWorkbench table {
  color: var(--ink, #1a1a2e);
}
[data-theme="dark"] #toolWorkbench table {
  color: #e2e8f0;
}
#toolWorkbench th {
  color: var(--ink, #1a1a2e);
  font-weight: 700;
}
[data-theme="dark"] #toolWorkbench th {
  color: #e2e8f0;
}
#toolWorkbench td {
  color: var(--ink, #1a1a2e);
}
[data-theme="dark"] #toolWorkbench td {
  color: #cbd5e1;
}

/* Fix "shareThisTool" — should be translated, but also style it better */
.share-tool,
.share-bar {
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════════════════ */
/* ── FASTTOOL BRAND BUTTONS: Override ALL inline styles ── */
/* ══════════════════════════════════════════════════════ */

/* All workbench buttons — brand-consistent (except those with inline gradient/background) */
#toolWorkbench button:not([style*="linear-gradient"]):not([style*="background: rgb"]):not([style*="background:rgb"]):not([style*="background-color"]):not([style*="height: 48px"]):not([style*="height:48px"]) {
  padding: 8px 16px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--brand, #0a8d83) !important;
  cursor: pointer !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  background: rgba(10, 141, 131, 0.06) !important;
  color: var(--brand, #0a8d83) !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

#toolWorkbench button:not([style*="linear-gradient"]):not([style*="height: 48px"]):hover {
  background: rgba(10, 141, 131, 0.15) !important;
  border-color: #0b7a72 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(10, 141, 131, 0.2);
}

#toolWorkbench button:not([style*="linear-gradient"]):active {
  transform: translateY(0);
  background: rgba(10, 141, 131, 0.25) !important;
}

/* Gradient preset buttons — preserve their background, just add hover border */
#toolWorkbench button[style*="linear-gradient"],
#toolWorkbench button[style*="height: 48px"] {
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s !important;
}

#toolWorkbench button[style*="linear-gradient"]:hover,
#toolWorkbench button[style*="height: 48px"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  border-color: #fff !important;
}

/* Primary/action buttons (Generate, Format, Copy, Download etc.) */
#toolWorkbench button[style*="background: rgb(10"],
#toolWorkbench button[style*="background: #0a8d83"],
#toolWorkbench button[style*="background:rgb(10"],
#toolWorkbench button[style*="background:#0a8d83"],
#toolWorkbench .primary-btn,
#toolWorkbench button[style*="background: var(--brand"] {
  background: linear-gradient(135deg, #0a8d83, #0b7a72) !important;
  color: #fff !important;
  border-color: #0a8d83 !important;
  box-shadow: 0 2px 8px rgba(10, 141, 131, 0.3);
}

#toolWorkbench button[style*="background: rgb(10"]:hover,
#toolWorkbench button[style*="background: #0a8d83"]:hover,
#toolWorkbench .primary-btn:hover {
  background: linear-gradient(135deg, #0b7a72, #096b63) !important;
  box-shadow: 0 4px 12px rgba(10, 141, 131, 0.4);
}

/* Selected/active preset buttons */
#toolWorkbench button[style*="background: rgb(10, 141"],
#toolWorkbench button[style*="border: 2px solid rgb(10"],
#toolWorkbench button[style*="outline: 2px"] {
  background: var(--brand, #0a8d83) !important;
  color: #fff !important;
  border-color: #0a8d83 !important;
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.2);
}

/* Danger/Remove buttons */
#toolWorkbench button[style*="background: rgb(239"],
#toolWorkbench button[style*="color: rgb(239"],
#toolWorkbench button[style*="color: red"],
#toolWorkbench button[style*="color:#ef"] {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

#toolWorkbench button[style*="background: rgb(239"]:hover,
#toolWorkbench button[style*="color: red"]:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
}

/* Toggle Dark/Light buttons — make visible */
#toolWorkbench button[style*="Toggle"],
#toolWorkbench button[style*="toggle"] {
  background: rgba(10, 141, 131, 0.08) !important;
  color: var(--brand, #0a8d83) !important;
  border: 1.5px solid var(--brand, #0a8d83) !important;
}

/* ── Dark mode overrides ── */
[data-theme="dark"] #toolWorkbench button:not([style*="linear-gradient"]):not([style*="background: rgb"]):not([style*="background:rgb"]):not([style*="height: 48px"]):not([style*="height:48px"]) {
  background: rgba(10, 141, 131, 0.1) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.3) !important;
}

[data-theme="dark"] #toolWorkbench button:not([style*="linear-gradient"]):not([style*="height: 48px"]):hover {
  background: rgba(10, 141, 131, 0.25) !important;
  border-color: #5eead4 !important;
}

[data-theme="dark"] #toolWorkbench button[style*="background: rgb(10"],
[data-theme="dark"] #toolWorkbench button[style*="background: #0a8d83"],
[data-theme="dark"] #toolWorkbench .primary-btn {
  background: linear-gradient(135deg, #0a8d83, #14b8a6) !important;
  color: #fff !important;
  border-color: #14b8a6 !important;
}

[data-theme="dark"] #toolWorkbench button[style*="background: rgb(239"],
[data-theme="dark"] #toolWorkbench button[style*="color: red"] {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
}

/* ── Input fields — brand-consistent borders ── */
#toolWorkbench input[type="text"],
#toolWorkbench input[type="number"],
#toolWorkbench input[type="url"],
#toolWorkbench input[type="email"],
#toolWorkbench select,
#toolWorkbench textarea {
  border-radius: 8px !important;
  border: 1.5px solid var(--stroke, #d1d5db) !important;
  padding: 8px 12px !important;
  font-family: inherit !important;
  transition: border-color 0.2s !important;
}

#toolWorkbench input:focus,
#toolWorkbench select:focus,
#toolWorkbench textarea:focus {
  border-color: var(--brand, #0a8d83) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.1) !important;
}

[data-theme="dark"] #toolWorkbench input:focus,
[data-theme="dark"] #toolWorkbench select:focus,
[data-theme="dark"] #toolWorkbench textarea:focus {
  border-color: #5eead4 !important;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1) !important;
}

/* ── Range sliders — brand color ── */
#toolWorkbench input[type="range"] {
  accent-color: var(--brand, #0a8d83) !important;
}

/* ── Color picker — cleaner look ── */
#toolWorkbench input[type="color"] {
  width: 44px !important;
  height: 38px !important;
  border: 2px solid var(--stroke, #d1d5db) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  padding: 3px !important;
}

#toolWorkbench input[type="color"]:hover {
  border-color: var(--brand, #0a8d83) !important;
}

/* ── Checkboxes — brand color ── */
#toolWorkbench input[type="checkbox"] {
  accent-color: var(--brand, #0a8d83) !important;
  width: 18px !important;
  height: 18px !important;
}

/* ── Select dropdowns ── */
#toolWorkbench select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230a8d83' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 32px !important;
}

/* ── Direction/preset text buttons with light hardcoded backgrounds ── */
[data-theme="dark"] #toolWorkbench button[style*="background: rgb(245"],
[data-theme="dark"] #toolWorkbench button[style*="background:#f5f5f5"],
[data-theme="dark"] #toolWorkbench button[style*="background: #f5f5f5"],
[data-theme="dark"] #toolWorkbench button[style*="background: rgb(238"],
[data-theme="dark"] #toolWorkbench button[style*="background: rgb(229"],
[data-theme="dark"] #toolWorkbench button[style*="background: rgb(255, 255"],
[data-theme="dark"] #toolWorkbench button[style*="background: white"],
[data-theme="dark"] #toolWorkbench button[style*="background:#fff"],
[data-theme="dark"] #toolWorkbench button[style*="background: #eee"],
[data-theme="dark"] #toolWorkbench button[style*="background: #ddd"] {
  background: rgba(10, 141, 131, 0.1) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.3) !important;
}

[data-theme="dark"] #toolWorkbench button[style*="background: rgb(245"]:hover,
[data-theme="dark"] #toolWorkbench button[style*="background:#f5f5f5"]:hover,
[data-theme="dark"] #toolWorkbench button[style*="background: #f5f5f5"]:hover {
  background: rgba(10, 141, 131, 0.25) !important;
  border-color: #5eead4 !important;
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM UI POLISH & MICRO-INTERACTIONS
   Added: 2026-04-06
   CSS-only enhancements — no JS changes required.
   ═══════════════════════════════════════════════════════════════ */

/* ── P1. Smooth Page Load Transitions ──
   Apply entrance animation to major page sections.
   tool-layout and hero get a gentle rise on load. ── */

.tool-layout {
  animation: fadeInUp 0.5s ease-out both;
}
.hero.panel {
  animation: fadeInUp 0.4s ease-out both;
}
.hero-panel {
  animation: fadeInUp 0.4s ease-out both;
}

/* ── P2. Enhanced Tool Card Hover ──
   Refine the existing hover: add inner glow, smoother
   icon bounce, and a subtle background warmth shift. ── */

.tool-card {
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background-color 0.3s ease;
}

/* Light mode: card gets a warmer white on hover */
html:not([data-theme="dark"]) .tool-card:hover {
  background-color: #fff;
}

/* Icon: elastic bounce on hover */
.tool-card-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tool-card:hover .tool-card-icon {
  transform: scale(1.18) rotate(-3deg);
}

/* Card title underline slide-in on hover */
.tool-card h3 a,
a.tool-card h3 {
  background-image: linear-gradient(var(--brand), var(--brand));
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}
.tool-card:hover h3 a,
a.tool-card:hover h3 {
  background-size: 100% 1.5px;
  text-decoration: none;
}

/* Gradient top bar: smoother reveal */
.tool-card::before {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: left;
}
.tool-card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

/* ── P3. Category Chip Polish ──
   Active: filled with gradient. Inactive: subtle hover glow.
   Smooth transition between all states. ── */

.category-chip {
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
}
.category-chip:hover {
  background: rgba(10, 141, 131, 0.15);
  border-color: rgba(10, 141, 131, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(10, 141, 131, 0.1);
}
.category-chip.active {
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(10, 141, 131, 0.25);
  transform: translateY(0);
}
.category-chip.active:hover {
  box-shadow: 0 4px 16px rgba(10, 141, 131, 0.35);
  transform: translateY(-1px);
}

/* Dark mode chip adjustments */
[data-theme="dark"] .category-chip:hover {
  background: rgba(18, 196, 184, 0.15);
  border-color: rgba(18, 196, 184, 0.4);
  box-shadow: 0 3px 8px rgba(18, 196, 184, 0.08);
}
[data-theme="dark"] .category-chip.active {
  box-shadow: 0 2px 12px rgba(18, 196, 184, 0.2);
}

/* ── Category chip tool count badge ── */
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--brand);
  background: rgba(10, 141, 131, 0.1);
  border-radius: 9px;
  vertical-align: middle;
}
.category-chip.active .chip-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .chip-count {
  background: rgba(18, 196, 184, 0.15);
  color: var(--brand);
}
[data-theme="dark"] .category-chip.active .chip-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

/* ── Section subtitle styling ── */
.section-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── P4. Skeleton Card Placeholder ──
   Shown before JS hydrates tool cards.
   Distinct shapes for icon, title, description. ── */

.skeleton-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--panel);
}
.skeleton-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.skeleton-title {
  height: 16px;
  width: 65%;
  margin-bottom: 8px;
}
.skeleton-text {
  height: 12px;
  width: 90%;
  margin-bottom: 6px;
}
.skeleton-text-short {
  height: 12px;
  width: 55%;
}

/* Reuse existing .skeleton class for the shimmer gradient */
.skeleton-icon,
.skeleton-title,
.skeleton-text,
.skeleton-text-short {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.1) 37%,
    rgba(0, 0, 0, 0.06) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}
[data-theme="dark"] .skeleton-icon,
[data-theme="dark"] .skeleton-title,
[data-theme="dark"] .skeleton-text,
[data-theme="dark"] .skeleton-text-short {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.06) 63%
  );
  background-size: 200% 100%;
}

/* ── P5. Scroll-Triggered Reveal ──
   Elements with .reveal-on-scroll start hidden and
   animate in when JS adds .is-visible. Pure CSS fallback:
   elements are visible if JS hasn't loaded yet. ── */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children inside a reveal container */
.reveal-on-scroll.is-visible > :nth-child(1) { transition-delay: 0.05s; }
.reveal-on-scroll.is-visible > :nth-child(2) { transition-delay: 0.10s; }
.reveal-on-scroll.is-visible > :nth-child(3) { transition-delay: 0.15s; }
.reveal-on-scroll.is-visible > :nth-child(4) { transition-delay: 0.20s; }

/* Fallback: if no JS, sections stay visible */
.no-js .reveal-on-scroll {
  opacity: 1;
  transform: none;
}

/* ── P6. Dark Mode Toggle Animation ──
   SVG icon rotates smoothly on theme switch.
   Also: a subtle expanding ring on click. ── */

.theme-toggle {
  position: relative;
  overflow: visible;
}
.theme-toggle svg {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
  will-change: transform;
}

/* When dark mode is active, rotate the icon (moon position) */
[data-theme="dark"] .theme-toggle svg {
  transform: rotate(180deg);
}

/* Click ring effect */
.theme-toggle::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.theme-toggle:active::before {
  opacity: 0.5;
  transform: scale(1.3);
  transition: opacity 0s, transform 0s;
}

/* Smooth background/color transitions for the entire document */
html {
  transition: background-color 0.35s ease;
}

/* ── P7. Footer Premium Polish ──
   Gradient separator, social link hover colors,
   link underline animation. ── */

/* Gradient separator above footer */
.site-footer::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--brand) 20%,
    var(--accent) 50%,
    var(--brand) 80%,
    transparent
  );
  opacity: 0.4;
  margin-bottom: 24px;
  border-radius: 2px;
}
.footer-grid {
  border-top: none;
}

/* Footer link underline slide effect */
.footer-links a {
  position: relative;
  display: inline-block;
}
.footer-links a::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--brand);
  transition: width 0.3s ease;
  border-radius: 1px;
}
.footer-links a:hover::after {
  width: 100%;
}

/* Social icon hover effects — if social links have .social-link class */
.footer-links a[href*="twitter"],
.footer-links a[href*="github"],
.footer-links a[href*="linkedin"],
.footer-links a[href*="youtube"],
.footer-links a[href*="x.com"] {
  transition: color 0.25s ease, transform 0.25s ease;
}
.footer-links a[href*="twitter"]:hover,
.footer-links a[href*="x.com"]:hover {
  color: #1da1f2;
}
.footer-links a[href*="github"]:hover {
  color: #6e5494;
}
[data-theme="dark"] .footer-links a[href*="github"]:hover {
  color: #c9d1d9;
}
.footer-links a[href*="linkedin"]:hover {
  color: #0077b5;
}
.footer-links a[href*="youtube"]:hover {
  color: #ff0000;
}

/* Footer brand name subtle glow */
.footer-brand strong,
.footer-brand b {
  background: linear-gradient(130deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── P8. Search Input Polish ──
   Focus ring glow, icon animation. ── */

#searchInput {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
#searchInput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 141, 131, 0.12);
  outline: none;
}
[data-theme="dark"] #searchInput:focus {
  box-shadow: 0 0 0 3px rgba(18, 196, 184, 0.12);
}

/* ── P9. Featured Category Card Hover ── */

.featured-cat-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.featured-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--brand);
}
.featured-cat-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease;
}
.featured-cat-card:hover .featured-cat-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(10, 141, 131, 0.18), rgba(10, 141, 131, 0.08));
}

[data-theme="dark"] .featured-cat-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ── P10. Spotlight Card Hover Refinement ── */

.spotlight-card {
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.spotlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border-color: var(--brand);
}
[data-theme="dark"] .spotlight-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* ── P11. Stats Banner Number Emphasis ── */

.hero-stats strong,
.hero-stats b {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── P12. Scroll Progress Indicator ──
   A thin brand-colored bar at the top of the viewport
   that fills as the user scrolls down. CSS-only via
   scroll-timeline (progressive enhancement). ── */

@supports (animation-timeline: scroll()) {
  @keyframes scrollProgress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    animation: scrollProgress linear forwards;
    animation-timeline: scroll();
  }
}

/* ── P13. Accessibility — Reduced Motion Override ──
   Disable ALL newly added animations when user prefers
   reduced motion. Supplements existing rules at lines 2519 & 4788. ── */

@media (prefers-reduced-motion: reduce) {
  .tool-layout,
  .hero.panel,
  .hero-panel {
    animation: none !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .tool-card,
  .tool-card-icon,
  .tool-card::before,
  .tool-card h3 a,
  a.tool-card h3,
  .category-chip,
  .featured-cat-card,
  .featured-cat-icon,
  .spotlight-card,
  .theme-toggle svg,
  .theme-toggle::before,
  .footer-links a::after,
  #searchInput {
    transition: none !important;
    animation: none !important;
  }

  .tool-card::before {
    transform: none !important;
  }

  .tool-card h3 a,
  a.tool-card h3 {
    background-image: none !important;
  }

  [data-theme="dark"] .theme-toggle svg {
    transform: none !important;
  }

  .skeleton-icon,
  .skeleton-title,
  .skeleton-text,
  .skeleton-text-short {
    animation: none !important;
  }

  /* Disable scroll progress bar */
  @supports (animation-timeline: scroll()) {
    body::before {
      animation: none !important;
      display: none !important;
    }
  }
}

/* ====================================================================
   RTL SUPPORT — Arabic (ar) & Urdu (ur)
   i18n.js sets dir="rtl" on <html> for these languages.
   This section mirrors directional properties so the layout reads
   correctly right-to-left without touching the LTR rules above.
   ==================================================================== */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Breadcrumb separator should point the other direction */
[dir="rtl"] .breadcrumb ol li + li::before {
  content: "\00ab";                 /* << instead of >> */
}

/* Flip horizontal paddings & margins that assume LTR */
[dir="rtl"] .prose-content ul,
[dir="rtl"] .prose-content ol,
[dir="rtl"] .faq-content ul,
[dir="rtl"] .faq-content ol {
  padding-left: 0;
  padding-right: 18px;
}

[dir="rtl"] .tool-meta-item svg,
[dir="rtl"] .breadcrumb-sep {
  margin-left: 0;
  margin-right: 8px;
}

/* Border accents move from left to right */
[dir="rtl"] .changelog-entry,
[dir="rtl"] blockquote,
[dir="rtl"] .did-you-know-card,
[dir="rtl"] .pro-tip-card {
  border-left: none;
  border-right: 4px solid var(--brand);
}

[dir="rtl"] .faq-answer-content {
  border-left: none;
  border-right: 4px solid #3b82f6;
  padding-left: 0;
  padding-right: 24px;
}

[dir="rtl"] .fmt-error-line {
  border-left: none;
  border-right: 3px solid #ef4444;
  margin-left: 0;
  margin-right: -12px;
  padding-left: 0;
  padding-right: 9px;
}

[dir="rtl"] .pass-good {
  border-left: none;
  border-right: 4px solid var(--good);
}

[dir="rtl"] .pass-bad {
  border-left: none;
  border-right: 4px solid var(--bad);
}

[dir="rtl"] .pass-mid {
  border-left: none;
  border-right: 4px solid var(--accent);
}

/* JSON tree indentation */
[dir="rtl"] .json-tree ul {
  padding-left: 0;
  padding-right: 20px;
}
[dir="rtl"] .json-tree > ul {
  padding-right: 0;
}

/* Related concepts timeline */
[dir="rtl"] .related-concepts-item {
  border-left: none;
  border-right: 2px solid rgba(10,141,131,0.2);
  padding-left: 0;
  padding-right: 4px;
}

/* Command palette category text */
[dir="rtl"] .cmd-item-cat {
  margin-left: 0;
  margin-right: auto;
}

/* Fav button spacing */
[dir="rtl"] .fav-btn {
  margin-left: 0;
  margin-right: 8px;
}

/* Cursor blink animation flip */
[dir="rtl"] .hero-typed-cursor {
  border-right: none;
  border-left: 2px solid var(--brand);
  padding-right: 0;
  padding-left: 4px;
}

/* Header layout stays natural with flexbox, just ensure text alignment */
[dir="rtl"] .site-header {
  flex-direction: row-reverse;
}

/* Footer nav */
[dir="rtl"] .site-footer-nav {
  direction: rtl;
}

/* Tables: first column aligns right, last aligns left */
[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}
[dir="rtl"] th:last-child,
[dir="rtl"] td:last-child {
  text-align: left;
}

/* Close/action buttons positioned on left instead of right */
[dir="rtl"] .modal-close,
[dir="rtl"] .toast-close {
  left: 12px;
  right: auto;
}

/* Select dropdown arrow positioning */
[dir="rtl"] select {
  padding-right: 12px;
  padding-left: 36px;
  background-position: left 12px center;
}

/* Badge spacing */
[dir="rtl"] .tool-badge {
  margin-left: 0;
  margin-right: 6px;
}

/* Stat cards alignment */
[dir="rtl"] .stat-card {
  text-align: right;
}

/* Input groups with icons */
[dir="rtl"] .input-with-icon {
  padding-right: 12px;
  padding-left: 36px;
}

/* ═══════════════════════════════════════════════════════════════
   CRO HERO REDESIGN — centred hero, proof banner, popular tools,
   category nav scroll, hero search bar
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero Centre Layout ── */
.hero-center {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hero-headline {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 3.4rem);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-weight: 800;
  line-height: 1.15;
  animation: heroTextReveal 0.4s ease-out forwards;
}
.hero-count {
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.hero-count-plus {
  color: var(--brand);
}

/* Animated badges */
.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(10, 141, 131, 0.10);
  color: var(--brand);
  border: 1px solid rgba(10, 141, 131, 0.22);
  opacity: 0;
  transform: translateY(8px);
  animation: badgePop 0.4s ease-out forwards;
}
.hb-1 { animation-delay: 0.15s; }
.hb-2 { animation-delay: 0.30s; }
.hb-3 { animation-delay: 0.45s; }
@keyframes badgePop {
  to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .hero-badge {
  background: rgba(18, 196, 184, 0.12);
  border-color: rgba(18, 196, 184, 0.28);
}

.hero-sub {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

/* ── Hero Search Bar ── */
.hero-search-wrap {
  width: 100%;
  max-width: 560px;
  position: relative;
}
.hero-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.hero-search-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--brand);
  pointer-events: none;
  z-index: 1;
}
.hero-search-wrap input[type="search"] {
  width: 100%;
  padding: 14px 50px 14px 48px;
  font-size: 1.05rem;
  border: 2px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hero-search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(10, 141, 131, 0.12);
}
.hero-search-wrap .search-shortcut-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hero-search-wrap input:focus ~ .search-shortcut-hint {
  opacity: 0;
}

/* ── Hero CTA Buttons ── */
.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: ctaGlow 2.5s ease-in-out infinite;
}
.hero-cta-primary:hover {
  transform: translateY(-2px);
  animation: none;
  box-shadow: 0 8px 24px rgba(10, 141, 131, 0.3);
}
.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--stroke);
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hero-cta-secondary:hover {
  border-color: var(--brand);
  background: rgba(10, 141, 131, 0.06);
}

.hero-trust-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ── Social Proof Banner ── */
.proof-banner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 36px 20px;
  margin: 24px 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  gap: 16px;
  flex-wrap: wrap;
}
.proof-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.proof-number {
  font-size: 2.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.proof-suffix {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}
.proof-icon-wrap {
  font-size: 2rem;
  line-height: 1.1;
}
.proof-label {
  font-size: 0.85rem;
  opacity: 0.88;
  margin-top: 2px;
}

/* ── Popular Tools Quick Access ── */
.popular-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.pq-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px 16px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
.pq-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(10, 141, 131, 0.10);
}
[data-theme="dark"] .pq-card {
  background: rgba(30, 40, 48, 0.7);
}
[data-theme="dark"] .pq-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.pq-icon {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 141, 131, 0.10), rgba(10, 141, 131, 0.03));
  border-radius: 14px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pq-card:hover .pq-icon {
  transform: scale(1.12);
}
.pq-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.pq-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Category Navigation Scroll ── */
.cat-nav-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) transparent;
}
.cat-nav-scroll::-webkit-scrollbar {
  height: 6px;
}
.cat-nav-scroll::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 3px;
}
.cat-nav-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 20px;
  min-width: 110px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cat-nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(10, 141, 131, 0.08);
}
[data-theme="dark"] .cat-nav-card {
  background: rgba(30, 40, 48, 0.7);
}
.cat-nav-icon {
  font-size: 1.8rem;
}
.cat-nav-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.cat-nav-count {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── CRO Mobile Adjustments ── */
@media (max-width: 639px) {
  .hero-headline { font-size: clamp(1.3rem, 7vw, 2rem); }
  .hero-sub { font-size: 0.92rem; }
  .hero-search-wrap { max-width: 100%; }
  .hero-search-wrap input[type="search"] { font-size: 0.95rem; padding: 12px 44px 12px 42px; }
  .hero-badges { gap: 6px; }
  .hero-badge { padding: 4px 12px; font-size: 0.78rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-cta-primary, .hero-cta-secondary { text-align: center; justify-content: center; }
  .popular-quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pq-card { padding: 16px 10px; }
  .pq-icon { font-size: 1.8rem; width: 44px; height: 44px; }
  .proof-banner { padding: 24px 16px; gap: 20px; }
  .proof-item { flex: 0 0 45%; }
  .proof-number, .proof-suffix { font-size: 1.8rem; }
  .cat-nav-card { min-width: 96px; padding: 12px 14px; }
  .cat-nav-icon { font-size: 1.5rem; }
}
@media (max-width: 420px) {
  .popular-quick-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Internal Linking: Category Explorer ── */
.category-explorer { margin-top: 2rem; }
.category-explorer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}
.category-explorer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(10, 141, 131, 0.18);
  background: rgba(10, 141, 131, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.category-explorer-chip:hover {
  background: rgba(10, 141, 131, 0.14);
  border-color: rgba(10, 141, 131, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(10, 141, 131, 0.1);
}
.category-explorer-chip.category-chip-active {
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
}
[data-theme="dark"] .category-explorer-chip {
  background: rgba(10, 141, 131, 0.12);
  border-color: rgba(10, 141, 131, 0.25);
}
[data-theme="dark"] .category-explorer-chip:hover {
  background: rgba(10, 141, 131, 0.22);
}

/* ── Internal Linking: Popular Tools ── */
.popular-tools-section { margin-top: 2rem; }
.popular-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 1rem;
}
.popular-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}
.popular-tool-card:hover {
  border-color: var(--brand);
  background: rgba(10, 141, 131, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.popular-tool-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popular-tool-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.popular-tool-cat {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
[data-theme="dark"] .popular-tool-card {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .popular-tool-card:hover {
  background: rgba(10, 141, 131, 0.1);
}

/* ── Internal Linking: Explore Category ── */
.explore-category { margin-top: 2rem; }
.explore-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 24px;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.explore-category-list li a {
  display: block;
  padding: 8px 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--stroke);
  transition: color 0.2s, padding-left 0.2s;
}
.explore-category-list li a:hover {
  color: var(--brand);
  padding-left: 8px;
}
.explore-category-list li.explore-more a {
  color: var(--brand);
  font-weight: 600;
  border-bottom: none;
}
.explore-category-list li.explore-more a:hover {
  text-decoration: underline;
}

/* ── FAQ inline links ── */
.faq-inline-link {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(10, 141, 131, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.faq-inline-link a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.faq-inline-link a:hover {
  text-decoration: underline;
}

/* ── Rich Footer for tool pages ── */
.rich-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--stroke);
}
.rich-footer .footer-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
  max-width: 280px;
}
.rich-footer .footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--stroke);
  margin-top: 16px;
}
.rich-footer .footer-bottom p {
  color: var(--muted);
  font-size: 0.82rem;
}
@media (max-width: 768px) {
  .rich-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .popular-tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .rich-footer .footer-grid { grid-template-columns: 1fr; }
  .popular-tools-grid { grid-template-columns: 1fr; }
  .explore-category-list { grid-template-columns: 1fr 1fr; }
  .category-explorer-grid { gap: 8px; }
  .category-explorer-chip { padding: 8px 12px; font-size: 0.82rem; }
}

/* ===================================================================
   HOMEPAGE & UI/UX POLISH — 2026-04-13
   All additions below; nothing above is modified.
   =================================================================== */

/* ── Hero Privacy Subtitle ── */
.hero-privacy-sub {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--brand);
  opacity: 0.85;
}

/* ── Hero Tool Count number styling ── */
#heroToolCount {
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

/* ── Tool Card Description ── */
.tool-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Category-Colored Pills ── */
.cat-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  border-width: 1px;
  border-style: solid;
  transition: opacity 0.2s;
}

/* ── Popular Quick Access (Hero Bottom) ── */
.popular-quick-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}
.popular-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pq-mini-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.pq-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(10, 141, 131, 0.12);
  color: var(--brand);
}
.pq-mini-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.pq-mini-name {
  line-height: 1.2;
}
[data-theme="dark"] .pq-mini-card {
  background: rgba(30, 40, 48, 0.6);
}
[data-theme="dark"] .pq-mini-card:hover {
  background: rgba(30, 40, 48, 0.85);
}

/* ── Homepage Footer: 5-column grid ── */
.site-footer.rich-footer .footer-grid {
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
}
@media (max-width: 900px) {
  .site-footer.rich-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}
@media (max-width: 480px) {
  .site-footer.rich-footer .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Breadcrumb Enhancement ── */
.breadcrumb {
  padding: 10px 0;
  margin-bottom: 8px;
}
.breadcrumb ol {
  font-size: 0.84rem;
}
.breadcrumb a {
  font-weight: 500;
  transition: color 0.2s;
}
.breadcrumb li + li::before {
  content: "\203A";
  font-size: 1.1em;
  margin-right: 6px;
  color: var(--muted);
  opacity: 0.6;
}
.breadcrumb [aria-current] {
  font-weight: 600;
  color: var(--ink);
}

/* ── Dark Mode Toggle SVG Enhancement ── */
.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--brand);
  background: rgba(10, 141, 131, 0.06);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink);
  transition: transform 0.3s ease;
}
.theme-toggle:hover svg {
  transform: rotate(15deg);
}
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(18, 196, 184, 0.1);
}

/* ── Loading Skeleton for Tool Page ── */
.tool-skeleton {
  display: grid;
  gap: 12px;
  padding: 20px;
}
.tool-skeleton-bar {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.1) 37%,
    rgba(0, 0, 0, 0.06) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.tool-skeleton-bar.wide { width: 80%; }
.tool-skeleton-bar.medium { width: 55%; }
.tool-skeleton-bar.narrow { width: 35%; }
.tool-skeleton-bar.tall { height: 120px; }
[data-theme="dark"] .tool-skeleton-bar {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 200% 100%;
}

/* ── Scroll Progress Bar Enhancement ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 10001;
  transition: width 0.1s ease-out;
  border-radius: 0 2px 2px 0;
}

/* ── Section Subtitle Styling ── */
.section-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ── Tool Card Grid Enhancements ── */
.tool-card h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Card Enter Animation (category switch) ── */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card-enter {
  animation: cardEnter 0.35s ease-out both;
}

/* ── Badge Special ── */
.badge-special {
  background: linear-gradient(130deg, rgba(234, 88, 12, 0.15), rgba(234, 88, 12, 0.08));
  color: #9a3412;
  border: 1px solid rgba(234, 88, 12, 0.25);
}
[data-theme="dark"] .badge-special {
  color: #fb923c;
}

/* ── Homepage Hero Mobile Full-Screen ── */
@media (max-width: 639px) {
  .hero.panel {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .hero-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  /* Popular quick row scroll on mobile */
  .popular-quick-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .popular-quick-row::-webkit-scrollbar { display: none; }
  .pq-mini-card {
    flex-shrink: 0;
  }
}

/* ── Tool Grid Mobile: Single Column ── */
@media (max-width: 479px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile Footer Single Column ── */
@media (max-width: 479px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ── How It Works Steps Grid ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.step-card {
  text-align: center;
  padding: 24px 18px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--panel);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}
.step-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
[data-theme="dark"] .step-card {
  background: rgba(30, 40, 48, 0.7);
}
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* ── Stats Banner ── */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
  text-align: center;
}
.stat-item {
  padding: 20px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  transition: transform 0.2s ease;
}
.stat-item:hover {
  transform: translateY(-2px);
}
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}
[data-theme="dark"] .stat-item {
  background: rgba(30, 40, 48, 0.7);
}
@media (max-width: 640px) {
  .stats-banner { grid-template-columns: repeat(2, 1fr); }
}

/* ── Blog Section Styling ── */
.blog-section .related-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.blog-section .related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

/* ── CTA Section Enhancement ── */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(10, 141, 131, 0.08), transparent 50%);
  pointer-events: none;
}

/* ── Favorites & Recent Section Grids ── */
.favorites-row,
.recent-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* ── Toggle Show All Button ── */
.toggle-show-all {
  width: auto;
  background: none;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.toggle-show-all:hover {
  background: rgba(10, 141, 131, 0.06);
  border-color: var(--brand);
  transform: none;
  box-shadow: none;
}

/* ── Chip Count Badge ── */
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(10, 141, 131, 0.15);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 4px;
  padding: 0 5px;
}

/* ── Featured Categories Card Enhancement ── */
.featured-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: var(--brand);
}
.featured-cat-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

/* ── How It Works Section Enhancement ── */
.how-it-works {
  text-align: center;
}
.how-it-works h2 {
  margin: 0 0 4px;
}

/* ── Trending Card Icon ── */
.trending-card-icon {
  font-size: 2.2rem;
  line-height: 1;
}

/* ── Load More Sentinel ── */
.load-sentinel {
  height: 1px;
  grid-column: 1 / -1;
}

/* ── Category Panel Enhancement ── */
.category-panel {
  padding: 14px 18px;
}

/* ── ft-overflow-hidden utility ── */
.ft-overflow-hidden {
  display: none;
}

/* ── CWV Phase 2: below-the-fold rendering containment ── */
.spotlight-section,
.trending-tools,
.recently-added-section,
.special-tools-section,
.ft-favorites-section,
.ft-recent-section,
.testimonials-section,
.articles-section,
.deep-content,
.eeat-block,
.featured-in {
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}

.sidebar ul {
  content-visibility: auto;
  contain-intrinsic-size: auto 1800px;
}

/* Smart Stack task launcher */
.intent-studio {
  display: grid;
  gap: 16px;
}
.intent-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.intent-chip {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.intent-chip:hover,
.intent-chip.active {
  background: rgba(10, 141, 131, 0.12);
  border-color: var(--brand);
  transform: translateY(-1px);
}
[data-theme="dark"] .intent-chip {
  background: rgba(30, 40, 48, 0.7);
}
.intent-stack {
  min-height: 196px;
}
.intent-stack-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(10, 141, 131, 0.22);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(10, 141, 131, 0.08), rgba(255, 255, 255, 0.52));
}
[data-theme="dark"] .intent-stack-card {
  background: linear-gradient(135deg, rgba(18, 196, 184, 0.1), rgba(30, 40, 48, 0.72));
}
.intent-stack-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.intent-stack-copy h3 {
  margin: 0;
  font-size: 1.25rem;
}
.intent-stack-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.intent-start-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  margin-top: auto;
}
.intent-start-link:hover {
  color: #fff;
  background: var(--brand-dark);
}
.intent-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.intent-step-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}
[data-theme="dark"] .intent-step-list li {
  background: rgba(30, 40, 48, 0.72);
}
.intent-step-index {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(10, 141, 131, 0.14);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.intent-step-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.intent-step-list a:hover {
  color: var(--brand);
}
.intent-step-list span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
@media (max-width: 719px) {
  .intent-stack-card {
    grid-template-columns: 1fr;
  }
  .intent-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .intent-chip {
    flex: 0 0 auto;
  }
}
