/* ===========================================================================
   FitForRiders — Design System v3 · "O instrumento de medição" (paleta D)
   Identidade: fita métrica de alfaiate + placas de número de corrida,
   em TINTA (monocromático POC/Lightweight) + LARANJA DE SEGURANÇA.
   - Títulos e números: Barlow Condensed (self-hosted em fonts/, 3 pesos)
   - Corpo: fonte do sistema (site estático e rápido — sem dependências)
   - O laranja é o SINAL e aparece SÓ em três sítios: o marcador da régua
     (--hivis), o botão de compra (--signal) e o foco de teclado (--focus).
     Todo o resto é tinta e cinzas quentes. Sem verde, sem tema escuro.
   =========================================================================== */

/* ---- Fonte de display (ficheiros locais em fonts/ — sem pedidos externos) ---- */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-condensed-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/barlow-condensed-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* ---- Tokens (só tema claro) ---- */
:root {
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --primary: #1b1a18;              /* tinta: links, estados ativos, marcas ✓ */
  --on-primary: #ffffff;
  --primary-container: #eeedea;    /* painel da resposta "Fits you" (neutro) */
  --on-primary-container: #1b1a18;

  --secondary-container: #e7e5e0;
  --on-secondary-container: #33312d;

  --tertiary: #8a6a1f;             /* dourado discreto para "snug" */
  --tertiary-container: #f2e7d2;
  --on-tertiary-container: #574a2e;

  --hivis: #f25c15;                /* laranja de segurança: SÓ o marcador da régua */
  --on-hivis: #2b1200;
  --signal: #c94a00;               /* laranja profundo: SÓ o botão de compra */
  --on-signal: #ffffff;
  --focus: #c94a00;                /* anel de foco de teclado */

  --surface: #f5f4f1;
  --surface-dim: #e7e5e0;
  --surface-container: #ffffff;
  --surface-container-high: #edece8;
  --on-surface: #1b1a18;
  --on-surface-variant: #5c5a56;
  --outline: #7a7772;
  --outline-variant: #dedbd4;

  --error: #ba1a1a;
  --star: #c79016;                 /* estrelas de segurança */
  --photo-dim: 1;                  /* brilho das fotos de produto (1 = normal) */

  --r-s: 8px;  --r-m: 12px;  --r-l: 16px;

  --shadow-1: 0 1px 2px rgba(20,18,14,.06), 0 1px 3px rgba(20,18,14,.10);
  --shadow-2: 0 2px 6px rgba(20,18,14,.10), 0 6px 16px rgba(20,18,14,.08);

  color-scheme: light;
}

/* (Tema escuro removido a pedido do dono, 2026-08-14 — o site é só claro.
   Se um dia voltar: está no git, tag v1.9.1.) */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

/* Foco de teclado sempre visível (navegação por Tab) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selecionar texto pinta de verde (a cor da resposta) — detalhe de marca */
::selection { background: var(--primary); color: var(--on-primary); }

/* Respeitar quem pediu menos movimento no sistema */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---- Barra superior ---- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--outline-variant);
}
.appbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 23px;
  text-transform: uppercase; letter-spacing: .02em;
}
.brand .dot { color: var(--primary); }
.brand svg { color: var(--primary); }

/* Selo "beta": o site está em desenvolvimento ativo */
.beta {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--on-tertiary-container); background: var(--tertiary-container);
  padding: 3px 8px 2px; border-radius: 5px; cursor: help; align-self: center;
}

/* Categorias de equipamento (capacetes ativos; resto no roadmap) */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.cat {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 7px 14px 6px; border-radius: var(--r-s);
  border: 1px solid var(--outline-variant);
}
.cat.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.cat.soon { color: var(--on-surface-variant); border-style: dashed; cursor: help; }
.cat.soon em {
  font-style: normal; font-size: 10px; font-weight: 600;
  letter-spacing: .08em; opacity: .8; margin-left: 4px;
}

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-s); border: none; cursor: pointer;
  background: transparent; color: var(--on-surface-variant);
  display: grid; place-items: center; transition: background .15s ease;
}
.icon-btn:hover { background: var(--surface-container-high); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---- Hero ---- */
.hero { padding: 36px 0 4px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 7vw, 62px); line-height: .95;
  text-transform: uppercase; letter-spacing: .01em;
  margin: 0 0 10px;
}
.hero p { color: var(--on-surface-variant); margin: 0; max-width: 62ch; font-size: 16px; }

