/* ==========================================================================
   personalloaner.com — "reference desk / data workbench" stylesheet
   --------------------------------------------------------------------------
   Class contract: CONTRACTS.md §4 (renderer <-> stylesheet).
   Brand palette sampled from personalloaner-logo.png (948x186 RGBA):
     mark teal             #03726f   (ascending bars / arrow)
     deep teal             #02514f
     coin amber            #f49a01
     deep amber            #bf7601
     wordmark ink          #12211e
     paper                 #f7faf8

   Layout identity (distinct from the loansloth.com template family):
     - sticky left rail chrome on desktop, compact top bar on mobile
     - asymmetric split hero + bento section grid
     - editorial serif display type, mono eyebrow labels
     - borderless "ledger" data tables with tabular numerals
     - dark ink footer band with a separate legal strip
     - single "action bar" component holding CTA + affiliate disclosure

   No imports, no external fonts, no JavaScript. System font stacks only.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  /* Brand — verified against sampled logo pixels */
  --green: #03726f;        /* brand teal: mark bars #03726f */
  --green-700: #02514f;    /* deep teal: bar shadow */
  --brown: #f49a01;        /* accent amber: coin #f49a01 */
  --brown-900: #bf7601;    /* deep amber */
  --cream: #f7faf8;        /* page bg: cool paper */
  --ink: #12211e;          /* wordmark near-black (cool) */
  --money: #0a7a5f;        /* money/positive green */

  /* Derived — contrast-checked on --cream and #fff (AA >= 4.5:1) */
  --green-800: #024845;    /* text links */
  --green-900: #013331;    /* focus ring on light surfaces */
  --green-050: #e7f3f1;    /* teal tint (panels, workbench accent) */
  --brown-050: #fef3e0;    /* amber tint (panels) */
  --amber-800: #8a5400;    /* amber text: 5.98:1 on paper */
  --ink-soft: #3c4a46;     /* secondary text */
  --muted: #5b6b66;        /* meta/disclosure */
  --card: #ffffff;
  --line: #dfe9e6;         /* hairlines */
  --line-strong: #c9d8d4;  /* input borders / strong rules */

  /* Dark surfaces */
  --ink-900: #0b1614;      /* footer band */
  --on-ink: #e9f1ee;       /* body text on ink */
  --on-ink-soft: #a9bbb6;  /* secondary text on ink (8.3:1) */
  --on-ink-accent: #7fd8cf;/* teal accent on ink (9:1) */

  /* Type & space */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype",
    "Book Antiqua", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --rail: 264px;
  --wrap: 1120px;
  --shadow: 0 1px 2px rgba(20, 31, 28, 0.05),
    0 14px 30px -22px rgba(20, 31, 28, 0.24);
  --shadow-lift: 0 2px 4px rgba(20, 31, 28, 0.06),
    0 18px 34px -20px rgba(20, 31, 28, 0.28);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ------------------------------------------------------------ body / shell */
body.site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.canvas {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

main#main {
  flex: 1 0 auto;
  padding-block: 1.5rem 3.5rem;
  scroll-margin-top: 5rem;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------- type / headings */
h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 1.6em 0 0.5em;
}

h1 {
  font-size: clamp(1.9rem, 1.35rem + 2.2vw, 2.75rem);
  letter-spacing: -0.022em;
}

h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem;
}

a {
  color: var(--green-800);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--green-900);
}

strong {
  font-weight: 700;
}

small {
  font-size: 0.8125rem;
  color: var(--muted);
}

::selection {
  background: #cdeae6;
  color: var(--ink);
}

/* Focus ring: dark teal passes 3:1 on paper; light teal on ink surfaces. */
:focus-visible {
  outline: 3px solid var(--green-900);
  outline-offset: 2px;
}

.surface-ink :focus-visible,
.site-footer :focus-visible,
.tool-result :focus-visible {
  outline-color: var(--on-ink-accent);
}

/* --------------------------------------------------------------- skip link */
.skip {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  transform: translateY(-250%);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip:focus {
  transform: none;
  color: var(--cream);
}

/* ------------------------------------------------------------------- wrap */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* --------------------------------------------------------- chrome: rail */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.rail-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  display: block;
  height: 34px;
  width: auto;
  transition: transform 0.18s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-3deg) translateY(-1px);
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  position: relative;
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--green-050);
}

