:root {
  --ink: #1a1a1a;
  --ink-2: #3d3d45;
  --muted: #6b7584;
  --line: rgba(18, 24, 33, 0.1);
  --bg: #f9fafb;
  --card: #ffffff;
  --red: #be3944;
  --red-dark: #9c2d37;
  --navy: #2f3961;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: "Space Grotesk", var(--font);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(14px, 2.2vw, 24px);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- palco ---------- */
#stage { position: fixed; inset: 0; touch-action: none; cursor: grab; outline: none; }
#stage.dragging { cursor: grabbing; }
#stage.pointing { cursor: pointer; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- topo ---------- */
.top {
  position: fixed; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: var(--gutter);
  background: linear-gradient(var(--bg) 35%, rgba(249, 250, 251, 0));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 4px 12px rgba(18, 24, 33, .15); }
.brand strong { display: block; font-family: "Space Grotesk", var(--font); font-weight: 600; font-size: 17px; letter-spacing: .02em; line-height: 1.1; text-transform: uppercase; color: var(--red); }
.brand strong b { color: var(--navy); font-weight: 700; }
.brand small { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.nav { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(18, 24, 33, .05), 0 6px 16px rgba(18, 24, 33, .06);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.chip:hover { box-shadow: 0 2px 4px rgba(18, 24, 33, .06), 0 10px 22px rgba(18, 24, 33, .09); }
.chip:active { transform: scale(.97); }
.chip.icon { width: 40px; padding: 0; justify-content: center; color: var(--ink-2); }
.chip.dark { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 20px rgba(47, 57, 97, .25); font-family: var(--title); font-weight: 600; }
.chip.static { box-shadow: none; background: rgba(255, 255, 255, .75); color: var(--muted); font-weight: 600; cursor: default; }
:is(.chip, button, a, select, input):focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.hint {
  position: fixed; z-index: 4; left: 50%; top: calc(var(--gutter) + 58px);
  transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 7px 16px; border-radius: 999px; background: #000; color: #fff;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; opacity: 0; transition: opacity .6s;
}
.hint.on { opacity: .92; }

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 6; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; pointer-events: none;
}
.dock > * { pointer-events: auto; }
.count { justify-self: end; }
.cats { position: relative; justify-self: start; }
.cats .now { color: var(--red); max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
.filter-panel {
  position: absolute; bottom: calc(100% + 10px); left: 0;
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 580px); overflow-y: auto; overflow-x: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(18, 24, 33, .16);
  padding: 16px;
  animation: rise .3s var(--ease);
}
.filter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.label { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#clear-filters { font-size: 13px; font-weight: 700; color: var(--red); }
.cats-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cats-list button {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; background: #fff; transition: background .2s, color .2s;
}
.cats-list button:hover { background: #f4f6f8; }
.cats-list button[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }
.cats-list button .n { opacity: .6; font-size: 12px; margin-left: 5px; }
.filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.filter-selects label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.filter-selects select { height: 38px; border-radius: 999px; padding-left: 12px; border: 1px solid var(--line); background: #fff; padding: 0 8px; font-weight: 600; }
.uso-label { display: grid; gap: 5px; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.uso-label select { height: 38px; border-radius: 999px; padding-left: 12px; border: 1px solid var(--line); background: #fff; padding: 0 8px; font-weight: 600; }
.uso-nota { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.f-uso { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.row .uso { display: block; width: max-content; margin: 4px 0 0 auto; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--red); }

.search-wrap { position: relative; display: flex; justify-content: center; }
.search {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, calc(100vw - 2 * var(--gutter)));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(18, 24, 33, .16);
  animation: rise-center .3s var(--ease);
}
.search-top { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); }
.search input:focus-visible { outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-close { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.search-close:hover { background: #f1f3f5; }
.hits { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; border-bottom: 1px solid var(--line); }
.hits:empty { display: none; }
.hits button { width: 100%; text-align: left; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 12px; }
.hits button:hover, .hits button.active { background: #f5f5f7; }
.hits .nm { display: block; font-family: var(--title); font-weight: 600; font-size: 15px; }
.hits .sub { display: block; font-size: 12.5px; color: var(--muted); }
.hits .none { padding: 12px; color: var(--muted); }

.th { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: #f4f5f7; overflow: hidden; }
.th img { width: 86%; height: 86%; object-fit: contain; mix-blend-mode: multiply; }

/* ---------- ficha ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(18, 24, 33, .25); }
.focus {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  background: var(--bg);
}
.focus[open] { animation: fade .3s var(--ease); }
.f-top {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--gutter); pointer-events: none;
  background: linear-gradient(var(--bg) 55%, rgba(249, 250, 251, 0));
}
.f-top > * { pointer-events: auto; }
.f-sig { font-family: "Space Grotesk", var(--font); font-weight: 600; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--red); }
.f-sig b { color: var(--navy); font-weight: 700; }
.f-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.f-body { width: min(1040px, calc(100vw - 2 * var(--gutter))); margin: 0 auto; padding: 84px 0 110px; }
.f-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.f-media { margin: 0; }
.f-hero {
  aspect-ratio: 1; border-radius: 28px; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 20px 50px rgba(18, 24, 33, .08);
}
.f-hero { position: relative; }
.f-hero img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; }
.f-hero svg { width: 90%; height: 90%; }
.f-credit { margin-top: 10px; font-size: 12px; color: var(--muted); }
.f-credit a { color: var(--muted); }
.f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: rgba(190, 57, 68, .1); color: var(--red); }
.pill.sec { background: rgba(47, 57, 97, .1); color: var(--navy); }
.pill.neutral { background: #fff; border: 1px solid #d4d4d4; color: var(--ink-2); }
#f-title { font-family: var(--title); font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 14px 0 6px; }
.f-maker { margin: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f-lead { font-size: 19px; line-height: 1.5; margin: 16px 0 0; color: #666; font-weight: 400; }
.f-price-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.f-price { font-family: var(--title); font-size: 28px; font-weight: 600; color: var(--navy); margin: 0; letter-spacing: -.01em; }
.f-price .note { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.mark { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: rgba(190, 57, 68, .1); color: var(--red); }
.f-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; height: 48px; padding: 0 26px; border-radius: 999px;
  font-family: var(--title); font-weight: 600; text-decoration: none; border: 2px solid #000; background: #fff; color: #000;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(190, 57, 68, .25); }
.btn.primary:hover { background: var(--red-dark); }
.f-details { margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-section { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.detail-section h3, .f-results h3 { margin: 0 0 10px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.detail-section p { font-size: 16px; line-height: 1.6; margin: 0; }
.f-meta { display: grid; grid-template-columns: 104px 1fr; gap: 10px 14px; margin: 0; font-size: 14.5px; line-height: 1.5; }
.f-meta dt { color: var(--muted); font-weight: 700; }
.f-meta dd { margin: 0; }
.f-recursos { margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.7; }
.f-recursos li::marker { color: var(--red); }
.f-fontes { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); word-break: break-word; }
.f-fontes a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: rgba(47, 57, 97, .3); }
.f-disclaimer { grid-column: 1 / -1; margin: 6px 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.f-results { margin-top: 40px; }
.f-list, .index-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  width: 100%; text-align: left; display: grid; grid-template-columns: 30px 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); transition: box-shadow .2s, transform .2s;
}
.row:hover { box-shadow: 0 10px 24px rgba(18, 24, 33, .08); transform: translateY(-1px); }
.row .num { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .nm { display: block; font-family: var(--title); font-weight: 600; font-size: 16.5px; }
.row .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .pr { font-family: var(--title); font-size: 14px; font-weight: 600; color: var(--navy); text-align: right; }
.f-rise { animation: rise .55s var(--ease) both; }

/* ---------- lista completa ---------- */
.sheet {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  background: var(--bg);
}
.sheet[open] { animation: fade .25s var(--ease); }
.sheet-inner:focus { outline: none; }
.sheet-inner { width: min(820px, calc(100vw - 2 * var(--gutter))); margin: 0 auto; height: 100%; overflow-y: auto; padding: 0 0 80px; }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: var(--gutter) 0 12px; background: linear-gradient(var(--bg) 75%, rgba(249, 250, 251, 0)); }
.sheet-bar h2 { margin: 0; font-family: var(--title); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.sheet-intro { margin: 0 0 16px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.sheet .f-disclaimer { margin-top: 20px; }

.noscript { position: fixed; inset: auto 0 45% 0; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rise-center { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 760px) {
  .f-grid, .f-details { grid-template-columns: 1fr; }
  .f-hero { width: min(420px, 100%); margin: 0 auto; }
}
@media (max-width: 640px) {
  .brand small { display: none; }
  .brand strong { font-size: 14.5px; white-space: nowrap; }
  .brand img { width: 30px; height: 30px; }
  .nav .chip.icon:not(:last-of-type) { display: none; }
  .count { display: none; }
  .dock { grid-template-columns: auto 1fr; gap: 8px; }
  .search-wrap { justify-content: flex-end; }
  .search-toggle span { display: none; }
  .search-toggle { width: 40px; padding: 0; justify-content: center; }
  .search { left: auto; right: 0; transform: none; animation-name: rise; }
  .hint { top: auto; bottom: calc(var(--gutter) + 58px); white-space: normal; width: max-content; max-width: calc(100vw - 40px); text-align: center; line-height: 1.5; border-radius: 16px; }
  .row { grid-template-columns: 52px minmax(0, 1fr); }
  .row .num { display: none; }
  .row .pr { grid-column: 2; text-align: left; margin-top: -6px; display: flex; align-items: center; gap: 8px; }
  .row .uso { margin: 0; }
  .f-meta { grid-template-columns: 92px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .focus[open], .sheet[open], .f-rise, .filter-panel, .search { animation: none; }
}
