/* Codekitto: estilos do site e componentes reaproveitáveis das ferramentas */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/fonts/bricolage-grotesque-latin.woff2) format('woff2');
}

:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --sunken: #f6efe4;
  --ink: #1e1b2e;
  --muted: #5e5872;
  --line: #e3d8c8;
  --kit: #f07a2e;
  --kit-soft: #ffeedb;
  --drop-line: #1e1b2e;
  --head: #1e1b2e;
  --head-ink: #fff4e6;
  --ok: #17784e;
  --err: #b3261e;
  --focus: #2f5bea;
  --link: #a4470f;
  --chart-1: #2a78d6;
  --chart-2: #f07a2e;
  /* Mascote: o contorno é sempre escuro, porque o pelo é claro em todos os temas. */
  --cat-line: #1e1b2e;
  --cat-fur: #ffe2bf;
  --cat-accent: #f07a2e;
  --cat-pink: #ffa3a3;
  --cat-prop: #c9c4da;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', monospace;
  --radius: 10px;
  color-scheme: light;
}

/* Temas. Sem escolha (sem data-theme no <html>), segue o sistema: claro ou escuro.
   A escolha no menu do cabeçalho grava data-theme. Para criar um tema novo, copie um bloco
   abaixo, troque as cores e adicione o tema em THEMES (src/layout.mjs) e em i18n.mjs. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #16141f;
    --surface: #211e2e;
    --sunken: #1a1825;
    --ink: #f1ece4;
    --muted: #a8a2b8;
    --line: #3a3550;
    --kit-soft: #2e2533;
    --drop-line: #f07a2e;
    --head: #100e17;
    --head-ink: #f1ece4;
    --ok: #4cc38a;
    --err: #ff8a80;
    --focus: #8fb0ff;
    --link: #ffb27a;
    --chart-1: #3987e5;
    --chart-2: #f07a2e;
    --cat-lid: #3a3550;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #16141f;
  --surface: #211e2e;
  --sunken: #1a1825;
  --ink: #f1ece4;
  --muted: #a8a2b8;
  --line: #3a3550;
  --kit-soft: #2e2533;
  --drop-line: #f07a2e;
  --head: #100e17;
  --head-ink: #f1ece4;
  --ok: #4cc38a;
  --err: #ff8a80;
  --focus: #8fb0ff;
  --link: #ffb27a;
  --chart-1: #3987e5;
  --chart-2: #f07a2e;
  --cat-lid: #3a3550;
  color-scheme: dark;
}

/* Terminal: verde em fundo preto, como um terminal antigo */
:root[data-theme='terminal'] {
  --bg: #0b0f0c;
  --surface: #111813;
  --sunken: #0e1410;
  --ink: #c8f7d8;
  --muted: #7fb394;
  --line: #1f3a2a;
  --kit: #39d98a;
  --kit-soft: #13261b;
  --drop-line: #39d98a;
  --head: #060906;
  --head-ink: #c8f7d8;
  --ok: #39d98a;
  --err: #ff8a80;
  --focus: #9fd0ff;
  --link: #7cf0b3;
  --chart-1: #39d98a;
  --chart-2: #f0c93a;
  --cat-lid: #1f3a2a;
  --font: var(--mono);
  color-scheme: dark;
}