/* ---- Segmented (as funções) — interruptor de instrumento ---- */
/* Sem bordas nos contentores (decisão do dono, 2.ª ronda): as superfícies
   separam-se pelo tom, não pelo traço — como na POC/Apple. */
.segmented {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
  background: var(--surface-container);
  border-radius: var(--r-m); padding: 4px; margin: 20px 0 14px;
}
.segmented button {
  border: none; background: transparent; cursor: pointer;
  padding: 10px 8px 9px; border-radius: var(--r-s);
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--on-surface-variant); display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s ease, color .15s ease;
}
.segmented button svg { width: 18px; height: 18px; }
.segmented button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.segmented button .lbl-full { display: inline; }
.mode-hint { color: var(--on-surface-variant); font-size: 13px; margin: 10px 2px 0; min-height: 18px; }

/* ---- Painel de entrada ---- */
.panel {
  background: var(--surface-container);
  border-radius: var(--r-l); padding: 18px; margin: 12px 0 22px; box-shadow: var(--shadow-1);
}
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.control { flex: 1 1 160px; min-width: 150px; }
.control.hidden { display: none; }
.control label {
  display: block; font-family: var(--font-display); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--on-surface-variant); margin-bottom: 6px;
}

/* Campo de texto: os NÚMEROS são os protagonistas (letra de placa de corrida) */
.textfield {
  display: flex; align-items: center; gap: 8px; min-height: 58px;
  background: var(--surface-container-high); border: 1px solid transparent;
  border-radius: var(--r-m); padding: 4px 14px; transition: border-color .15s ease;
}
.textfield:focus-within { border-color: var(--primary); }
.textfield input {
  width: 100%; border: none; background: transparent; color: var(--on-surface);
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  letter-spacing: .02em; padding: 4px 0; outline: none;
}
.textfield .unit {
  color: var(--on-surface-variant); font-family: var(--font-display);
  font-weight: 600; font-size: 17px; text-transform: uppercase; letter-spacing: .04em;
  background: transparent; border: 1px solid var(--outline-variant); border-radius: var(--r-s);
  padding: 5px 11px 4px; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s ease, color .15s ease;
}
.textfield .unit:hover { border-color: var(--primary); color: var(--primary); }

select {
  width: 100%; min-height: 58px; padding: 14px 40px 14px 14px; font-size: 15px; color: var(--on-surface);
  font-family: var(--font-body);
  background: var(--surface-container-high); border: 1px solid transparent;
  border-radius: var(--r-m); outline: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--on-surface-variant) 50%),
                    linear-gradient(135deg, var(--on-surface-variant) 50%, transparent 50%);
  background-position: calc(100% - 20px) 25px, calc(100% - 15px) 25px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select:focus { border-color: var(--primary); }

/* Links em tinta precisam de sublinhado para se lerem como links */
.text-btn {
  background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer;
  font-size: 14px; padding: 8px 0 0; font-family: var(--font-body);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--outline);
}
.text-btn:hover { text-decoration-color: var(--primary); }

/* ===========================================================================
   A RÉGUA — o elemento de assinatura. Uma fita métrica de alfaiate real:
   centímetros por cima, polegadas por baixo, o marcador hi-vis na TUA medida
   (arrastável), e barras discretas = quantos capacetes existem em cada cm.
   O interior (ticks, barras, marcador) é construído por app.js.
   =========================================================================== */
.ruler {
  position: relative; margin-top: 16px; height: 92px;
  background: var(--surface-container-high);
  border-radius: var(--r-m);
  cursor: ew-resize; user-select: none; touch-action: none;
  overflow: hidden;
}
.ruler .rtick { position: absolute; width: 1px; background: var(--outline); }
.ruler .rtick.cm    { top: 0; height: 14px; }
.ruler .rtick.cm.half { height: 8px; opacity: .55; }
.ruler .rtick.in    { bottom: 0; height: 14px; }
.ruler .rtick.in.half { height: 8px; opacity: .55; }
.ruler .rlab {
  position: absolute; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--on-surface-variant); letter-spacing: .03em; line-height: 1;
}
.ruler .rlab.cm { top: 18px; }
.ruler .rlab.in { bottom: 18px; }
.ruler .runit {
  position: absolute; left: 7px; font-family: var(--font-display); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--on-surface-variant); opacity: .8; line-height: 1;
}
.ruler .runit.cm { top: 18px; }
.ruler .runit.in { bottom: 18px; }

