:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #fbfcff;
  --ink: #182436;
  --text: #5d6978;
  --muted: #6c7890;
  --faint: #98a2b3;
  --line: #dbe2ea;
  --line-soft: #edf2f7;
  --primary: #002fa7;
  --primary-hover: #00247e;
  --primary-soft: #e8f0ff;
  --blue: #2d6cdf;
  --amber: #9a6212;
  --amber-soft: #fff3d6;
  --shadow-sm: 0 4px 14px rgba(16, 24, 40, .04);
  --shadow-md: 0 16px 42px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(219, 226, 234, .9);
  background: rgba(248, 250, 252, .92);
  backdrop-filter: blur(14px);
}

.nav {
  max-width: 1180px;
  min-height: 52px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark,
.tool-logo,
.logo {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  font-weight: 900;
}

.logo-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.logo-fallback {
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover { color: var(--ink); }
.nav-spacer { flex: 1; }

.submit-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.icon-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.icon-action:hover { background: #eef2f6; }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 86px 22px 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 47, 167, .18);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
}

h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: 0;
}

h2 { letter-spacing: 0; }

.hero-copy {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.stats-strip {
  min-width: 310px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat { padding: 18px; }
.stat + .stat { border-left: 1px solid var(--line-soft); }
.stat strong { display: block; font-size: 26px; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }

.search-panel {
  position: sticky;
  top: 65px;
  z-index: 20;
  margin-bottom: 24px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.search-box {
  position: relative;
  height: 42px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.search-box > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 112px 0 42px;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.filter-actions {
  position: absolute;
  right: 5px;
  top: 50%;
  min-height: 32px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  transform: translateY(-50%);
}

.filter-button,
.reset-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.reset-button { display: none; color: var(--muted); }
.filter-actions.has-selection .reset-button { display: inline-flex; }
.filter-button:last-child, .reset-button:last-child { border-right: 0; }
.filter-button:hover, .reset-button:hover, .filter-button[aria-expanded="true"] { background: #f1f5fb; }

.order-select {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 38px 0 14px;
  color: var(--ink);
  background-color: rgba(255, 255, 255, .96);
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.filter-panel {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0 0;
}

.filter-panel.open { display: grid; }

.filter-column {
  min-height: 286px;
  max-height: 286px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filter-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.filter-option {
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 12px;
  color: var(--ink);
  font-size: 13px;
}

.filter-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.count {
  min-width: 28px;
  border-radius: 6px;
  padding: 3px 6px;
  background: #f2f4f7;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-row h2 {
  margin: 0;
  font-size: 25px;
}

.section-row span {
  color: var(--muted);
  font-size: 14px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  height: 188px;
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .24s cubic-bezier(.2, .8, .2, 1), border-color .24s ease, background .24s ease;
  cursor: pointer;
}

.tool-card:hover {
  z-index: 10;
  border-color: rgba(0, 47, 167, .28);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .08);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tool-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 18px;
  flex: 0 0 auto;
}

.tool-meta { min-width: 0; }
.tool-meta h3 {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-meta span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desc {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  line-height: 1.65;
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: start;
  overflow: hidden;
}

.tag, .chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f6;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
}

.card-switch {
  position: relative;
  min-height: 96px;
}

.state-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  transition: opacity .26s cubic-bezier(.2, .8, .2, 1), transform .26s cubic-bezier(.2, .8, .2, 1);
}

.default-panel { opacity: 1; transform: translateY(0) scale(1); }
.hover-panel { opacity: 0; pointer-events: none; transform: translateY(6px) scale(.992); }
.tool-card:hover .default-panel { opacity: 0; transform: translateY(-5px) scale(.992); }
.tool-card:hover .hover-panel { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

.featured {
  margin-left: auto;
  color: var(--amber);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .2s ease, transform .2s ease;
}

.tool-card:hover .featured { opacity: 1; transform: translateY(0); }

.alt-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.alt-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  padding: 4px 6px;
  color: var(--ink);
  font-weight: 800;
}

.alt-link:hover { background: #f1f5fb; }

.mini-logo {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 47, 167, .16);
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.alt-popover {
  position: absolute;
  left: 62px;
  top: 32px;
  z-index: 20;
  width: min(274px, calc(100vw - 56px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .22s cubic-bezier(.2, .8, .2, 1), transform .22s cubic-bezier(.2, .8, .2, 1);
  backdrop-filter: blur(12px);
}

.alt-link:hover + .alt-popover,
.alt-link:focus + .alt-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.popover-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.popover-head .mini-logo {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.popover-head strong { font-size: 18px; }

.alt-popover p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.alt-popover span:last-child {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.ad-slot {
  min-height: 188px;
  display: grid;
  place-items: center;
  border: 1px dashed #c8d3e1;
  border-radius: 8px;
  background: #f4f7fb;
  color: var(--muted);
  text-align: center;
  box-shadow: none;
}

.ad-slot strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}

.ad-slot span {
  display: block;
  max-width: 230px;
  font-size: 13px;
  line-height: 1.55;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.page-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-button {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.page-button.current {
  border-color: rgba(0, 47, 167, .24);
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.page-button.muted { color: var(--muted); }
.page-button.disabled { opacity: .45; cursor: not-allowed; }

.content-band {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.content-band h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.content-band p {
  max-width: 820px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
}

.crumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 22px;
  align-items: start;
}

.article {
  max-width: 760px;
}

.tool-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  font-size: 28px;
}

.tool-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(42px, 6vw, 60px);
}

.verified {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}

.tagline {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  font-weight: 900;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.screenshot {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  place-items: center;
  margin: 26px 0 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #041936, #062f36 52%, #0c7b6b);
}

.screenshot > img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  background: var(--surface);
}

.screenshot-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
}

.browser {
  width: 82%;
  min-height: 180px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

.browser-bar {
  height: 32px;
  border-bottom: 1px solid var(--line);
}

.article-section {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.article-section h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.article-section p {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.8;
}

.side {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 14px;
}

.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.side-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: 11px 0;
  color: var(--muted);
  font-size: 13px;
}

.fact:first-of-type { border-top: 0; }
.fact strong { color: var(--ink); text-align: right; }

.price-row {
  border-top: 1px solid var(--line-soft);
  padding: 12px 0;
}

.price-row:first-of-type { border-top: 0; }
.price-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.price-row strong:last-child { color: var(--primary); }
.price-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.related-card {
  display: block;
  border-top: 1px solid var(--line-soft);
  padding: 12px 0;
}

.related-card:first-of-type { border-top: 0; }
.related-card strong { display: block; }
.related-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.automation-note {
  border-left: 3px solid var(--primary);
  padding-left: 14px;
  color: var(--text);
}

@media (max-width: 980px) {
  .hero, .detail-layout { grid-template-columns: 1fr; }
  .stats-strip { min-width: 0; max-width: 440px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav { min-height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  main { padding: 104px 16px 52px; }
  .search-panel { position: static; }
  .search-row { grid-template-columns: 1fr; }
  .search-box { height: auto; min-height: 88px; }
  .search-box > svg { top: 22px; }
  .search-box input { height: 42px; padding-right: 12px; }
  .filter-actions {
    position: static;
    min-height: 40px;
    margin: 0 8px 8px;
    transform: none;
  }
  .filter-button, .reset-button { flex: 1; justify-content: center; min-height: 44px; }
  .order-select { min-height: 44px; }
  .filter-panel, .tools-grid, .two-column, .side { grid-template-columns: 1fr; }
  .section-row, .pagination { align-items: flex-start; flex-direction: column; }
  .page-controls { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tag { min-height: 28px; font-size: 12px; }
  .tool-head { grid-template-columns: 54px minmax(0, 1fr); }
  .logo { width: 54px; height: 54px; border-radius: 12px; }
}
