/* =============================================
   ToolsGallery — main.css
   ============================================= */

/* --- Design Tokens --- */
:root {
  --color-primary: #F97316;
  --color-primary-dark: #EA6C0A;
  --color-primary-light: #FFF7ED;
  --color-primary-bg: #FEF3E2;
  --color-black: #0F0F0F;
  --color-gray-900: #111827;
  --color-gray-800: #1F2937;
  --color-gray-700: #374151;
  --color-gray-600: #4B5563;
  --color-gray-400: #9CA3AF;
  --color-gray-200: #E5E7EB;
  --color-gray-100: #F9FAFB;
  --color-white: #FFFFFF;
  --color-success: #16A34A;
  --color-error: #DC2626;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --transition: 0.2s ease;
  --container-max: 1200px;
  --container-padding: 1.5rem;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  color: var(--color-gray-900);
  background: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

button { cursor: pointer; font-family: var(--font-family); border: none; background: none; }

input, textarea, select {
  font-family: var(--font-family);
  font-size: 1rem;
}

/* --- Container --- */
.tg-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* --- Skip Link --- */
.tg-skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.tg-skip-link:focus { top: 1rem; }

/* =============================================
   HEADER
   ============================================= */
.tg-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
}

.tg-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
}

/* Logo */
.tg-header__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  text-decoration: none;
}

.tg-header__logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-black);
  letter-spacing: -0.02em;
}

/* Nav */
.tg-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.tg-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tg-nav__link {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-gray-700);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.tg-nav__link:hover,
.tg-nav__link.current-menu-item {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* CTA */
.tg-header__cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.tg-header__cta-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* Hamburger */
.tg-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-left: auto;
}

.tg-header__hamburger:hover { background: var(--color-gray-100); }

.tg-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-gray-800);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.tg-header__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.tg-header__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.tg-header__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   LOGO
   ============================================= */
.tg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.tg-logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text, #0F0F0F);
  letter-spacing: -0.4px;
  line-height: 1;
  font-family: Inter, system-ui, sans-serif;
}

.tg-logo-accent {
  color: #F97316;
  font-weight: 400;
}

[data-theme="dark"] .tg-logo-text {
  color: #F0F0F0 !important;
}

.tg-footer .tg-logo,
footer .tg-logo {
  pointer-events: all !important;
  cursor: pointer !important;
}

/* =============================================
   MOBILE MENU
   ============================================= */
.tg-mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text, #0F0F0F);
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  align-items: center;
  justify-content: center;
}

.tg-mobile-menu-btn:hover {
  background: var(--color-primary-light, rgba(249,115,22,0.08));
}

@media (max-width: 768px) {
  .tg-mobile-menu-btn { display: flex; }
  .tg-header__nav,
  .tg-header__cta-btn,
  .tg-theme-toggle:not(.tg-mobile-theme-row .tg-theme-toggle) { display: none !important; }
}

.tg-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tg-mobile-overlay.tg-open { display: block; }

.tg-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  height: 100dvh;
  background: var(--color-white, #ffffff);
  z-index: 999;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}

.tg-mobile-menu.tg-open { right: 0; }

.tg-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
  flex-shrink: 0;
}

.tg-mobile-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text, #0F0F0F);
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.tg-mobile-close-btn:hover {
  background: rgba(249,115,22,0.1);
  color: #F97316;
}

.tg-mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}

.tg-mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text, #0F0F0F);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.tg-mobile-nav-link:hover {
  background: var(--color-primary-light, rgba(249,115,22,0.08));
  color: #F97316;
  border-left-color: #F97316;
}

.tg-mobile-nav-active {
  background: var(--color-primary-light, rgba(249,115,22,0.08));
  color: #F97316 !important;
  border-left-color: #F97316 !important;
  font-weight: 600 !important;
}

.tg-mobile-menu-footer {
  padding: 20px;
  border-top: 1px solid var(--color-border, rgba(0,0,0,0.08));
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.tg-mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--color-text-muted, #6B7280);
}

[data-theme="dark"] .tg-mobile-menu { background: #1e1e1e !important; }
[data-theme="dark"] .tg-mobile-nav-link { color: #F0F0F0 !important; }
[data-theme="dark"] .tg-mobile-menu-header { border-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .tg-mobile-menu-footer { border-color: rgba(255,255,255,0.08) !important; }

/* =============================================
   BREADCRUMB
   ============================================= */
.tg-breadcrumb {
  background: var(--color-gray-100);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 0.625rem 0;
}

.tg-breadcrumb__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-gray-600);
}

.tg-breadcrumb__link {
  color: var(--color-gray-600);
  transition: color var(--transition);
}

.tg-breadcrumb__link:hover { color: var(--color-primary); }

.tg-breadcrumb__sep {
  color: var(--color-gray-400);
  user-select: none;
  font-size: 0.75rem;
}

.tg-breadcrumb__current {
  color: var(--color-gray-800);
  font-weight: 500;
}

/* =============================================
   FOOTER
   ============================================= */
.tg-footer {
  background: var(--color-gray-900);
  color: var(--color-gray-400);
  padding-top: 4rem;
}

.tg-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.tg-footer__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.tg-footer__logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-white);
}

.tg-footer__tagline {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tg-footer__desc {
  font-size: 0.875rem;
  line-height: 1.7;
}

.tg-footer__col-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 1.25rem;
}

.tg-footer__links { display: flex; flex-direction: column; gap: 0.625rem; }

.tg-footer__link {
  font-size: 0.875rem;
  color: var(--color-gray-400);
  transition: color var(--transition);
}

.tg-footer__link:hover { color: var(--color-primary); }

.tg-footer__bottom {
  border-top: 1px solid var(--color-gray-800);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.tg-footer__bottom-tagline { color: var(--color-primary); font-weight: 500; }

/* =============================================
   BUTTONS
   ============================================= */
.tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
  text-decoration: none;
}

.tg-btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.tg-btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}

.tg-btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.tg-btn--outline:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

.tg-btn--ghost {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}
.tg-btn--ghost:hover { background: var(--color-gray-200); }

.tg-btn--lg { padding: 0.875rem 2rem; font-size: 1.0625rem; }
.tg-btn--sm { padding: 0.4375rem 1rem; font-size: 0.875rem; }

/* =============================================
   HERO (front-page)
   ============================================= */
.tg-hero {
  background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-white) 60%);
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tg-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.tg-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(249,115,22,0.2);
}

.tg-hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--color-black);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 700px;
  margin: 0 auto 1.25rem;
}

.tg-hero__title span { color: var(--color-primary); }

.tg-hero__subtitle {
  font-size: 1.125rem;
  color: var(--color-gray-600);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.tg-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.tg-hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.tg-hero__stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-black);
  letter-spacing: -0.03em;
}

.tg-hero__stat-label {
  font-size: 0.8125rem;
  color: var(--color-gray-600);
  margin-top: 0.125rem;
}

/* =============================================
   TOOL CATEGORY SECTION
   ============================================= */
.tg-section {
  padding: 4rem 0;
}

.tg-section--gray { background: var(--color-gray-100); }

.tg-section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.tg-section__tag {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3125rem 0.875rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.tg-section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-black);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.tg-section__desc {
  font-size: 1rem;
  color: var(--color-gray-600);
  max-width: 560px;
  margin: 0 auto;
}

/* =============================================
   TOOL CARDS
   ============================================= */
.tg-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.tg-tool-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
}

.tg-tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-primary);
}

.tg-tool-card__icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.5rem;
}

/* Colored SVG tool icon (tg_get_tool_icon) — category color + operation glyph */
.tg-tool-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--tg-ic, #F97316);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.tg-tool-card__icon { line-height: 0; }  /* remove old emoji spacing */
.tg-tool-card__icon:has(.tg-tool-icon) { background: transparent; }

/* Compact contexts: related-tool cards and the sidebar popular list */
.tg-related-card__icon .tg-tool-icon { width: 40px; height: 40px; border-radius: 11px; }
.tg-related-card__icon .tg-tool-icon svg { width: 20px; height: 20px; }
.tg-sidebar-tool-link .tg-tool-icon { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; }
.tg-sidebar-tool-link .tg-tool-icon svg { width: 15px; height: 15px; }

/* =============================================
   POPULAR TOOLS FILTER (homepage)
   ============================================= */
