/* =====================================================
   TOOLSLIGHT — GLOBAL.CSS
   Source of truth for all design tokens + shared components.
   Loaded once, on every page, via the toolslight-tools plugin.
   To change the site's look: edit ONLY the :root block below.
   ===================================================== */


   /*Path : /home/toolslight.com/public_html/wp-content/plugins/toolslight-tools/assets/css/global.css*/
   
:root {
  color-scheme: light;
  --bg-body:       #FAFAFA;
  --bg-card:       #FFFFFF;
  --bg-subtle:     #F4F4F5;
  --border:        #E5E7EB;
  --border-hover:  #D1D5DB;

  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;

  /* Accent — Nephritis-derived green, ~4.7:1 contrast for white button text on light bg */
  --accent:         #1E8449;
  --accent-hover:   #17703C;
  --accent-bg:      #EAFBF3;
  --accent-text:    #145A32;

  /* Category eyebrows — sourced from Flat UI Colors palette */
  --calc-bg: #EAFBF3; --calc-text: #1E8449;   /* Nephritis */
  --gen-bg:  #EBF5FB; --gen-text:  #21618C;   /* Belize Hole */
  --conv-bg: #FDF2E9; --conv-text: #B9770E;   /* Carrot (darkened) */
  --dev-bg:  #EAECEE; --dev-text:  #2C3E50;   /* Wet Asphalt */

  /* Icon tints — pale bg + saturated icon color, both AA-safe on white */
  --icon-green-bg:  #D5F5E3; --icon-green:  #229954; /* Nephritis */
  --icon-blue-bg:   #D6EAF8; --icon-blue:   #2471A3; /* Belize Hole */
  --icon-orange-bg: #FAE5D3; --icon-orange: #CA6F1E; /* Carrot */
  --icon-purple-bg: #EBDEF0; --icon-purple: #8E44AD; /* Wisteria */
  --icon-slate-bg:  #D6DBDF; --icon-slate:  #34495E; /* Wet Asphalt */
  --icon-pink-bg:   #FADBD8; --icon-pink:   #C0392B; /* Pomegranate — stand-in for pink, swatch has none */

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-pill: 999px;
  --shadow-hover: 0 8px 20px rgba(0,0,0,0.06), 0 3px 6px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-body:       #111111;
  --bg-card:       #1C1C1C;
  --bg-subtle:     #222222;
  --border:        #2A2A2A;
  --border-hover:  #3D3D3D;

  --text-primary:   #F0EDE8;
  --text-secondary: #888888;
  --text-muted:     #505050;

  /* Accent — Emerald, ~10:1 contrast on dark bg. This is the fix for the
     "1.97 / Very poor" issue from Coolors — old dark-mode accent (#0a5c36)
     was too dark to use as text against dark backgrounds. */
     --accent: #15803D;
    --accent-hover: #166534;
  --accent-bg:      rgba(46,204,113,0.14);
  --accent-text:    #58D68D;

  --calc-bg: rgba(46,204,113,0.10);  --calc-text: #58D68D;  /* Emerald */
  --gen-bg:  rgba(52,152,219,0.10);  --gen-text:  #7FB3D5;  /* Peter River */
  --conv-bg: rgba(230,126,34,0.10);  --conv-text: #F0975A;  /* Carrot */
  --dev-bg:  rgba(52,73,94,0.16);    --dev-text:  #AEB6BF;  /* Concrete */

  --icon-green-bg:  rgba(39,174,96,0.14);  --icon-green:  #58D68D;
  --icon-blue-bg:   rgba(52,152,219,0.14); --icon-blue:   #7FB3D5;
  --icon-orange-bg: rgba(211,84,0,0.14);   --icon-orange: #F0975A;
  --icon-purple-bg: rgba(142,68,173,0.14); --icon-purple: #C39BD3;
  --icon-slate-bg:  rgba(52,73,94,0.18);   --icon-slate:  #AEB6BF;
  --icon-pink-bg:   rgba(192,57,43,0.14);  --icon-pink:   #F1948A;

  --shadow-hover: 0 8px 20px rgba(0,0,0,0.30);
}


/* =====================================================
   EARLY THEME BOOTSTRAP
   The class is added by a tiny inline <head> script before first paint.
   It prevents theme transitions from animating during page navigation.
   ===================================================== */
html.tl-theme-booting,
html.tl-theme-booting *,
html.tl-theme-booting *::before,
html.tl-theme-booting *::after {
  transition: none !important;
}

/* =====================================================
   BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* =====================================================
   HEADER + LOGO
   ===================================================== */
/* AFTER */
#tlHeader {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.25s ease;
}
[data-theme="dark"] #tlHeader { background: rgba(17,17,17,0.85); }
#tlHeader.scrolled { border-bottom-color: var(--border); }


.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.tl-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-primary);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
}

.logo-light-text {
  color: var(--accent);
  display: inline-block;
  max-width: 60px;
  margin-left: 2px;
  opacity: 1;
  overflow: hidden;
  transition: max-width 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease-out, margin 0.5s ease;
}

.tl-theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: transparent;
  cursor: pointer;
}

#light-icon {
  display: block;
  fill: var(--accent);
  stroke: var(--accent-hover);
  filter: drop-shadow(0 0 4px rgba(30, 132, 73, 0.48));
  transition: transform 0.3s ease, fill 0.4s ease, stroke 0.4s ease, filter 0.4s ease;
}