/* Alto contraste: preto, branco e amarelo, para quem enxerga com dificuldade */
:root[data-theme='contrast'] {
  --bg: #000000;
  --surface: #000000;
  --sunken: #141414;
  --ink: #ffffff;
  --muted: #f0f0f0;
  --line: #ffffff;
  --kit: #ffe600;
  --kit-soft: #1f1c00;
  --drop-line: #ffe600;
  --head: #000000;
  --head-ink: #ffffff;
  --ok: #5cff95;
  --err: #ff7070;
  --focus: #00e5ff;
  --link: #ffe600;
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --cat-lid: #333333;
  color-scheme: dark;
}
:root[data-theme='contrast'] .site-head { border-bottom: 2px solid #ffffff; }
:root[data-theme='contrast'] .site-foot { border-top: 2px solid #ffffff; }
:root[data-theme='contrast'] a { text-decoration-thickness: 2px; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: 12px; top: -60px; background: var(--kit); color: #1e1b2e; padding: 8px 14px; border-radius: 6px; z-index: 50; font-weight: 650; }
.skip:focus { top: 12px; }
main:focus { outline: none; }

/* ---------- cabeçalho ---------- */


.site-head { background: var(--head); color: var(--head-ink); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 750; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand .logo { width: 38px; height: 38px; flex: none; }
.brand b { color: var(--kit); font-weight: inherit; }
:root[data-theme='contrast'] .brand b { color: inherit; }

.head-nav { display: flex; align-items: center; gap: 6px; }
.lang-link { color: var(--head-ink); text-decoration: none; font-weight: 650; font-size: 0.9rem; padding: 6px 10px; border: 1.5px solid color-mix(in srgb, var(--head-ink) 35%, transparent); border-radius: 8px; }
.lang-link:hover { border-color: var(--kit); }

/* Menu de temas */
.theme-menu summary {
  width: 38px; height: 34px; padding: 0; justify-content: center;
  border: 1.5px solid color-mix(in srgb, var(--head-ink) 35%, transparent); border-radius: 8px;
}
.theme-menu summary::after { display: none; }
.theme-menu summary:hover, .theme-menu[open] summary { border-color: var(--kit); }
.theme-menu summary svg { width: 18px; height: 18px; }
.theme-menu .theme-panel { width: 260px; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px; }
.theme-menu .theme-panel p { margin: 4px 8px 6px; font-weight: 700; }
.theme-option {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font: inherit; font-size: 0.97rem; color: var(--ink); background: none; border: 0; border-radius: 8px;
  padding: 8px; cursor: pointer; white-space: nowrap;
}
.theme-option:hover { background: var(--sunken); }
.theme-option[aria-pressed='true'] { font-weight: 700; background: var(--sunken); }
.theme-option[aria-pressed='true']::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.theme-swatch { display: flex; flex: none; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1.5px var(--line); }
.theme-swatch i { display: block; width: 10px; height: 20px; }
@media (max-width: 560px) {
  .theme-menu .theme-panel { left: auto; right: 16px; width: 260px; }
}

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-weight: 650; padding: 6px 12px; border-radius: 8px; user-select: none; display: flex; align-items: center; gap: 8px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.menu[open] summary::after { transform: translateY(1px) rotate(225deg); }
.menu summary:hover, .menu[open] summary { background: color-mix(in srgb, var(--head-ink) 12%, transparent); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  width: min(92vw, 640px); max-height: 75vh; overflow: auto;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px; padding: 18px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 24px;
}
.menu-group-name { display: block; font-weight: 700; color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.menu-group li a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; font-size: 0.97rem; }
.menu-group li a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 560px) {
  .menu { position: static; }
  .menu-panel { left: 16px; right: 16px; width: auto; top: 70px; }
  .site-head .wrap { position: relative; }
}

/* ---------- títulos e textos de abertura ---------- */

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); font-weight: 780; letter-spacing: -0.03em; }

.crumbs { font-size: 0.92rem; color: var(--muted); padding-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

.hero { padding: 48px 0 32px; max-width: 760px; }
.hero--small { padding: 20px 0 20px; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 12px 0 0; max-width: 62ch; }

/* ---------- lista de ferramentas (início e grupos) ---------- */

.directory { display: grid; gap: 36px 40px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding-bottom: 24px; }
.directory--single { grid-template-columns: 1fr; max-width: 760px; }
.dir-group h2 { font-size: 1.05rem; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.dir-group h2 a { color: inherit; text-decoration: none; }
.dir-list { list-style: none; margin: 0; padding: 0; }
.dir-list li { border-bottom: 1px solid var(--line); }
.dir-list a { display: grid; gap: 2px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.dir-list a:hover .dir-name { text-decoration: underline; text-decoration-color: var(--kit); text-decoration-thickness: 3px; }
.dir-name { font-weight: 680; font-size: 1.08rem; }
.dir-short { color: var(--muted); font-size: 0.97rem; }
.soon { color: var(--muted); padding-bottom: 24px; }
/* Página 404: o gatinho ao lado do título */
.notfound { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; max-width: none; padding-bottom: 32px; }
.notfound-cat { width: 100%; max-width: 300px; height: auto; aspect-ratio: 4 / 3; flex: none; }
.home-about { padding: 24px 0 64px; border-top: 2px solid var(--line); }

/* ---------- página de ferramenta ---------- */

.tool-head { padding: 14px 0 22px; max-width: 820px; }

/* A bancada: o painel onde a ferramenta funciona */
.bench {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 7px 7px 0 var(--kit);
  padding: 18px;
  margin-right: 7px;
}
@media (min-width: 720px) { .bench { padding: 26px 28px; } }

.local-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.93rem; margin: 18px 0 0; }
.local-note svg { width: 16px; height: 16px; flex: none; color: var(--ok); }

.tool-body { display: grid; gap: 40px; padding: 28px 0 64px; }
@media (min-width: 960px) { .tool-body { grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; } }

.related h2 { font-size: 1rem; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; }
.related a:hover { text-decoration: underline; }
@media (min-width: 960px) { .related { position: sticky; top: 20px; align-self: start; } }

/* ---------- texto explicativo ---------- */

.prose { max-width: 68ch; min-width: 0; } /* min-width: tabelas largas rolam dentro da caixa, sem alargar a página */
.prose h1 { margin: 36px 0 20px; }
.prose h2 { font-size: 1.55rem; font-weight: 720; margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 8px; }
.prose h3 { font-size: 1.17rem; font-weight: 700; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }
.prose ol li::marker { font-weight: 700; color: var(--ink); }
.prose .table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { background: var(--sunken); font-weight: 700; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--sunken); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.static-page .prose { padding-bottom: 64px; }
.contact-email { font-size: 1.4rem; font-weight: 700; }

/* ---------- anúncios ---------- */

.ad { margin: 28px 0; min-height: 100px; }
.ad--dev {
  display: grid; place-items: center; min-height: 120px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 0.9rem; background: repeating-linear-gradient(-45deg, transparent 0 12px, var(--sunken) 12px 24px);
}

/* ---------- rodapé ---------- */

.site-foot { background: var(--head); color: var(--head-ink); padding: 44px 0 28px; font-size: 0.96rem; }
.site-foot a { color: var(--head-ink); }
.foot-grid { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.foot-about p { color: color-mix(in srgb, var(--head-ink) 72%, transparent); margin: 12px 0 0; max-width: 34ch; }
.foot-col h2 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.foot-col h2 a { text-decoration: none; }
.foot-col ul, .foot-legal ul { list-style: none; margin: 0; padding: 0; }
.foot-col li a { display: block; padding: 3px 0; text-decoration: none; color: color-mix(in srgb, var(--head-ink) 78%, transparent); }
.foot-col li a:hover { color: var(--head-ink); text-decoration: underline; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 36px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--head-ink) 20%, transparent); }
.foot-legal ul { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-legal p { margin: 0; color: color-mix(in srgb, var(--head-ink) 60%, transparent); }

/* =========================================================
   Componentes das ferramentas (use estas classes no ui.html)
   ========================================================= */

/* Área de soltar arquivo */
.kv-drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 10px;
  padding: 34px 18px; border: 2px dashed var(--drop-line); border-radius: 12px;
  background: var(--kit-soft); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.kv-drop:hover, .kv-drop.is-over { background: color-mix(in srgb, var(--kit) 40%, var(--surface)); border-style: solid; }
.kv-drop input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.kv-drop:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.kv-drop-icon { width: 44px; height: 44px; color: var(--ink); }
.kv-drop-title { font-size: 1.2rem; font-weight: 700; }
.kv-drop-hint { color: var(--muted); font-size: 0.95rem; }
.kv-drop--compact { padding: 16px; grid-auto-flow: column; justify-content: center; }
.kv-drop--compact .kv-drop-icon { width: 28px; height: 28px; }
.kv-drop--compact .kv-drop-title { font-size: 1rem; }

/* Botões */
.kv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  padding: 11px 18px; min-height: 44px; border-radius: 10px; cursor: pointer; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
}
.kv-btn:hover { background: var(--sunken); }
.kv-btn--primary { background: var(--kit); color: #1e1b2e; border-color: #1e1b2e; }
.kv-btn--primary:hover { background: color-mix(in srgb, var(--kit) 82%, #ffffff); }
.kv-btn--quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 8px 10px; min-height: 36px; }
.kv-btn--big { font-size: 1.15rem; padding: 14px 28px; min-height: 54px; border-radius: 12px; }
.kv-btn--quiet:hover { color: var(--ink); background: var(--sunken); }
.kv-btn[disabled], .kv-btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.kv-btn svg { width: 18px; height: 18px; }

/* Campos */
.kv-controls { display: grid; gap: 18px 28px; margin-top: 22px; }
@media (min-width: 720px) { .kv-controls { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.kv-field { display: grid; gap: 8px; align-content: start; min-width: 0; border: 0; padding: 0; margin: 0; }
.kv-label { font-weight: 680; font-size: 0.98rem; padding: 0; }
.kv-help { color: var(--muted); font-size: 0.9rem; }
.kv-input-unit { display: flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface); overflow: hidden; max-width: 220px; }
.kv-input-unit:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.kv-input-unit input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.3rem; font-weight: 700; padding: 8px 12px; font-variant-numeric: tabular-nums; }
.kv-input-unit input:focus { outline: none; }
.kv-input-unit span { display: grid; place-items: center; padding: 0 14px; background: var(--sunken); border-left: 2px solid var(--ink); font-weight: 680; }
.kv-input-unit--small input { font-size: 1.05rem; font-weight: 600; }
.kv-input { border: 2px solid var(--ink); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; padding: 9px 12px; max-width: 220px; }
.kv-input:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.kv-textarea {
  width: 100%; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1rem; line-height: 1.5; padding: 10px 12px; resize: vertical;
}
.kv-textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Caixa de código (JSON, SQL, XML...): fonte monoespaçada, sem quebra automática de linha */
.kv-textarea--code { font-family: var(--mono); font-size: 0.92rem; line-height: 1.55; tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; min-height: 220px; }
.kv-output { margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--sunken); font-family: var(--mono); font-size: 0.92rem; line-height: 1.55; white-space: pre; overflow: auto; max-height: 480px; tab-size: 2; }

/* Chips de valores prontos */
.kv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kv-chip {
  font: inherit; font-size: 0.93rem; font-weight: 620; padding: 6px 12px; min-height: 36px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums;
}
.kv-chip:hover { border-color: var(--ink); }
.kv-chip[aria-pressed='true'] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Seleção segmentada (radio) */
.kv-seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; width: fit-content; }
.kv-seg label { position: relative; }
.kv-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.kv-seg span { display: block; padding: 8px 16px; font-weight: 650; cursor: pointer; border-left: 2px solid var(--ink); }
.kv-seg label:first-child span { border-left: 0; }
.kv-seg input:checked + span { background: var(--ink); color: var(--surface); }
.kv-seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -5px; }
.kv-seg input:disabled + span { opacity: 0.4; cursor: not-allowed; }

.kv-range { width: 100%; accent-color: var(--ink); margin: 6px 0; }

/* Barra de progresso (conversões longas) */
.kv-progress { display: grid; gap: 6px; }
.kv-progress-bar { height: 12px; border-radius: 6px; background: var(--sunken); overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); }
.kv-progress-bar span { display: block; height: 100%; width: 0; background: var(--kit); border-radius: 6px; transition: width 0.2s linear; }
.kv-progress p { margin: 0; color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }

