/* Tools Page Specific Styles */

/* Shared type scale — slightly compact; use these tiers across hero, grid, closer, search */
:root {
  --tools-fs-eyebrow: 0.62rem;
  --tools-fs-index: 0.64rem;
  --tools-fs-caption: 0.66rem;
  --tools-fs-tag: 0.72rem;
  --tools-fs-label: 0.66rem;
  --tools-fs-small: 0.74rem;
  --tools-fs-ui: 0.82rem;
  --tools-fs-body: 0.875rem;
  --tools-fs-body-lg: 0.9rem;
  --tools-fs-input: 0.92rem;
  --tools-fs-subhead: 0.98rem;
  --tools-fs-card-title: 1.12rem;
  --tools-fs-section: 1.38rem;
  --tools-fs-section-icon: 1.15rem;
  --tools-fs-hero: clamp(1.32rem, 2.95vw, 1.88rem);
  --tools-fs-hero-accent: 0.86em;
  --tools-fs-stat: 1.42rem;
  --tools-fs-stat-sm: 1.08rem;
  --tools-fs-stat-icon: 1.02rem;
  --tools-fs-icon-card: 21px;
  --tools-fs-search-input: 0.92rem;
  --tools-fs-result-title: 1.02rem;
  --tools-fs-result-desc: 0.84rem;
  --tools-fs-section-mobile: 1.22rem;
  --tools-fs-stat-tight: 1.12rem;
  --tools-fs-hero-mobile: clamp(1.28rem, 4.6vw, 1.72rem);
  --tools-fs-hero-xs: clamp(1.2rem, 4.8vw, 1.38rem);
  --tools-fs-no-results-icon: 2.5rem;
  --tools-fs-msearch: 0.8rem;
}

/* Main Tools Container — blends with labs-common body (golden luxury) */
.tools-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.75rem) 20px max(3.25rem, env(safe-area-inset-bottom, 0px));
  background: transparent;
}

/* ---------- Tools catalog hero — editorial split (rail + toolbar + copy | metrics) ---------- */
.tools-hero {
  position: relative;
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: clamp(18px, 2.5vw, 24px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(145, 103, 48, 0.22);
  background: linear-gradient(165deg, rgba(255, 252, 246, 0.99) 0%, rgba(248, 236, 214, 0.95) 52%, rgba(238, 222, 196, 0.97) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 22px 52px -34px rgba(94, 65, 30, 0.4);
}

.tools-hero__mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(145, 103, 48, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 103, 48, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 95% 75% at 18% 12%, black 18%, transparent 68%);
}

.tools-hero__sheen {
  position: absolute;
  inset: -35% -25% auto -35%;
  height: 78%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(185, 139, 59, 0.12) 50%, transparent 62%);
  transform: rotate(-2deg);
}

.tools-hero__rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  z-index: 1;
  pointer-events: none;
  border-radius: clamp(18px, 2.5vw, 24px) 0 0 clamp(18px, 2.5vw, 24px);
  background: linear-gradient(180deg, #d4a85c 0%, #b98b3b 38%, #8a6228 100%);
  box-shadow: 3px 0 18px -6px rgba(94, 65, 30, 0.45);
}

.tools-hero__surface {
  position: relative;
  z-index: 2;
  padding: clamp(1.1rem, 3vw, 1.75rem) clamp(1.1rem, 3.4vw, 2.35rem) clamp(1.2rem, 3.2vw, 1.9rem);
  padding-left: calc(clamp(1.1rem, 3.4vw, 2.35rem) + 12px);
}

.tools-hero__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding-bottom: 0.95rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(145, 103, 48, 0.13);
}

.tools-hero__toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.tools-hero__index {
  font-size: var(--tools-fs-index);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(145, 103, 48, 0.38);
  font-variant-numeric: tabular-nums;
}

.tools-hero__eyebrow {
  font-size: var(--tools-fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(94, 67, 41, 0.88);
}

.tools-hero .search-trigger-btn {
  padding: 10px 16px;
  font-size: var(--tools-fs-ui);
}

.tools-hero__main {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.2rem, 3vw, 1.85rem);
  align-items: start;
}

@media (min-width: 900px) {
  .tools-hero__main {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 290px);
    align-items: stretch;
    gap: clamp(1.5rem, 3.5vw, 2.75rem);
  }
}

.tools-hero__copy {
  text-align: left;
  animation: fadeInUp 0.7s ease-out 0.04s both;
}