/* Barras de cobertura: quantos capacetes servem cada cm (faixa central).
   Em tinta, mais leves — a cor fica reservada ao marcador. */
.ruler .rbar {
  position: absolute; bottom: 39px; width: 6px; transform: translateX(-50%);
  background: var(--primary); opacity: .32; border-radius: 2px 2px 0 0;
}

/* O marcador da medida: linha + bandeira hi-vis (tipo autocolante de prova) */
.ruler .rmark { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 2;
  background: var(--on-surface); transform: translateX(-50%); }
.ruler .rflag {
  position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: var(--hivis); color: var(--on-hivis);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  letter-spacing: .03em; white-space: nowrap;
  padding: 3px 9px 2px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--on-hivis) 25%, transparent);
  box-shadow: var(--shadow-1);
  cursor: ew-resize;
}
/* Estrias de peça maquinada (knurling) nos lados da bandeira: dizem "pega
   e arrasta" — como o serrilhado de um aro de guiador ou de um espigão. */
.ruler .rflag::before, .ruler .rflag::after {
  content: ""; width: 7px; height: 11px; flex-shrink: 0;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 3px);
  opacity: .4;
}

/* Micro-detente: um "click" visual por cada passo ao arrastar (como o
   estalido de um freehub). O app.js põe/tira a classe .tick; quem pediu
   menos movimento ao sistema não vê nada (prefers-reduced-motion acima). */
.ruler .rflag { transition: transform .07s ease; }
.ruler .rflag.tick { transform: translate(-50%, -50%) scale(1.08); }
.ruler:focus-visible { outline-offset: -3px; }
.ruler-hint { font-size: 12px; color: var(--on-surface-variant); margin: 8px 2px 0; opacity: .85; }

/* ---- Guia como medir (com desenho técnico do perfil da cabeça) ---- */
.guide {
  display: none; margin-top: 14px; padding: 16px 18px; border-radius: var(--r-m);
  background: var(--surface-container-high); font-size: 14px; color: var(--on-surface-variant);
}
.guide.open {
  display: grid; grid-template-columns: 148px 1fr;
  gap: 6px 22px; align-items: center;
}
.guide ol { margin: 8px 0 0; padding-left: 20px; }
.guide li { margin-bottom: 4px; }
.guide strong { color: var(--on-surface); }

/* O desenho: perfil em traço fino, a linha da fita em verde (a medida é
   sempre verde neste site) e a cota "1–2 cm" em estilo de projeto. */
.measure-fig { margin: 0; align-self: center; }
.measure-fig svg { display: block; width: 100%; height: auto; }
.measure-fig .fig-head { stroke: var(--on-surface-variant); }
.measure-fig .fig-tape { stroke: var(--signal); }   /* a fita É o sinal */
.measure-fig .fig-dim  { stroke: var(--outline); }
.measure-fig .fig-lab  {
  fill: var(--on-surface-variant); font-family: var(--font-display);
  font-weight: 600; font-size: 11.5px; letter-spacing: .06em;
}
@media (max-width: 560px) {
  .guide.open { grid-template-columns: 1fr; justify-items: center; }
  .measure-fig { max-width: 140px; }
  .guide > div { justify-self: stretch; }
}

/* ---- Cabeçalho de resultados ---- */
.results-head { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 14px; }
.results-head h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin: 0;
}
.results-head .count { color: var(--on-surface-variant); font-size: 14px; }

/* ---- Grelha de cartões ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }

.card {
  background: var(--surface-container);
  border-radius: var(--r-l); padding: 16px; display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .12s ease;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }

/* Foto do produto (normalizada em img/; some se falhar). */
.card-photo {
  margin: 0 0 12px; border-radius: var(--r-m); overflow: hidden;
  background: #ffffff;
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  cursor: zoom-in;
  filter: brightness(var(--photo-dim));   /* no escuro, escurece fundo E foto por igual */
  transition: filter .15s ease;
}
.card-photo:hover { filter: brightness(1); }
.card-photo img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }

/* A RESPOSTA — o protagonista do cartão: serve ou não, e em que tamanho */
.fit-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--primary-container); color: var(--on-primary-container);
  border-radius: var(--r-m); padding: 9px 14px; margin: 0 0 12px;
}
.fit-line .fit-size {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  line-height: 1; letter-spacing: .02em; min-width: 30px; text-align: center;
}
.fit-line .fit-size.long { font-size: 19px; line-height: 1.05; max-width: 96px; white-space: normal; }
.fit-line .fit-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fit-line .fit-copy strong {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .07em;
}
.fit-line .fit-copy small { font-size: 12px; opacity: .85; }
.fit-line.tight { background: var(--tertiary-container); color: var(--on-tertiary-container); }

.card-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 16.5px; line-height: 1.2; font-weight: 700; }
.card .brand-name { color: var(--on-surface-variant); font-size: 13px; }

/* Linha de segurança: com nota = estrelas; sem nota = discreta e honesta */
.safety-line { display: flex; align-items: center; gap: 7px; font-size: 13px; margin: 0 0 10px; }
.safety-line .stars { color: var(--star); letter-spacing: 1.5px; font-size: 14px; }
.safety-line b { font-weight: 700; }
.safety-line .vt-src { color: var(--on-surface-variant); }
.safety-line.none { color: var(--on-surface-variant); opacity: .75; font-size: 12.5px; }
.safety-line.example::after { content: "· example"; color: var(--on-surface-variant); opacity: .8; }

/* (mantido para compatibilidade com conteúdos antigos) */
.size-pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 14px;
  padding: 7px 13px; border-radius: 999px; margin-bottom: 12px;
}
.size-pill small { font-weight: 500; opacity: .8; }
.size-pill.tight { background: var(--tertiary-container); color: var(--on-tertiary-container); }

/* Linha de especificações do cartão (estilo · tecnologia · peso): uma linha
   calma de folha de especificações, com separadores hairline — substitui os
   chips em caixinha (menos "botões", mais catálogo técnico). */