.tl-theme-toggle:hover #light-icon { transform: scale(1.1) rotate(5deg); }
.tl-theme-toggle:focus-visible { box-shadow: 0 0 0 3px var(--accent-bg); }
[data-theme="dark"] #light-icon { fill: transparent; stroke: var(--text-primary); filter: none; }

.tl-theme-hint {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 500;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 9px 12px;
  border: 1px solid var(--border-hover);
  border-radius: 9px;
  background: var(--text-primary);
  color: var(--bg-card);
  box-shadow: var(--shadow-hover);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.tl-theme-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--border-hover);
  border-left: 1px solid var(--border-hover);
  background: var(--text-primary);
  transform: translateX(-50%) rotate(45deg);
}

.tl-theme-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

#tlHeader.scrolled .logo-light-text { max-width: 0; opacity: 0; margin-left: 0; }

nav.desktop-nav { display: flex; align-items: center; gap: 6px; }

.nav-item { position: relative; }
.nav-trigger {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary); padding: 8px 10px; border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.15s;
}
.nav-trigger:hover { color: var(--text-primary); }
.nav-item.open .nav-trigger { color: var(--text-primary); background: var(--bg-subtle); }
.nav-chevron { font-size: 15px; transition: transform 0.2s ease; color: var(--text-muted); }
.nav-item.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  width: 360px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
}
.nav-dropdown.is-wide { width: 560px; }
.nav-item:nth-last-child(-n+2) .nav-dropdown {
  left: auto;
  right: 0;
  transform: translateY(-6px);
}
.nav-item.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-item:nth-last-child(-n+2).open .nav-dropdown { transform: translateY(0); }

.nav-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 7px 9px;
  border-bottom: 1px solid var(--border);
}
.nav-dropdown-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.nav-dropdown-head small { font-size: 10.5px; color: var(--text-muted); }
.nav-dropdown-grid { display: grid; grid-template-columns: 1fr; gap: 2px; padding-top: 6px; }
.nav-dropdown.is-wide .nav-dropdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  color: var(--text-primary);
  transition: background 0.15s;
}
.nav-dropdown-item:hover { background: var(--bg-subtle); }
.nav-dropdown-item > i {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 16px;
}
.nav-dropdown-item .nd-text { display: flex; flex-direction: column; min-width: 0; }
.nav-dropdown-item .nd-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.nav-dropdown-item .nd-desc {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.nav-dropdown-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: color .15s, background .15s;
}
.nav-dropdown-view-all:hover { color: var(--accent); background: var(--bg-subtle); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 22px;
  padding: 6px;
  line-height: 0;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg-body);
  overflow-y: auto;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 24px;
  padding: 6px;
  line-height: 0;
}
.mobile-nav-body { padding: 8px 20px 40px; }
.mobile-nav-group { border-bottom: 1px solid var(--border); }
.mobile-nav-cat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 17px 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.mobile-nav-cat > span { display: flex; align-items: center; gap: 8px; }
.mobile-nav-cat small {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}
.mobile-nav-cat > i { font-size: 17px; color: var(--text-muted); transition: transform 0.2s ease; }
.mobile-nav-group.open .mobile-nav-cat > i { transform: rotate(180deg); }
.mobile-nav-list { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.mobile-nav-group.open .mobile-nav-list { max-height: 700px; }
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 2px 11px 4px;
  color: var(--text-secondary);
  font-size: 14px;
}
.mobile-nav-item i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 15px;
}
.mobile-nav-item .nd-title { color: var(--text-primary); font-weight: 500; }
.mobile-nav-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 10px;
  padding: 11px 4px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

/* =====================================================
   HERO
   ===================================================== */
.hero { padding: 76px 0 56px; text-align: center; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 14px; color: var(--text-primary); }
.hero h1 span { color: var(--accent); }
.hero .sub { font-size: 16px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 36px; }

/* Search box — no glow ring, no kbd, cycling placeholder */
.search-shell { max-width: 480px; margin: 0 auto 28px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--border-hover); }
.search-icon { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 15px;
  background: transparent;
  color: var(--text-primary);
}
.search-box input::placeholder { color: var(--text-muted); }

.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap input { width: 100%; }
.search-placeholder-overlay{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.search-cursor{
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-start infinite;
  vertical-align: middle;
}
@keyframes blink{ 50% { opacity: 0; } }

/* Filter pills */
.filters { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  font-size: 13px; font-weight: 500; font-family: var(--font);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 6px 16px; background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s ease;
}
.filter-pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.filter-pill.active { background: var(--text-primary); color: var(--bg-body); border-color: var(--text-primary); }

/* =====================================================
   TOOL SECTIONS (homepage category blocks)
   ===================================================== */
.tools { padding-bottom: 80px; }
.section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.eyebrow {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 5px 12px; border-radius: var(--radius-sm);
}
.calc .eyebrow { background: var(--calc-bg); color: var(--calc-text); }
.gen  .eyebrow { background: var(--gen-bg);  color: var(--gen-text);  }
.conv .eyebrow { background: var(--conv-bg); color: var(--conv-text); }
.dev  .eyebrow { background: var(--dev-bg);  color: var(--dev-text);  }

.view-all { font-size: 13px; color: var(--text-secondary); transition: color 0.2s; }
.view-all:hover { color: var(--accent); }

/* =====================================================
   CARD GRID
   ===================================================== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; color: inherit;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.icon-box { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.icon-green  { background: var(--icon-green-bg);  color: var(--icon-green);  }
.icon-blue   { background: var(--icon-blue-bg);   color: var(--icon-blue);   }
.icon-orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.icon-purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.icon-slate  { background: var(--icon-slate-bg);  color: var(--icon-slate);  }
.icon-pink   { background: var(--icon-pink-bg);   color: var(--icon-pink);   }

.card-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); margin-bottom: 3px; }
.card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.badge {
  display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 500;
  background: var(--bg-subtle); color: var(--text-muted); border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: auto; align-self: flex-start;
}

/* =====================================================
   TOOL PAGE — shared shell used by every tool
   ===================================================== */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted);
  margin: 20px 0 8px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.tool-page-title { text-align: center; padding: 20px 0 10px; }
