/* ============================================================
   ToolNest — main.css  (class names match PHP templates)
   ============================================================ */

/* ── 1. CSS VARIABLES ── */
:root {
  --primary:        #4F7EF7;
  --primary-dark:   #3B6AE3;
  --primary-light:  #EEF2FF;

  --bg-page:        #F8F9FC;
  --bg-card:        #FFFFFF;
  --bg-input:       #F4F5F8;
  --bg-sidebar:     #1E2235;
  --surface:        #FFFFFF;

  --text-primary:   #1A1D2E;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  --cat-text:       #4F7EF7;
  --cat-calc:       #10B981;
  --cat-convert:    #F59E0B;
  --cat-image:      #EC4899;
  --cat-security:   #8B5CF6;
  --cat-dev:        #EF4444;
  --cat-writing:    #06B6D4;

  --success: #10B981;
  --warning: #F59E0B;
  --error:   #EF4444;
  --info:    #4F7EF7;

  --border:       #E5E7EB;
  --border-focus: #4F7EF7;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:   ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  28px;
  --text-3xl:  36px;

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);

  --nav-height:    64px;
  --container-max: 1280px;
  --transition:    150ms ease;
  --transition-md: 250ms ease;

  /* Spacing aliases used by tools.css / blog.css / admin.css */
  --sp-1:  8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-8: 64px;

  /* Font weight aliases */
  --font-normal: 400;
  --font-medium: 500;
  --font-semi:   600;
  --font-bold:   700;

  /* Leading aliases */
  --leading-tight:  1.3;
  --leading-normal: 1.5;
  --leading-loose:  1.8;
}

/* ── 2. DARK MODE ── */
[data-theme="dark"] {
  --bg-page:        #0F1117;
  --bg-card:        #1A1D2E;
  --bg-input:       #252840;
  --bg-sidebar:     #0D0F1A;
  --surface:        #1A1D2E;
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border:         #2D3148;
  --primary-light:  #1E2444;
  --shadow-md:      0 2px 8px rgba(0,0,0,0.35);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.45);
}

/* ── 3. RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--transition-md), color var(--transition-md);
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font-family: inherit; font-size: 100%; line-height: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; }
ol, ul { list-style: none; }
table { border-collapse: collapse; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { color: var(--text-secondary); line-height: 1.8; }

/* ── 4. LAYOUT ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px)  { .container { padding-inline: 24px; } }
@media (min-width: 1024px) { .container { padding-inline: 32px; } }

.grid   { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 767px)  { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ── 5. NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .nav-inner { padding-inline: 24px; } }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo svg { display: block; }
.nav-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.nav-logo-text span { color: var(--primary); }

.nav-search {
  flex: 1;
  max-width: 480px;
  margin-inline: auto;
  position: relative;
}
.nav-search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(79,126,247,0.15);
}
.nav-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 16px;
}

/* Search results dropdown */
.nav-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
}
.nav-search-results.is-open,
.nav-search-results.active { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
  color: var(--text-primary);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-input); }
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.search-result-name { font-size: var(--text-sm); font-weight: 600; }
.search-result-desc { font-size: var(--text-xs); color: var(--text-muted); }
.search-result-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--text-sm); }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Nav links (desktop) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-links a {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { background: var(--bg-input); color: var(--primary); }
@media (max-width: 767px) { .nav-links { display: none; } }

/* Mobile overlay menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.5);
}
.nav-overlay.is-open { display: block; }
.nav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(300px, 85vw);
  height: 100%;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.nav-drawer.is-open { transform: translateX(0); }
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.nav-drawer-close {
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.nav-drawer-close:hover { background: var(--bg-input); color: var(--text-primary); }
.nav-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 4px;
  overflow-y: auto;
}
.nav-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-drawer-nav a:hover { background: var(--bg-input); color: var(--primary); }
.nav-drawer-search {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.nav-drawer-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.theme-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-size: 18px;
}
.theme-toggle:hover { background: var(--bg-input); color: var(--primary); }

.nav-menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px;
}
@media (max-width: 767px) {
  .nav-menu-toggle { display: flex; }
  .nav-search { display: none; }
}
@media (max-width: 479px) { .nav-logo-text { display: none; } }

/* ── 6. FOOTER ── */
.footer {
  background: var(--bg-sidebar);
  color: #94A3B8;
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}
@media (max-width: 1023px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 639px)  { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { font-size: var(--text-sm); line-height: 1.8; margin-top: 12px; color: #94A3B8; }
.footer h4 { font-size: var(--text-sm); font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer ul { display: flex; flex-direction: column; gap: 10px; }
.footer ul li a { font-size: var(--text-sm); color: #94A3B8; transition: color var(--transition); }
.footer ul li a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: #64748B;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── 7. BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-sm  { font-size: var(--text-xs); padding: 7px 14px; }
.btn-lg  { font-size: var(--text-base); padding: 13px 28px; }
.btn-xl  { font-size: var(--text-md); padding: 16px 36px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,126,247,0.35);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}
.btn-secondary:hover {
  background: #dce7fe;
  border-color: #dce7fe;
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text-primary); }

.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-full { width: 100%; }

/* ── 8. FORM ELEMENTS ── */
.form-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); display: block; margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(79,126,247,0.15);
}

/* ── 9. CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--transition-md), border-color var(--transition-md), transform var(--transition-md);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body   { padding: 24px; }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-input); }
.card-tool-link:hover { transform: translateY(-2px); border-color: var(--primary); }

/* ── 10. BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-blue    { background: var(--primary-light); color: var(--primary); }
.badge-gray    { background: var(--bg-input); color: var(--text-secondary); }
.badge-green   { background: #D1FAE5; color: #065F46; }
.badge-popular {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg,#F59E0B,#EF4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}
[data-theme="dark"] .badge-green { background: rgba(16,185,129,0.2); color: #34D399; }

/* ── 11. BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: 16px 0;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-muted); font-size: 10px; }

/* ── 12. STAT BOX (tool pages) ── */
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

/* ── 13. USAGE COUNT ── */
.usage-count { color: var(--primary); font-weight: 600; }

/* ── 14. AD CONTAINERS ── */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-align: center;
  overflow: hidden;
  margin: 24px auto;
  min-height: 60px;
}
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }

/* ── 15. HERO ── */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  background: linear-gradient(160deg, var(--bg-page) 0%, var(--primary-light) 60%, var(--bg-page) 100%);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  max-width: 720px;
  margin: 0 auto 16px;
}
.hero-title .highlight { color: var(--primary); }
.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.8;
}
.hero-search {
  max-width: 640px;
  margin: 0 auto 32px;
  position: relative;
}
.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 56px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,126,247,0.15), var(--shadow-lg);
}
.hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 20px;
}
.hero-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.hero-search-btn:hover { background: var(--primary-dark); }

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-stat-num   { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); }
.hero-stat-label { font-size: var(--text-sm); color: var(--text-muted); }
.hero-stat-divider { width: 1px; height: 40px; background: var(--border); }
@media (max-width: 639px) { .hero { padding: 40px 0 32px; } .hero-stat-divider { display: none; } }

/* ── 16. CATEGORY PILLS ── */
.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── 17. SECTION ── */
.section { padding: 48px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.section-link:hover { color: var(--primary-dark); }
.text-center { text-align: center; }
.mb-32 { margin-bottom: 32px; }

/* ── 18. CATEGORY SECTION ── */
.cat-section { margin-bottom: 48px; }
.cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--bg-input);
}
.cat-header-info { flex: 1; }
.cat-name  { font-size: var(--text-lg); font-weight: 600; color: var(--text-primary); }
.cat-count { font-size: var(--text-sm); color: var(--text-muted); }
.cat-icon-circle {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--primary-light);
  flex-shrink: 0;
}

/* ── 19. TOOL CARD ── */
.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  transition: transform var(--transition-md), box-shadow var(--transition-md), border-color var(--transition-md);
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
  transition: transform var(--transition);
}
.tool-card:hover .tool-card-icon { transform: scale(1.08); }
.tool-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}

/* ── 20. TOOLS SCROLL ROW ── */
.tools-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 16px;
}
@media (max-width: 639px) {
  .tools-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .tools-scroll::-webkit-scrollbar { display: none; }
  .tools-scroll .tool-card { min-width: 200px; flex-shrink: 0; }
}

/* ── 21. BLOG CARD ── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--transition-md), box-shadow var(--transition-md);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card-img {
  width: 100%; height: 180px;
  object-fit: cover;
  background: var(--primary-light);
}
.blog-card-body { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-muted);
}
.blog-card-cat { font-size: var(--text-xs); font-weight: 500; color: var(--primary); }
.blog-card-title {
  font-size: var(--text-base); font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-excerpt {
  font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── 22. ARTICLE CONTENT ── */
.article-content h2 { font-size: var(--text-2xl); margin: 32px 0 16px; }
.article-content h3 { font-size: var(--text-xl); margin: 24px 0 12px; }
.article-content p  { margin-bottom: 16px; line-height: 1.8; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; color: var(--text-secondary); line-height: 1.6; }
.article-content a  { color: var(--primary); text-decoration: underline; }
.article-content strong { color: var(--text-primary); font-weight: 600; }
.article-content code {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono); font-size: 0.9em;
}
.article-content pre {
  background: var(--bg-sidebar); color: #e2e8f0;
  border-radius: var(--radius-md); padding: 20px;
  overflow-x: auto; margin-bottom: 20px;
  font-family: var(--font-mono); font-size: var(--text-sm);
}
.article-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 20px;
}

/* ── 23. TRUST GRID ── */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 20px;
}
.trust-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.trust-icon  { font-size: 36px; margin-bottom: 12px; }
.trust-title { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.trust-desc  { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }

/* ── 24. TOAST ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 400px;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-xl); pointer-events: all;
  border-left: 4px solid transparent;
  animation: toast-in 0.3s ease forwards;
  background: var(--bg-card); color: var(--text-primary);
}
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--error); }
.toast-info    { border-left-color: var(--info); }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── 25. PAGINATION ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  font-size: var(--text-sm); border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary);
  text-decoration: none; transition: all var(--transition); cursor: pointer;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── 26. SPINNER ── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 27. UTILITY ── */
.hidden   { display: none !important; }
.w-full   { width: 100%; }
.mx-auto  { margin-inline: auto; }
.sr-only  { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.font-mono { font-family: var(--font-mono); }
.text-sm  { font-size: var(--text-sm); }
.text-muted { color: var(--text-muted); }

/* ── 28. PRINT ── */
@media print {
  .nav, .footer, .ad-container, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