.tools-hero__title {
  margin: 0 0 0.95rem;
  font-size: var(--tools-fs-hero);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: #2f2114;
}

.tools-hero__title-line {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: var(--tools-fs-hero-accent);
  color: #9f742f;
  letter-spacing: -0.02em;
}

.tools-hero__lede {
  margin: 0;
  max-width: 40rem;
  font-size: var(--tools-fs-body-lg);
  line-height: 1.68;
  color: rgba(88, 64, 38, 0.88);
}

.header-stats.tools-hero__stats {
  margin: 0;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp 0.7s ease-out 0.14s both;
}

@media (min-width: 900px) {
  .header-stats.tools-hero__stats {
    justify-content: center;
    align-self: stretch;
  }
}

@media (max-width: 899px) {
  /* One horizontal row of three compact stats (mobile + tablet narrow) */
  .header-stats.tools-hero__stats {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: stretch;
    align-items: stretch;
    gap: 6px;
  }

  .header-stats.tools-hero__stats .stat-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 6px;
  }

  .header-stats.tools-hero__stats .stat-number,
  .header-stats.tools-hero__stats .stat-label {
    text-align: center;
  }
}

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

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

.header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.75s ease-out 0.12s both;
}

.header-stats .stat-item {
  text-align: center;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.94));
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.header-stats .stat-item:hover {
  border-color: rgba(171, 124, 52, 0.4);
  box-shadow: 0 12px 32px -18px rgba(94, 65, 30, 0.28);
  transform: translateY(-3px);
  background: linear-gradient(180deg, #fffef9 0%, #f3e6cf 100%);
}

.stat-icon {
  width: 40px;
  height: 40px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(145, 103, 48, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.3);
  border-radius: 10px;
  color: #b98b3b;
  font-size: var(--tools-fs-stat-icon);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  grid-row: 1 / 3;
}

.header-stats .stat-item:hover .stat-icon {
  background: rgba(182, 138, 58, 0.16);
  border-color: rgba(171, 124, 52, 0.45);
  transform: scale(1.04);
  box-shadow: 0 6px 16px -8px rgba(94, 65, 30, 0.35);
}

.header-stats .stat-number {
  display: block;
  font-size: var(--tools-fs-stat);
  font-weight: 800;
  color: #9f742f;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 5px;
  transition: color 0.25s ease;
  min-height: 1.45rem;
}

.header-stats .stat-label {
  display: block;
  font-size: var(--tools-fs-label);
  color: rgba(88, 64, 38, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 3px;
}

/* Tools Grid Layout */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Closing band — space + soft CTA before footer (replaces old bottom stats block) */
.tools-page-closer {
  position: relative;
  margin-top: clamp(2.75rem, 7vw, 4.5rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.35rem, 3.5vw, 2rem) clamp(1.25rem, 3vw, 2rem);
  border-radius: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(145, 103, 48, 0.2);
  background: linear-gradient(165deg, rgba(255, 252, 246, 0.97) 0%, rgba(245, 232, 208, 0.92) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 18px 42px -28px rgba(94, 65, 30, 0.28);
  overflow: hidden;
}

.tools-page-closer__glow {
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 70%;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 100%, rgba(185, 139, 59, 0.12), transparent 65%);
  z-index: 0;
}

.tools-page-closer__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.tools-page-closer__lead {
  flex: 1 1 min(100%, 28rem);
  text-align: left;
}

.tools-page-closer__eyebrow {
  margin: 0 0 0.5rem;
  font-size: var(--tools-fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(122, 85, 38, 0.88);
}

.tools-page-closer__text {
  margin: 0;
  font-size: var(--tools-fs-body-lg);
  line-height: 1.65;
  color: rgba(88, 64, 38, 0.88);
  max-width: 36rem;
}

.tools-page-closer__text a {
  color: #8a6228;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tools-page-closer__text a:hover {
  color: #5e4329;
}

.tools-page-closer__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.tools-page-closer__pills li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: var(--tools-fs-small);
  font-weight: 600;
  color: rgba(94, 67, 41, 0.92);
  background: rgba(255, 252, 246, 0.75);
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 999px;
}

.tools-page-closer__pills i {
  color: #9f742f;
  font-size: var(--tools-fs-small);
  opacity: 0.95;
}

@media (max-width: 640px) {
  .tools-page-closer__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-page-closer__pills {
    justify-content: flex-start;
  }
}

/* Tool Categories */
.tool-category {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.95));
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.3);
  border: 1px solid rgba(145, 103, 48, 0.2);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tool-category[id] {
  scroll-margin-top: 5.5rem;
}