.nav-link.is-active {
  color: var(--ink);
  background: var(--green-050);
  box-shadow: inset 0 -2px 0 var(--brown);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.rail-foot {
  display: none;
}

/* ------------------------------------------------------------ breadcrumbs */
.breadcrumbs {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.25rem 0 1rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--line-strong);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--green-800);
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26ch;
}

/* -------------------------------------------------------- titles and lede */
.page-head {
  padding-block: 0.75rem 0.25rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-800);
  margin: 0 0 0.5rem;
}

.page-title {
  margin: 0.1rem 0 0.65rem;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
  margin: 0 0 1.25rem;
}

.meta-line {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: 0.25rem 0 1.5rem;
}

.meta-line strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ------------------------------------------------------------ hero (home) */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding-block: 1rem 2.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-title {
  font-size: clamp(2.15rem, 1.4rem + 3.4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0.35rem 0 0.85rem;
}

.hero-lede {
  max-width: 56ch;
  margin-bottom: 0;
}

.hero-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.hero-figures .figure {
  margin: 0;
}

.hero-figures .figure + .figure {
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}

.hero-figures dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.hero-figures dd {
  margin: 0;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

/* -------------------------------------------------------- workbench panel */
.workbench {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.workbench-title {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.3rem;
}

.workbench-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.workbench-item {
  border-bottom: 1px solid var(--line);
}

.workbench-item:first-child {
  border-top: 1px solid var(--line);
}

.workbench-item a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 0;
  text-decoration: none;
  color: var(--ink);
}

.workbench-item a:hover .wb-name {
  color: var(--green-800);
  text-decoration: underline;
}

.wb-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--amber-800);
}

.wb-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.wb-arrow {
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.workbench-item a:hover .wb-arrow {
  transform: translateX(3px);
  color: var(--green-700);
}

.workbench-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-800);
  text-decoration: none;
}

.workbench-all:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------- bento grid */
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 2rem;
}

.bento-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
}

.bento-cell > :first-child {
  margin-top: 0;
}

.bento-cell > :last-child {
  margin-bottom: 0;
}

.bento-cell h2 {
  margin: 0.35rem 0 0.6rem;
}

.surface-paper {
  background: #fff;
  box-shadow: var(--shadow);
}

.surface-teal {
  background: var(--green-050);
  border-color: #cfe6e2;
  border-left: 4px solid var(--green-700);
}

.surface-amber {
  background: var(--brown-050);
  border-color: #f6e2c2;
  border-left: 4px solid var(--brown);
}

.surface-ink {
  background: var(--ink);
  border-color: var(--ink-900);
  color: var(--on-ink);
}

.surface-ink h2 {
  color: #fff;
}

.surface-ink p {
  color: #cfdcd8;
}

.surface-ink .eyebrow {
  color: var(--on-ink-accent);
}

.bento-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  text-decoration: none;
}