.tg-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.tg-filter-btn {
  appearance: none;
  border: 1px solid var(--color-gray-200, #E5E7EB);
  background: var(--color-white, #fff);
  color: var(--color-gray-600, #6B7280);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tg-filter-btn:hover {
  border-color: var(--color-primary, #F97316);
  color: var(--color-primary, #F97316);
}

.tg-filter-btn.active {
  background: var(--color-primary, #F97316);
  border-color: var(--color-primary, #F97316);
  color: #fff;
}

.tg-popular-grid .tg-tool-card.is-hidden { display: none; }

/* Small category label on popular-tool cards */
.tg-tool-card__cat {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-full, 999px);
  background: var(--color-bg-alt, #F3F4F6);
  color: var(--color-text-muted, #6B7280);
}

[data-theme="dark"] .tg-filter-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #C9CDD3;
}

[data-theme="dark"] .tg-filter-btn:hover {
  border-color: var(--color-primary, #F97316);
  color: var(--color-primary, #F97316);
}

[data-theme="dark"] .tg-filter-btn.active {
  background: var(--color-primary, #F97316);
  border-color: var(--color-primary, #F97316);
  color: #fff;
}

[data-theme="dark"] .tg-tool-card__cat {
  background: rgba(255, 255, 255, 0.08);
  color: #A7ACB3;
}

.tg-tool-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-gray-900);
  line-height: 1.3;
}

.tg-tool-card__desc {
  font-size: 14px;
  color: var(--color-gray-600);
  line-height: 1.65;
  flex: 1;
}

.tg-tool-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* =============================================
   FEATURES / HOW-IT-WORKS
   ============================================= */
.tg-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.tg-feature-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tg-feature-card__icon {
  width: 52px;
  height: 52px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.tg-feature-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.tg-feature-card__desc {
  font-size: 0.9rem;
  color: var(--color-gray-600);
  line-height: 1.6;
}

/* Steps */
.tg-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  counter-reset: steps;
}

.tg-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  counter-increment: steps;
  position: relative;
}

.tg-step__number {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tg-step__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.tg-step__desc {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  line-height: 1.6;
}

/* =============================================
   SECTION CTA (centered button row below grids)
   ============================================= */
.tg-section__cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* =============================================
   HOW IT WORKS
   ============================================= */
.tg-hiw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

.tg-hiw-steps::before {
  content: '';
  position: absolute;
  top: 28px; /* center of the number circle */
  left: calc(50% / 3);
  right: calc(50% / 3);
  height: 2px;
  border-top: 2px dashed var(--color-gray-200);
  pointer-events: none;
  z-index: 0;
}

.tg-hiw-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.tg-hiw-step__number {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}

.tg-hiw-step__icon {
  width: 52px;
  height: 52px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.tg-hiw-step__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.tg-hiw-step__desc {
  font-size: 0.9rem;
  color: var(--color-gray-600);
  line-height: 1.6;
  max-width: 240px;
}

/* =============================================
   AD SLOTS
   ============================================= */
.tg-ad-leaderboard { text-align: center; padding: 1rem 0; }

.tg-ad-section {
  padding: 2.5rem 0;
}

.tg-ad-section__inner {
  text-align: center;
}

/* ---------------------------------------------
   Ad wrapper collapse — master ad switch
   With TG_ADS_ENABLED off, tg_ad_slot() returns an empty string but the
   wrapper markup stays in the templates (so ads can return without code
   changes). These rules stop those wrappers from leaving a blank gap.
--------------------------------------------- */
.tg-ad-section:empty,
.tg-ad-leaderboard:empty,
.tg-ad-section__inner:empty,
.tg-ad-mid:empty {
  display: none;
  margin: 0;
  padding: 0;
}

/* :empty does not match an element that still holds the newline/indentation
   the PHP tag leaves behind, which is exactly what these wrappers contain
   once the slot returns ''. "No element child" is the reliable test. */
.tg-ad-leaderboard:not(:has(*)),
.tg-ad-section__inner:not(:has(*)),
.tg-ad-mid:not(:has(*)) {
  display: none;
  margin: 0;
  padding: 0;
}

/* Two-level wrappers: the outer div always has an element child, so test the
   inner one. .tg-leaderboard-wrap lives in tool.css; the extra :not() here
   outranks it regardless of stylesheet order. */
.tg-ad-section:not(:has(.tg-ad-section__inner > *)),
.tg-leaderboard-wrap:not(:has(.tg-container > *)) {
  display: none;
  margin: 0;
  padding: 0;
}

/* =============================================
   PAGINATION
   ============================================= */
.tg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 2rem 0;
  flex-wrap: wrap;
}

.tg-pagination a,
.tg-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border: 1px solid var(--color-gray-200);
  color: var(--color-gray-700);
}

.tg-pagination a:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
.tg-pagination .current { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }
.tg-pagination .dots { border: none; color: var(--color-gray-400); }

/* =============================================
   BLOG / ARCHIVE
   ============================================= */
.tg-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.tg-post-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.tg-post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.tg-post-card__thumb {
  aspect-ratio: 16/9;
  background: var(--color-gray-100);
  overflow: hidden;
}

.tg-post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tg-post-card:hover .tg-post-card__thumb img { transform: scale(1.05); }

.tg-post-card__body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }

.tg-post-card__cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary);
}

.tg-post-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1.4;
  flex: 1;
}

.tg-post-card__title a { color: inherit; }
.tg-post-card__title a:hover { color: var(--color-primary); }

.tg-post-card__excerpt {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  line-height: 1.6;
}

.tg-post-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--color-gray-400);
}

/* =============================================
   SINGLE POST / PAGE content
   ============================================= */
.tg-entry {
  max-width: 740px;
  margin-inline: auto;
}

.tg-entry__header { margin-bottom: 2.5rem; }

.tg-entry__cat {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.tg-entry__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--color-black);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.tg-entry__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-gray-500);
  flex-wrap: wrap;
}

.tg-entry__featured-img {
  margin-bottom: 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tg-entry__featured-img img { width: 100%; }

.tg-entry__content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-gray-800);
}

.tg-entry__content h2,
.tg-entry__content h3,
.tg-entry__content h4 {
  font-weight: 700;
  color: var(--color-black);
  letter-spacing: -0.02em;
  margin: 2rem 0 0.875rem;
}

.tg-entry__content h2 { font-size: 1.5rem; }
.tg-entry__content h3 { font-size: 1.25rem; }
.tg-entry__content h4 { font-size: 1.0625rem; }

.tg-entry__content p { margin-bottom: 1.25rem; }

.tg-entry__content ul,
.tg-entry__content ol {
  margin: 0 0 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tg-entry__content ul { list-style: disc; }
.tg-entry__content ol { list-style: decimal; }

.tg-entry__content a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.tg-entry__content a:hover { color: var(--color-primary-dark); }

.tg-entry__content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-gray-700);
}

.tg-entry__content code {
  background: var(--color-gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: var(--color-primary-dark);
}

.tg-entry__content pre {
  background: var(--color-gray-900);
  color: var(--color-gray-100);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.tg-entry__content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.tg-entry__content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.tg-entry__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.tg-entry__content th {
  background: var(--color-gray-100);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--color-gray-200);
}

.tg-entry__content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

/* =============================================
   SIDEBAR
   ============================================= */
.tg-sidebar { display: flex; flex-direction: column; gap: 2rem; }

.tg-widget {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.tg-widget__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

/* =============================================
   404 PAGE
   ============================================= */
.tg-404 {
  padding: 6rem 0;
  text-align: center;
}

.tg-404__code {
  font-size: 7rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

.tg-404__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 0.75rem;
}

.tg-404__desc {
  font-size: 1rem;
  color: var(--color-gray-600);
  margin-bottom: 2rem;
}

/* =============================================
   SEARCH
   ============================================= */
.tg-search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
  margin-inline: auto;
}

.tg-search-form__input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  font-size: 1rem;
  color: var(--color-gray-900);
  outline: none;
  transition: border-color var(--transition);
}

.tg-search-form__input:focus { border-color: var(--color-primary); }

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.tg-layout--sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.tg-page-header {
  background: var(--color-primary-bg);
  padding: 3rem 0;
  margin-bottom: 3rem;
}

.tg-page-header__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--color-black);
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.tg-page-header__desc {
  font-size: 1rem;
  color: var(--color-gray-600);
}

/* =============================================
   TOOLS DIRECTORY PAGE (page-tools.php)
   ============================================= */

/* Hero */
.tg-tools-hero {
  background: var(--color-primary-light);
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.tg-tools-hero .tg-breadcrumb--inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 1.25rem;
}

.tg-tools-hero .tg-breadcrumb--inline .tg-breadcrumb__link {
  color: var(--color-gray-600);
  text-decoration: none;
}

.tg-tools-hero .tg-breadcrumb--inline .tg-breadcrumb__link:hover {
  color: var(--color-primary);
}

.tg-tools-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 0.75rem;
}

.tg-tools-hero__subtitle {
  font-size: 1.0625rem;
  color: var(--color-gray-600);
  max-width: 580px;
  margin: 0 auto 2rem;
}

/* Search bar */
.tg-tools-search {
  max-width: 560px;
  margin: 0 auto;
}

.tg-tools-search__wrap {
  position: relative;
}

.tg-tools-search__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.tg-tools-search__input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  font-size: 1rem;
  font-family: var(--font-family);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-gray-900);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.tg-tools-search__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

/* Category tabs */
.tg-tools-tabs-wrap {
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tg-tools-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tg-tools-tabs::-webkit-scrollbar { display: none; }

.tg-tools-tab {
  flex-shrink: 0;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.tg-tools-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-white);
}