.tool-category:hover {
  border-color: rgba(171, 124, 52, 0.32);
  box-shadow: 0 18px 40px -22px rgba(94, 65, 30, 0.26);
}

.tool-category h3 {
  color: #7a5526;
  font-size: var(--tools-fs-section);
  margin-bottom: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-category h3 i {
  font-size: var(--tools-fs-section-icon);
}

/* Category Tools Grid */
.category-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
  gap: 24px;
  justify-content: start;
}

/* Individual Tool Cards */
.tool-card {
  background: linear-gradient(180deg, #fffaf2 0%, #f8ecd8 100%);
  border-radius: 12px;
  padding: 30px 30px 80px 30px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tool-card:hover {
  border-color: rgba(171, 124, 52, 0.38);
  box-shadow: 0 14px 32px -18px rgba(94, 65, 30, 0.28);
  transform: translateY(-4px);
}

/* Tool Icon */
.tool-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #b98b3b, #ab7c34);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.tool-icon i {
  font-size: var(--tools-fs-icon-card);
  color: #fff8ef;
}

.tool-card:hover .tool-icon {
  transform: scale(1.04);
  box-shadow: 0 8px 22px -10px rgba(94, 65, 30, 0.35);
}

/* Tool Card Content */
.tool-card h4 {
  color: #5e4329;
  font-size: var(--tools-fs-card-title);
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.tool-card p {
  color: rgba(88, 64, 38, 0.78);
  font-size: var(--tools-fs-body);
  line-height: 1.6;
  margin-bottom: 20px;
  min-height: 48px;
}

/* Tool Tags */
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  background: rgba(145, 103, 48, 0.1);
  color: #b98b3b;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: var(--tools-fs-tag);
  font-weight: 500;
  border: 1px solid rgba(145, 103, 48, 0.3);
  transition: all 0.3s ease;
}

.tool-card:hover .tag {
  background: rgba(145, 103, 48, 0.2);
  border-color: rgba(145, 103, 48, 0.5);
}

/* Tool Button - Matching index.html hero buttons */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--tools-fs-ui);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  position: absolute;
  bottom: 20px;
  left: 30px;
  right: 30px;
  overflow: hidden;
  border: 1px solid rgba(121, 85, 40, 0.45);
  cursor: pointer;
  justify-content: center;
}

.tool-btn:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
  box-shadow: 0 8px 22px -12px rgba(94, 65, 30, 0.45);
}

.tool-btn i {
  font-size: var(--tools-fs-small);
}

/* Disclaimer Section - Orange Theme */
.disclaimer-section {
  max-width: 1400px;
  margin: 40px auto 40px;
  padding: 0 20px;
}

.disclaimer-content {
  background: linear-gradient(135deg, #2d1b0f, #1f1409);
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(255, 140, 0, 0.12);
  border: 1px solid rgba(255, 140, 0, 0.3);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.disclaimer-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff8c00, #ffa500, #ff7f00, #ff8c00);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -200% 0; }
}

.disclaimer-content::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255, 140, 0, 0.1), transparent);
  border-radius: 12px;
  z-index: -1;
  animation: glow 4s ease-in-out infinite alternate;
}

