/* Shared styles for the pages under /tools/. Same palette and type as the
   corpus.finance home page: warm paper, ink, one gold accent. */

:root {
  color-scheme: light;
  --paper: #f2f1ec;
  --card: #fbfaf6;
  --ink: #1a2229;
  --body: #3a444b;
  --muted: #596268;
  --faint: #687177;
  --line: rgba(26, 34, 41, 0.12);
  --line-strong: rgba(26, 34, 41, 0.24);
  --gold: #a8955f;
  --gold-deep: #7d6a36;
  --gold-wash: rgba(168, 149, 95, 0.12);
  --red: #a2452f;
  font-family: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  background:
    radial-gradient(circle at 82% 6rem, rgba(168, 149, 95, 0.12), transparent 26rem),
    var(--paper);
  color: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 40px, 1080px); margin: 0 auto; }

/* Header and footer mirror the home page */
header.site { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { color: var(--ink); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.025em; text-decoration: none; }
.wordmark span { color: var(--gold); }
.site-nav { display: flex; gap: 22px; font-size: 0.9375rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

footer.site { border-top: 1px solid var(--line); margin-top: 88px; }
.footer-inner { padding: 28px 0 36px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.footer-copy { max-width: 620px; }
.footer-copy p { margin: 0; }
.footer-copy p + p { margin-top: 6px; color: var(--faint); font-size: 0.8125rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-content: flex-start; }

/* Page head */
.crumbs { margin: 32px 0 0; font-size: 0.875rem; color: var(--faint); }
.crumbs a { color: var(--faint); }
.page-head { padding: 22px 0 8px; max-width: 800px; }
h1 { margin: 0; color: var(--ink); font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance; }
.lede { margin: 18px 0 0; font-size: 1.125rem; line-height: 1.55; color: var(--body); max-width: 62ch; }
.assure { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.assure li { font-size: 0.8125rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: rgba(251, 250, 246, 0.6); }

h2 { margin: 0 0 10px; color: var(--ink); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
section.block { margin-top: 56px; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 1.15em; }
.prose li { margin-bottom: 6px; }
.small { font-size: 0.875rem; color: var(--muted); }

/* Cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card + .card { margin-top: 14px; }

label, .label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="search"], input[type="number"], select {
  width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23596268' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input::placeholder { color: #9aa1a5; }
.hint { margin: 5px 0 0; font-size: 0.8125rem; color: var(--faint); line-height: 1.4; }
.field-error { margin: 6px 0 0; font-size: 0.8125rem; color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px; font: inherit; font-weight: 600; font-size: 1rem; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #f7f6f1; cursor: pointer; text-decoration: none; }
.btn:hover { background: #2a343c; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: rgba(26, 34, 41, 0.05); }
.btn.text { min-height: 0; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 500; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.num { font-variant-numeric: tabular-nums; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--body); }
tr:last-child td { border-bottom: 0; }
td:first-child { min-width: 150px; }
th.r, td.r { text-align: right; padding-right: 0; padding-left: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
td strong { color: var(--ink); font-weight: 600; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 68ch; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--ink); font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--gold-deep); font-weight: 500; }
details[open] summary::after { content: "\2212"; }
details p { margin: 10px 0 0; }

.note { border-left: 3px solid var(--gold); background: var(--gold-wash); padding: 14px 16px; border-radius: 0 10px 10px 0; font-size: 0.9375rem; max-width: 68ch; }
.note p { margin: 0; }
.note p + p { margin-top: 8px; }

.tool-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 34px; }
.tool-list a.card { display: block; text-decoration: none; color: inherit; margin: 0; transition: border-color 0.15s; }
.tool-list a.card:hover { border-color: var(--gold); }
.tool-list .go { display: inline-block; margin-top: 12px; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .wrap { width: min(100% - 32px, 1080px); }
  .header-inner { min-height: 64px; }
  .card { padding: 18px 16px; }
  section.block { margin-top: 44px; }
  footer.site { margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
