
:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #65727c;
  --line: #d9e0e4;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-3: #2563eb;
  --soft: #e8f4f2;
  --shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.brand-mark, .tool-logo, .detail-logo {
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white;
  font-weight: 800;
  overflow: hidden;
}
.tool-logo img, .detail-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: white;
}
.tool-logo span, .detail-logo span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
}
.top-nav { display: flex; gap: 6px; }
.nav-link {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}
.nav-link.is-active, .nav-link:hover { background: var(--soft); color: var(--accent); }

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 24px;
}
.filter-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 32px; line-height: 1.16; }
h2 { margin-bottom: 0; font-size: 22px; }
h3 { margin-bottom: 0; font-size: 17px; line-height: 1.3; }
.lead { color: var(--muted); line-height: 1.7; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}
.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
}
.check-row input { min-height: auto; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stats-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.stats-grid strong { display: block; font-size: 22px; }
.stats-grid span { color: var(--muted); font-size: 12px; }

.results-panel, .page-wrap, .detail-page {
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto;
}
.workbench .results-panel { width: auto; margin: 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
output, .button, .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 750;
}
.button:hover, .back-link:hover { border-color: var(--accent); color: var(--accent); }

.category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.category-tile {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.category-tile strong { color: var(--accent-2); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.tool-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(23, 32, 38, 0.04);
}
.tool-card[hidden] { display: none; }
.tool-card-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 16px;
}
.tool-card:hover { border-color: rgba(15, 118, 110, 0.45); box-shadow: var(--shadow); }
.tool-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  font-size: 14px;
}
.tool-main { min-width: 0; }
.tool-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.tool-card-top strong {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: 13px;
}
.tool-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.tool-meta, .tag-row, .flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-meta span, .tag-row span, .flag-row span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}
.tool-meta span { background: #eef2ff; color: #3730a3; }
.tag-row span { background: #f1f5f9; color: #475569; }
.flag-row { margin-top: 8px; }
.flag-row span { background: var(--soft); color: var(--accent); font-weight: 700; }
.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.page-wrap, .detail-page { padding: 32px 0; }
.category-list {
  display: grid;
  gap: 10px;
}
.category-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.category-row span { font-size: 18px; font-weight: 800; }
.category-row strong { color: var(--accent-2); }
.category-row em { color: var(--muted); font-style: normal; }

.back-link { margin-bottom: 16px; }
.detail-hero {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.detail-logo {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  font-size: 22px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.info-block {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.info-block h2 { margin-bottom: 14px; }
dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}
dt { color: var(--muted); font-weight: 750; }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.alternative-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.alternative-list a, .alternative-list span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; padding: 16px; }
  .filter-panel { position: static; }
  .results-panel, .page-wrap, .detail-page { width: calc(100vw - 32px); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .top-nav { width: 100%; }
  .nav-link { flex: 1; text-align: center; }
  h1 { font-size: 26px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card-link { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; }
  .tool-logo { width: 44px; height: 44px; }
  .detail-hero { grid-template-columns: 1fr; padding: 20px; }
  .detail-logo { width: 72px; height: 72px; }
  .category-row { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
}