.tg-tools-tab.is-active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Tool sections */
.tg-tools-sections {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.tg-tools-section {
  margin-bottom: 3rem;
}

.tg-tools-section.is-hidden {
  display: none;
}

.tg-tools-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tg-tools-section__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.tg-tools-section__see-all {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.tg-tools-section__see-all:hover {
  text-decoration: underline;
}

.tg-tools-section__empty {
  color: var(--color-gray-600);
  font-size: 0.9375rem;
}

/* Featured tool cards grid */
.tg-tools-grid--featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
}

/* Featured card */
.tg-tool-card--featured {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
}

.tg-tool-card--featured:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.tg-tool-card--featured .tg-tool-card__badge--green {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #D1FAE5;
  color: #065F46;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

.tg-tool-card__svg {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.tg-tool-card__svg svg {
  width: 100%;
  height: 100%;
}

.tg-tool-card--featured .tg-tool-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.tg-tool-card--featured .tg-tool-card__desc {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tg-tool-card__cta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.tg-tool-card__cta:hover { text-decoration: underline; }

/* Other tools compact list */
.tg-tools-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin-top: 0.75rem;
}

.tg-tools-list__link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
  color: var(--color-gray-700);
  text-decoration: none;
  transition: color var(--transition);
}

.tg-tools-list__link:hover { color: var(--color-primary); }

.tg-tools-list__arrow {
  color: var(--color-primary);
  font-size: 0.9rem;
}

/* Ad mid */
.tg-ad-mid {
  margin: 2rem 0;
}

/* Search results */
.tg-search-results {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

.tg-search-results__count {
  font-size: 0.9375rem;
  color: var(--color-gray-600);
  margin-bottom: 1.25rem;
}

.tg-search-results__empty {
  color: var(--color-gray-600);
  font-size: 1rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .tg-footer__grid { grid-template-columns: 1fr 1fr; }
  .tg-layout--sidebar { grid-template-columns: 1fr; }
  .tg-tools-grid--featured { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --container-padding: 1rem; }

  .tg-header__nav,
  .tg-header__cta-btn { display: none; }
  .tg-header__hamburger { display: flex; }

  .tg-hero { padding: 3rem 0 2.5rem; }
  .tg-section { padding: 2.5rem 0; }

  .tg-footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .tg-footer__bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .tg-tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tg-posts-grid { grid-template-columns: 1fr; }

  .tg-hiw-steps {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .tg-hiw-steps::before { display: none; }

  .tg-hiw-step__number {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .tg-footer__grid { grid-template-columns: 1fr; }
  .tg-hero__actions { flex-direction: column; }
  .tg-hero__stats { gap: 1.5rem; }
  .tg-tools-grid--featured { grid-template-columns: 1fr; }
  .tg-tools-list { grid-template-columns: 1fr; }
}

/* =============================================
   PHASE 9 — SEO / AEO Styles
   ============================================= */

/* Definition Box (AEO) — heading matches the previous inline <strong> */
.tg-definition-box {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.6;
}
.tg-definition-box h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 8px;
}
.tg-definition-box p { margin: 0 0 8px; }
.tg-definition-box p:last-child { margin-bottom: 0; }

/* Why Use + Benefits sections */
.tg-why-use ul,
.tg-benefits-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.tg-why-use ul li,
.tg-benefits-list li {
  padding: 6px 0;
  font-size: 15px;
  line-height: 1.5;
}

/* Category link after content */
.tg-category-link {
  margin-top: 1.5rem;
  padding: 12px 16px;
  background: var(--color-bg-alt, #f8f8f8);
  border-radius: 8px;
  font-size: 15px;
}
.tg-category-link p { margin: 0; }

/* Trust Signals Footer Bar */
.tg-trust-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1.5rem;
  font-size: 13px;
  color: var(--color-text-muted, #aaa);
}

/* SEO Content Section (F1) */
.tg-seo-content {
  background: var(--color-bg-alt, #f8f9fa);
  padding: 4rem 0;
}
.tg-seo-content__inner {
  max-width: 880px;
  margin: 0 auto;
}
.tg-seo-content h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  color: var(--color-text, #0F0F0F);
}
.tg-seo-content h3 {
  font-size: 1.15rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text, #0F0F0F);
}
.tg-seo-content p {
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--color-text-muted, #4B5563);
}
.tg-seo-content ul { margin: 0.5rem 0 1rem 1.25rem; }
.tg-seo-content ul li { margin-bottom: 0.35rem; }

/* Category cards inside the SEO section */
.tg-seo-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 1.25rem 0 0.5rem;
}
.tg-seo-cat-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  background: var(--bg-card, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tg-seo-cat-card:hover {
  border-color: var(--color-primary, #F97316);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}
.tg-seo-cat-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light, #FFF7ED);
  color: var(--color-primary, #F97316);
}
.tg-seo-cat-card__name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--color-text, #0F0F0F);
}
.tg-seo-cat-card__desc {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-muted, #6B7280);
}

[data-theme="dark"] .tg-seo-cat-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .tg-seo-cat-card:hover {
  border-color: var(--color-primary, #F97316);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .tg-seo-cat-card__icon {
  background: rgba(249, 115, 22, 0.15);
}

/* CTA bar at the end of the category SEO section */
.tg-category-cta-bar {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--color-primary-light, #fff7ed);
  border-radius: 12px;
}
.tg-category-cta-bar p {
  margin: 0 0 0.5rem;
}
.tg-category-cta-bar p:last-child {
  margin-bottom: 0;
}

[data-theme="dark"] .tg-category-cta-bar {
  background: rgba(249, 115, 22, 0.12);
}

/* Blog Card Grid */
.tg-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.tg-blog-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tg-blog-card__img-wrap { display: block; overflow: hidden; max-height: 200px; }
.tg-blog-card__img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.3s; }
.tg-blog-card:hover .tg-blog-card__img { transform: scale(1.04); }
.tg-blog-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.tg-blog-card__cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary, #F97316); font-weight: 600; margin-bottom: 0.5rem; display: block; }
.tg-blog-card__title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.75rem; line-height: 1.35; }
.tg-blog-card__title a { color: inherit; text-decoration: none; }
.tg-blog-card__title a:hover { color: var(--color-primary, #F97316); }
.tg-blog-card__excerpt { font-size: 14px; color: #666; line-height: 1.5; flex: 1; margin-bottom: 1rem; }
.tg-blog-card__meta { font-size: 12px; color: #999; display: flex; gap: 1rem; margin-bottom: 1rem; }

/* Archive Header */
.tg-archive-header { margin-bottom: 2rem; }
.tg-archive-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.tg-archive-desc { font-size: 1rem; color: #666; }

/* Sitemap Page */
.tg-sitemap-section { margin-bottom: 2.5rem; }
.tg-sitemap-section h2 { font-size: 1.25rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--color-primary, #F97316); padding-bottom: 0.5rem; }
.tg-sitemap-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.4rem 1rem; }
.tg-sitemap-list li { font-size: 14px; }
.tg-sitemap-list a { color: var(--color-primary, #F97316); text-decoration: none; }
.tg-sitemap-list a:hover { text-decoration: underline; }

/* 404 Page Improvements */
.tg-404__search { max-width: 480px; margin: 1.5rem auto; }
.tg-404__categories { margin-top: 2rem; }
.tg-404__cat-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
.tg-404__popular { margin-top: 2rem; }
.tg-404__tool-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.tg-404__tool-list a { color: var(--color-primary, #F97316); text-decoration: none; font-size: 14px; }
.tg-404__tool-list a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .tg-blog-grid { grid-template-columns: 1fr; }
  .tg-trust-signals { font-size: 12px; gap: 0.75rem 1rem; }
  .tg-sitemap-list { grid-template-columns: 1fr; }
}

/* =============================================
   ABOUT PAGE (FIX 8)
   ============================================= */
.tg-about-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px;
}
.tg-about-hero {
  text-align: center;
  margin-bottom: 48px;
}
.tg-about-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}
.tg-about-lead {
  font-size: 18px;
  line-height: 1.7;
  color: #555;
  max-width: 640px;
  margin: 0 auto;
}
.tg-about-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 32px 0;
}
.tg-about-stat {
  text-align: center;
  background: rgba(249,115,22,0.08);
  border-radius: 12px;
  padding: 20px 28px;
  min-width: 120px;
}
.tg-about-stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #F97316;
}
.tg-about-stat span {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  display: block;
}
.tg-about-page h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(249,115,22,0.2);
}
.tg-about-page ul {
  padding-left: 20px;
  line-height: 1.8;
}
.tg-about-contact {
  background: rgba(249,115,22,0.06);
  border-radius: 16px;
  padding: 32px;
  margin-top: 48px;
  text-align: center;
}

/* =============================================
   CONTACT PAGE (FIX 9)
   ============================================= */
.tg-contact-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}
.tg-contact-hero {
  text-align: center;
  margin-bottom: 40px;
}
.tg-contact-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.tg-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 768px) {
  .tg-contact-grid { grid-template-columns: 1fr; }
}
.tg-form-group { margin-bottom: 20px; }
.tg-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
.tg-form-group input,
.tg-form-group select,
.tg-form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.tg-form-group input:focus,
.tg-form-group select:focus,
.tg-form-group textarea:focus {
  outline: none;
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.tg-contact-info-card {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 24px;
  margin-top: 16px;
}
.tg-contact-info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.tg-contact-info-item:last-child { margin-bottom: 0; }
.tg-contact-icon { font-size: 24px; flex-shrink: 0; }
.tg-contact-info-item strong {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 2px;
}
.tg-contact-info-item p { margin: 0; font-weight: 500; }
.tg-contact-topics { list-style: none; padding: 0; margin: 0; }
.tg-contact-topics li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
  line-height: 1.5;
}
.tg-contact-topics li:last-child { border-bottom: none; }

/* =============================================
   LEGAL PAGES (FIX 10)
   ============================================= */
.tg-legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.8;
}
.tg-legal-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.tg-legal-updated {
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}
.tg-legal-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: #0F0F0F;
}
.tg-legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: #333;
}
.tg-legal-page ul { padding-left: 20px; margin: 8px 0; }
.tg-legal-page li { margin-bottom: 6px; }
.tg-legal-page a { color: #F97316; text-decoration: underline; }

/* =============================================
   UI/UX OVERHAUL — All 11 Fixes
   ============================================= */

/* FIX 1 — HEADER NAV SPACING */
.tg-nav__list {
  gap: 8px;
}

.tg-nav__link {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.tg-nav__link:hover,
.tg-nav__link.current-menu-item,
.tg-nav__link[aria-current="page"] {
  color: #F97316;
  background: rgba(249,115,22,0.08);
}

.tg-header__cta-btn {
  background: #F97316;
  color: white !important;
  padding: 10px 22px !important;
  border-radius: 50px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
  transition: all 0.2s ease !important;
}

.tg-header__cta-btn:hover {
  background: #ea6c0a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(249,115,22,0.4) !important;
  color: white !important;
}

/* Theme toggle in header */
.tg-header__inner {
  gap: 1rem;
}

/* FIX 2 — CTA HOVER EFFECTS */
.tg-btn,
.tg-btn--primary,
.tg-btn--secondary,
.tg-btn--outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.tg-btn--primary {
  background: #F97316;
  color: white;
  box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}

.tg-btn--primary:hover {
  background: #ea6c0a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.4);
  color: white;
}

.tg-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}

.tg-btn--outline {
  background: transparent;
  color: #F97316;
  border: 2px solid #F97316;
}

.tg-btn--outline:hover {
  background: #F97316;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.3);
}

/* Action button inside tool box */
.tg-action-btn {
  width: 100%;
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F97316 0%, #f85c00 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(249,115,22,0.3);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.tg-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(249,115,22,0.45);
  background: linear-gradient(135deg, #f85c00 0%, #e55300 100%);
}

.tg-action-btn:active {
  transform: translateY(1px);
}

.tg-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.tg-action-btn:hover::before {
  left: 100%;
}

/* FIX 6 — STYLISH FAQ ACCORDION */
.tg-faq-section {
  margin-top: 48px;
}

.tg-faq-section > h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  position: relative;
  padding-left: 16px;
}

.tg-faq-section > h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: #F97316;
  border-radius: 4px;
}

.tg-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: none;
  background: transparent;
}

.tg-faq-item {
  background: var(--bg-card, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.tg-faq-item:hover {
  border-color: rgba(249,115,22,0.3);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}

.tg-faq-item[open] {
  border-color: rgba(249,115,22,0.4);
  box-shadow: 0 4px 20px rgba(249,115,22,0.12);
}

.tg-faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 20px 24px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #0F0F0F);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  font-family: inherit;
  list-style: none;
  user-select: none;
}

.tg-faq-question::marker { content: none; }
.tg-faq-question::-webkit-details-marker { display: none; }

.tg-faq-item[open] .tg-faq-question {
  color: #F97316;
}

.tg-faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-primary, #F97316);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F97316' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tg-faq-item[open] .tg-faq-chevron {
  transform: rotate(180deg);
}

.tg-faq-answer {
  padding: 0 24px 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-muted, #6B7280);
}

.tg-faq-answer p { margin: 0; }

.tg-faq-item[open] .tg-faq-answer {
  animation: tg-faq-fade .25s ease;
}

@keyframes tg-faq-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* FAQ answers are always present AND always visible. They used to sit in
   a <details>, which reads as "collapsed" — an answer a reader (or an
   answer engine) has to click for is worth less than one that is simply
   on the page. The card styling above is reused as-is; only the bits that
   assumed a clickable <summary> are unwound here. */
.tg-faq-list .tg-faq-question {
  display: block;
  margin: 0;
  cursor: default;
  user-select: text;
}

/* Last-updated line under the H1. */
.tg-tool-updated {
  margin: 0.25rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6B7280);
}
[data-theme="dark"] .tg-tool-updated { color: #A0A0A0; }

/* Long-form part of the tool intro — real headings and paragraphs, not
   one runaway <p>. */
.tg-tool-longform > h2 { margin-top: 1.5rem; }
.tg-tool-longform > h3 { margin-top: 1.25rem; }
.tg-tool-longform > p,
.tg-tool-longform > ul,
.tg-tool-longform > ol { line-height: 1.75; }

/* FIX 7 — BLOG SIDEBAR */
.tg-blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
}

.tg-sidebar-widget {
  background: var(--bg-card, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.tg-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #6B7280);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.1));
}

.tg-sidebar-tools-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tg-sidebar-tool-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  color: var(--color-text, #0F0F0F);
}

.tg-sidebar-tool-item a:hover {
  background: rgba(249,115,22,0.1);
  color: #F97316;
}

.tg-sidebar-tool-name {
  font-size: 14px;
  font-weight: 500;
}

.tg-sidebar-tool-cat {
  font-size: 11px;
  color: var(--color-text-light, #9CA3AF);
  background: var(--bg-tertiary, #f0f2f5);
  padding: 2px 8px;
  border-radius: 20px;
}

.tg-sidebar-view-all {
  display: block;
  text-align: center;
  color: #F97316;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed rgba(249,115,22,0.3);
  transition: all 0.2s;
}

.tg-sidebar-view-all:hover {
  background: rgba(249,115,22,0.1);
}

.tg-sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text, #0F0F0F);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.tg-sidebar-cat-link:hover {
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.2);
  color: #F97316;
}

.tg-sidebar-cat-icon { font-size: 18px; flex-shrink: 0; }

.tg-sidebar-cat-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.tg-sidebar-cat-count {
  font-size: 12px;
  background: var(--bg-tertiary, #f0f2f5);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--color-text-muted, #6B7280);
  font-weight: 600;
}

.tg-sidebar-posts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tg-sidebar-post-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tg-sidebar-post-item a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #0F0F0F);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s;
}

.tg-sidebar-post-item a:hover { color: #F97316; }

.tg-sidebar-post-date {
  font-size: 12px;
  color: var(--color-text-light, #9CA3AF);
}

.tg-sidebar-cta {
  background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(249,115,22,0.05));
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.tg-sidebar-cta p {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #0F0F0F);
}

/* FIX 8 — TOOL CARD HOVER EFFECTS */
.tg-tool-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card, 0 2px 8px rgba(0,0,0,0.06));
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tg-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249,115,22,0) 0%, rgba(249,115,22,0.04) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
}

.tg-tool-card:hover::before { opacity: 1; }

.tg-tool-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F97316, #ff8c3a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tg-tool-card:hover::after { transform: scaleX(1); }

.tg-tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249,115,22,0.25);
  box-shadow: 0 12px 35px rgba(0,0,0,0.1), 0 4px 15px rgba(249,115,22,0.1);
}

