/* =============================================================
   www.mformercury.com/tools — the sales tools directory.

   Loaded only by /tools, /tools/category/<slug> and /tools/<slug>, after
   site.css, so the other twelve pages do not download styles for pages
   they never render.

   Three namespaces: tdir-* is the hub and anything shared, tcat-* is a
   category page, tpg-* is a single tool's page. Same language as the rest
   of the site — ink, hairlines, one violet — so a page carrying a hundred
   third-party marks still reads as ours rather than as a logo wall.
   ============================================================= */

.tdir-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Hub hero: one screen, and the choice is already in it ── */
.tdir-hero { padding: 56px 0 34px; }
.tdir-hero-in { max-width: 760px; }
.tdir-hero h1 { font-size: 46px; letter-spacing: -0.035em; line-height: 1.06; margin-top: 12px; text-wrap: balance; }
.tdir-hero-lede { margin-top: 14px; font-size: 17.5px; line-height: 1.6; color: var(--ink-2); max-width: 660px; text-wrap: pretty; }

/* The thumb on the scale, stated where the claim is made rather than in a
   footnote nobody scrolls to. */
.tdir-disclose { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-3); max-width: 620px; }
.tdir-disclose a { color: var(--accent); font-weight: 600; }
.tdir-disclose a:hover { text-decoration: underline; }

