/*
  tool-page-v4.css — the one v4 page chrome every /tools/ page stands on.
  Wave 2.1, 2026-08-11. Owner defect: "this tool needs to be way more easy to
  follow nobody is reading all that" + "/tools/compare-records/ has old design
  same for all the tools".

  SYSTEM OF RECORD: the owner-approved v4 consumer-marketplace comp as ported
  in assets/guide-premium.css (white page, Inter-only weight hierarchy, the
  serif face is the wordmark and nothing else, coral primary action, teal
  links, hairline cards, 44px targets, #4fc3c0 focus rings). Header, footer,
  tokens and type metrics below are copied from guide-premium.css so the tool
  pages and the guide pages render as one product.

  PAGE ANATOMY every tool page follows (the 5-second contract):
    .dir-skip                     skip link
    header.dir-header.pd-header   the v4 header (same markup as the guides)
    main > .tp-hero               ONE short centered h1 (the keyword phrase),
                                  ONE sentence of value copy. Nothing else.
    .tp-main > .tc-tool           the tool card, FORM FIRST. Every paragraph
                                  of method/limits/caveat prose lives in
                                  collapsed <details> (tc-method inside the
                                  card, .tp-fold outside it) BELOW the tool.
    .tp-related                   quiet related-tool cards
    footer.pd-footer              the v4 footer

  Load order on a tool page:
      <link rel="stylesheet" href="/assets/tool-page-v4.css">
      <link rel="stylesheet" href="/assets/tool-chassis.css">
      <link rel="stylesheet" href="/tools/<tool>/<tool>.css">   (page-scoped)
  tool-chassis.css keeps owning everything inside .tc-tool. This file owns
  everything around it. `.shell` is aliased to `.pd-shell` so legacy interior
  wrappers keep their width without a markup sweep.
*/