.tool-page-title h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.tool-page-title p { font-size: 14.5px; color: var(--text-secondary); }

.layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 32px; align-items: start; padding: 24px 0 64px; }

.tool-shell { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }

.field-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 8px; }

.tl-input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-body); color: var(--text-primary); font-family: var(--font);
  font-size: 14px; padding: 11px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.tl-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.tl-input[type="date"] {
  min-height: 44px;
  cursor: pointer;
}
.tl-input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.tl-input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: var(--bg-subtle);
}

.btn-primary {
  width: 100%; height: 42px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: background 0.15s; margin-top: 14px;
}
.btn-primary:hover { background: var(--accent-hover); }

.result-box { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; margin-top: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.result-cell { text-align: center; }
.result-cell .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.result-cell .lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.result-sentence { text-align: center; font-size: 13.5px; color: var(--text-secondary); margin-bottom: 14px; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-cell { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat-cell .lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.stat-cell .val { font-size: 17px; font-weight: 700; }

.about-section { margin-top: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.about-section h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.about-section h3 { font-size: 14.5px; font-weight: 700; margin: 20px 0 8px; }
.about-section p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.about-section ul { margin: 6px 0 6px 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.8; }

.sidebar { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.sidebar-card h4 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }

.related-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-secondary); transition: color 0.2s;
}
.related-item:first-of-type { border-top: none; }
.related-item:hover { color: var(--accent); }
.related-item i { font-size: 15px; color: var(--text-muted); flex-shrink: 0; }
.soon-tag {
  margin-left: auto; font-size: 10px; color: var(--text-muted); background: var(--bg-subtle);
  padding: 2px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* =====================================================
   DYNAMIC TOOL COMPONENTS
   ===================================================== */
.tl-tool-error {
  margin: 20px;
  padding: 14px;
  border: 1px solid #ef4444;
  border-radius: var(--radius-sm);
  background: #fff5f5;
  color: #b91c1c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.tl-related-tools .related-item > span { min-width: 0; }
.tl-related-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 11px 0 2px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}
.tl-related-view-all:hover { color: var(--accent-hover); }

/* =====================================================
   FOOTER
   ===================================================== */
#tlFooter { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.footer-logo { font-weight: 800; letter-spacing: 0.07em; font-size: 13px; color: var(--text-secondary); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text-primary); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 14px; }
  nav.desktop-nav { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .hero h1 { font-size: 30px; }
  .hero .sub { font-size: 14px; }
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
  .tool-page-title h1 { font-size: 24px; }
  .stat-row { grid-template-columns: 1fr; }
  .tool-shell, .about-section { padding: 20px; }
  .hero { margin-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .logo-light-text, #light-icon, .tl-theme-hint { transition: none; animation: none; }
}
/* =====================================================
   ACCESSIBILITY + WORDPRESS SHELL SAFETY
   ===================================================== */
[hidden] { display: none !important; }
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Only flatten GeneratePress's content wrapper on the dedicated homepage. */
.tl-homepage-page #page,
.tl-homepage-page .site.grid-container,
.tl-homepage-page .site-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.tl-homepage-page #primary,
.tl-homepage-page .content-area,
.tl-homepage-page .site-main {
  width: 100%;
  margin: 0;
  padding: 0;
}
.tl-homepage-page .inside-article,
.tl-homepage-page .entry-content {
  margin: 0;
  padding: 0;
  background: transparent;
}
.tl-homepage-page .entry-header { display: none; }

/* GeneratePress's own footer is replaced by #tlFooter below. */
.site-footer { display: none; }

/* =====================================================
   COMPLETE DYNAMIC HOMEPAGE
   ===================================================== */
.tl-home {
  overflow: hidden;
  background: var(--bg-body);
}

.tl-home-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 0%, var(--accent-bg), transparent 38%),
    var(--bg-body);
}
.tl-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.45), transparent 78%);
}
.tl-home-hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 82px;
  padding-bottom: 46px;
  text-align: center;
}
.tl-home-hero-copy {
  max-width: 760px;
  margin: 0 auto;
}
.tl-home-overline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.tl-home-overline i { color: var(--accent); font-size: 14px; }
.tl-home-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.tl-home-hero h1 span { color: var(--accent); }
.tl-home-hero-copy > p {
  max-width: 670px;
  margin: 20px auto 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.75;
}

.tl-home-search-shell {
  max-width: 680px;
  margin: 34px auto 0;
}
.tl-home-search-box {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 12px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg-card);
  box-shadow: 0 18px 45px rgba(0,0,0,.07), 0 3px 10px rgba(0,0,0,.04);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