.bento-link:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ grids */
.grid {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.tile:hover {
  border-top-color: var(--brown);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.tile-title {
  font-weight: 700;
  color: var(--ink);
  text-transform: capitalize;
  letter-spacing: -0.005em;
}

.tile:hover .tile-title {
  color: var(--green-800);
}

.tile-note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ------------------------------------------------ data tables (ledger look) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 0.5rem 0 0;
  font-variant-numeric: tabular-nums lining-nums;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 0.75rem 0.85rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.data-table thead th {
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  padding-top: 0;
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table a {
  color: var(--green-800);
}

.data-table small {
  display: block;
  margin-top: 0.15rem;
  line-height: 1.45;
}

/* --------------------------------------------------------------- callouts */
.callout {
  max-width: 78ch;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brown);
  border-radius: var(--radius);
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-green {
  background: var(--green-050);
  border-color: #cfe6e2;
  border-left-color: var(--green-700);
}

.callout-warn {
  background: var(--brown-050);
  border-color: #f6e2c2;
  border-left-color: var(--brown);
}

.callout-warn strong {
  color: var(--amber-800);
}

/* --------------------------------------------- CTA + disclosure (one block) */
.action-bar {
  margin: 1.5rem 0 1.75rem;
  padding: 1rem 1.1rem;
  background: var(--green-050);
  border: 1px solid #cfe6e2;
  border-left: 4px solid var(--green-700);
  border-radius: var(--radius);
}

.action-bar-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.7rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease,
    border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

/* Teal surface + near-white label: 5.5:1 (AA for normal text). */
.btn-primary {
  background: var(--green);
  color: #f7faf8;
  border-color: #02605e;
  box-shadow: 0 1px 2px rgba(20, 31, 28, 0.12);
}

.btn-primary:hover {
  background: var(--green-700);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgba(2, 72, 69, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: #fff;
  color: var(--green-800);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--green-050);
  border-color: var(--green-700);
  transform: translateY(-1px);
}

.disclosure {
  max-width: 72ch;
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(2, 81, 79, 0.18);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.disclosure a {
  color: var(--green-800);
}

.workbench .action-bar {
  margin: 1rem 0 0;
  padding: 0.9rem;
}

.workbench .action-bar-cta {
  flex-direction: column;
  align-items: stretch;
}

.workbench .btn {
  width: 100%;
}

.workbench .disclosure {
  font-size: 0.75rem;
}

/* Compact CTA variant: same buttons and disclosure as .action-bar, tightened
   so the block clears the first viewport at 390x844 (page-head placement). */
.cta-bar {
  margin: 1rem 0 1.35rem;
  padding: 0.8rem 0.9rem;
}

.cta-bar .action-bar-cta {
  gap: 0.5rem;
}

.cta-bar .btn {
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
}

.cta-bar .disclosure {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  font-size: 0.75rem;
  line-height: 1.55;
}

/* -------------------------------------------------------------------- FAQ */
.faq {
  padding-bottom: 0.6rem;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:last-of-type {
  border-bottom: 0;
}

.faq-item summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--green-800);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}

.faq-item[open] summary {
  color: var(--green-900);
}

.faq-item[open] summary::after {
  content: "\2013";
}

.faq-answer {
  max-width: 70ch;
  padding: 0 0 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.faq-answer > :first-child {
  margin-top: 0;
}

.faq-answer > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ prose */
.prose > h2,
.prose > h3 {
  margin-top: 1.75em;
}

.prose > h2:first-child,
.prose > h3:first-child {
  margin-top: 0;
}

.prose p,
.prose li,
.prose h2,
.prose h3,
.prose blockquote {
  max-width: 66ch;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose a {
  color: var(--green-800);
  text-decoration: underline;
  text-decoration-color: rgba(2, 72, 69, 0.4);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1.25rem 0;
  font-variant-numeric: tabular-nums lining-nums;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.prose thead th {
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
}

/* ------------------------------------------------------------------- tool */
.tool {
  padding: 1.35rem;
}

.tool-form {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field input,
.field select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
}

.field input:hover,
.field select:hover {
  border-color: #b9cdc8;
}

.field input:focus,
.field select:focus {
  border-color: var(--green-700);
}

.field input::placeholder {
  color: var(--muted);
}

.tool-form .btn {
  justify-self: start;
}

/* Result readout: dark ink panel with mono-tabular figures. */
.tool-result {
  margin-top: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: var(--ink);
  border: 1px solid var(--ink-900);
  border-radius: var(--radius);
  color: var(--on-ink);
}

.tool-primary {
  margin: 0 0 0.35rem;
  color: var(--on-ink-accent);
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums lining-nums;
}

.tool-result .data-table {
  margin-top: 0.6rem;
}

.tool-result .data-table th {
  font-family: var(--font);
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: var(--on-ink-soft);
}

.tool-result .data-table td {
  text-align: right;
  color: #eef6f3;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
}

.tool-result .data-table th,
.tool-result .data-table td {
  border-bottom: 1px solid rgba(233, 241, 238, 0.14);
  padding: 0.6rem 0;
}

.tool-note {
  margin: 0;
  color: var(--on-ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.tool-result .tool-note + .tool-primary {
  margin-top: 0.5rem;
}

/* -------------------------------------------------------------- link list */
.link-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.link-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.link-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0.1rem;
}

.link-list a {
  color: var(--green-800);
  font-weight: 600;
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------- city list */
.city-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  columns: 1;
  column-gap: 2rem;
}

.city-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  break-inside: avoid;
}

.city-list a {
  color: var(--green-800);
  text-decoration: none;
}

.city-list a:hover {
  text-decoration: underline;
}

.city-pop {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

/* ------------------------------------------------- guides hub (TOC index) */
.toc {
  margin: 1.5rem 0 2rem;
  border-top: 3px solid var(--ink);
}

.toc-group {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  counter-reset: toc;
}

.toc-cat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.toc-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  counter-increment: toc;
  border-bottom: 1px solid var(--line);
}

.toc-item:last-child {
  border-bottom: 0;
}

.toc-item a {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  text-decoration: none;
  color: var(--ink);
}

.toc-item a:hover .toc-name {
  color: var(--green-800);
  text-decoration: underline;
}

.toc-num::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber-800);
}

.toc-name {
  font-weight: 600;
  font-size: 1.02rem;
}

.toc-arrow {
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.toc-item a:hover .toc-arrow {
  transform: translateX(3px);
  color: var(--green-700);
}

/* ------------------------------------------------------------------ pager */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--green-800);
  font-weight: 600;
  text-decoration: none;
}

.pager a:hover {
  background: var(--green-050);
  border-color: var(--green-700);
}

/* ------------------------------------------------ footer (dark ink band) */
.site-footer {
  background: var(--ink);
  color: var(--on-ink);
}

.site-footer .wrap {
  padding-block: 3rem 1.75rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-brand {
  margin: 0 0 0.5rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-note {
  max-width: 34ch;
  margin: 0;
  color: var(--on-ink-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.footer-head {
  margin: 0 0 0.8rem;
  color: var(--on-ink-accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #dfe9e6;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(233, 241, 238, 0.16);
  color: var(--on-ink-soft);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.footer-disclaimer {
  max-width: 100ch;
  margin: 0 0 0.6rem;
}

.footer-legal-links {
  margin: 0;
}

.footer-legal a {
  color: #dfe9e6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover {
  color: #fff;
}

/* ------------------------------------------------------------- small screens */
@media (max-width: 639px) {
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
  }

  /* Key/value results must wrap, not scroll */
  .tool-result .data-table {
    display: table;
    overflow: visible;
    white-space: normal;
  }

  .tool-result .data-table th,
  .tool-result .data-table td {
    white-space: normal;
  }

  .tool-result .data-table th {
    width: 55%;
    font-weight: 600;
  }
}

@media (max-width: 519px) {
  .hero-figures .figure + .figure {
    border-left: 0;
    padding-left: 0;
  }
}

/* ------------------------------------------------------------ breakpoints */
@media (min-width: 640px) {
  .wrap {
    padding-inline: 1.5rem;
  }

  main#main {
    padding-block: 2rem 4.5rem;
  }

  .card {
    padding: 1.75rem;
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .city-list {
    columns: 2;
  }

  .footer-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-top {
    grid-template-columns: minmax(220px, 1.3fr) 3fr;
  }

  .tool-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-form .btn {
    grid-column: 1 / -1;
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b-wide,
  .b-mid {
    grid-column: span 2;
  }
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .city-list {
    columns: 3;
  }

  .tool-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
    gap: 2.75rem;
    align-items: start;
    padding-block: 1.5rem 2.75rem;
  }
}

/* Desktop rail: chrome becomes a sticky vertical column. */
@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
    flex: 1 0 auto;
  }

  .site-header {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .rail-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 100%;
    padding: 1.5rem 1.25rem;
  }

  .brand {
    margin-bottom: 1.75rem;
  }

  .brand-logo {
    height: 38px;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    overflow: visible;
  }

  .nav-link {
    padding: 0.7rem 0.8rem 0.7rem 0.95rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }

  .nav-link.is-active {
    box-shadow: inset 3px 0 0 var(--brown);
    border-radius: var(--radius-sm);
  }

  .rail-foot {
    display: block;
    margin-top: auto;
    padding-top: 1.5rem;
  }

  .rail-cta {
    width: 100%;
  }

  .rail-note {
    margin: 0.65rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted);
  }

  .rail-note a {
    color: var(--green-800);
  }

  .canvas {
    min-height: 100vh;
  }

  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .b-wide {
    grid-column: span 8;
  }

  .b-half {
    grid-column: span 4;
  }

  .b-mid {
    grid-column: span 6;
  }
}

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

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

  .tile:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .brand:hover .brand-logo,
  .workbench-item a:hover .wb-arrow,
  .toc-item a:hover .toc-arrow {
    transform: none;
  }
}
