/* ================================================================
   Shruchin ToolTree — Global Stylesheet (v2, Template Refresh)
   Brand: 🌱 One Tree. Infinite Tools.
   Design: Green nav bar + colored category cards + navy footer
   ================================================================ */

:root {
  /* Brand */
  --green:        #2ea043;
  --green-dark:   #1f7a32;
  --green-darker: #175f26;
  --navy:         #0f1b2d;
  --navy-2:       #17253c;
  --text:         #1f2937;
  --muted:        #6b7280;
  --bg:           #f6f9f5;
  --bg-alt:       #ffffff;
  --border:       #e5e7eb;

  /* Category colors */
  --c-blue:       #2f7ff2;
  --c-blue-soft:  #e6f0ff;
  --c-green:      #22a34a;
  --c-green-soft: #e2f7e8;
  --c-purple:     #8b5cf6;
  --c-purple-soft:#f0e9ff;
  --c-orange:     #f59e0b;
  --c-orange-soft:#fff3e0;
  --c-teal:       #14b8a6;
  --c-teal-soft:  #d7f5f1;
  --c-pink:       #ec4899;
  --c-pink-soft:  #fde3ef;

  /* System */
  --shadow-sm:  0 1px 2px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.05);
  --shadow-md:  0 4px 12px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg:  0 8px 24px rgba(15,23,42,.10), 0 16px 40px rgba(15,23,42,.08);
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --transition: .28s cubic-bezier(.2,.7,.2,1);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f1418;
  --bg-alt: #171e26;
  --text: #e6ebf1;
  --muted: #98a2b3;
  --border: #232c38;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Poppins', 'Inter', sans-serif; margin: 0 0 .5em; line-height: 1.2; }
p  { margin: 0 0 1em; color: var(--muted); }
a  { color: var(--green-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
ul { padding: 0; margin: 0; list-style: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Color utility */
.c-blue   { color: var(--c-blue); }
.c-green  { color: var(--c-green); }
.c-purple { color: var(--c-purple); }
.c-dark   { color: var(--navy); }


/* =====================================================
   TOP HEADER (Logo + Search)
   ===================================================== */
.top-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.top-header-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  justify-content: space-between;
}

/* Brand block */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  min-width: 0;
  flex-shrink: 0;
}
.brand-logo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid #eef2f7;
  box-shadow: 0 3px 10px rgba(15,27,45,.12);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.brand:hover .brand-logo {
  transform: rotate(-6deg) scale(1.05);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--navy);
  letter-spacing: -.5px;
  white-space: nowrap;
  line-height: 1.1;
}
.brand-name b {
  color: var(--green-dark);
  font-weight: 800;
}
.brand-tagline {
  font-family: 'Poppins', sans-serif;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  margin-top: 2px;
}
.brand-tagline em {
  font-style: italic;
  color: var(--green-dark);
}

/* Top search */
.top-search {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
  background: #f3f6f9;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.top-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,160,67,.15);
  background: #fff;
}
.top-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 16px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  min-width: 0;
}
.top-search input::placeholder { color: #9ca3af; }
.top-search button {
  background: var(--green);
  border: none;
  color: #fff;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.top-search button:hover { background: var(--green-dark); }

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 20;
}
.search-results.show { display: block; }
.search-results li { padding: 0; border-bottom: 1px solid var(--border); }
.search-results li:last-child { border-bottom: none; }
.search-results a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: var(--text);
  font-weight: 500;
}
.search-results a:hover, .search-results li.active a {
  background: var(--c-green-soft);
  color: var(--green-dark);
}
.search-results .sr-tag {
  font-size: .72rem;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 999px;
}
.search-results .empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}

/* Menu toggle (mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* =====================================================
   GREEN NAV BAR
   ===================================================== */
.main-nav {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46,160,67,.25);
}
.nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}
.nav-links {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 2px;
}
.nav-links > li {
  position: relative;
  display: flex;
}
.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  padding: 14px 15px;
  font-size: .93rem;
  font-weight: 500;
  transition: background var(--transition);
  white-space: nowrap;
}
.nav-links > li > a:hover,
.nav-links > li:hover > a {
  background: var(--green-dark);
  color: #fff;
}
.nav-links .nav-home {
  padding: 14px 16px;
}
.nav-links .caret {
  font-size: .7rem;
  opacity: .85;
  margin-left: 2px;
  transition: transform var(--transition);
}
.has-dropdown:hover .caret { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 90;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: block;
  animation: dropIn .22s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown li a {
  display: block;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.dropdown li a:hover {
  background: var(--c-green-soft);
  color: var(--green-dark);
}

/* Favorites button */
.favorites-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  padding: 9px 18px;
  margin: 6px 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  align-self: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.favorites-btn:hover {
  background: #000;
  color: #fff;
  transform: translateY(-1px);
}
.favorites-btn svg { color: #ffd166; }


/* =====================================================
   HERO
   ===================================================== */
.hero {
  padding: 60px 0 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
  letter-spacing: -.5px;
}
.hero-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}
.hero-subtitle span { margin: 0 4px; }

.hero-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.hero-dots .dot {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  opacity: .45;
}
.hero-dots .d1 { width: 14px; height: 14px; top: 30%; left: 15%; border-color: var(--c-green); }
.hero-dots .d2 { width: 10px; height: 10px; top: 60%; left: 22%; border-color: var(--c-blue); }
.hero-dots .d3 { width: 12px; height: 12px; top: 25%; right: 15%; border-color: var(--c-purple); }
.hero-dots .d4 { width: 8px;  height: 8px;  top: 65%; right: 22%; border-color: var(--c-orange); }


/* =====================================================
   CATEGORY CARDS (6 colored cards)
   ===================================================== */
.categories {
  padding: 30px 0 40px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 18px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.cat-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  margin-bottom: 6px;
}
.cat-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 6px 0 4px;
}
.cat-card p {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 14px;
  min-height: 44px;
}
.cat-btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  margin-top: auto;
}
.cat-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  color: #fff;
}

