:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-muted: #f4f4f5;
  --text: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --border: rgba(9, 9, 11, 0.08);
  --border-strong: rgba(9, 9, 11, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 40px -24px rgba(0, 0, 0, 0.35);
  --accent: #09090b;
  --accent-text: #fafafa;
  --header: rgba(250, 250, 250, 0.86);
  --glow: rgba(79, 70, 229, 0.16);
  --ring: rgba(9, 9, 11, 0.08);
  --badge-gratis-bg: rgba(16, 185, 129, 0.12);
  --badge-gratis-text: #047857;
  --badge-gratis-ring: rgba(16, 185, 129, 0.22);
  --badge-freemium-bg: rgba(14, 165, 233, 0.12);
  --badge-freemium-text: #0369a1;
  --badge-freemium-ring: rgba(14, 165, 233, 0.22);
  --badge-pago-bg: rgba(245, 158, 11, 0.14);
  --badge-pago-text: #b45309;
  --badge-pago-ring: rgba(245, 158, 11, 0.28);
  color-scheme: light;
  background: var(--bg);
}

html.dark {
  --bg: #09090b;
  --bg-elevated: #111113;
  --bg-muted: rgba(255, 255, 255, 0.045);
  --text: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 18px 44px -24px rgba(0, 0, 0, 0.85);
  --accent: #fafafa;
  --accent-text: #09090b;
  --header: rgba(9, 9, 11, 0.82);
  --glow: rgba(255, 255, 255, 0.07);
  --ring: rgba(255, 255, 255, 0.08);
  --badge-gratis-bg: rgba(16, 185, 129, 0.14);
  --badge-gratis-text: #6ee7b7;
  --badge-gratis-ring: rgba(16, 185, 129, 0.28);
  --badge-freemium-bg: rgba(56, 189, 248, 0.12);
  --badge-freemium-text: #7dd3fc;
  --badge-freemium-ring: rgba(56, 189, 248, 0.28);
  --badge-pago-bg: rgba(251, 191, 36, 0.12);
  --badge-pago-text: #fcd34d;
  --badge-pago-ring: rgba(251, 191, 36, 0.28);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

html body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #18181b;
  color: #fafafa;
}

html.dark ::selection {
  background: #e4e4e7;
  color: #09090b;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 60;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.45rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.muted {
  color: var(--muted);
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.mark {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.brand-tag {
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
}

.icon-button {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

#icon-sun,
#icon-moon {
  display: none;
}

html.dark #icon-sun,
html:not(.dark) #icon-moon {
  display: block;
}

.hero {
  position: relative;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -4rem;
  width: min(720px, 100vw);
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--glow), transparent 68%);
  pointer-events: none;
}

.kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0.4rem 0 0;
  font-size: min(1.5rem, calc((100vw - 2rem) / 17.2));
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.15;
  white-space: nowrap;
}

.lede {
  max-width: 38rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  max-width: none;
  height: 3rem;
  margin-top: 0.65rem;
  padding: 0 0.85rem 0 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow), 0 0 0 1px transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 4px var(--ring);
}

.search svg {
  flex: none;
  color: var(--muted);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.search input::placeholder {
  color: var(--faint);
}

.search input:focus-visible {
  outline: none;
}

.search input[type="search"]::-webkit-search-cancel-button,
.search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.search-clear:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.search-clear[hidden] {
  display: none;
}

.kbd {
  display: none;
  flex: none;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-muted);
  color: var(--muted);
  padding: 0.18rem 0.42rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.filterbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 1.35rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.filterbar.is-stuck {
  border-bottom-color: var(--border);
}

.pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.7rem 0 0.15rem;
  scrollbar-width: none;
}

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

.pill {
  display: inline-flex;
  height: 1.7rem;
  flex: none;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--muted);
  padding: 0 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill[aria-pressed="true"] {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-text);
}

.pill-count {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.72;
}

.toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0 0.75rem;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.segment {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.1rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-muted);
}

.segment button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  height: 1.45rem;
  padding: 0 0.6rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.segment button[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}

.segment button:hover {
  color: var(--text);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-note {
  color: var(--muted);
  font-size: 0.75rem;
}

.listing + .listing {
  margin-top: 1.75rem;
}

.listing[hidden],
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

.card {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1rem;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.logo {
  position: relative;
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.375rem;
}

.logo-fallback {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #52525b;
}

.logo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-copy {
  min-width: 0;
  flex: 1;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-actions {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.15rem;
}

.card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-top: 0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
}

.badge-gratis {
  background: var(--badge-gratis-bg);
  color: var(--badge-gratis-text);
  box-shadow: inset 0 0 0 1px var(--badge-gratis-ring);
}

.badge-freemium {
  background: var(--badge-freemium-bg);
  color: var(--badge-freemium-text);
  box-shadow: inset 0 0 0 1px var(--badge-freemium-ring);
}

.badge-pago {
  background: var(--badge-pago-bg);
  color: var(--badge-pago-text);
  box-shadow: inset 0 0 0 1px var(--badge-pago-ring);
}

.card-category {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: calc(1.45em * 2);
}

.star {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.star:hover {
  background: var(--bg-muted);
  color: #d97706;
}

.star[aria-pressed="true"] {
  color: #f59e0b;
}

.star[aria-pressed="true"]:hover {
  color: #fbbf24;
}

.open-mark {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.card:hover .open-mark {
  color: var(--text);
  transform: translate(1px, -1px);
}

.btn-ghost {
  display: inline-flex;
  height: 2.3rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0 0.9rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--text);
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  padding: 2.75rem 1.25rem;
  text-align: center;
}

.empty h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 1.875rem;
  }

  .kbd {
    display: inline-flex;
  }

  .pills {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

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

  .lede {
    font-size: 1.02rem;
  }
}

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

  .pills {
    gap: 0.3rem;
    overflow-x: auto;
  }

  .pill {
    height: 1.75rem;
    padding: 0 0.45rem;
    font-size: 0.72rem;
  }
}

#lists {
  scroll-margin-top: 12rem;
}

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

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
  }

  html.dark .card:hover {
    background: #16161a;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