[data-theme="dark"] .tl-home-search-box {
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.tl-home-search-box:focus-within {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0,0,0,.09), 0 0 0 3px var(--accent-bg);
}
.tl-home-search-box > i {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 20px;
}
.tl-home-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.tl-home-search-input-wrap input {
  width: 100%;
  height: 56px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
}
.tl-home-search-input-wrap input::-webkit-search-cancel-button { display: none; }
.tl-home-search-placeholder {
  position: absolute;
  top: 50%;
  left: 0;
  max-width: 100%;
  overflow: hidden;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity .15s ease;
}
.tl-home-search-placeholder.is-hidden { opacity: 0; }
.tl-home-search-clear {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}
.tl-home-search-clear:hover { color: var(--text-primary); }
.tl-home-search-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px 0;
  color: var(--text-muted);
  font-size: 11.5px;
}

.tl-home-filters { margin-top: 22px; }
.tl-home-filters .filter-pill {
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
}
.tl-home-filters .filter-pill.active {
  background: var(--text-primary);
  color: var(--bg-body);
}
.tl-home-trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 27px;
  color: var(--text-secondary);
  font-size: 12px;
}
.tl-home-trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.tl-home-trust-row i { color: var(--accent); font-size: 15px; }

.tl-home-main { padding-top: 54px; padding-bottom: 76px; }
.tl-home-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.tl-home-section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tl-home-section-heading h2,
.tl-home-values h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.tl-home-section-heading p,
.tl-home-values-copy > p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.tl-home-featured {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.tl-home-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tl-featured-card {
  min-height: 220px;
  padding: 24px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-bg) 65%, var(--bg-card)), var(--bg-card) 50%);
}
.tl-featured-card .icon-box {
  width: 48px;
  height: 48px;
  font-size: 22px;
}
.tl-featured-card .card-name { font-size: 16px; }

.tl-home-directory { padding-top: 48px; }
.tl-home-directory-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 11px;
}
.tl-home-category {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.tl-home-category:last-child { border-bottom: 0; }
.tl-home-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.tl-home-category-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}
.tl-home-category-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 18px;
}
.tl-home-category.calc .tl-home-category-icon { background: var(--calc-bg); color: var(--calc-text); }
.tl-home-category.gen .tl-home-category-icon { background: var(--gen-bg); color: var(--gen-text); }
.tl-home-category.conv .tl-home-category-icon { background: var(--conv-bg); color: var(--conv-text); }
.tl-home-category.dev .tl-home-category-icon { background: var(--dev-bg); color: var(--dev-text); }
.tl-home-category-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tl-home-category-count {
  color: var(--text-muted);
  font-size: 11px;
}
.tl-home-category-title-wrap p {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.tl-home-category .view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-top: 5px;
  font-weight: 600;
}
.tl-home-tool-grid { align-items: stretch; }
.tl-home-overflow-card { display: none; }
.tl-home.is-searching .tl-home-overflow-card:not([hidden]) { display: flex; }

.tl-tool-card { min-width: 0; }
.tl-tool-card-copy { min-width: 0; }
.tl-tool-card .card-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.tl-tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.tl-tool-card-footer .badge { margin-top: 0; }
.tl-tool-card-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.tl-tool-card:hover .tl-tool-card-arrow {
  color: var(--accent);
  background: var(--accent-bg);
  transform: translate(1px, -1px);
}

.tl-home-empty {
  max-width: 520px;
  margin: 58px auto 12px;
  padding: 36px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  text-align: center;
}
.tl-home-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 21px;
}
.tl-home-empty h3 { margin: 0; font-size: 17px; }
.tl-home-empty p { margin: 8px 0 18px; color: var(--text-secondary); font-size: 13px; }
.tl-home-empty-reset {
  padding: 9px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tl-home-empty-reset:hover { background: var(--accent-hover); }

.tl-home-values {
  display: grid;
  grid-template-columns: .85fr 1.65fr;
  gap: 42px;
  margin-top: 48px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.tl-home-values-copy { align-self: center; }
.tl-home-values-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tl-home-values-grid article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.tl-home-values-grid article > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--accent);
  font-size: 17px;
}
.tl-home-values-grid h3 {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
}
.tl-home-values-grid p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.6;
}

/* =====================================================
   DYNAMIC SITE FOOTER
   ===================================================== */
#tlFooter {
  padding: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.tl-footer-main {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(145px, .7fr));
  gap: 44px;
  padding-top: 42px;
  padding-bottom: 36px;
}
.tl-footer-brand .logo {
  display: inline-flex;
  margin-bottom: 13px;
}
.tl-footer-brand p {
  max-width: 310px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.7;
}
.tl-footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.tl-footer-column h2 {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tl-footer-column > a,
.tl-footer-menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  transition: color .15s ease;
}
.tl-footer-column a:hover { color: var(--accent); }
.tl-footer-column a span {
  color: var(--text-muted);
  font-size: 10px;
}
.tl-footer-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 17px;
  padding-bottom: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
}