.spec-row {
  display: flex; flex-wrap: wrap; gap: 5px 17px; margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .07em; line-height: 1.5;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.spec-row span { position: relative; }
.spec-row span + span::before {
  content: ""; position: absolute; left: -9px; top: 50%;
  transform: translateY(-50%); width: 1px; height: 11px;
  background: var(--outline-variant);
}

/* Chips de características (mantidos para as páginas de guias geradas) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font-size: 12px; color: var(--on-surface-variant); background: var(--surface-container-high);
  border: 1px solid var(--outline-variant); padding: 4px 9px; border-radius: 6px;
}
.chip.safety { color: var(--on-surface); }
.chip.safety .stars { color: var(--star); letter-spacing: 1px; }
.chip.example { border-style: dashed; opacity: .9; }
.chip.example::after { content: " · example"; opacity: .7; }

.highlights { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13.5px; color: var(--on-surface-variant); }
.highlights li { padding-left: 20px; position: relative; margin-bottom: 4px; }
.highlights li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: .01em; line-height: 1.1; }
.price small {
  display: block; font-family: var(--font-body); font-size: 11.5px;
  color: var(--on-surface-variant); font-weight: 500; letter-spacing: 0;
  max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price.no-price { font-size: 17px; color: var(--on-surface-variant); }
.btn-filled {
  background: var(--signal); color: var(--on-signal); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 16px 9px; border-radius: var(--r-s); white-space: nowrap; border: none; cursor: pointer;
}
.btn-filled:hover { filter: brightness(1.08); box-shadow: var(--shadow-1); }

.src-link {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
  color: var(--primary); text-decoration: none;
}
.src-link:hover { text-decoration: underline; }
.src-link.unverified { color: var(--on-surface-variant); }

/* ---- Lightbox: clicar na foto abre a galeria em grande ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 10, .84); backdrop-filter: blur(4px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px;
  padding: 22px;
}
.lightbox figure {
  margin: 0; max-width: min(860px, 100%); width: 100%; justify-self: center;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.lightbox img {
  width: 100%; max-height: min(72vh, 640px); object-fit: contain;
  background: #ffffff; border-radius: var(--r-l); padding: 22px;
}
.lightbox figcaption { color: #fff; font-size: 14px; font-weight: 600; text-align: center; }
.lightbox figcaption .lb-count { opacity: .7; font-weight: 500; }
.lb-prev, .lb-next, .lb-close {
  border: none; cursor: pointer; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff;
  width: 46px; height: 46px; font-size: 24px; line-height: 1;
  display: grid; place-items: center; transition: background .12s ease;
}
.lb-prev:hover, .lb-next:hover, .lb-close:hover { background: rgba(255,255,255,.28); }
.lb-close { position: absolute; top: 18px; right: 18px; font-size: 18px; }
@media (max-width: 560px) {
  .lightbox { padding: 10px; gap: 4px; }
  .lightbox img { padding: 12px; border-radius: var(--r-m); }
  .lb-prev, .lb-next { width: 38px; height: 38px; }
}

/* ---- Comparar: cabeçalho com ordenar (clique no nome) + filtro Excel (▼) ---- */
table.compare thead th { white-space: nowrap; }
.th-sort { cursor: pointer; user-select: none; transition: color .12s ease; }
.th-sort:hover { color: var(--on-surface); }
table.compare th.active { color: var(--primary); }
.th-sort .arrow { font-size: 10px; }

/* Botão ▼ de cada coluna (fica "aceso" quando a coluna tem filtro ativo) */
.th-filter-btn {
  margin-left: 6px; width: 24px; height: 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--outline-variant); background: var(--surface-container-high);
  color: var(--on-surface-variant); font-size: 9px; line-height: 1; vertical-align: middle;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.th-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.th-filter-btn.filtering { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* O menu de filtro (popup estilo Excel) */
.xfilter {
  position: absolute; z-index: 60; width: 240px;
  background: var(--surface-container); color: var(--on-surface);
  border: 1px solid var(--outline-variant); border-radius: var(--r-m);
  box-shadow: var(--shadow-2); padding: 10px;
  font-family: var(--font-body); font-size: 13px;
}
.xfilter .sorts { display: flex; gap: 6px; margin-bottom: 8px; }
.xfilter .sorts button {
  flex: 1; padding: 7px 4px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--surface-container-high); color: var(--on-surface);
  border: 1px solid var(--outline-variant); border-radius: var(--r-s);
}
.xfilter .sorts button:hover { border-color: var(--primary); color: var(--primary); }
.xfilter input[type="search"] {
  width: 100%; padding: 8px 10px; font-size: 13px; outline: none;
  background: var(--surface-container-high); color: var(--on-surface);
  border: 1px solid var(--outline-variant); border-radius: var(--r-s);
}
.xfilter input[type="search"]:focus { border-color: var(--primary); }
.xfilter .vals { max-height: 210px; overflow: auto; margin: 8px 0; }
.xfilter label.val {
  display: flex; align-items: center; gap: 8px; padding: 5px 4px;
  cursor: pointer; border-radius: 6px; color: var(--on-surface);
}
.xfilter label.val:hover { background: var(--surface-container-high); }
.xfilter label.val.all { border-bottom: 1px solid var(--outline-variant); border-radius: 0; margin-bottom: 4px; padding-bottom: 8px; }
.xfilter input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.xfilter .foot { display: flex; gap: 8px; }
.xfilter .foot button {
  flex: 1; padding: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border-radius: var(--r-s);
}
.xfilter .foot .clear { background: transparent; color: var(--on-surface-variant); border: 1px solid var(--outline-variant); }
.xfilter .foot .clear:hover { border-color: var(--error); color: var(--error); }
.xfilter .foot .done { background: var(--primary); color: var(--on-primary); border: none; }
.xfilter .foot .done:hover { filter: brightness(1.05); }

.linklike { background: none; border: none; padding: 0; font: inherit; color: var(--primary); font-weight: 600; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.cmp-none { text-align: center; color: var(--on-surface-variant); padding: 24px 14px; }

.table-scroll { overflow-x: auto; border-radius: var(--r-l); background: var(--surface-container); }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.compare th, table.compare td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--outline-variant);
  font-variant-numeric: tabular-nums;
}
table.compare thead th {
  background: var(--surface-container-high);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .07em;
}
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare tbody tr:hover { background: var(--surface-container-high); }
table.compare .yoursize { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--primary); letter-spacing: .02em; }
table.compare .stars { color: var(--star); }
table.compare a {
  color: var(--primary); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: var(--outline);
}
table.compare a:hover { text-decoration-color: var(--primary); }