@font-face {
  font-family: "CSDP Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "CSDP Newsreader";
  src: url("/assets/fonts/newsreader-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --pd-ink: #1a2733;
  --pd-ink-strong: #10202e;
  --pd-navy: #0c2033;
  --pd-white: #ffffff;
  --pd-soft: #f7f7f5;
  --pd-line: #e8eaec;
  --pd-line-strong: #d3d8dc;
  --pd-muted: #5d6772;
  --pd-faint: #8a939c;
  --pd-coral: #d95745;
  --pd-coral-dark: #c24736;
  --pd-teal: #147d80;
  --pd-teal-dark: #0d6265;
  --pd-amber: #f2a33c;
  --pd-focus: #4fc3c0;
  --pd-shell: 1220px;
  --pd-sh-card: 0 1px 2px rgba(16, 32, 46, .06), 0 4px 12px rgba(16, 32, 46, .06);
  --pd-sh-float: 0 3px 10px rgba(16, 32, 46, .1), 0 14px 36px rgba(16, 32, 46, .14);
  --pd-font: "CSDP Inter", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pd-display: "CSDP Newsreader", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  color: var(--pd-ink);
  background: var(--pd-white);
  font-family: var(--pd-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(20, 125, 128, .16);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
label,
select,
summary,
a {
  touch-action: manipulation;
}

a {
  color: var(--pd-teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--pd-coral-dark);
}

:focus-visible {
  outline: 2px solid var(--pd-focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.pd-shell,
.shell {
  width: min(calc(100% - 64px), var(--pd-shell));
  margin-inline: auto;
  padding-inline: 0;
}

.dir-skip {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--pd-white);
  background: var(--pd-ink-strong);
  border-radius: 8px;
  font-weight: 700;
  transform: translateY(-150%);
}

.dir-skip:focus {
  transform: translateY(0);
}

/* ============ header — copied from guide-premium.css ============ */

.pd-header {
  position: relative;
  z-index: 40;
  background: var(--pd-white);
  border-bottom: 1px solid var(--pd-line);
}

.pd-header__inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dir-brand {
  flex: 0 0 auto;
  color: var(--pd-ink-strong);
  font-family: var(--pd-display);
  font-size: 21.5px;
  font-weight: 640;
  letter-spacing: -.012em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.dir-brand:hover {
  color: var(--pd-ink-strong);
}

.csdp-brand__accent {
  color: var(--pd-coral);
}

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

.dir-nav a {
  padding: 9px 14px;
  color: var(--pd-ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease-out;
}

.dir-nav a:hover {
  color: var(--pd-ink);
  background: var(--pd-soft);
}

.dir-nav .dir-nav__business {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding-inline: 16px;
  border: 1px solid var(--pd-line-strong);
  font-weight: 640;
  transition: box-shadow 140ms ease-out, border-color 140ms ease-out;
}

.dir-nav .dir-nav__business:hover {
  background: var(--pd-white);
  border-color: var(--pd-ink);
  box-shadow: var(--pd-sh-card);
}

/* ============ hero — short, centered, then the tool ============ */

.tp-hero {
  padding: 34px 0 4px;
  text-align: center;
}

.tp-crumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--pd-faint);
}

.tp-crumb a {
  color: var(--pd-faint);
  text-decoration: none;
}

.tp-crumb a:hover {
  color: var(--pd-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tp-crumb [aria-current] {
  color: var(--pd-muted);
}

.tp-hero h1 {
  margin: 14px auto 0;
  max-width: 22ch;
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 780;
  letter-spacing: -.022em;
  line-height: 1.12;
  color: var(--pd-ink-strong);
  text-align: center;
  text-wrap: balance;
}

.tp-sub {
  margin: 12px auto 0;
  max-width: 62ch;
  font-size: 16px;
  color: var(--pd-muted);
  text-align: center;
  text-wrap: pretty;
}

.tp-sub b {
  color: var(--pd-ink);
  font-weight: 640;
}

/* 1-2-3 step chips. Use only where the steps genuinely orient. */

.tp-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tp-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 13px 4px 5px;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  background: var(--pd-soft);
  color: var(--pd-ink);
  font-size: 13px;
  font-weight: 600;
}

.tp-steps li::before {
  content: counter(tp-step);
  counter-increment: tp-step;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pd-white);
  border: 1px solid var(--pd-line-strong);
  color: var(--pd-coral-dark);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tp-steps {
  counter-reset: tp-step;
}

/* ============ tool column ============ */

.tp-main {
  width: min(calc(100% - 64px), 880px);
  margin-inline: auto;
  padding: 22px 0 26px;
  display: grid;
  gap: 26px;
}

/* Wide tools (side-by-side tables, long checklists) take the full shell. */
.tp-main--wide {
  width: min(calc(100% - 64px), var(--pd-shell));
}

/* The single primary action: one big coral button per tool. Sized here so
   all nine tools agree; colors stay the chassis's tc-btn--primary coral. */
.tc-tool .tp-go {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

/* ============ page-level folds — the relocated prose ============ */

.tp-fold {
  border: 1px solid var(--pd-line-strong);
  border-radius: 12px;
  background: var(--pd-soft);
}

.tp-fold summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pd-ink);
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
}

.tp-fold summary::-webkit-details-marker {
  display: none;
}

.tp-fold summary::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 180ms cubic-bezier(.2, .7, .3, 1);
}

.tp-fold[open] > summary::before {
  transform: rotate(45deg);
}

.tp-fold summary:hover {
  background: var(--pd-white);
}

.tp-fold__body {
  display: grid;
  gap: 10px;
  padding: 6px 18px 18px;
  border-top: 1px solid var(--pd-line);
}

.tp-fold__body h2,
.tp-fold__body h3 {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--pd-muted);
}

.tp-fold__body p,
.tp-fold__body li {
  margin: 0;
  max-width: 72ch;
  font-size: 14.5px;
  color: var(--pd-ink);
  text-wrap: pretty;
}

.tp-fold__body ul,
.tp-fold__body ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

/* ============ related tools ============ */

.tp-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.tp-related a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--pd-line);
  border-radius: 12px;
  background: var(--pd-white);
  text-decoration: none;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}

.tp-related a:hover {
  border-color: var(--pd-ink);
  box-shadow: var(--pd-sh-card);
}

.tp-related span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pd-muted);
}

.tp-related strong {
  font-size: 14.5px;
  font-weight: 640;
  color: var(--pd-ink-strong);
  line-height: 1.35;
}

/* ============ footer — copied from guide-premium.css ============ */

.pd-footer {
  margin-top: 30px;
  background: var(--pd-white);
  border-top: 1px solid var(--pd-line);
}

.dir-footer__grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 26px;
}

.dir-footer__left {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}

.dir-brand--footer {
  color: var(--pd-ink-strong);
  font-size: 17px;
}

.dir-brand--footer:hover {
  color: var(--pd-ink-strong);
}

.dir-footer__tag {
  color: var(--pd-faint);
  font-size: 12.5px;
}

.pd-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
}

.pd-footer nav a {
  color: var(--pd-muted);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
}

.pd-footer nav a:hover {
  color: var(--pd-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============ narrow viewports ============ */

@media (max-width: 740px) {
  .pd-shell,
  .shell {
    width: calc(100% - 36px);
  }

  .tp-main {
    width: calc(100% - 36px);
  }

  .pd-header__inner {
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 10px;
  }

  .dir-nav {
    flex-wrap: wrap;
    gap: 2px;
  }

  .dir-nav a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .tp-hero {
    padding-top: 24px;
  }

  .tp-hero h1 {
    font-size: 26px;
  }

  .tp-sub {
    font-size: 15px;
  }

  .dir-footer__grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .dir-footer__left {
    flex-direction: column;
    gap: 6px;
  }

  .pd-footer nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