.tdir-search { position: relative; margin-top: 24px; max-width: 560px; }
.tdir-search svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink-4); pointer-events: none; }
.tdir-search input {
  width: 100%; height: 50px; padding: 0 16px 0 44px;
  font: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tdir-search input::placeholder { color: var(--ink-4); }
.tdir-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tdir-search input::-webkit-search-cancel-button { cursor: pointer; }

/* The eight categories this audience actually arrives for, named before
   anything is clicked. The old page hid the most-wanted one behind a
   "show all 189" button. */
.tdir-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.tdir-start > span { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); margin-right: 2px; }
.tdir-start a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 7px 14px; border-radius: 999px;
  background: var(--accent-tint); border: 1px solid var(--accent-line);
  font-size: 13.5px; font-weight: 600; color: var(--accent);
  transition: background .15s ease, border-color .15s ease;
}
.tdir-start a:hover { background: var(--ground); border-color: var(--accent); }
.tdir-start a b { font-weight: 700; color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tdir-start-plain a { background: var(--ground); border-color: var(--line); color: var(--ink-2); }
.tdir-start-plain a:hover { border-color: var(--accent); color: var(--accent); }

/* ── Stack-layer nav: six doors, sticky, always reachable ── */
.tdir-layers { position: sticky; top: 60px; z-index: 20; background: var(--ground); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tdir-layers ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.tdir-layers ul::-webkit-scrollbar { display: none; }
.tdir-layers a {
  display: inline-flex; align-items: center; height: 46px; padding: 0 14px;
  font-size: 14px; font-weight: 600; color: var(--ink-3); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.tdir-layers a:hover { color: var(--ink); }
.tdir-layers a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ── A layer, and the categories inside it ─────────────── */
.tdir-layer { padding: 52px 0 8px; scroll-margin-top: 118px; }
.tdir-layer-head { max-width: 680px; margin-bottom: 22px; }
.tdir-layer-head h2 { font-size: 28px; letter-spacing: -0.03em; }
.tdir-layer-head p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.tdir-layer-head small { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); }

/* Columns, the way a directory is read: scan headings, drop into one. */
.tdir-cats { columns: 3 300px; column-gap: 16px; }
.tdir-cat {
  break-inside: avoid; margin: 0 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tdir-cat:hover { border-color: var(--accent-line); box-shadow: 0 4px 16px rgba(26, 26, 33, .05); }
.tdir-cat-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.tdir-cat-head h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.tdir-cat-head span { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.tdir-cat-head:hover h3 { color: var(--accent); }

.tdir-cat-list { margin: 0; padding: 6px; list-style: none; }
.tdir-cat-list a {
  display: flex; align-items: center; gap: 9px;
  min-height: 36px; padding: 6px 10px; border-radius: 6px;
  font-size: 14px; color: var(--ink-2);
  transition: background .12s ease, color .12s ease;
}
.tdir-cat-list a:hover { background: var(--ground-3); color: var(--ink); }
.tdir-cat-list img, .tdir-cat-list .tdir-mark { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; }
.tdir-cat-list .tdir-mark { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ink-4); background: var(--ground-3); }
.tdir-cat-list a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The name yields first; a cup or an "Ours" tag never gets squeezed out of the row. */
.tdir-cat-list a > span:not(.tdir-ours):not(.tdir-sr) { flex: 1 1 auto; }
/* The catalog keeps the source's ranking, so the first three are worth marking. */
.tdir-rank { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* First place gets the cup instead of the numeral. Amber, because it is the
   one thing on this page that is meant to be seen before the text around it —
   and the only colour here that is not ink or the brand violet. */
.tdir-cup { flex: 0 0 auto; margin-left: auto; width: 15px; height: 15px; color: #B8860B; }
.tdir-cat-list .is-ours > a { background: var(--accent-tint); }
.tdir-cat-list .is-ours > a:hover { background: var(--accent-line); }

/* Our own listing says so, everywhere it appears. */
.tdir-ours {
  flex: 0 0 auto; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.tdir-card.is-ours { border-color: var(--accent-line); background: var(--accent-tint); }
.tdir-card.is-ours:hover { border-color: var(--accent); }
.tdir-card .tdir-cup { width: 17px; height: 17px; margin-left: auto; }
.tdir-card .tdir-ours { margin-left: 4px; }

.tdir-cat-more {
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 10px 16px; border-top: 1px solid var(--line-2);
  font-size: 13px; font-weight: 650; color: var(--accent);
}
.tdir-cat-more svg { width: 14px; height: 14px; transition: transform .2s ease; }
.tdir-cat-more:hover svg { transform: translateX(2px); }

/* ── Search results replace the browse list ────────────── */
.tdir-results { padding: 40px 0 24px; }
.tdir-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tdir-results-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.tdir-results-head button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--ground); font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tdir-results-head button:hover { border-color: var(--ink-4); color: var(--ink); }

/* ── The tool card, shared by results, categories, similar ── */
.tdir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.tdir-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground);
  content-visibility: auto; contain-intrinsic-size: auto 148px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tdir-card:hover { border-color: var(--accent-line); box-shadow: 0 4px 16px rgba(26, 26, 33, .06); transform: translateY(-1px); }
.tdir-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tdir-card-top img, .tdir-card-top .tdir-mark {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px;
  object-fit: contain; background: var(--ground-2); border: 1px solid var(--line-2); padding: 3px;
}
.tdir-card-top .tdir-mark { display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--ink-3); padding: 0; }
.tdir-card-top b { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdir-card-tag {
  flex: 1 1 auto; font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tdir-card-cat { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); }
.tdir-empty { margin-top: 28px; text-align: center; font-size: 15px; color: var(--ink-2); }

.tdir-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tdir-chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 6px 13px; border-radius: 999px;
  background: var(--ground); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: border-color .15s ease, color .15s ease;
}
.tdir-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── The CTA band every page kind ends on ──────────────── */
.tdir-cta { padding: 64px 0 80px; }
.tdir-cta-in {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  padding: 34px 36px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-tint);
}
.tdir-cta-copy { max-width: 620px; }
.tdir-cta-copy h2 { font-size: 25px; letter-spacing: -0.03em; }
.tdir-cta-copy p { margin-top: 8px; font-size: 15.5px; color: var(--ink-2); }
.tdir-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Breadcrumb, on both leaf page kinds ───────────────── */
.tdir-crumb { padding: 22px 0 0; }
.tdir-crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-3); }
.tdir-crumb li + li::before { content: "/"; margin-right: 8px; color: var(--ink-4); }
.tdir-crumb a:hover { color: var(--accent); }
.tdir-crumb [aria-current] { color: var(--ink); font-weight: 600; }

