/* Base compartilhada. Cada site define as variáveis e os detalhes visuais em theme.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* Cabeçalho */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .85rem; padding-bottom: .85rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.3rem; letter-spacing: var(--head-tracking); }
.brand svg { width: 1.9rem; height: 1.9rem; flex: none; }
.site-head nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-head nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-head nav a:hover { border-bottom-color: var(--accent); }

/* Títulos */
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-tracking); line-height: 1.12; margin: 0; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 2.4rem; margin-bottom: .6rem; }
h3 { font-size: 1.2rem; margin-top: 1.8rem; margin-bottom: .4rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46rem; margin: .8rem 0 0; }

/* Trilha */
.crumbs { font-size: .9rem; color: var(--muted); padding: .9rem 0 0; }
.crumbs a { color: var(--muted); }
.crumbs .wrap > * + * { margin-left: .2rem; }

/* Texto corrido */
.prose { max-width: 42rem; padding: 1.2rem 0 2.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose li { margin-bottom: .35rem; }
.prose h1 { margin-bottom: .5rem; }
.byline { color: var(--muted); font-size: .95rem; margin: 0 0 1.8rem; }
.prose table, .tbl { border-collapse: collapse; width: 100%; margin: 0 0 1.4rem; font-size: .98rem; }
.prose th, .prose td, .tbl th, .tbl td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th, .tbl th { background: var(--paper); font-weight: 700; border-bottom: 2px solid var(--ink); }
.tblwrap { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; }
.sources { font-size: .95rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.2rem; padding-top: 1rem; }
.sources h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.sources ul { padding-left: 1.1rem; margin: 0; }
.note { border-left: 4px solid var(--accent); background: var(--note-bg); padding: .8rem 1rem; margin: 0 0 1.2rem; border-radius: 0 4px 4px 0; }
.note.alert { border-left-color: var(--warn); background: var(--warn-bg); }
.note.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.note p { margin: 0; }
.note p + p { margin-top: .5rem; }
.related { max-width: 42rem; border-top: 1px solid var(--line); padding: 1.2rem 0 2.5rem; }
.related h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.related ul { margin: 0; padding-left: 1.1rem; }

/* Listas de ferramentas e guias */
.list-title { padding-top: 1.5rem; }
.ledger { list-style: none; margin: 2rem 0 3rem; padding: 0; border-top: 2px solid var(--ink); }
.ledger a { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: .3rem 2rem; padding: 1rem .2rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.ledger a:hover strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: .2em; }
.ledger strong { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.12rem; }
.ledger span { color: var(--muted); }
@media (max-width: 40rem) { .ledger a { grid-template-columns: 1fr; } }

/* Ferramentas */
.tool-head { padding-top: 1.4rem; padding-bottom: 1.2rem; }
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); gap: 2.2rem; align-items: start; padding-bottom: 2rem; }
@media (max-width: 52rem) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.field { margin-bottom: 1.05rem; }
.field label, .field .lab { display: block; font-weight: 700; margin-bottom: .3rem; }
.field .hint { display: block; font-size: .9rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
input[type=text], input[type=number], select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--field-line); border-radius: var(--radius); padding: .65rem .75rem;
  min-height: 2.9rem;
}
input[type=text]:focus, input[type=number]:focus, select:focus { border-color: var(--accent); outline: 3px solid var(--focus); outline-offset: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 30rem) { .two { grid-template-columns: 1fr; } }
.choice { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .55rem; }
.choice input { margin-top: .4rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.choice label { font-weight: 500; margin: 0; }
.btn { display: inline-block; font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius); padding: .75rem 1.2rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: var(--accent-ink); }