.tg-tool-card__icon,
.tg-tool-card__svg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.tg-tool-card:hover .tg-tool-card__icon,
.tg-tool-card:hover .tg-tool-card__svg {
  transform: scale(1.1) rotate(-3deg);
}

.tg-tool-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text, #0F0F0F);
  transition: color 0.2s;
  line-height: 1.3;
}

.tg-tool-card:hover .tg-tool-card__title { color: #F97316; }

.tg-tool-card__desc {
  font-size: 14px;
  color: var(--color-text-muted, #6B7280);
  line-height: 1.65;
  flex: 1;
}

.tg-tool-card__cta {
  font-size: 13px;
  font-weight: 600;
  color: #F97316;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
  margin-top: auto;
}

.tg-tool-card:hover .tg-tool-card__cta { gap: 8px; }

.tg-tool-card__badge,
.tg-free-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* FIX 9 — TINYWOW-STYLE CATEGORY FILTER */
.tg-category-filter-bar {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 20px;
  padding: 8px;
  margin: 32px 0;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
}

.tg-filter-scroll-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tg-filter-scroll-wrapper::-webkit-scrollbar { display: none; }

.tg-filter-pills {
  display: flex;
  gap: 6px;
  padding: 2px;
  min-width: max-content;
}

.tg-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6B7280);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: inherit;
}