/* Per-color mapping */
.cat-card[data-color="blue"]   .cat-icon,
.cat-card[data-color="blue"]   .cat-btn   { background: var(--c-blue); }
.cat-card[data-color="green"]  .cat-icon,
.cat-card[data-color="green"]  .cat-btn   { background: var(--c-green); }
.cat-card[data-color="purple"] .cat-icon,
.cat-card[data-color="purple"] .cat-btn   { background: var(--c-purple); }
.cat-card[data-color="orange"] .cat-icon,
.cat-card[data-color="orange"] .cat-btn   { background: var(--c-orange); }
.cat-card[data-color="teal"]   .cat-icon,
.cat-card[data-color="teal"]   .cat-btn   { background: var(--c-teal); }
.cat-card[data-color="pink"]   .cat-icon,
.cat-card[data-color="pink"]   .cat-btn   { background: var(--c-pink); }


/* =====================================================
   POPULAR TOOLS (chip bar)
   ===================================================== */
.popular-section {
  padding: 10px 0 30px;
}
.popular-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.popular-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.popular-head .pop-icon {
  color: var(--c-green);
  font-size: 1.15rem;
}
.popular-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--navy);
  font-weight: 700;
}
.popular-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  color: var(--green-dark);
  box-shadow: 0 4px 12px rgba(46,160,67,.15);
}
.chip-ico {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}
.chip-ico.red    { background: #ef4444; }
.chip-ico.green  { background: var(--c-green); }
.chip-ico.blue   { background: var(--c-blue); }
.chip-ico.purple { background: var(--c-purple); }
.chip-ico.orange { background: var(--c-orange); }
.chip-ico.teal   { background: var(--c-teal); }
.chip.view-all {
  color: var(--muted);
  font-weight: 600;
  gap: 4px;
}
.chip.view-all span {
  font-size: 1.15rem;
  color: var(--muted);
}


/* =====================================================
   TOOLS GRID (all tools section)
   ===================================================== */
.tools-section { padding: 50px 0 60px; }
.section-heading {
  text-align: center;
  margin-bottom: 30px;
}
.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--navy);
  margin: 0 0 8px;
}
.section-heading p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}
.tools-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tool-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--green);
  color: var(--text);
}
.tool-card .t-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--tc, var(--c-blue));
  margin-bottom: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,.10);
}
.tool-card h3 {
  font-size: 1rem;
  color: var(--navy);
  margin: 4px 0 4px;
  font-weight: 700;
}
.tool-card p {
  font-size: .85rem;
  margin: 0;
  color: var(--muted);
}