.kv-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.kv-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* Abas */
.kv-tabs { display: flex; flex-wrap: wrap; gap: 2px; box-shadow: inset 0 -2px 0 var(--line); }
.kv-tab {
  font: inherit; font-weight: 650; font-size: 1rem; background: none; border: 0; cursor: pointer;
  padding: 10px 14px; color: var(--muted); border-bottom: 4px solid transparent;
}
.kv-tab:hover { color: var(--ink); }
.kv-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--kit); }
@media (max-width: 420px) { .kv-tab { padding: 10px 8px; font-size: 0.94rem; } }

/* Mensagens */
.kv-msg { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; border-left: 4px solid var(--muted); background: var(--sunken); font-size: 0.97rem; }
.kv-msg--err { border-left-color: var(--err); color: var(--err); }
.kv-msg--ok { border-left-color: var(--ok); }

/* Lista de resultados */
.kv-results { display: grid; gap: 12px; margin-top: 22px; }
.kv-results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.kv-results-head h2 { font-size: 1.1rem; font-weight: 700; }
.kv-results-tools { display: flex; gap: 6px; flex-wrap: wrap; }

/* Texto só para leitores de tela */
.kv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Formulário de números (ferramentas de finanças): campos em colunas, valor + unidade lado a lado */
.kv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 28px; }
.kv-form .kv-input-unit { max-width: 260px; }
.kv-form .kv-input-unit span:first-child { border-left: 0; border-right: 2px solid var(--ink); }
.kv-form .kv-input-unit--small { max-width: 130px; }
.kv-form select.kv-input { max-width: 260px; }
.kv-form .kv-help { margin: 0; }
.kv-pair { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.kv-pair .kv-input-unit--small { max-width: 112px; }
.kv-pair .kv-seg span { padding: 8px 12px; }

/* Números de resultado (ferramentas de finanças) */
.kv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kv-stat { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--sunken); border: 1.5px solid var(--line); min-width: 0; }
.kv-stat dt { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.kv-stat dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv-stat small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.kv-stat--wide { grid-column: 1 / -1; }
.kv-stat--hero { background: var(--kit-soft); border-color: var(--ink); }
.kv-stat--hero dd { font-size: clamp(2rem, 1.4rem + 3vw, 2.8rem); letter-spacing: -0.02em; line-height: 1.1; }

/* Tabela de números */
.kv-table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 12px; max-height: 480px; overflow-y: auto; }
.kv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.kv-table th, .kv-table td { padding: 7px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.kv-table th:first-child, .kv-table td:first-child { text-align: left; }
.kv-table thead th { position: sticky; top: 0; background: var(--sunken); color: var(--muted); font-weight: 650; font-size: 0.88rem; border-bottom: 2px solid var(--line); }
.kv-table tbody tr:last-child td { border-bottom: 0; }
.kv-table tfoot td { font-weight: 750; border-top: 2px solid var(--line); border-bottom: 0; }

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