/* ── A category page ───────────────────────────────────── */
.tcat-hero { padding: 20px 0 30px; border-bottom: 1px solid var(--line); }
.tcat-head { max-width: 720px; }
.tcat-head h1 { font-size: 40px; letter-spacing: -0.035em; line-height: 1.08; margin-top: 10px; text-wrap: balance; }
.tcat-lede { margin-top: 12px; font-size: 17px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.tcat-list { padding: 32px 0 0; }
.tcat-related { padding: 56px 0 0; }
.tcat-related .sec-head { margin-bottom: 18px; }
.tcat-related .sec-head h2 { font-size: 24px; letter-spacing: -0.03em; }

/* ── A tool page ───────────────────────────────────────── */
.tpg-hero { padding: 24px 0 0; }
.tpg-head { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.tpg-logo { flex: 0 0 auto; }
.tpg-logo img, .tpg-logo .tdir-mark {
  width: 64px; height: 64px; border-radius: 14px; object-fit: contain;
  background: var(--ground-2); border: 1px solid var(--line); padding: 8px;
}
.tpg-logo .tdir-mark { display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--ink-3); padding: 0; }
.tpg-title { min-width: 0; }
.tpg-title h1 { font-size: 40px; letter-spacing: -0.035em; line-height: 1.08; }
.tpg-tag { margin-top: 10px; font-size: 17.5px; line-height: 1.5; color: var(--ink-2); max-width: 680px; text-wrap: pretty; }
.tpg-cats { margin-top: 16px; }

.tpg-body { padding: 40px 0 0; }
.tpg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.tpg-main h2 { font-size: 22px; letter-spacing: -0.025em; margin: 34px 0 12px; }
.tpg-main h2:first-child { margin-top: 0; }
.tpg-main p { font-size: 16.5px; line-height: 1.68; color: var(--ink-2); margin-bottom: 12px; text-wrap: pretty; }
.tpg-main strong { color: var(--ink); font-weight: 650; }
.tpg-note { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-4); line-height: 1.6; }

.tpg-faq { border-top: 1px solid var(--line); }
.tpg-faq details { border-bottom: 1px solid var(--line); }
.tpg-faq summary { list-style: none; cursor: pointer; padding: 15px 30px 15px 0; position: relative; font-size: 16px; font-weight: 650; color: var(--ink); }
.tpg-faq summary::-webkit-details-marker { display: none; }
.tpg-faq summary::after {
  content: ""; position: absolute; right: 6px; top: 22px;
  width: 9px; height: 9px; border-right: 2px solid var(--ink-4); border-bottom: 2px solid var(--ink-4);
  transform: rotate(45deg); transition: transform .2s ease;
}
.tpg-faq details[open] summary::after { transform: rotate(-135deg); }
.tpg-faq details p { padding: 0 8px 18px 0; margin: 0; font-size: 15.5px; }

.tpg-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.tpg-box { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground-2); }
.tpg-box h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tpg-box dl { margin: 14px 0 0; display: grid; gap: 12px; }
.tpg-box dt { font-size: 12.5px; color: var(--ink-4); }
.tpg-box dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.tpg-box dd a { color: var(--accent); }
.tpg-box dd a:hover { text-decoration: underline; }
.tpg-box-cta { background: var(--ground); border-color: var(--accent-line); }
.tpg-box-cta p { margin: 10px 0 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.tpg-box-cta .btn { width: 100%; margin-bottom: 8px; }
.tpg-box-cta .btn:last-child { margin-bottom: 0; }

.tpg-similar { padding: 64px 0 0; }
.tpg-similar .sec-head { margin-bottom: 22px; }
.tpg-similar .sec-head h2 { font-size: 26px; letter-spacing: -0.03em; }
.tpg-similar .sec-lede { font-size: 16px; }
.tpg-back { margin-top: 22px; font-size: 14.5px; font-weight: 600; color: var(--ink-4); }
.tpg-back a { color: var(--accent); }
.tpg-back a:hover { color: var(--accent-hover); }

@media (max-width: 1100px) { .tdir-cats { columns: 2 300px; } }
@media (max-width: 900px) {
  .tpg-cols { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .tpg-side { position: static; }
  .tpg-title h1, .tcat-head h1 { font-size: 32px; }
  .tpg-head { gap: 16px; }
  .tpg-logo img, .tpg-logo .tdir-mark { width: 52px; height: 52px; }
}
@media (max-width: 640px) {
  .tdir-hero { padding: 36px 0 26px; }
  .tdir-hero h1 { font-size: 32px; }
  .tdir-hero-lede { font-size: 16px; }
  .tdir-cats { columns: 1; }
  .tdir-grid { grid-template-columns: 1fr; }
  .tdir-cta-in { padding: 26px 22px; }
  .tdir-layer { padding-top: 40px; }
  .tdir-layer-head h2 { font-size: 24px; }
  .tpg-title h1, .tcat-head h1 { font-size: 27px; }
  .tpg-tag, .tcat-lede { font-size: 16px; }
  /* Thumbs, not cursors: nothing tappable drops under 44px on a phone. */
  .tdir-start a, .tdir-chip, .tdir-cat-list a, .tdir-cat-more, .tdir-results-head button { min-height: 44px; }
  .tdir-layers a { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tdir-card, .tdir-card:hover, .tdir-cat, .tdir-cat:hover { transition: none; transform: none; }
  .tdir-cat-more:hover svg { transform: none; }
}