/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--navy);
  color: #d7dde3;
  margin-top: 40px;
  padding: 50px 0 0;
}
.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  padding-bottom: 40px;
}
.footer-brand-col .brand-name { color: #fff; }
.footer-brand-col .brand-name b { color: #7ce38b; }
.footer-brand-col .brand-tagline { color: #9ca3af; }
.footer-brand-col .brand-tagline em { color: #7ce38b; }
.footer-brand-col .brand-logo {
  background: #fff;
  padding: 3px;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 700;
}
.site-footer ul li {
  margin-bottom: 10px;
}
.site-footer ul li a {
  color: #b7c0cc;
  font-size: .92rem;
  transition: color var(--transition), padding-left var(--transition);
}
.site-footer ul li a:hover {
  color: #fff;
  padding-left: 4px;
}
.footer-muted {
  color: #9ca3af;
  font-size: .9rem;
  margin-bottom: 14px;
}

/* Social icons */
.social-links {
  display: flex;
  gap: 10px;
}
.social-links a {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sc, #374151);
  color: #fff;
  transition: transform var(--transition), filter var(--transition);
}
.social-links a:hover {
  transform: translateY(-3px) scale(1.05);
  filter: brightness(1.15);
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 0;
  background: rgba(0,0,0,.15);
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #8a94a3;
  font-size: .85rem;
}


/* =====================================================
   TOAST + SCROLL TOP
   ===================================================== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 100px);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 999; opacity: 0;
  transition: transform .4s ease, opacity .4s ease;
  max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.success { background: linear-gradient(135deg, var(--c-green), var(--green-dark)); }
.toast.error   { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.toast.info    { background: linear-gradient(135deg, var(--c-blue), #1d4ed8); }

.scroll-top {
  position: fixed; right: 20px; bottom: 20px;
  width: 46px; height: 46px;
  border: none; border-radius: 50%;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  background: var(--green);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 8px 20px rgba(46,160,67,.4);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 60;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-4px); }


/* =====================================================
   TOOL-PAGE SHARED (kept from v1, restyled)
   ===================================================== */
.tool-page { padding: 40px 0 80px; }
.tool-header { text-align: center; margin-bottom: 30px; }
.tool-header .badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--c-green-soft); color: var(--green-dark);
  font-size: .8rem; font-weight: 600; margin-bottom: 10px;
}
.tool-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
}
.tool-panel {
  padding: 28px; margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.drop-zone {
  border: 2px dashed var(--green);
  border-radius: var(--radius); padding: 40px 20px; text-align: center;
  background: var(--c-green-soft); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.drop-zone:hover, .drop-zone.dragover {
  background: rgba(46,160,67,.18);
  border-color: var(--green-dark);
}
.drop-zone p { margin: 6px 0; color: var(--muted); }
.drop-zone strong { color: var(--green-dark); }
.hidden-input { display: none; }

textarea.tool-input, input.tool-input, select.tool-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff;
  color: var(--text); font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: .95rem; resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea.tool-input:focus, input.tool-input:focus, select.tool-input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,160,67,.15);
}
.control-row {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 14px 0;
}
.control-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .88rem; font-weight: 500;
}
.result-box {
  padding: 16px; border-radius: 10px; background: #f9fafb;
  border: 1px solid var(--border); word-break: break-all; min-height: 60px;
  font-family: 'JetBrains Mono', monospace;
}
.stat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  margin-top: 16px;
}
.stat {
  padding: 14px; border-radius: 10px; text-align: center;
  background: var(--c-green-soft);
}
.stat b {
  display: block; font-size: 1.5rem;
  color: var(--green-dark); font-family: 'Poppins';
}
.stat span { font-size: .8rem; color: var(--muted); }

.preview-img {
  max-width: 100%; border-radius: 10px; margin-top: 14px;
  border: 1px solid var(--border);
}
canvas { max-width: 100%; }

.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green-dark); }

/* Buttons (kept for tool pages) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 22px; border-radius: 10px;
  font-weight: 600; font-size: .92rem; cursor: pointer; border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--green); color: #fff;
  box-shadow: 0 4px 12px rgba(46,160,67,.30);
}
.btn-primary:hover {
  transform: translateY(-2px); background: var(--green-dark);
  box-shadow: 0 8px 20px rgba(46,160,67,.40); color: #fff;
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--green); color: var(--green-dark); }
.btn-outline:hover { background: var(--green); color: #fff; }


/* =====================================================
   RESPONSIVE — Tablets and phones
   ===================================================== */
@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid   { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
}

@media (max-width: 900px) {
  .top-header-inner { gap: 14px; flex-wrap: wrap; }
  .brand-name    { font-size: 1.3rem; }
  .brand-tagline { font-size: .72rem; }
  .brand-logo    { width: 48px; height: 48px; }
  .top-search    { order: 3; max-width: 100%; width: 100%; }

  .menu-toggle   { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  .main-nav.open .nav-links { display: flex; }
  .main-nav .nav-inner { flex-direction: column; gap: 0; }
  .nav-links > li { display: block; }
  .nav-links > li > a { padding: 12px 20px; justify-content: space-between; }
  .has-dropdown .dropdown {
    position: static;
    box-shadow: none;
    background: rgba(0,0,0,.15);
    border-radius: 0;
    padding: 4px 12px 8px 32px;
    display: none;
  }
  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.open .dropdown  { display: block; }
  .has-dropdown.open .caret     { transform: rotate(180deg); }
  .dropdown li a { color: #fff; }
  .dropdown li a:hover { background: rgba(255,255,255,.15); color: #fff; }
  .favorites-btn { margin: 8px 20px 12px; align-self: flex-start; }

  .footer-grid   { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 720px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-card p    { min-height: auto; }
}

@media (max-width: 560px) {
  .top-header-inner { gap: 10px; }
  .brand-tagline    { display: none; }
  .brand-logo       { width: 44px; height: 44px; }
  .brand-name       { font-size: 1.15rem; }

  .hero             { padding: 40px 0 20px; }

  .footer-grid          { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom-inner  { justify-content: center; text-align: center; }

  .popular-chips        { gap: 8px; }
  .chip                 { padding: 8px 12px; font-size: .82rem; }

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

@media (max-width: 400px) {
  .category-grid { grid-template-columns: 1fr; }
}


/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