/* ---- Estado vazio ---- */
.empty {
  text-align: center; padding: 40px 20px; color: var(--on-surface-variant);
  background: var(--surface-container); border-radius: var(--r-l); border: 1px dashed var(--outline);
}
.empty strong { color: var(--on-surface); }

/* ---- Secção "How it works" (conteúdo indexável) ---- */
.about { margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--outline-variant); }
.about h2 {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px;
}
.about p { color: var(--on-surface-variant); font-size: 14px; margin: 0 0 12px; }
.about strong { color: var(--on-surface); }

/* ---- Rodapé (o rebordo superior é uma aresta de régua: ticks finos,
        4 curtos + 1 alto, como a fita métrica que dá o nome ao site) ---- */
footer.site {
  position: relative; border-top: 1px solid var(--outline-variant);
  margin-top: 40px; padding: 26px 0 60px; color: var(--on-surface-variant); font-size: 13px;
}
footer.site::before, footer.site::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  pointer-events: none; opacity: .55;
}
footer.site::before {   /* ticks menores, de 8 em 8 px */
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--outline-variant) 0 1px, transparent 1px 8px);
}
footer.site::after {    /* tick maior, de 40 em 40 px */
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--outline-variant) 0 1px, transparent 1px 40px);
}
footer.site a { color: var(--primary); }
footer.site .disclaimer {
  margin-top: 10px; padding-left: 12px;
  border-left: 2px solid var(--outline-variant);
}
footer.site .fineprint { opacity: .7; }

/* ===========================================================================
   Páginas de guias (as páginas de SEO geradas por tools/build-seo.js)
   =========================================================================== */

a.brand { text-decoration: none; color: inherit; }

.crumbs { font-size: 13px; color: var(--on-surface-variant); margin: 20px 0 8px; }
.crumbs a { color: var(--primary); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.guide-body h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 6vw, 46px); line-height: .98;
  text-transform: uppercase; letter-spacing: .01em; margin: 0 0 12px;
}
.guide-body .lead { font-size: 17px; color: var(--on-surface-variant); margin: 0 0 8px; }
.guide-body .lead strong { color: var(--on-surface); }
.guide-body h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 23px;
  text-transform: uppercase; letter-spacing: .04em; margin: 34px 0 10px;
}
.guide-body h3 { font-size: 16px; margin: 26px 0 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.guide-body h3 .h3-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.guide-body p, .guide-body li { color: var(--on-surface-variant); }
.guide-body strong { color: var(--on-surface); }
.guide-body ol, .guide-body ul { padding-left: 22px; }
.guide-body li { margin-bottom: 6px; }
.guide-body .table-scroll { margin: 14px 0; }
.guide-body table.compare td.sizes { font-size: 13px; line-height: 1.7; }
.guide-body table.compare td.sizes b { color: var(--on-surface); }
.guide-body .muted { color: var(--on-surface-variant); opacity: .75; }
.guide-body .stars { color: var(--star); letter-spacing: 1px; }
.guide-body .snug {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--tertiary-container); color: var(--on-tertiary-container);
  padding: 2px 7px 1px; border-radius: 5px; vertical-align: middle;
}
.guide-body .note { font-size: 13px; }

.cta {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 24px 0;
  padding: 18px; background: var(--surface-container);
  border-radius: var(--r-l);
}
.cta p { margin: 0; flex: 1 1 260px; color: var(--on-surface); }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.link-grid li { margin: 0; }
.link-grid a {
  display: block; padding: 11px 13px; font-size: 14px; font-weight: 600;
  color: var(--primary); text-decoration: none; background: var(--surface-container);
  border-radius: var(--r-s);
}
.link-grid a:hover { background: var(--surface-container-high); }

/* Mapa de páginas no rodapé */
.foot-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 22px; }
.foot-nav strong { display: block; color: var(--on-surface); margin-bottom: 6px; font-size: 13px; }
.foot-nav a { display: inline-block; margin: 0 10px 4px 0; text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }

@media (max-width: 680px) {
  .ruler .rlab.cm.thin { display: none; }     /* menos números em ecrãs estreitos */
  .ruler .rtick.in.half { display: none; }
}
@media (max-width: 560px) {
  .segmented button .lbl-full { display: none; }
  .segmented button { padding: 12px 4px; }
  .textfield input { font-size: 30px; }
  .appbar .btn-filled { padding: 9px 14px; font-size: 14px; }
  .hero h1 { letter-spacing: 0; }
}