/* =====================================================
   HOMEPAGE + FOOTER RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .tl-home-values { grid-template-columns: 1fr; }
  .tl-footer-main { grid-template-columns: 1.25fr repeat(2, 1fr); }
  .tl-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .tl-home-hero-inner { padding-top: 62px; padding-bottom: 38px; }
  .tl-home-hero-copy > p { font-size: 15px; }
  .tl-home-search-meta { justify-content: center; }
  .tl-home-search-meta span:last-child { display: none; }
  .tl-home-featured-grid { grid-template-columns: 1fr; }
  .tl-featured-card { min-height: auto; }
  .tl-home-section-heading,
  .tl-home-category-head { align-items: flex-start; }
  .tl-home-values-grid { grid-template-columns: 1fr; }
  .tl-footer-main { grid-template-columns: repeat(2, 1fr); gap: 30px 24px; }
  .tl-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .tl-home-hero-inner { padding-top: 48px; }
  .tl-home-overline { margin-bottom: 16px; }
  .tl-home-hero h1 { font-size: 39px; }
  .tl-home-search-shell { margin-top: 27px; }
  .tl-home-search-box { min-height: 54px; padding-left: 14px; }
  .tl-home-search-input-wrap input { height: 52px; font-size: 14px; }
  .tl-home-search-placeholder { font-size: 14px; }
  .tl-home-trust-row { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 18px; }
  .tl-home-main { padding-top: 40px; padding-bottom: 54px; }
  .tl-home-section-heading,
  .tl-home-category-head { display: block; }
  .tl-home-directory-count { display: inline-flex; margin-top: 14px; }
  .tl-home-category .view-all { margin-top: 14px; }
  .tl-home-category-title-wrap { gap: 10px; }
  .tl-home-category-icon { width: 36px; height: 36px; }
  .tl-home-values { padding: 22px; gap: 25px; }
  .tl-footer-main { grid-template-columns: 1fr; }
  .tl-footer-brand { grid-column: auto; }
  .tl-footer-bottom { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-home-search-box,
  .tl-home-search-placeholder,
  .tl-tool-card-arrow { transition: none; }
}

/* =====================================================
   RELATED TOOLS — FULL-WIDTH SECTION BELOW ABOUT
   Keeps the existing full homepage, header, footer, and shared component CSS.
   Applies only to containers that directly contain the dynamic related-tools
   sidebar, changing the order to: Tool → About → Related Tools.
   ===================================================== */
:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-tools) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 32px !important;
  align-items: start !important;
}

:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-tools) > .main-col,
:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-tools) > .about-section {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-tools) > .sidebar {
  position: static !important;
  top: auto !important;
  grid-column: 1 / -1;
  width: 100%;
  max-width: none !important;
  align-self: stretch;
}

.sidebar > .tl-related-tools.sidebar-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  width: 100%;
  padding: 28px;
  border-radius: var(--radius-lg);
}

.sidebar > .tl-related-tools.sidebar-card h4 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-transform: none;
}

.sidebar > .tl-related-tools.sidebar-card .related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.sidebar > .tl-related-tools.sidebar-card .related-item:first-of-type {
  border-top: 1px solid var(--border);
}

.sidebar > .tl-related-tools.sidebar-card .related-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.sidebar > .tl-related-tools.sidebar-card .related-item > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 18px;
}

.sidebar > .tl-related-tools.sidebar-card .tl-related-view-all {
  grid-column: 1 / -1;
  justify-self: flex-start;
  width: auto;
  margin-top: 4px;
  padding: 10px 0 0;
}

@media (max-width: 560px) {
  .sidebar > .tl-related-tools.sidebar-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }

  .sidebar > .tl-related-tools.sidebar-card .related-item {
    min-height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar > .tl-related-tools.sidebar-card .related-item {
    transition: none;
  }
}

/* =====================================================
   HOMEPAGE V4
   Homepage-only redesign. Other pages keep their current layout.
   Card limits are controlled in includes/components/homepage.php.
   ===================================================== */

/* Keep the complete logo visible while scrolling on the homepage. */
.tl-homepage-page #tlHeader.scrolled .logo-light-text {
  max-width: 60px;
  margin-left: 2px;
  opacity: 1;
}

.tl-header-homepage .header-inner {
  height: 64px;
}

.tl-home-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-home-header-login,
.tl-home-header-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.tl-home-header-login {
  color: var(--text-secondary);
}