.tg-filter-pill:hover {
  background: var(--bg-card, #fff);
  color: var(--color-text, #0F0F0F);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.tg-filter-pill.active {
  background: #F97316;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(249,115,22,0.35);
  transform: scale(1.02);
}

.tg-filter-pill.active:hover {
  background: #ea6c0a;
  box-shadow: 0 6px 20px rgba(249,115,22,0.45);
}

.tg-pill-icon { font-size: 16px; line-height: 1; }

.tg-pill-count {
  background: rgba(255,255,255,0.2);
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.tg-filter-pill:not(.active) .tg-pill-count {
  background: var(--bg-tertiary, #f0f2f5);
  color: var(--color-text-light, #9CA3AF);
}

/* FIX 10 — SEARCH FIELD REDESIGN */
.tg-search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.tg-search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card, #fff);
  border: 2px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 50px;
  padding: 4px 4px 4px 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}

.tg-search-wrapper:focus-within {
  border-color: #F97316;
  box-shadow: 0 0 0 4px rgba(249,115,22,0.12), 0 8px 30px rgba(0,0,0,0.12);
  transform: scale(1.01);
}

.tg-search-icon {
  color: var(--color-text-light, #9CA3AF);
  flex-shrink: 0;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.tg-search-wrapper:focus-within .tg-search-icon { color: #F97316; }

.tg-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none;
  padding: 12px 16px !important;
  font-size: 16px !important;
  color: var(--color-text, #0F0F0F) !important;
  font-family: inherit;
  min-width: 0;
}

.tg-search-input::placeholder { color: var(--color-text-light, #9CA3AF); }

.tg-search-kbd { flex-shrink: 0; margin-right: 8px; }

.tg-search-kbd kbd {
  background: var(--bg-tertiary, #f0f2f5);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--color-text-muted, #6B7280);
  font-family: inherit;
}

.tg-search-wrapper:focus-within .tg-search-kbd { display: none; }

.tg-search-clear {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary, #f0f2f5);
  color: var(--color-text-muted, #6B7280);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-right: 4px;
  font-family: inherit;
}

.tg-search-clear:hover {
  background: rgba(249,115,22,0.1);
  color: #F97316;
}

.tg-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 100;
}

.tg-search-suggestions-inner { padding: 16px; }

.tg-search-hint {
  font-size: 12px;
  color: var(--color-text-light, #9CA3AF);
  margin: 0 0 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tg-search-quick-links { display: flex; gap: 8px; flex-wrap: wrap; }

.tg-search-quick {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  background: var(--bg-secondary, #f8f9fa);
  color: var(--color-text, #0F0F0F);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tg-search-quick:hover {
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.3);
  color: #F97316;
}

/* Responsive */
@media (max-width: 768px) {
  .tg-filter-pills { gap: 4px; }
  .tg-filter-pill { padding: 8px 14px; font-size: 13px; }
  .tg-search-kbd { display: none; }
}

/* ===================================
   DARK THEME NUCLEAR OVERRIDE
   These rules override ALL hardcoded
   colors. Added at bottom for priority.
   =================================== */

/* TOOL CARDS */
[data-theme="dark"] .tg-tool-card,
[data-theme="dark"] [class*="tool-card"],
[data-theme="dark"] .tg-card {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.1) !important;
}

[data-theme="dark"] .tg-tool-card *,
[data-theme="dark"] [class*="tool-card"] *,
[data-theme="dark"] .tg-card * {
  color: #F0F0F0 !important;
}

/* Tool card specific elements */
[data-theme="dark"] .tg-tool-card-title,
[data-theme="dark"] .tg-tool-card h3,
[data-theme="dark"] .tg-tool-card h2,
[data-theme="dark"] .tg-card-title {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-tool-card-desc,
[data-theme="dark"] .tg-tool-card p,
[data-theme="dark"] .tg-card-desc {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-tool-card-cta,
[data-theme="dark"] .tg-card-cta,
[data-theme="dark"] .tg-tool-card a {
  color: #F97316 !important;
}

/* FREE badge */
[data-theme="dark"] .tg-free-badge {
  background: #166534 !important;
  color: #86efac !important;
}

/* ===================================
   SECTION HEADINGS
   =================================== */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #FFFFFF !important;
}

/* Category section titles */
[data-theme="dark"] .tg-tools-section h2,
[data-theme="dark"] .tg-category-title,
[data-theme="dark"] [class*="section"] h2,
[data-theme="dark"] [class*="section"] h3 {
  color: #FFFFFF !important;
}

/* "See all X tools" links */
[data-theme="dark"] [class*="see-all"],
[data-theme="dark"] [class*="view-all"] {
  color: #F97316 !important;
}

/* ===================================
   TOOL BOX AND UPLOAD ZONE
   =================================== */
[data-theme="dark"] .tg-tool-box,
[data-theme="dark"] [class*="tool-box"],
[data-theme="dark"] .tg-tool-container {
  background: #1e1e1e !important;
  border-color: rgba(249,115,22,0.2) !important;
}

[data-theme="dark"] .tg-upload-zone,
[data-theme="dark"] [class*="drop-zone"],
[data-theme="dark"] [class*="upload-area"],
[data-theme="dark"] [class*="upload-zone"] {
  background: rgba(249,115,22,0.05) !important;
  border-color: rgba(249,115,22,0.25) !important;
}

[data-theme="dark"] .tg-upload-zone p,
[data-theme="dark"] .tg-upload-zone span,
[data-theme="dark"] .tg-upload-zone svg,
[data-theme="dark"] [class*="upload-zone"] p,
[data-theme="dark"] [class*="upload-zone"] span,
[data-theme="dark"] [class*="drop-zone"] p,
[data-theme="dark"] [class*="drop-zone"] span {
  color: #A0A0A0 !important;
}

/* Upload icon/SVG */
[data-theme="dark"] .tg-upload-zone svg *,
[data-theme="dark"] [class*="upload"] svg * {
  stroke: #A0A0A0 !important;
  fill: none !important;
}

/* ===================================
   ACTION BUTTON (Merge PDFs, etc)
   =================================== */
[data-theme="dark"] .tg-action-btn,
[data-theme="dark"] button[class*="action"],
[data-theme="dark"] .tg-tool-box button:not([class*="faq"]):not([class*="filter"]) {
  background: #F97316 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

[data-theme="dark"] .tg-action-btn:disabled,
[data-theme="dark"] .tg-action-btn[disabled] {
  background: #3a3a3a !important;
  color: #666666 !important;
}

/* ===================================
   FAQ ACCORDION — COMPLETE FIX
   =================================== */
[data-theme="dark"] .tg-faq-list .tg-faq-question {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-faq-accordion {
  background: transparent !important;
  border: none !important;
}

[data-theme="dark"] .tg-faq-item {
  background: #1e1e1e !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 14px !important;
}

[data-theme="dark"] .tg-faq-question {
  background: transparent !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-faq-item[open] .tg-faq-question {
  color: #F97316 !important;
}

[data-theme="dark"] .tg-faq-answer {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-faq-answer p,
[data-theme="dark"] .tg-faq-answer li,
[data-theme="dark"] .tg-faq-answer span {
  color: #A0A0A0 !important;
}

/* ===================================
   RELATED TOOLS CARDS
   =================================== */
[data-theme="dark"] .tg-related-card,
[data-theme="dark"] [class*="related-card"],
[data-theme="dark"] .tg-related-tools a,
[data-theme="dark"] .tg-related-grid a {
  background: #1e1e1e !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
}

[data-theme="dark"] .tg-related-card *,
[data-theme="dark"] [class*="related-card"] *,
[data-theme="dark"] .tg-related-grid a * {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-related-title,
[data-theme="dark"] .tg-related-card span {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-related-link {
  color: #F97316 !important;
}

/* ===================================
   SIDEBAR WIDGETS
   =================================== */
[data-theme="dark"] .tg-sidebar-widget {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-sidebar-widget h2,
[data-theme="dark"] .tg-sidebar-widget h3,
[data-theme="dark"] .tg-sidebar-title,
[data-theme="dark"] [class*="sidebar"] h2,
[data-theme="dark"] [class*="sidebar"] h3 {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-sidebar-tool-item a,
[data-theme="dark"] .tg-sidebar-tools-list a {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-sidebar-tool-item a:hover {
  color: #F97316 !important;
  background: rgba(249,115,22,0.1) !important;
}

[data-theme="dark"] .tg-sidebar-tool-cat {
  background: #2a2a2a !important;
  color: #707070 !important;
}

[data-theme="dark"] .tg-sidebar-cat-link {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-sidebar-cat-name {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-sidebar-cat-count {
  background: #2a2a2a !important;
  color: #707070 !important;
}

[data-theme="dark"] .tg-sidebar-post-item a {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-sidebar-post-date {
  color: #707070 !important;
}

[data-theme="dark"] .tg-sidebar-view-all {
  color: #F97316 !important;
  border-color: rgba(249,115,22,0.3) !important;
}

/* ===================================
   CATEGORY FILTER PILLS
   =================================== */
[data-theme="dark"] .tg-category-filter-bar {
  background: #1a1a1a !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-filter-pill {
  color: #A0A0A0 !important;
  background: transparent !important;
}

[data-theme="dark"] .tg-filter-pill:hover {
  background: #2a2a2a !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-filter-pill.active {
  background: #F97316 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .tg-pill-count {
  background: rgba(255,255,255,0.1) !important;
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-filter-pill.active .tg-pill-count {
  background: rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
}

/* ===================================
   BREADCRUMB
   =================================== */
[data-theme="dark"] .tg-breadcrumb,
[data-theme="dark"] [class*="breadcrumb"] {
  background: transparent !important;
}

[data-theme="dark"] .tg-breadcrumb a,
[data-theme="dark"] [class*="breadcrumb"] a {
  color: #707070 !important;
}

[data-theme="dark"] .tg-breadcrumb a:hover {
  color: #F97316 !important;
}

[data-theme="dark"] .tg-breadcrumb span,
[data-theme="dark"] [class*="breadcrumb"] span {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-breadcrumb span:last-child,
[data-theme="dark"] [class*="breadcrumb"] > *:last-child {
  color: #F0F0F0 !important;
}

/* ===================================
   BLOG CARDS
   =================================== */
[data-theme="dark"] .tg-blog-card,
[data-theme="dark"] [class*="blog-card"] {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-blog-card h2,
[data-theme="dark"] .tg-blog-card h3,
[data-theme="dark"] .tg-blog-card-title {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-blog-card p,
[data-theme="dark"] .tg-blog-card-excerpt {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-blog-card-meta,
[data-theme="dark"] .tg-blog-card-date,
[data-theme="dark"] .tg-blog-card time {
  color: #707070 !important;
}

[data-theme="dark"] .tg-blog-card-cat {
  color: #F97316 !important;
}

[data-theme="dark"] .tg-blog-card .tg-btn-outline,
[data-theme="dark"] .tg-blog-card a[class*="btn"] {
  color: #F97316 !important;
  border-color: #F97316 !important;
  background: transparent !important;
}

/* ===================================
   TOOL PAGE SPECIFIC SECTIONS
   =================================== */
[data-theme="dark"] .tg-why-use,
[data-theme="dark"] [class*="why-use"] {
  background: #1a1a1a !important;
  border-radius: 12px !important;
}

[data-theme="dark"] .tg-why-use *,
[data-theme="dark"] [class*="why-use"] * {
  color: #D0D0D0 !important;
}

[data-theme="dark"] .tg-why-use h2,
[data-theme="dark"] [class*="why-use"] h2 {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-benefits,
[data-theme="dark"] [class*="benefits"] {
  background: transparent !important;
}

[data-theme="dark"] .tg-benefits-list li,
[data-theme="dark"] [class*="benefits"] li {
  color: #D0D0D0 !important;
}

[data-theme="dark"] .tg-how-to-use,
[data-theme="dark"] [class*="how-to"] {
  background: transparent !important;
}

[data-theme="dark"] .tg-how-to-use h2 {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-step-item,
[data-theme="dark"] [class*="step-item"] {
  color: #D0D0D0 !important;
}

[data-theme="dark"] .tg-step-item strong,
[data-theme="dark"] [class*="step-item"] strong {
  color: #FFFFFF !important;
}

/* ===================================
   SEARCH BOX
   =================================== */
[data-theme="dark"] .tg-search-wrapper {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.15) !important;
}

[data-theme="dark"] .tg-search-input,
[data-theme="dark"] .tg-search-wrapper input {
  background: transparent !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-search-input::placeholder {
  color: #707070 !important;
}

[data-theme="dark"] .tg-search-icon,
[data-theme="dark"] .tg-search-wrapper svg {
  color: #707070 !important;
}

[data-theme="dark"] .tg-search-kbd kbd {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #707070 !important;
}

[data-theme="dark"] .tg-search-suggestions {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.1) !important;
}

[data-theme="dark"] .tg-search-hint {
  color: #707070 !important;
}

[data-theme="dark"] .tg-search-quick {
  background: #2a2a2a !important;
  color: #F0F0F0 !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* ===================================
   TOOLS PAGE HEADER SECTION
   =================================== */
[data-theme="dark"] .tg-tools-page-header,
[data-theme="dark"] [class*="page-header"] {
  background: #1a1a1a !important;
}

[data-theme="dark"] .tg-tools-page-header h1,
[data-theme="dark"] [class*="page-header"] h1 {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-tools-page-header p,
[data-theme="dark"] [class*="page-header"] p {
  color: #A0A0A0 !important;
}

/* ===================================
   HERO SECTION STATS
   =================================== */
[data-theme="dark"] .tg-stats-bar,
[data-theme="dark"] [class*="stats-bar"] {
  background: #1a1a1a !important;
}

[data-theme="dark"] .tg-stat strong,
[data-theme="dark"] .tg-stat-number {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-stat span,
[data-theme="dark"] .tg-stat-label {
  color: #A0A0A0 !important;
}

/* ===================================
   ALL GENERIC TEXT ELEMENTS
   =================================== */
[data-theme="dark"] p {
  color: #C0C0C0 !important;
}

[data-theme="dark"] li {
  color: #C0C0C0 !important;
}

[data-theme="dark"] span:not([class*="badge"]):not([class*="btn"]):not([class*="tag"]):not([class*="icon"]) {
  color: inherit;
}

/* ===================================
   PENCIL/GENERIC ICONS IN DARK MODE
   =================================== */
[data-theme="dark"] .tg-related-tools .tg-tool-icon,
[data-theme="dark"] [class*="tool-icon"] {
  opacity: 1 !important;
  filter: brightness(1.2) !important;
}

/* ===================================
   CATEGORY PAGE HEADER
   =================================== */
[data-theme="dark"] .tg-category-page-header,
[data-theme="dark"] .taxonomy-tool_category .tg-page-hero {
  background: #1a1a1a !important;
}

[data-theme="dark"] .tg-category-page-header h1,
[data-theme="dark"] .tg-category-page-header p {
  color: inherit !important;
}

/* ===================================
   FORMS ON ALL PAGES
   =================================== */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #606060 !important;
}

[data-theme="dark"] label {
  color: #D0D0D0 !important;
}

[data-theme="dark"] input[type="range"] {
  background: #3a3a3a !important;
}

[data-theme="dark"] input[type="color"] {
  border-color: rgba(255,255,255,0.2) !important;
}

/* ===================================
   TAGS — category labels on blog
   =================================== */
[data-theme="dark"] .tg-blog-card-cat,
[data-theme="dark"] [class*="cat-badge"],
[data-theme="dark"] [class*="post-cat"],
[data-theme="dark"] .tg-cat-label {
  background: rgba(249,115,22,0.15) !important;
  color: #F97316 !important;
}

/* ===================================
   TRUST SIGNALS BAR (footer top)
   =================================== */
[data-theme="dark"] .tg-trust-signals {
  background: #1a1a1a !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

[data-theme="dark"] .tg-trust-signals span {
  color: #A0A0A0 !important;
}

/* ===================================
   ABOUT PAGE DARK
   =================================== */
[data-theme="dark"] .tg-about-page {
  color: #C0C0C0 !important;
}

[data-theme="dark"] .tg-about-stat {
  background: rgba(249,115,22,0.1) !important;
}

[data-theme="dark"] .tg-about-stat strong {
  color: #F97316 !important;
}

[data-theme="dark"] .tg-about-stat span {
  color: #A0A0A0 !important;
}

[data-theme="dark"] .tg-about-page h2 {
  color: #FFFFFF !important;
  border-color: rgba(249,115,22,0.2) !important;
}

[data-theme="dark"] .tg-about-contact {
  background: rgba(249,115,22,0.08) !important;
  border: 1px solid rgba(249,115,22,0.2) !important;
}

/* ===================================
   CONTACT PAGE DARK
   =================================== */
[data-theme="dark"] .tg-contact-info-card {
  background: #222222 !important;
}

[data-theme="dark"] .tg-contact-info-item strong {
  color: #707070 !important;
}

[data-theme="dark"] .tg-contact-info-item p {
  color: #D0D0D0 !important;
}

[data-theme="dark"] .tg-contact-topics li {
  color: #C0C0C0 !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* ===================================
   LEGAL PAGES DARK
   =================================== */
[data-theme="dark"] .tg-legal-page p,
[data-theme="dark"] .tg-legal-page li {
  color: #C0C0C0 !important;
}

[data-theme="dark"] .tg-legal-page h1 {
  color: #FFFFFF !important;
}

[data-theme="dark"] .tg-legal-page h2 {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-legal-page h3 {
  color: #D0D0D0 !important;
}

[data-theme="dark"] .tg-legal-updated {
  color: #707070 !important;
}

/* ===================================
   FOOTER — ALWAYS DARK (both themes)
   =================================== */
.tg-footer,
footer,
[class*="footer"] {
  background: #0a0a0a !important;
}

.tg-footer h2,
.tg-footer h3,
.tg-footer h4,
footer h2,
footer h3,
footer h4 {
  color: #ffffff !important;
}

.tg-footer p,
.tg-footer li,
.tg-footer span,
footer p,
footer li,
footer span {
  color: rgba(255,255,255,0.6) !important;
}

.tg-footer a,
footer a {
  color: rgba(255,255,255,0.6) !important;
}

.tg-footer a:hover,
footer a:hover {
  color: #F97316 !important;
}

.tg-footer .tg-logo-text,
footer .tg-logo-text {
  color: #ffffff !important;
}

.tg-footer .tg-footer-tagline,
footer .tg-footer-tagline {
  color: #F97316 !important;
}

.tg-footer hr,
footer hr,
.tg-footer-divider {
  border-color: rgba(255,255,255,0.08) !important;
}

.tg-footer-bottom,
[class*="footer-bottom"] {
  color: rgba(255,255,255,0.4) !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
}

.tg-footer-bottom a,
[class*="footer-bottom"] a {
  color: #F97316 !important;
}

/* ===================================
   HEADER — BOTH THEMES EXPLICIT
   =================================== */

/* LIGHT theme header */
[data-theme="light"] .tg-header,
[data-theme="light"] header {
  background: rgba(255,255,255,0.97) !important;
}

[data-theme="light"] .tg-nav a,
[data-theme="light"] header nav a {
  color: #0F0F0F !important;
}

[data-theme="light"] .tg-logo-text {
  color: #0F0F0F !important;
}

/* DARK theme header */
[data-theme="dark"] .tg-header,
[data-theme="dark"] header {
  background: rgba(17,17,17,0.98) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-nav a,
[data-theme="dark"] header nav a {
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-nav a:hover,
[data-theme="dark"] header nav a:hover {
  color: #F97316 !important;
  background: rgba(249,115,22,0.1) !important;
}

[data-theme="dark"] .tg-logo-text {
  color: #F0F0F0 !important;
}

/* Theme toggle button */
[data-theme="dark"] .tg-theme-toggle {
  background: #2a2a2a !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-theme-toggle:hover {
  background: rgba(249,115,22,0.15) !important;
}

/* ===================================
   DARK THEME — FIX ALL GREY/BLACK TEXT
   =================================== */

[data-theme="dark"] *[style*="color: #4B5563"],
[data-theme="dark"] *[style*="color:#4B5563"],
[data-theme="dark"] *[style*="color: #4b5563"],
[data-theme="dark"] *[style*="color:#4b5563"] {
  color: #C0C0C0 !important;
}

[data-theme="dark"] *[style*="color: #1f2937"],
[data-theme="dark"] *[style*="color:#1f2937"],
[data-theme="dark"] *[style*="color: #374151"],
[data-theme="dark"] *[style*="color:#374151"],
[data-theme="dark"] *[style*="color: #111827"],
[data-theme="dark"] *[style*="color:#111827"],
[data-theme="dark"] *[style*="color: #000000"],
[data-theme="dark"] *[style*="color:#000000"],
[data-theme="dark"] *[style*="color: #000"],
[data-theme="dark"] *[style*="color:#000"],
[data-theme="dark"] *[style*="color: black"],
[data-theme="dark"] *[style*="color:black"],
[data-theme="dark"] *[style*="color: #0F0F0F"],
[data-theme="dark"] *[style*="color:#0F0F0F"],
[data-theme="dark"] *[style*="color: #0f0f0f"],
[data-theme="dark"] *[style*="color:#0f0f0f"],
[data-theme="dark"] *[style*="color: #111111"],
[data-theme="dark"] *[style*="color:#111111"],
[data-theme="dark"] *[style*="color: #222"],
[data-theme="dark"] *[style*="color:#222"],
[data-theme="dark"] *[style*="color: #333"],
[data-theme="dark"] *[style*="color:#333"],
[data-theme="dark"] *[style*="color: #444"],
[data-theme="dark"] *[style*="color:#444"],
[data-theme="dark"] *[style*="color: #555"],
[data-theme="dark"] *[style*="color:#555"],
[data-theme="dark"] *[style*="color: #222222"],
[data-theme="dark"] *[style*="color:#222222"],
[data-theme="dark"] *[style*="color: #333333"],
[data-theme="dark"] *[style*="color:#333333"],
[data-theme="dark"] *[style*="color: #444444"],
[data-theme="dark"] *[style*="color:#444444"],
[data-theme="dark"] *[style*="color: #555555"],
[data-theme="dark"] *[style*="color:#555555"] {
  color: #E0E0E0 !important;
}

[data-theme="dark"] *[style*="background: #fff"],
[data-theme="dark"] *[style*="background:#fff"],
[data-theme="dark"] *[style*="background: white"],
[data-theme="dark"] *[style*="background:white"],
[data-theme="dark"] *[style*="background-color: #fff"],
[data-theme="dark"] *[style*="background-color:#fff"],
[data-theme="dark"] *[style*="background-color: white"],
[data-theme="dark"] *[style*="background-color:white"],
[data-theme="dark"] *[style*="background: #ffffff"],
[data-theme="dark"] *[style*="background:#ffffff"],
[data-theme="dark"] *[style*="background-color: #ffffff"],
[data-theme="dark"] *[style*="background-color:#ffffff"],
[data-theme="dark"] *[style*="background: #f8f9fa"],
[data-theme="dark"] *[style*="background-color: #f8f9fa"],
[data-theme="dark"] *[style*="background: #f9fafb"],
[data-theme="dark"] *[style*="background-color: #f9fafb"] {
  background-color: #1e1e1e !important;
}

[data-theme="dark"] .tg-tool-card-desc,
[data-theme="dark"] .tg-tool-card p,
[data-theme="dark"] .tg-tool-card span,
[data-theme="dark"] .tg-card-desc,
[data-theme="dark"] .tg-blog-card p,
[data-theme="dark"] .tg-blog-card span,
[data-theme="dark"] [class*="excerpt"],
[data-theme="dark"] [class*="desc"],
[data-theme="dark"] [class*="description"],
[data-theme="dark"] [class*="content"] p,
[data-theme="dark"] [class*="content"] li,
[data-theme="dark"] [class*="content"] span,
[data-theme="dark"] .entry-content p,
[data-theme="dark"] .entry-content li,
[data-theme="dark"] .entry-content span {
  color: #C0C0C0 !important;
}

[data-theme="dark"] [class*="title"],
[data-theme="dark"] [class*="heading"],
[data-theme="dark"] [class*="name"] {
  color: #FFFFFF !important;
}

[data-theme="dark"] {
  --color-text: #F0F0F0;
  --color-text-muted: #C0C0C0;
  --color-text-light: #A0A0A0;
  --color-heading: #FFFFFF;
}

/* ================================
   COMMENTS
   ================================ */

.tg-comments {
  margin: 48px 0 32px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border, #E5E7EB);
}

.tg-comments__title,
.tg-comment-form__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 24px;
}

.tg-comments__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tg-comment {
  padding: 20px;
  background: var(--bg-card, #F9FAFB);
  border-radius: 12px;
  border: 1px solid var(--color-border, #E5E7EB);
}

.tg-comment__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tg-comment__img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.tg-comment__author {
  font-weight: 600;
  color: var(--color-heading);
  display: block;
}

.tg-comment__time {
  font-size: 13px;
  color: var(--color-text-muted, #6B7280);
}

.tg-comment__text p {
  color: var(--color-text);
  line-height: 1.7;
  margin: 0;
}

.tg-comment__reply a {
  font-size: 13px;
  color: #F97316;
  font-weight: 500;
  text-decoration: none;
}

/* Comment Form */
.tg-comment-form {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border, #E5E7EB);
}

.tg-comment-form__note {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.tg-comment-form__note span {
  color: #EF4444;
}

.tg-comment-form__row {
  margin-bottom: 16px;
}

.tg-comment-form__row label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 6px;
}

.tg-comment-form__row label span {
  color: #EF4444;
}

.tg-comment-form__input,
.tg-comment-form__textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border, #D1D5DB);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--bg-card, #FFFFFF);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.tg-comment-form__input:focus,
.tg-comment-form__textarea:focus {
  outline: none;
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.tg-comment-form__textarea {
  resize: vertical;
  min-height: 140px;
}

.tg-comment-form__submit {
  margin-top: 8px;
  padding: 12px 28px;
  background: #F97316;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tg-comment-form__submit:hover {
  background: #EA580C;
  transform: translateY(-1px);
}

[data-theme="dark"] .tg-comment {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-comment-form__input,
[data-theme="dark"] .tg-comment-form__textarea {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #F0F0F0 !important;
}

[data-theme="dark"] .tg-comment-form__row label {
  color: #D0D0D0 !important;
}

/* ================================
   MOBILE MENU ADDITIONS
   ================================ */

.tg-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
  flex-shrink: 0;
}

.tg-mobile-menu__search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 8px;
  padding: 10px 14px;
  background: var(--bg-surface, #F3F4F6);
  border-radius: 10px;
  border: 1px solid var(--color-border, #E5E7EB);
}

.tg-mobile-search-input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-text);
  width: 100%;
  outline: none;
}

.tg-mobile-search-input::placeholder {
  color: var(--color-text-muted);
}

.tg-mobile-nav__link {
  display: block;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.06));
  transition: color 0.15s;
}

.tg-mobile-nav__link:hover {
  color: #F97316;
}

.tg-mobile-nav__divider {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, #9CA3AF);
}

.tg-mobile-cat {
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.06));
}

.tg-mobile-cat__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
}

.tg-mobile-cat__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tg-mobile-cat__name {
  flex: 1;
}

.tg-mobile-cat__count {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--bg-surface, #F3F4F6);
  padding: 2px 7px;
  border-radius: 20px;
}

.tg-mobile-cat__arrow {
  transition: transform 0.2s;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.tg-mobile-cat__btn[aria-expanded="true"] .tg-mobile-cat__arrow {
  transform: rotate(180deg);
}

.tg-mobile-cat__tools {
  padding: 4px 0 12px 38px;
  display: flex;
  flex-direction: column;
}

.tg-mobile-cat__tool {
  padding: 7px 20px 7px 0;
  font-size: 14px;
  color: var(--color-text-muted, #6B7280);
  text-decoration: none;
  transition: color 0.15s;
}

.tg-mobile-cat__tool:hover {
  color: #F97316;
}

.tg-mobile-cat__viewall {
  margin-top: 6px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: #F97316;
  text-decoration: none;
}

.tg-mobile-menu__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border, rgba(0,0,0,0.08));
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  flex-shrink: 0;
}

.tg-mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .tg-header__inner {
    display: flex;
    align-items: center;
  }
  .tg-logo {
    flex: 1;
  }
  .tg-mobile-menu-btn {
    order: 2;
    margin-left: 0;
  }
}

.tg-hero__title {
    font-size: 60px;
    font-weight: 700;
    line-height: 1.2;
}

.flip-wrapper {
    display: inline-block;
    height: 70px;
    overflow: hidden;
    vertical-align: bottom;
}

.flip-text {
    display: flex;
    flex-direction: column;
    animation: flipWords 8s infinite;
}

.flip-text span {
    height: 70px;
    line-height: 70px;
    display: block;
    color: #fff;
    font-weight: bold;
	padding:0 10px;
}
.flip-text span:nth-child(1) {
    background: #E74C3C;
}
.flip-text span:nth-child(2) {
    background: #9B59B6;
}
.flip-text span:nth-child(3) {
    background: #27AE60;
}
.flip-text span:nth-child(4) {
    background: #27AE60;
}
@keyframes flipWords {
    0%,20% {
        transform: translateY(0);
    }

    25%,45% {
        transform: translateY(-70px);
    }

    50%,70% {
        transform: translateY(-140px);
    }

    75%,95% {
        transform: translateY(-210px);
    }

    100% {
        transform: translateY(0);
    }
}

.tg-header__nav .tg-nav__list {
    gap: 2.5vw;
}

.tg-entry {
	max-width: 100% !important;
}
textarea {
    resize: none !important;
}
.tg-comment__body .tg-footer, 
.tg-comment__body footer, 
.tg-comment__body [class*="footer"] {
    background: transparent !important;
}

.tg-comment__body .tg-footer a, 
.tg-comment__body footer a {
    color: #F97316 !important;
}
.tg-widget {
    background: #fff;
	border: 1px solid rgba(0,0,0,.4);
	margin-bottom: 30px;
}
#block-4,
#block-5 {
	margin-bottom: 0 !important;
}
.widget_block .tg-footer, 
.widget_block footer, 
.widget_block [class*="footer"] {
    background: transparent !important;
}
.widget_block .tg-footer a, 
.widget_block  footer a {
    color: rgba(0, 0, 0, 1) !important;
}
[data-theme="light"] .tg-footer .tg-logo-text {
    color: #fff !important;
}
/* ================================
   TOOL OPTIONS UI — IMPROVED DESIGN
   (PDF Tools Final Fix)
   ================================ */

.tg-opt-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.tg-opt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-opt-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tg-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: white;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: all 0.15s;
  user-select: none;
}

.tg-radio-label:hover {
  border-color: #F97316;
  background: #fff7ed;
  color: #c2410c;
}

.tg-radio-label input[type="radio"] {
  accent-color: #F97316;
  width: 16px;
  height: 16px;
}

.tg-radio-label:has(input[type="radio"]:checked) {
  border-color: #F97316;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}

.tg-select {
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s;
  width: 100%;
}

.tg-select:focus {
  outline: none;
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.tg-input,
.tg-text-input {
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  background: white;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.tg-input:focus,
.tg-text-input:focus {
  outline: none;
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.tg-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tg-slider {
  flex: 1;
  accent-color: #F97316;
  height: 6px;
  cursor: pointer;
}

.tg-slider-value {
  font-size: 14px;
  font-weight: 600;
  color: #F97316;
  min-width: 40px;
  text-align: right;
}

.tg-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.5;
}

.tg-warn-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.tg-btn-sm {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.tg-btn-primary {
  background: #F97316;
  color: white;
}

.tg-btn-primary:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

.tg-btn-outline {
  background: white;
  border: 1.5px solid #d1d5db;
  color: #374151;
}

.tg-btn-outline:hover {
  border-color: #F97316;
  color: #F97316;
}

/* Signature wizard steps */
.tg-sig-steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.tg-sig-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  cursor: pointer;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
}

.tg-sig-step.active {
  color: #F97316;
  border-bottom: 2px solid #F97316;
  margin-bottom: -2px;
}

.tg-sig-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.tg-sig-step.active .tg-sig-step-num {
  background: #F97316;
  color: white;
}

/* Dark theme overrides */
[data-theme="dark"] .tg-opt-section {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-opt-label {
  color: #e5e7eb !important;
}

[data-theme="dark"] .tg-radio-label {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #e5e7eb !important;
}

[data-theme="dark"] .tg-radio-label:hover,
[data-theme="dark"] .tg-radio-label:has(input[type="radio"]:checked) {
  border-color: #F97316 !important;
  background: rgba(249,115,22,0.1) !important;
  color: #fdba74 !important;
}

[data-theme="dark"] .tg-select,
[data-theme="dark"] .tg-input,
[data-theme="dark"] .tg-text-input {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #e5e7eb !important;
}

[data-theme="dark"] .tg-info-box {
  background: rgba(59,130,246,0.1) !important;
  border-color: rgba(59,130,246,0.3) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .tg-warn-box {
  background: rgba(245,158,11,0.1) !important;
  border-color: rgba(245,158,11,0.3) !important;
  color: #fcd34d !important;
}

[data-theme="dark"] .tg-btn-outline {
  background: #2a2a2a !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #e5e7eb !important;
}

[data-theme="dark"] .tg-btn-outline:hover {
  border-color: #F97316 !important;
  color: #F97316 !important;
}

/* ================================
   PROCESSING LOADER
   (spinner + message + progress bar
   shown while any tool is running)
   ================================ */

.tg-proc-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 20px;
  margin: 16px 0;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.tg-proc-loader[hidden] { display: none; }

.tg-proc-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: #F97316;
  border-radius: 50%;
  animation: tg-proc-spin 0.8s linear infinite;
}

@keyframes tg-proc-spin {
  to { transform: rotate(360deg); }
}

.tg-proc-msg {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
}

.tg-proc-bar-wrap {
  width: 100%;
  max-width: 280px;
}

.tg-proc-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.tg-proc-fill {
  height: 100%;
  background: linear-gradient(90deg, #F97316, #ea580c);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Dark theme */
[data-theme="dark"] .tg-proc-loader {
  background: #1e1e1e !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .tg-proc-msg {
  color: #e5e7eb !important;
}

[data-theme="dark"] .tg-proc-bar {
  background: #374151 !important;
}

/* Action button loading state */
.tg-action-btn:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
}

/* FFmpeg specific loader (video tools take longer) */
.tg-proc-loader.tg-ffmpeg-loader {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-color: rgba(249,115,22,0.2);
}

.tg-proc-loader.tg-ffmpeg-loader .tg-proc-spinner {
  border-color: rgba(255,255,255,0.1);
  border-top-color: #F97316;
}

.tg-proc-loader.tg-ffmpeg-loader .tg-proc-msg {
  color: #e5e7eb;
}

/* Accepted-formats hint inside the upload zone */
.tg-upload-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

[data-theme="dark"] .tg-upload-hint {
  color: #6b7280 !important;
}

/* File-tool option groups — branded, consistent with .tg-select */
.tg-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.tg-option-group > label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.tg-option-group select,
.tg-option-group input[type="text"],
.tg-option-group input[type="number"] {
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
  width: 100%;
  max-width: 340px;
}
.tg-option-group select:focus,
.tg-option-group input:focus {
  outline: none;
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
[data-theme="dark"] .tg-option-group > label { color: #e5e7eb; }
[data-theme="dark"] .tg-option-group select,
[data-theme="dark"] .tg-option-group input {
  background: #2a2a2a;
  border-color: rgba(255,255,255,0.15);
  color: #e5e7eb;
}

/* =============================================
   Merge PDF — file frame grid
   Preview + drag-to-reorder + per-file rotation.
   Scoped to the merge tool box only.
   ============================================= */

/* The frames replace the plain filename rows, but the list container
   stays in the flow so the "Maximum N files" notice still shows. */
.tg-tool-box[data-handler="merge"] .tg-file-list-item,
.tg-tool-box[data-handler="merge"] .tg-add-more-btn { display: none; }
.tg-tool-box[data-handler="merge"] .tg-file-list { margin-bottom: 0; }

.tg-merge-note {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-gray-700);
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin: 0.625rem 0;
}

.tg-merge-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0.625rem 0 0.75rem;
  font-size: 0.8125rem;
}

.tg-merge-count { color: var(--color-gray-600); }
.tg-merge-summary { color: var(--color-success); font-weight: 600; }

.tg-merge-add {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  background: transparent;
  border-radius: var(--radius-full);
  padding: 0.3125rem 0.75rem;
  transition: background var(--transition);
}
.tg-merge-add:hover { background: var(--color-primary-light); }

.tg-merge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.tg-merge-grid[data-dragover] {
  outline: 2px dashed var(--color-primary);
  outline-offset: 6px;
  border-radius: var(--radius-md);
}

.tg-merge-frame {
  position: relative;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  padding: 0.625rem 0.5rem 0.5rem;
  text-align: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* Vertical scrolling still works when a touch starts on the frame —
     touch drags are picked up by the badge handle instead. */
  touch-action: pan-y;
  transition: border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.tg-merge-frame:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.tg-merge-frame.dragging {
  opacity: 0.5;
  cursor: grabbing;
  border-style: dashed;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.tg-merge-badge {
  position: absolute;
  top: 0.375rem;
  left: 0.375rem;
  z-index: 2;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.3125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
  /* The one spot that must swallow touch gestures so a drag can start. */
  touch-action: none;
}
.tg-merge-badge:focus-visible {
  outline: 2px solid var(--color-gray-900);
  outline-offset: 2px;
}

.tg-merge-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.tg-merge-thumb canvas {
  max-width: 110px;
  max-height: 110px;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.tg-merge-thumb-msg {
  font-size: 0.6875rem;
  color: var(--color-gray-400);
  padding: 0 0.5rem;
}

.tg-merge-spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: tg-merge-spin 0.7s linear infinite;
}
@keyframes tg-merge-spin { to { transform: rotate(360deg); } }

.tg-merge-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-merge-pages {
  font-size: 0.6875rem;
  color: var(--color-gray-600);
}

.tg-merge-actions {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.tg-merge-btn {
  width: 1.625rem;
  height: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: 0.875rem;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition);
}
.tg-merge-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.tg-merge-btn--remove:hover { color: var(--color-error); border-color: var(--color-error); }

/* Dark theme */
[data-theme="dark"] .tg-merge-note {
  background: rgba(249,115,22,0.10);
  color: #e5e7eb;
}
[data-theme="dark"] .tg-merge-count { color: #9ca3af; }
[data-theme="dark"] .tg-merge-frame {
  background: #2a2a2a;
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .tg-merge-thumb { background: #1e1e1e; }
[data-theme="dark"] .tg-merge-name { color: #f0f0f0; }
[data-theme="dark"] .tg-merge-pages { color: #9ca3af; }
[data-theme="dark"] .tg-merge-btn {
  background: #1e1e1e;
  border-color: rgba(255,255,255,0.15);
  color: #e5e7eb;
}
[data-theme="dark"] .tg-merge-spinner { border-color: rgba(255,255,255,0.15); border-top-color: var(--color-primary); }
[data-theme="dark"] .tg-merge-badge:focus-visible { outline-color: #f0f0f0; }

/* The dark theme paints every button inside a tool box solid orange with
   !important (see the ACTION BUTTON block above). That is right for the
   primary action, but the small per-frame rotate/remove controls need to
   stay quiet — matched specificity + !important, scoped to merge frames. */
[data-theme="dark"] .tg-tool-box .tg-merge-frame button.tg-merge-btn {
  background: #1e1e1e !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] .tg-tool-box .tg-merge-frame button.tg-merge-btn:hover {
  color: var(--color-primary) !important;
  border-color: var(--color-primary);
}
[data-theme="dark"] .tg-tool-box .tg-merge-frame button.tg-merge-btn--remove:hover {
  color: var(--color-error) !important;
  border-color: var(--color-error);
}

/* =============================================
   Multi-file image tools — frame grid
   Preview + drag-to-reorder + per-image rotation
   for compress / convert / combine. Mirrors the
   merge-PDF frames; scoped to boxes whose grid
   actually rendered (data-img-frames="on").
   ============================================= */

/* The frames replace the plain filename rows and the runner's own
   "add more" button — the frame bar carries its own. */
.tg-tool-box[data-img-frames="on"] .tg-file-list-item,
.tg-tool-box[data-img-frames="on"] .tg-add-more-btn { display: none; }
.tg-tool-box[data-img-frames="on"] .tg-file-list { margin-bottom: 0; }

.tg-img-frame-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0.625rem 0 0.75rem;
  font-size: 0.8125rem;
}
.tg-img-frame-count { color: var(--color-gray-600); }
.tg-img-frame-summary { color: var(--color-success); font-weight: 600; }

.tg-img-frame-add {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  background: transparent;
  border-radius: var(--radius-full);
  padding: 0.3125rem 0.75rem;
  transition: background var(--transition);
}
.tg-img-frame-add:hover { background: var(--color-primary-light); }

.tg-img-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.tg-img-frame-grid[data-dragover] {
  outline: 2px dashed var(--color-primary);
  outline-offset: 6px;
  border-radius: var(--radius-md);
}

.tg-img-frame {
  position: relative;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  padding: 0.625rem 0.5rem 0.5rem;
  text-align: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* Vertical scrolling still works when a touch starts on the frame —
     touch drags are picked up by the badge handle instead. */
  touch-action: pan-y;
  transition: border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.tg-img-frame:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.tg-img-frame.dragging {
  opacity: 0.5;
  cursor: grabbing;
  border-style: dashed;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.tg-img-frame-badge {
  position: absolute;
  top: 0.375rem;
  left: 0.375rem;
  z-index: 2;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.3125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
  /* The one spot that must swallow touch gestures so a drag can start. */
  touch-action: none;
}
.tg-img-frame-badge:focus-visible {
  outline: 2px solid var(--color-gray-900);
  outline-offset: 2px;
}

.tg-img-frame-thumb {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.tg-img-frame-thumb canvas {
  max-width: 104px;
  max-height: 104px;
  /* Checkerboard so transparent PNGs read as transparent, not white. */
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 10px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.tg-img-frame-msg {
  font-size: 0.6875rem;
  color: var(--color-gray-400);
  padding: 0 0.5rem;
}

.tg-img-frame-spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: tg-img-frame-spin 0.7s linear infinite;
}
@keyframes tg-img-frame-spin { to { transform: rotate(360deg); } }

.tg-img-frame-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-img-frame-meta {
  font-size: 0.6875rem;
  color: var(--color-gray-600);
}

.tg-img-frame-actions {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.tg-img-frame-btn {
  width: 1.625rem;
  height: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: 0.875rem;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition);
}
.tg-img-frame-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.tg-img-frame-btn--remove:hover { color: var(--color-error); border-color: var(--color-error); }

/* Dark theme */
[data-theme="dark"] .tg-img-frame-count { color: #9ca3af; }
[data-theme="dark"] .tg-img-frame {
  background: #2a2a2a;
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .tg-img-frame-thumb { background: #1e1e1e; }
[data-theme="dark"] .tg-img-frame-name { color: #f0f0f0; }
[data-theme="dark"] .tg-img-frame-meta { color: #9ca3af; }
[data-theme="dark"] .tg-img-frame-btn {
  background: #1e1e1e;
  border-color: rgba(255,255,255,0.15);
  color: #e5e7eb;
}
[data-theme="dark"] .tg-img-frame-spinner { border-color: rgba(255,255,255,0.15); border-top-color: var(--color-primary); }
[data-theme="dark"] .tg-img-frame-badge:focus-visible { outline-color: #f0f0f0; }

/* The dark theme paints every button inside a tool box solid orange with
   !important (see the ACTION BUTTON block above). That is right for the
   primary action, but the small per-frame rotate/remove controls need to
   stay quiet — matched specificity + !important, scoped to image frames. */
[data-theme="dark"] .tg-tool-box .tg-img-frame button.tg-img-frame-btn {
  background: #1e1e1e !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] .tg-tool-box .tg-img-frame button.tg-img-frame-btn:hover {
  color: var(--color-primary) !important;
  border-color: var(--color-primary);
}
[data-theme="dark"] .tg-tool-box .tg-img-frame button.tg-img-frame-btn--remove:hover {
  color: var(--color-error) !important;
  border-color: var(--color-error);
}

/* =============================================
   Single-image tools — preview frame + toolbar
   One framed preview per tool (round, resize,
   crop, flip, rotate, add-text, add-border,
   upscale, blur-bg, remove-watermark) with the
   shared Rotate / Clear controls above it.
   ============================================= */

.tg-img-preview-frame {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-gray-100);
  text-align: center;
  max-width: 100%;
  overflow-x: auto;
}
.tg-img-preview-frame canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  /* Checkerboard so transparent PNGs read as transparent, not white. */
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
  box-shadow: var(--shadow-sm);
}
/* Interactive editors (crop box, text layers, watermark selection) size
   their own canvas — the frame just shrinks to fit it, and never past
   the width of the tool box on a phone. */
.tg-img-preview-frame--editor {
  padding: 0.5rem;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.tg-img-preview-frame--editor canvas {
  box-shadow: none;
  background: none;
  display: block;
}
/* An editor whose overlay canvas is stretched over the frame (the
   watermark selection layer) can't have padding under it, or the two
   canvases stop lining up. */
.tg-img-preview-frame--flush { padding: 0; overflow: hidden; }

/* Standalone before/after preview canvases used by the background tools
   (remove-bg, change-bg, blur-bg). These sit in a plain flex row rather
   than a .tg-img-preview-frame, so they carry their own border. */
.tg-img-preview-canvas {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
}
/* Checkerboard behind a transparent result, so "no background" reads as
   transparent instead of white. */
.tg-img-checker {
  background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / 14px 14px;
}
/* Quiet helper line under a slider. */
.tg-opt-hint {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: -0.25rem;
}

/* Gradient presets for the Change Background tool. */
.tg-grad-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tg-grad-swatch {
  width: 40px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  /* The swatch IS the preview — no label, so keep the hit area >=28px. */
  transition: border-color var(--transition), transform var(--transition);
}
.tg-grad-swatch:hover { transform: translateY(-1px); }
.tg-grad-swatch.is-active { border-color: var(--color-primary); }
[data-theme="dark"] .tg-grad-swatch { border-color: rgba(255,255,255,0.18); }

.tg-img-tools-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.tg-img-tools-bar .tg-img-tool-btn {
  /* >=40px tall so the controls stay comfortable on touch. */
  min-height: 40px;
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tg-img-tools-bar .tg-img-tool-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Dark theme */
[data-theme="dark"] .tg-img-preview-frame {
  background: #1e1e1e;
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .tg-img-preview-canvas {
  border-color: rgba(255,255,255,0.12);
}

/* The dark theme paints every button inside a tool box solid orange with
   !important (see the ACTION BUTTON block above). That is right for the
   primary action, but these secondary controls need to stay quiet —
   matched specificity + !important, scoped to the image tools bar. */
[data-theme="dark"] .tg-tool-box .tg-img-tools-bar button.tg-img-tool-btn {
  background: #2a2a2a !important;
  color: #e5e7eb !important;
  border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .tg-tool-box .tg-img-tools-bar button.tg-img-tool-btn:hover {
  color: var(--color-primary) !important;
  border-color: var(--color-primary);
}

/* =============================================
   TOOL PAGE — TOOL FIRST ON SMALL SCREENS
   The long intro now renders below the tool box (see single-tg_tool.php,
   section 4b). These rules keep everything that is still above it small
   enough that a phone shows the upload area without scrolling.
   ============================================= */

/* One-line tagline under the H1, in place of the old 350-word intro. */
.tg-tool-tagline {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-gray-600);
}
[data-theme="dark"] .tg-tool-tagline { color: #C0C0C0; }

/* Trust bar — a single compact row of chips. It used to be four
   unstyled inline spans that wrapped to three lines of text and pushed
   the tool further down. */
.tg-tool-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1rem;
}
.tg-tool-meta-item {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  background: var(--color-gray-100);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-gray-600);
  white-space: nowrap;
}
[data-theme="dark"] .tg-tool-meta-item {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #C0C0C0 !important;
}

/* The intro's lead paragraph now opens a full section rather than sitting
   in a box above the tool, so its heading matches the other section
   headings instead of staying at body size. */
.tg-tool-longform .tg-definition-box h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.tg-tool-longform .tg-definition-box { margin-bottom: 0; font-size: inherit; }

/* Grid items default to min-width:auto, so one wide child (the scrolling
   trust bar below, a wide table in an intro) stretches the whole column
   and gives the page a horizontal scrollbar. */
.tg-tool-page-layout > .tg-tool-page-main { min-width: 0; }

/* Same guard for the blog layout (single post, blog index, archives). Its
   1fr column is minmax(auto, 1fr), so a post's comparison table, <pre> or
   long URL set the column's minimum and the article rendered ~800px wide
   on a phone — clipped on the left, horizontal scroll on the right. */
.tg-layout--sidebar > .tg-layout__main,
.tg-layout--sidebar > .tg-layout__sidebar { min-width: 0; }

.tg-entry__content { overflow-wrap: break-word; }
.tg-entry__content img,
.tg-entry__content video { max-width: 100%; height: auto; }
.tg-entry__content iframe,
.tg-entry__content figure,
.tg-layout__main .tg-ad-placeholder { max-width: 100%; }

@media (max-width: 768px) {
  /* Wide comparison tables scroll inside the article instead of widening it. */
  .tg-entry__content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* The title, meta and tools CTA sit outside .tg-entry__content, so a long
     unbroken word in the H1 still pushed past the screen edge. Embeds and
     blocks pasted with an inline fixed width (width:640px) did the same. */
  .tg-entry { min-width: 0; overflow-wrap: break-word; }
  .tg-entry__content pre,
  .tg-entry__content embed,
  .tg-entry__content object,
  .tg-entry__content div { max-width: 100%; }
  .tg-entry__content .wp-block-table { overflow-x: auto; }
}

@media (max-width: 1024px) {
  /* tool.css stacks the sidebar first on narrow screens (order: -1), which
     put its widgets and ads between the breadcrumbs and the tool — the same
     "where is the tool?" problem the intro caused. Higher specificity so it
     wins over that rule regardless of stylesheet order. */
  .tg-tool-page-layout > .tg-tool-page-sidebar { order: 1; }
}

@media (max-width: 600px) {
  /* Keep the chips to one scrollable row on a phone. */
  .tg-tool-meta-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tg-tool-meta-bar::-webkit-scrollbar { display: none; }
  .tg-tool-cat-badge { margin-bottom: 8px; }
  .tg-tool-title { margin-bottom: 8px; }
  .tg-tool-updated { margin: 0.25rem 0 0.75rem; }
  .tg-tool-tagline { margin-bottom: 0.75rem; }
}
