.tools-page { --brass: #d9ad4f; --tool-paper: #f4ead2; }
.tools-page main { padding-bottom: 3rem; }
.tools-hero { position: relative; min-height: 590px; display: grid; align-items: center; isolation: isolate; border-bottom: 1px solid var(--line); overflow: hidden; }
.tools-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; z-index: -2; }
.tools-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,7,11,.92), rgba(6,7,11,.4) 55%, rgba(6,7,11,.05)); z-index: -1; }
.tools-hero-copy { width: min(1200px, calc(100% - 3rem)); margin: auto; padding: 5rem 0; }
.tools-hero h1 { max-width: 700px; margin: 1rem 0 1.4rem; font-size: clamp(3.4rem, 7.5vw, 7rem); line-height: 1; text-transform: uppercase; letter-spacing: -.025em; }
.tools-hero h1 span { color: var(--brass); display: block; }
.tools-hero .eyebrow { color: var(--brass); }
.tools-hero .hero-lede { max-width: 520px; font-size: 1.15rem; color: var(--tool-paper); }
.tools-label { display: inline-block; font: .73rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--brass); border: 1px solid #d9ad4f66; padding: .45rem .65rem; }
.tools-wrap { max-width: 1200px; width: calc(100% - 3rem); margin: auto; }
.tools-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: 4rem 0 2rem; }
.tools-intro h2 { margin: .5rem 0 0; font-size: clamp(2.1rem, 4vw, 3rem); }
.tools-intro p { max-width: 490px; color: var(--muted); }
.tool-feature { border: 1px solid #d9ad4f50; background: linear-gradient(135deg, #191711, #0c1118); display: grid; grid-template-columns: 1.08fr 1fr; margin-bottom: 3rem; }
.tool-feature > a { display: block; min-height: 320px; overflow: hidden; }
.tool-feature img { width: 100%; height: 100%; object-fit: cover; object-position: 75% center; transition: transform .25s; }
.tool-feature > a:hover img { transform: scale(1.025); }
.tool-feature-copy { padding: clamp(1.5rem, 4vw, 3rem); }
.tool-feature h3 { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.06; margin: 1.2rem 0; }
.tool-feature-copy p { color: #c7bfae; }
.tool-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; border-top: 1px solid var(--line); padding: 1.2rem 0; font: .75rem var(--font-mono); color: var(--muted); }
.tools-principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; border-top: 1px solid var(--line); padding: 2.5rem 0; }
.tools-principles h3 { font: 700 1.15rem var(--font-body); }
.tools-principles p { color: var(--muted); }
.tool-doc { max-width: 900px; margin: auto; padding: 3rem 0; }
.tool-doc section { margin: 0 0 3rem; }
.tool-doc h2 { font-size: 2.1rem; margin-bottom: 1rem; }
.tool-doc p, .tool-doc li { color: #cbc4b6; }
.tool-doc table { width: 100%; border-collapse: collapse; }
.tool-doc th, .tool-doc td { padding: .9rem; text-align: left; border-bottom: 1px solid var(--line); }
.tool-doc th { color: var(--brass); font: .75rem var(--font-mono); text-transform: uppercase; }
.tool-note { border-left: 2px solid var(--brass); padding: .6rem 1.2rem; background: #d9ad4f08; }
.tool-doc pre { overflow-x: auto; padding: 1.5rem; border: 1px solid var(--line); background: #05070a; font-size: .8rem; }
.tools-page a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.tools-home-feature { border: 1px solid #d9ad4f55; margin-top: 3rem; background: #100f0c; }
.tools-home-feature .tool-feature { margin: 0; border: 0; }
@media (max-width: 760px) {
  .tools-hero { min-height: 640px; align-items: end; }
  .tools-hero > img { object-position: 72% top; height: 65%; }
  .tools-hero::after { background: linear-gradient(0deg, #06070b 8%, rgba(6,7,11,.95) 27%, rgba(6,7,11,.16) 80%); }
  .tools-hero-copy { padding: 16rem 0 2.5rem; }
  .tools-hero h1 { font-size: clamp(3.3rem, 14vw, 5rem); }
  .tools-intro { display: block; padding-top: 2.5rem; }
  .tool-feature { grid-template-columns: 1fr; }
  .tool-feature > a { min-height: 230px; max-height: 300px; }
  .tools-principles { grid-template-columns: 1fr; gap: 1rem; }
  .tool-doc th, .tool-doc td { padding: .75rem .4rem; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .tool-feature img { transition: none; } }

/* ---- Dealer Style Restic page (tools/restic/, body.tools-restic): long-form report components and charts ---- */
.tools-restic [id] { scroll-margin-top: 5.5rem; }
.tool-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid #d9ad4f50; border-top: 0; background: linear-gradient(135deg, #191711, #0c1118); }
.tool-stat { padding: 1.4rem 1.3rem 1.2rem; border-left: 1px solid var(--line); }
.tool-stat:first-child { border-left: 0; }
.tool-stat p { margin: 0; }
.tool-stat-value { font: 700 clamp(1.5rem, 2.6vw, 2.15rem)/1.1 var(--font-body); color: var(--paper); letter-spacing: -.01em; }
.tool-stat .tool-stat-label { margin-top: .35rem; font: .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); }
.tool-stat .tool-stat-note { margin-top: .6rem; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.tool-tag { display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border: 1px solid #d9ad4f88; color: var(--brass); font: .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; vertical-align: middle; }
.tool-provisional, .tool-pending { border-left-style: dashed; }
.tool-toc { margin: 0 0 3rem; padding: 1.2rem 1.4rem; border: 1px solid var(--line); background: #0a0d14; }
.tool-toc .tool-toc-title { margin: 0 0 .6rem; font: .73rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--brass); }
.tool-toc ol { margin: 0; padding-left: 1.3rem; }
.tool-toc li { margin: .3rem 0; color: var(--muted); font-size: .95rem; }
.tools-restic .tool-doc section { margin-bottom: 4.5rem; }
.tools-restic .tool-doc h3 { margin: 2.8rem 0 .9rem; font: 700 1.45rem/1.25 var(--font-body); color: var(--paper); }
.tools-restic .tool-doc h4 { margin: 1.8rem 0 .6rem; font: 700 1.05rem/1.3 var(--font-body); color: var(--paper); }
.tools-restic .tool-doc code { font-size: .88em; overflow-wrap: anywhere; }
.tool-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.tool-list { margin: .6rem 0 1.4rem; padding-left: 1.2rem; }
.tool-list li { margin: .55rem 0; }
.tool-list li strong, .tool-dl dt, .tool-dl dt a { color: var(--paper); }
.tool-figure { margin: 1.5rem 0 2rem; border: 1px solid var(--line); background: #05070a; }
.tool-figure img { display: block; width: 100%; height: auto; }
.tool-table-wrap { margin: 1.2rem 0 1.6rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tools-restic .tool-doc table { min-width: 560px; font-size: .92rem; }
.tools-restic .tool-doc caption { caption-side: bottom; padding: .8rem 0 0; text-align: left; font-size: .85rem; line-height: 1.5; color: var(--muted); }
.tools-restic .tool-doc th, .tools-restic .tool-doc td { padding: .6rem .7rem; vertical-align: top; }
.tools-restic .tool-doc tbody th { font: inherit; font-weight: 600; text-transform: none; color: var(--paper); }
.tools-restic .tool-doc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tools-restic .tool-doc tbody th code { white-space: nowrap; }
.tool-history td:nth-child(5) { min-width: 15rem; }
.tools-restic .tool-doc .tool-history thead th { white-space: normal; }
.tool-pending-text { border-bottom: 1px dashed #d9ad4f88; }
.tool-more { margin: 1rem 0 1.6rem; border: 1px solid var(--line); background: #0a0d14; }
.tool-more > summary { padding: .8rem 1rem; cursor: pointer; font: .76rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); }
.tool-more > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tool-more[open] > summary { border-bottom: 1px solid var(--line); }
.tool-more > .tool-table-wrap { margin: 0; padding: .4rem 1rem 1rem; }
.tool-chart { margin: 1.8rem 0 2.2rem; padding: 1.2rem 1.2rem 1rem; border: 1px solid var(--line); background: #06070b; }
.tool-chart figcaption { margin-top: 1rem; font-size: .85rem; line-height: 1.5; color: var(--muted); }
.tool-chart .tool-table-wrap { margin: .6rem 0 0; }
.tool-doc .tool-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; margin: 0 0 .9rem; font-size: .84rem; color: #cbc4b6; }
.tool-key { display: inline-flex; align-items: center; gap: .45rem; }
.tool-key-bar { width: 14px; height: 10px; border-radius: 2px; background: var(--k); }
.tool-key-line { width: 18px; height: 2px; background: var(--k); }
.tool-key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--k); }
.tool-key-ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--k); }
.tool-key-diamond { width: 8px; height: 8px; background: var(--k); transform: rotate(45deg); }
.tool-ramp { width: 9rem; height: 10px; border-radius: 2px; }
.tool-svg { display: block; overflow: visible; }
.tool-svg text { font-family: var(--font-body); }
.tool-svg .tc-cat { fill: #f2ecdb; font-size: 13px; font-weight: 600; font-family: var(--font-mono); }
.tc-val { fill: #f2ecdb; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tc-tick { fill: #aaa18c; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tc-axis { fill: #aaa18c; font-size: 12px; }
.tc-era { fill: #cbc4b6; font-size: 11px; }
.tool-mark:hover rect, .tool-mark:hover circle { filter: brightness(1.25); }
.tool-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tool-svg-wide { width: 100%; min-width: 780px; height: auto; }
.tool-heat td.num { font-weight: 600; border-bottom: 2px solid #06070b; border-left: 2px solid #06070b; }
.tool-heat tbody th span { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.tools-restic .tool-heat .tool-heat-mean { background: transparent; color: var(--paper); font-weight: 400; }
.tool-dotpanels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.tool-dotpanel p { margin: 0; }
.tool-dotpanel .tool-dot-name { font: .73rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); margin-bottom: .6rem; }
.tool-dots { display: block; width: 100%; height: auto; }
.tool-dotpanel .tool-dot-count { margin-top: .6rem; font-size: 1.05rem; color: var(--paper); }
.tool-dot-count strong { font-size: 1.5rem; }
.tool-dotpanel .tool-dot-text { font-size: .85rem; line-height: 1.45; color: var(--muted); }
.tool-dl { margin: 1rem 0 1.6rem; }
.tool-dl dt { margin-top: 1.1rem; font-weight: 700; }
.tool-dl dd { margin: .25rem 0 0; color: #cbc4b6; }
.tools-restic .tool-doc .button-row { margin: 1.4rem 0; }
@media (max-width: 900px) {
  .tool-stats { grid-template-columns: 1fr 1fr; }
  .tool-stat:nth-child(3) { border-left: 0; }
  .tool-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .tool-two { grid-template-columns: 1fr; }
  .tool-dotpanels { grid-template-columns: 1fr; }
  .tool-chart { padding: 1rem .8rem .9rem; }
  .tools-restic .tool-doc h3 { font-size: 1.3rem; }
  .tools-restic .tool-doc table.tool-heat { min-width: 0; font-size: .78rem; }
  .tools-restic .tool-doc .tool-heat th, .tools-restic .tool-doc .tool-heat td { padding: .55rem .3rem; }
  .tool-heat tbody th span { display: none; }
  .tools-restic .tool-doc .tool-heat thead th { font-size: .62rem; letter-spacing: 0; }
}
@media (max-width: 480px) {
  .tool-stats { grid-template-columns: 1fr; }
  .tool-stat { border-left: 0; border-top: 1px solid var(--line); }
  .tool-stat:first-child { border-top: 0; }
}