.tl-home-header-login:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.tl-home-header-signup {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.tl-home-header-signup:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.tl-home-v4 {
  min-height: 70vh;
  overflow: hidden;
  background: var(--bg-body);
}

.tl-home-v4-hero {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.tl-home-v4-hero-inner {
  padding-top: 78px;
  padding-bottom: 72px;
  text-align: center;
}

.tl-home-v4-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(40px, 6vw, 66px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.048em;
}

.tl-home-v4-hero p {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.tl-home-v4-search-launcher {
  width: min(100%, 760px);
  min-height: 60px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 34px auto 0;
  padding: 0 16px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  color: var(--text-secondary);
  text-align: left;
  cursor: text;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tl-home-v4-search-launcher:hover,
.tl-home-v4-search-launcher:focus-visible {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.tl-home-v4-search-launcher > i {
  color: var(--text-muted);
  font-size: 20px;
}

.tl-home-v4-search-launcher > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-home-v4-search-launcher > small {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.tl-home-v4-main {
  padding-top: 62px;
  padding-bottom: 76px;
}

.tl-home-v4-section + .tl-home-v4-section {
  margin-top: 68px;
}

.tl-home-v4-section-heading {
  max-width: 620px;
  margin: 0 auto 26px;
  text-align: center;
}

.tl-home-v4-section-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.03em;
}

.tl-home-v4-section-heading p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
}

.tl-home-v4-featured {
  padding-bottom: 62px;
  border-bottom: 1px solid var(--border);
}

.tl-home-v4-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.tl-home-v4-tool-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 102px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.tl-home-v4-tool-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.tl-home-v4-tool-icon,
.tl-home-v4-category-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--accent-bg);
  color: var(--accent-text);
}

.tl-home-v4-tool-icon {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.tl-home-v4-tool-copy,
.tl-home-v4-category-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tl-home-v4-tool-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-home-v4-tool-copy > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tl-home-v4-tool-copy small {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.tl-home-v4-card-arrow {
  align-self: start;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 15px;
  transition: color .16s ease, transform .16s ease;
}

.tl-home-v4-tool-card:hover .tl-home-v4-card-arrow,
.tl-home-v4-category-card:hover .tl-home-v4-card-arrow {
  color: var(--accent);
  transform: translate(1px, -1px);
}

.tl-home-v4-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tl-home-v4-category-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  min-width: 0;
  min-height: 154px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.tl-home-v4-category-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.tl-home-v4-category-icon {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.tl-home-v4-category-card.calc .tl-home-v4-category-icon { background: var(--calc-bg); color: var(--calc-text); }
.tl-home-v4-category-card.gen .tl-home-v4-category-icon { background: var(--gen-bg); color: var(--gen-text); }
.tl-home-v4-category-card.conv .tl-home-v4-category-icon { background: var(--conv-bg); color: var(--conv-text); }
.tl-home-v4-category-card.dev .tl-home-v4-category-icon { background: var(--dev-bg); color: var(--dev-text); }

.tl-home-v4-category-copy strong {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.018em;
}

.tl-home-v4-category-copy > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.58;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tl-home-v4-category-copy small {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

/* Homepage search overlay */
body.tl-home-search-open {
  overflow: hidden;
}

.tl-home-v4-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 82px 20px 24px;
  opacity: 0;
  transition: opacity .17s ease;
}

.tl-home-v4-search-overlay.is-open {
  opacity: 1;
}

.tl-home-v4-search-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(17, 24, 39, .42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: default;
}

[data-theme="dark"] .tl-home-v4-search-backdrop {
  background: rgba(0, 0, 0, .64);
}

.tl-home-v4-search-dialog {
  position: relative;
  width: min(100%, 900px);
  max-height: calc(100vh - 106px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
  transform: translateY(-8px);
  transition: transform .17s ease;
}

.tl-home-v4-search-overlay.is-open .tl-home-v4-search-dialog {
  transform: translateY(0);
}

.tl-home-v4-search-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 0 9px 0 15px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-body);
}

.tl-home-v4-search-input-row:focus-within {
  border-color: var(--accent);
}

.tl-home-v4-search-input-row > i {
  color: var(--text-muted);
  font-size: 20px;
}

.tl-home-v4-search-input-row input {
  width: 100%;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
}

.tl-home-v4-search-input-row input::placeholder {
  color: var(--text-muted);
}

.tl-home-v4-search-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.tl-home-v4-search-close:hover {
  color: var(--text-primary);
}

.tl-home-v4-search-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 4px 11px;
}

.tl-home-v4-search-status-row strong {
  color: var(--text-primary);
  font-size: 14px;
}

.tl-home-v4-search-status-row span {
  color: var(--text-muted);
  font-size: 12px;
}

.tl-home-v4-search-results {
  min-height: 100px;
}

.tl-home-v4-search-group-title {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.tl-home-v4-search-related-group {
  margin-top: 16px;
}

.tl-home-v4-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tl-home-v4-search-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tl-home-v4-search-card:hover,
.tl-home-v4-search-card:focus-visible {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.tl-home-v4-search-card.is-primary {
  min-height: 112px;
  padding: 18px;
  border-color: var(--accent);
  background: var(--accent-bg);
}

.tl-home-v4-search-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 19px;
}

.tl-home-v4-search-card.is-primary .tl-home-v4-search-card-icon {
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  font-size: 22px;
}

.tl-home-v4-search-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tl-home-v4-search-card-copy small {
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
}

.tl-home-v4-search-card-copy strong {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-home-v4-search-card.is-primary .tl-home-v4-search-card-copy strong {
  font-size: 17px;
}

.tl-home-v4-search-card-copy > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tl-home-v4-search-card-arrow {
  color: var(--text-muted);
  font-size: 15px;
}

.tl-home-v4-search-empty {
  padding: 48px 20px 36px;
  text-align: center;
}

.tl-home-v4-search-empty > i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 21px;
}

.tl-home-v4-search-empty h3 {
  margin: 0;
  font-size: 17px;
}

.tl-home-v4-search-empty p {
  max-width: 440px;
  margin: 7px auto 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .tl-home-v4-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .tl-home-v4-hero-inner {
    padding-top: 58px;
    padding-bottom: 54px;
  }

  .tl-home-v4-hero h1 {
    font-size: 42px;
  }

  .tl-home-v4-main {
    padding-top: 48px;
    padding-bottom: 58px;
  }

  .tl-home-v4-section + .tl-home-v4-section {
    margin-top: 52px;
  }

  .tl-home-v4-featured {
    padding-bottom: 50px;
  }

  .tl-home-v4-category-grid,
  .tl-home-v4-search-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-home-v4-category-card {
    min-height: 138px;
    padding: 20px;
  }

  .tl-home-v4-search-overlay {
    padding: 68px 12px 12px;
  }

  .tl-home-v4-search-dialog {
    max-height: calc(100vh - 80px);
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .tl-home-header-actions {
    gap: 4px;
  }

  .tl-home-header-login {
    display: none;
  }

  .tl-home-header-signup {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .tl-home-v4-hero-inner {
    padding-top: 48px;
    padding-bottom: 46px;
  }

  .tl-home-v4-hero h1 {
    font-size: 36px;
    letter-spacing: -.04em;
  }

  .tl-home-v4-hero p {
    margin-top: 13px;
    font-size: 14.5px;
  }

  .tl-home-v4-search-launcher {
    min-height: 56px;
    margin-top: 27px;
    padding-left: 15px;
  }

  .tl-home-v4-search-launcher > span {
    font-size: 14px;
  }

  .tl-home-v4-search-launcher > small {
    display: none;
  }

  .tl-home-v4-featured-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-home-v4-section-heading {
    margin-bottom: 20px;
  }

  .tl-home-v4-section-heading h2 {
    font-size: 25px;
  }

  .tl-home-v4-tool-card {
    min-height: 90px;
    padding: 14px;
  }

  .tl-home-v4-category-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    min-height: 124px;
    padding: 17px;
  }

  .tl-home-v4-category-icon {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }

  .tl-home-v4-category-copy strong {
    font-size: 16px;
  }

  .tl-home-v4-category-copy > span {
    margin-top: 5px;
    font-size: 13px;
  }

  .tl-home-v4-category-copy small {
    margin-top: 8px;
    font-size: 11.5px;
  }

  .tl-home-v4-category-card > .tl-home-v4-card-arrow {
    display: none;
  }

  .tl-home-v4-search-overlay {
    padding: 8px;
  }

  .tl-home-v4-search-dialog {
    width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .tl-home-v4-search-card.is-primary {
    min-height: 98px;
    padding: 14px;
  }

  .tl-home-v4-search-status-row {
    padding-top: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-home-v4-search-launcher,
  .tl-home-v4-tool-card,
  .tl-home-v4-category-card,
  .tl-home-v4-card-arrow,
  .tl-home-v4-search-overlay,
  .tl-home-v4-search-dialog,
  .tl-home-v4-search-card {
    transition: none;
  }
}

/* =====================================================
   INTERIOR HEADER V2

   This block applies only to non-homepage headers. The approved homepage
   header and homepage layout remain unchanged.
   ===================================================== */

body.tl-page-overlay-open {
  overflow: hidden;
}

#tlHeader.tl-header-interior {
  background: var(--bg-card);
  border-bottom-color: var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#tlHeader.tl-header-interior.scrolled {
  background: var(--bg-card);
}

.tl-interior-header-main {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 66px;
}

.tl-interior-header-brand {
  display: flex;
  align-items: center;
  min-width: 132px;
}

#tlHeader.tl-header-interior.scrolled .logo-light-text {
  max-width: 60px;
  margin-left: 2px;
  opacity: 1;
}

.tl-interior-search-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  color: var(--text-muted);
  cursor: text;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tl-interior-search-launcher:hover,
.tl-interior-search-launcher:focus-visible {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.tl-interior-search-launcher i {
  flex: 0 0 auto;
  font-size: 18px;
}

.tl-interior-search-launcher span {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-interior-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 144px;
}

.tl-interior-login,
.tl-interior-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.tl-interior-login {
  color: var(--text-secondary);
}

.tl-interior-login:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tl-interior-signup {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.tl-interior-signup:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.tl-interior-category-strip {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.tl-interior-category-strip-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 43px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tl-interior-category-strip-inner::-webkit-scrollbar {
  display: none;
}

.tl-interior-category-strip a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: color .16s ease;
}

.tl-interior-category-strip a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(.55);
  transition: opacity .16s ease, transform .16s ease;
}

.tl-interior-category-strip a:hover,
.tl-interior-category-strip a.is-active {
  color: var(--text-primary);
}

.tl-interior-category-strip a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

#tlHeader.tl-header-interior .nav-toggle {
  display: none;
}

.tl-mobile-search-open {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  margin: 8px 0 10px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

/* ---------- Global tool-search overlay ---------- */
.tl-site-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 86px 18px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease;
}

.tl-site-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.tl-site-search-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(17, 24, 39, .34);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: default;
}

[data-theme="dark"] .tl-site-search-backdrop {
  background: rgba(0, 0, 0, .58);
}

.tl-site-search-dialog {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 24px 70px rgba(0,0,0,.18);
  transform: translateY(-8px);
  transition: transform .16s ease;
}

.tl-site-search-overlay.is-open .tl-site-search-dialog {
  transform: translateY(0);
}

.tl-site-search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tl-site-search-head span {
  display: block;
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tl-site-search-head h2 {
  margin: 3px 0 0;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.tl-site-search-head > button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.tl-site-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.tl-site-search-field > i {
  position: absolute;
  left: 15px;
  z-index: 1;
  color: var(--text-muted);
  font-size: 19px;
  pointer-events: none;
}

.tl-site-search-field input {
  width: 100%;
  min-height: 54px;
  padding: 12px 48px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: 0;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color .16s ease;
}

.tl-site-search-field input:focus {
  border-color: var(--accent);
}

.tl-site-search-field input::placeholder {
  color: var(--text-muted);
}

.tl-site-search-field > button {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.tl-site-search-status {
  margin: 9px 2px 13px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.tl-site-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tl-site-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  min-width: 0;
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: inherit;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tl-site-search-result:hover,
.tl-site-search-result:focus-visible {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.tl-site-search-result.is-best {
  grid-column: 1 / -1;
  min-height: 104px;
  border-color: var(--accent);
  background: var(--accent-bg);
}

.tl-site-search-result-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 18px;
}

.tl-site-search-result.is-best .tl-site-search-result-icon {
  background: var(--bg-card);
}

.tl-site-search-result-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tl-site-search-result-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-site-search-result-copy > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tl-site-search-result-copy small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.tl-site-search-result > i {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 15px;
}

.tl-site-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 18px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  text-align: center;
}

.tl-site-search-empty > i {
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 24px;
}

.tl-site-search-empty strong {
  font-size: 15px;
}

.tl-site-search-empty span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

@media (max-width: 860px) {
  .tl-interior-header-main {
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 14px;
  }

  .tl-interior-header-actions {
    min-width: auto;
  }

  .tl-interior-login {
    display: none;
  }
}

@media (max-width: 700px) {
  .tl-interior-header-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 60px;
  }

  .tl-interior-header-actions {
    display: none;
  }

  #tlHeader.tl-header-interior .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tl-interior-search-launcher {
    justify-self: end;
    width: 42px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    cursor: pointer;
  }

  .tl-interior-search-launcher span {
    display: none;
  }

  .tl-interior-category-strip-inner {
    gap: 22px;
    min-height: 42px;
  }

  .tl-interior-category-strip a {
    min-height: 42px;
    font-size: 12.5px;
  }

  .tl-site-search-overlay {
    padding: 68px 12px 12px;
  }

  .tl-site-search-dialog {
    max-height: calc(100vh - 80px);
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .tl-site-search-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-site-search-result.is-best {
    grid-column: auto;
  }

  .tl-site-search-head h2 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-interior-search-launcher,
  .tl-interior-category-strip a::after,
  .tl-site-search-overlay,
  .tl-site-search-dialog,
  .tl-site-search-result {
    transition: none;
  }
}


/* =====================================================
   MOBILE HEADER NAVIGATION — HOMEPAGE + SHARED ACCOUNT LINKS
   Homepage desktop keeps Log in / Sign up. On mobile those links move
   to the bottom of the shared hamburger navigation.
   ===================================================== */
#tlHeader.tl-header-homepage .tl-home-nav-toggle {
  display: none;
}

.tl-mobile-account-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tl-mobile-account-secondary,
.tl-mobile-account-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 750;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.tl-mobile-account-secondary {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}

.tl-mobile-account-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

.tl-mobile-account-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.tl-mobile-account-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

/* Keep the lightweight search result area isolated from the rest of the page. */
.tl-site-search-dialog,
.tl-home-v4-search-dialog {
  contain: layout paint;
}

.tl-site-search-grid,
.tl-home-v4-search-results {
  contain: layout;
}

/* =====================================================
   RELATED TOOLS V4 — SAME FOLDER ONLY
   Four columns × two rows on desktop. Mobile shows the first six cards.
   ===================================================== */
:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-v4) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 32px !important;
  align-items: start !important;
}

:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-v4) > .main-col,
:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-v4) > .about-section,
:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-v4) > .sidebar {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

:where(.layout, [class*="-layout"]):has(> .sidebar .tl-related-v4) > .sidebar {
  position: static !important;
  top: auto !important;
  max-width: none !important;
  align-self: stretch;
}

.sidebar > .tl-related-v4,
.tl-related-v4 {
  width: 100%;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.tl-related-v4-head {
  margin-bottom: 18px;
}

.tl-related-v4-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.tl-related-v4-head p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
}

.tl-related-v4-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tl-related-v4-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.tl-related-v4-card:hover,
.tl-related-v4-card:focus-visible {
  outline: none;
  border-color: var(--border-hover);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.tl-related-v4-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 18px;
}

.tl-related-v4-card strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.tl-related-v4-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition: color .18s ease, transform .18s ease;
}

.tl-related-v4-card:hover .tl-related-v4-arrow {
  color: var(--accent);
  transform: translate(1px, -1px);
}

.tl-related-v4-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.tl-related-v4-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100%, 250px);
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 750;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.tl-related-v4-button:hover {
  transform: translateY(-1px);
}

.tl-related-v4-button.is-folder {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.tl-related-v4-button.is-folder:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.tl-related-v4-button.is-category {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}

.tl-related-v4-button.is-category:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  color: var(--accent);
}

@media (max-width: 900px) {
  .tl-related-v4-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #tlHeader.tl-header-homepage .tl-home-header-actions {
    display: none;
  }

  #tlHeader.tl-header-homepage .tl-home-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tl-related-v4 {
    padding: 20px;
  }

  .tl-related-v4-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-related-v4-card:nth-child(n+7) {
    display: none;
  }
}

@media (max-width: 420px) {
  .tl-mobile-account-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-mobile-account-secondary,
  .tl-mobile-account-primary,
  .tl-related-v4-card,
  .tl-related-v4-arrow,
  .tl-related-v4-button {
    transition: none;
  }
}