@keyframes glow {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

.disclaimer-content p {
  color: #e8e8e8;
  line-height: 1.6;
  margin: 0;
  font-size: var(--tools-fs-body-lg);
  background: rgba(255, 140, 0, 0.03);
  padding: 0;
  border-radius: 0;
  border: none;
  transition: all 0.3s ease;
}

.disclaimer-content strong {
  color: #ffa500;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 140, 0, 0.2);
}

.disclaimer-content a {
  color: #ff8c00;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid transparent;
}

.disclaimer-content a:hover {
  color: #ffffff;
  background: rgba(255, 140, 0, 0.2);
  border-color: rgba(255, 140, 0, 0.5);
  text-decoration: none;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

/* Desktop: Icon left, text right layout */
@media (min-width: 769px) {
  .header-stats:not(.tools-hero__stats) {
    justify-content: flex-start;
  }

  .header-stats.tools-hero__stats {
    justify-content: center;
  }

  .header-stats .stat-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    text-align: left;
  }
  .header-stats .stat-icon {
    margin: 0;
    grid-row: 1 / 3;
    grid-column: 1;
    width: 48px;
    height: 48px;
    font-size: var(--tools-fs-stat-sm);
  }
  .header-stats .stat-number {
    margin-bottom: 2px;
    line-height: 1.1;
    grid-column: 2;
    grid-row: 1;
    text-align: left;
  }
  .header-stats .stat-label {
    margin-top: 0;
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .tools-container {
    padding: 40px 15px;
  }

  .tools-hero__surface {
    padding-left: calc(clamp(0.85rem, 3vw, 1.25rem) + 10px);
    padding-right: clamp(0.85rem, 3vw, 1.25rem);
  }

  .tools-hero__title {
    font-size: var(--tools-fs-hero-mobile);
  }

  .tools-hero__lede {
    font-size: var(--tools-fs-body);
  }

  .header-stats.tools-hero__stats .stat-item {
    padding: 8px 4px;
  }

  .tools-hero .stat-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    font-size: var(--tools-fs-small);
  }

  .tools-hero .header-stats .stat-number {
    font-size: var(--tools-fs-stat-sm);
  }

  .tools-hero .header-stats .stat-label {
    font-size: var(--tools-fs-eyebrow);
  }

  .header-stats:not(.tools-hero__stats) {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .header-stats:not(.tools-hero__stats) .stat-item {
    padding: 12px 8px;
    text-align: center;
  }

  .header-stats:not(.tools-hero__stats) .stat-icon {
    width: 32px;
    height: 32px;
    font-size: var(--tools-fs-caption);
    margin: 0 auto 6px;
  }

  .header-stats:not(.tools-hero__stats) .stat-number {
    font-size: var(--tools-fs-stat-sm);
    margin-bottom: 3px;
  }

  .header-stats:not(.tools-hero__stats) .stat-label {
    font-size: var(--tools-fs-eyebrow);
  }

  .disclaimer-section {
    padding: 0 15px;  /* Match tools-container exactly */
  }
  
  .disclaimer-content {
    padding: 15px 20px;
  }
  
  .disclaimer-content p {
    font-size: var(--tools-fs-body);
  }

  .tool-category {
    padding: 25px;
  }

  .tool-category h3 {
    font-size: var(--tools-fs-section-mobile);
  }

  .category-tools {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tool-card {
    padding: 25px 25px 80px 25px;
  }

  .tool-card h4 {
    font-size: var(--tools-fs-subhead);
  }

  .tool-card p {
    min-height: auto;
  }

  .tool-btn {
    left: 25px;
    right: 25px;
  }

  /* Mobile button alignment - Left to right */
  .btn-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
  }

  .btn {
    flex: 1;
    text-align: center;
  }

}

@media (max-width: 480px) {
  .tools-hero__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-hero .search-trigger-btn {
    width: 100%;
    justify-content: center;
  }

  .tools-hero__title {
    font-size: var(--tools-fs-hero-xs);
  }

  /* keep 3 stats in one row — same as max-width:899px; do not stack */
  .header-stats.tools-hero__stats {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .header-stats.tools-hero__stats .stat-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 3px;
  }

  .header-stats:not(.tools-hero__stats) {
    gap: 6px;
  }

  .header-stats:not(.tools-hero__stats) .stat-item {
    padding: 10px 6px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    font-size: var(--tools-fs-msearch);
  }

  .header-stats .stat-number {
    font-size: var(--tools-fs-stat-tight);
  }

  .header-stats .stat-label {
    font-size: var(--tools-fs-eyebrow);
  }

  .tool-category {
    padding: 20px;
  }

  .tool-card {
    padding: 20px 20px 80px 20px;
  }

  .tool-btn {
    left: 20px;
    right: 20px;
  }

  /* Keep hero buttons horizontal on mobile */
  .tools-hero .btn-container {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    max-width: 350px;
    margin: 0 auto;
  }

  .tools-hero .btn {
    flex: 1;
    padding: 11px 18px;
    font-size: var(--tools-fs-msearch);
    min-width: 120px;
    max-width: 160px;
    white-space: nowrap;
    border-radius: 6px;
  }
}

/* Additional hover animations for enhanced interactivity */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(145, 103, 48, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(145, 103, 48, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(145, 103, 48, 0);
  }
}


/* Page backdrop: orange accent top-right, cool accent bottom-left (matches toolkit body ::before/::after) */
body.page-toolkit-labs {
  background:
    radial-gradient(920px circle at 92% 12%, rgba(238, 152, 89, 0.14), transparent 42%),
    radial-gradient(880px circle at 10% 88%, rgba(89, 161, 238, 0.1), transparent 44%),
    linear-gradient(180deg, #faf7ef 0%, #f0e4d0 50%, #f6f3eb 100%);
  background-color: #f6f3eb;
  color: #4f3a24;
}

/* Sit main column above ambient ::before/::after blobs (same as tool-page-shell on other lab pages) */
body.page-toolkit-labs .tools-container {
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  body.page-toolkit-labs .tools-container {
    padding-bottom: max(5.5rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Loading animation for tool cards */
.tool-card {
  animation: cardFadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

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

/* Stagger animation delays for tool cards */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   Search Modal Styles
   ============================================ */

/* Search Section - Top of Hero */
.search-section {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.94));
  border-radius: 16px;
  padding: 20px 30px;
  margin-bottom: 30px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  box-shadow: 0 12px 32px -20px rgba(94, 65, 30, 0.28);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-section:hover {
  border-color: rgba(171, 124, 52, 0.32);
  box-shadow: 0 14px 36px -18px rgba(94, 65, 30, 0.3);
}

.search-section-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.search-section-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b98b3b;
  font-family: 'Outfit', sans-serif;
  font-size: var(--tools-fs-subhead);
  font-weight: 500;
}

.search-section-text i {
  font-size: var(--tools-fs-stat-sm);
  opacity: 0.8;
}

.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(182, 138, 58, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.35);
  border-radius: 10px;
  color: #7a5526;
  font-family: 'Outfit', sans-serif;
  font-size: var(--tools-fs-body-lg);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.search-trigger-btn:hover {
  background: rgba(182, 138, 58, 0.16);
  border-color: rgba(171, 124, 52, 0.45);
  box-shadow: 0 6px 18px -10px rgba(94, 65, 30, 0.35);
}

.search-trigger-btn:active {
  opacity: 0.95;
}

.search-trigger-btn i {
  font-size: var(--tools-fs-subhead);
}

.search-trigger-btn kbd {
  margin-left: 8px;
  padding: 3px 7px;
  background: rgba(145, 103, 48, 0.15);
  border: 1px solid rgba(145, 103, 48, 0.4);
  border-radius: 4px;
  font-size: var(--tools-fs-index);
  font-family: monospace;
  color: #b98b3b;
  font-weight: 600;
}

/* Search Modal */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

.search-modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 250, 242, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10001;
}

.search-modal-content {
  position: relative;
  z-index: 10002;
  width: 100%;
  max-width: 800px;
  margin-top: 60px;
  margin-bottom: 40px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.99), rgba(248, 238, 222, 0.97));
  border-radius: 16px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  box-shadow: 0 24px 50px -28px rgba(94, 65, 30, 0.45);
  animation: slideDown 0.3s ease-out;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

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

.search-modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(145, 103, 48, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: #b98b3b;
  font-size: var(--tools-fs-subhead);
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 14px 50px 14px 48px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 10px;
  color: #4a351f;
  font-family: 'Outfit', sans-serif;
  font-size: var(--tools-fs-search-input);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input:focus {
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.16);
  background: #fffef9;
}

.search-input::placeholder {
  color: #8c7558;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.search-clear-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.search-clear-btn:hover {
  color: #b98b3b;
  background: rgba(145, 103, 48, 0.1);
}

.search-close-btn {
  padding: 12px;
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 10px;
  color: #b98b3b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-width: 44px;
  height: 44px;
}

.search-close-btn:hover {
  background: rgba(145, 103, 48, 0.1);
  border-color: rgba(145, 103, 48, 0.4);
  transform: rotate(90deg);
}

.search-results-wrapper {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: calc(100vh - 280px);
}

.search-results-info {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(145, 103, 48, 0.1);
  background: rgba(248, 238, 222, 0.6);
}

.results-count {
  color: #b98b3b;
  font-size: var(--tools-fs-body-lg);
  font-weight: 500;
}

.search-hint {
  color: rgba(88, 64, 38, 0.65);
  font-size: var(--tools-fs-body);
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-hint kbd {
  padding: 2px 6px;
  background: rgba(145, 103, 48, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 4px;
  font-size: var(--tools-fs-caption);
  font-family: monospace;
  color: #b98b3b;
}

.search-results {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  padding: 16px;
  background: linear-gradient(180deg, #fffaf2 0%, #f5ead5 100%);
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.search-result-item:hover {
  border-color: rgba(171, 124, 52, 0.38);
  box-shadow: 0 10px 24px -16px rgba(94, 65, 30, 0.28);
  transform: translateX(2px);
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.search-result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(145, 103, 48, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 8px;
  color: #b98b3b;
  font-size: var(--tools-fs-subhead);
  flex-shrink: 0;
}

.search-result-title {
  flex: 1;
  color: #5e4329;
  font-size: var(--tools-fs-result-title);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

.search-result-category {
  padding: 4px 10px;
  background: rgba(145, 103, 48, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 12px;
  color: #b98b3b;
  font-size: var(--tools-fs-caption);
  font-weight: 500;
  white-space: nowrap;
}

.search-result-description {
  color: rgba(88, 64, 38, 0.76);
  font-size: var(--tools-fs-result-desc);
  line-height: 1.5;
  margin-bottom: 8px;
  margin-left: 52px;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 52px;
}

.search-result-tag {
  padding: 3px 8px;
  background: rgba(145, 103, 48, 0.05);
  border: 1px solid rgba(145, 103, 48, 0.15);
  border-radius: 6px;
  color: #b98b3b;
  font-size: var(--tools-fs-caption);
  font-weight: 400;
}

.search-no-results {
  padding: 60px 20px;
  text-align: center;
  color: rgba(88, 64, 38, 0.72);
}

.search-no-results i {
  font-size: var(--tools-fs-no-results-icon);
  color: rgba(171, 124, 52, 0.55);
  margin-bottom: 16px;
  display: block;
}

.search-no-results p {
  color: rgba(88, 64, 38, 0.78);
  font-size: var(--tools-fs-subhead);
  margin-bottom: 8px;
}

.search-no-results p:first-of-type {
  color: #5e4329;
  font-size: var(--tools-fs-result-title);
  font-weight: 500;
}

.no-results-hint {
  color: rgba(88, 64, 38, 0.62) !important;
  font-size: var(--tools-fs-body-lg) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Improved Search Section for Mobile */
  .search-section {
    padding: 14px 16px;
    margin-bottom: 25px;
    border-radius: 12px;
  }

  .search-section-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .search-section-text {
    font-size: var(--tools-fs-body);
    gap: 6px;
    flex-shrink: 0;
  }

  .search-section-text i {
    font-size: var(--tools-fs-subhead);
  }

  .search-section-text span {
    display: none;
  }

  .search-trigger-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 16px;
    font-size: var(--tools-fs-body);
    min-width: 0;
  }

  .search-trigger-btn span {
    display: inline;
  }

  .search-trigger-btn kbd {
    display: none;
  }

  .search-modal.active {
    padding: 10px;
  }

  .search-modal-content {
    margin-top: 20px;
    margin-bottom: 20px;
    max-height: calc(100vh - 40px);
    border-radius: 12px;
  }

  .search-modal-header {
    padding: 16px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .search-input-wrapper {
    flex: 1;
    width: auto;
  }

  .search-close-btn {
    align-self: auto;
    flex-shrink: 0;
  }

  .search-results-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .search-hint {
    font-size: var(--tools-fs-msearch);
  }

  .search-results {
    padding: 8px;
  }

  .search-result-item {
    padding: 14px;
  }

  .search-result-description,
  .search-result-tags {
    margin-left: 0;
    margin-top: 8px;
  }

  .search-result-header {
    flex-wrap: wrap;
  }

  .search-result-category {
    font-size: var(--tools-fs-index);
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  /* Improved Search Section for Small Mobile */
  .search-section {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .search-section-content {
    gap: 8px;
  }

  .search-section-text {
    font-size: var(--tools-fs-msearch);
  }

  .search-section-text i {
    font-size: var(--tools-fs-body-lg);
  }

  .search-section-text span {
    display: none;
  }

  .search-trigger-btn {
    padding: 10px 14px;
    font-size: var(--tools-fs-msearch);
    gap: 6px;
  }

  .search-trigger-btn span {
    display: inline;
    font-size: var(--tools-fs-msearch);
  }

  .search-trigger-btn i {
    font-size: var(--tools-fs-body-lg);
  }

  .search-result-title {
    font-size: var(--tools-fs-subhead);
  }

  .search-result-description {
    font-size: var(--tools-fs-body);
  }
}