/* Comprovante de resultado */
.slip-col { position: sticky; top: 1rem; }
@media (max-width: 52rem) { .slip-col { position: static; } }
.slip { background: #fff; padding: 1.3rem 1.3rem 1.15rem; border-top: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); box-shadow: 0 10px 24px -18px rgba(20, 30, 50, .55); }
.slip h2 { font-size: 1rem; margin: 0 0 .7rem; font-family: var(--font-body); font-weight: 700; color: var(--muted); letter-spacing: 0; }
.slip .big { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1.05; margin: 0 0 .3rem; overflow-wrap: anywhere; }
.slip .big span { background: linear-gradient(transparent 56%, var(--hi) 56%); padding: 0 .12em; margin: 0 -.12em; }
.slip .sub { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.row { display: flex; align-items: baseline; gap: .5rem; padding: .22rem 0; font-size: .98rem; }
.row .leader { flex: 1; border-bottom: 1px dotted var(--muted); min-width: .75rem; transform: translateY(-.28em); }
.row .v { font-weight: 600; text-align: right; }
.row.strong { font-weight: 700; padding-top: .6rem; margin-top: .4rem; border-top: 1px solid var(--line); }
.row.strong .v { font-weight: 800; }
.slip .note { margin: 1rem 0 0; font-size: .95rem; }
.bar-meter { height: .8rem; background: var(--line); border-radius: 99px; overflow: hidden; margin: .4rem 0 .9rem; }
.bar-meter i { display: block; height: 100%; background: var(--accent); }
.bar-meter i.warn { background: var(--warn); }

/* Conteúdo abaixo da ferramenta */
.tool-body { max-width: 42rem; padding-bottom: 1rem; }
.tool-body p, .tool-body ul, .tool-body ol { margin: 0 0 1.1rem; }

/* Rodapé */
.site-foot { border-top: 1px solid var(--line); background: var(--paper); margin-top: 2rem; padding: 1.8rem 0 2.2rem; font-size: .95rem; color: var(--muted); }
.site-foot p { margin: 0 0 .6rem; max-width: 46rem; }
.foot-links a { margin-right: 1.2rem; color: var(--ink); }

:root {
  --paper: #ffffff;
  --bg: #ebece9;              /* concreto */
  --ink: #22272b;             /* grafite */
  --muted: #55606a;
  --line: #cdd1cc;
  --field-line: #8b948e;
  --accent: #f5c400;          /* amarelo de fita métrica */
  --accent-dark: #dcae00;
  --accent-ink: #22272b;
  --hi: #f5c400;
  --link: #22272b;
  --link-hover: #000000;
  --focus: #22272b;
  --warn: #c2381e;
  --warn-bg: #fdede9;
  --ok: #1e7a4c;
  --ok-bg: #e7f5ed;
  --note-bg: #fff6cc;
  --radius: 3px;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head-weight: 800;
  --head-tracking: -0.01em;
}

h1, h2, h3, .brand, .ledger strong { font-stretch: 112%; }
a { text-decoration-color: var(--accent); text-decoration-thickness: .16em; }
.prose a, .tool-body a, .related a, .crumbs a { text-decoration-thickness: .16em; }

/* A fita métrica: a marca da casa, só no cabeçalho */
.site-head { border-bottom: 0; }
.site-head::after {
  content: ""; display: block; height: 16px; background:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 24px) left bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 6px) left bottom / 100% 5px no-repeat,
    var(--accent);
}
.site-head nav a:hover { border-bottom-color: var(--ink); }
.btn { border: 2px solid var(--ink); }
.btn:hover { background: var(--ink); color: #fff; }

.slip { border-top: 6px solid var(--accent); border-bottom: 2px solid var(--ink); box-shadow: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.slip .big span { background: linear-gradient(transparent 56%, var(--accent) 56%); }
.panel { border-radius: var(--radius); }
.ledger { border-top-color: var(--ink); }

/* Página inicial */
.hero { background: var(--paper); padding: 3rem 0 3.2rem; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); max-width: 12ch; line-height: 1; }
.hero .lede { max-width: 34rem; margin: 1.2rem 0 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; }
.hero-actions a.plain { font-weight: 600; }
.section { padding: 2.4rem 0 .5rem; }
.section > .wrap > h2 { margin-top: 0; }
.more { margin: 0 0 2.5rem; }
.trust { max-width: 46rem; }
