:root {
  --brand: #C0272D;
  --brand-600: #A61F25;
  --brand-050: #FCF3F3;
  --ink: #0B1730;
  --ink-2: #33405A;
  --muted: #667085;
  --line: #E5E7EB;
  --line-strong: #D9DEE7;
  --surface: #FFFFFF;
  --surface-soft: #F6F7F9;
  --page: #F3F5F8;
  --danger-soft: #FDECEC;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 23, 48, .04), 0 6px 18px rgba(11, 23, 48, .035);
  --shadow-lg: 0 20px 56px rgba(11, 23, 48, .14), 0 4px 14px rgba(11, 23, 48, .08);
  --page-pad: max(24px, calc((100vw - 1240px) / 2));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--ink);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(192, 39, 45, .34);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.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;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 44px;
  overflow: hidden;
  background: var(--page);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--page-pad);
  color: #fff;
  background: #0B1730;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(192, 39, 45, .24);
}

.brand-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: .04em;
  white-space: nowrap;
}

.brand-en {
  margin-left: 3px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .56);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .14em;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions a,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: rgba(255, 255, 255, .76);
  background: transparent;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.top-actions a:hover,
.quiet-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .1);
}

.top-actions .icon {
  width: 15px;
  height: 15px;
}

/* Single-screen main */
.main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr);
  align-items: center;
  gap: 56px;
  min-height: 248px;
  padding: 34px var(--page-pad) 36px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 83% 16%, rgba(192, 39, 45, .24), transparent 34%),
    radial-gradient(circle at 18% 120%, rgba(77, 110, 160, .24), transparent 44%),
    linear-gradient(120deg, #0B1730 0%, #101F3C 58%, #0B1730 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 60%, #000 100%);
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -110px;
  top: -190px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, .025), 0 0 0 96px rgba(255, 255, 255, .018);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .11em;
}

.eyebrow span {
  width: 18px;
  height: 2px;
  background: #E15B60;
  border-radius: 2px;
}

.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 2.9vw, 44px);
  line-height: 1.22;
  font-weight: 760;
  letter-spacing: -.035em;
}

.hero h1 em {
  color: #F3B7BA;
  font-style: normal;
}

.hero p {
  margin: 13px 0 0;
  color: rgba(255, 255, 255, .64);
  font-size: 15px;
  line-height: 1.65;
}

.trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 22px;
  color: rgba(255, 255, 255, .64);
  font-size: 12px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
}

.trust-row .icon {
  width: 14px;
  height: 14px;
  color: #E9B4B6;
}

.search-panel {
  min-width: 0;
  width: 100%;
  max-width: 560px;
  justify-self: end;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 15px 0 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .2);
  transition: box-shadow .18s ease, border-color .18s ease;
}

.search-box:focus-within {
  border-color: #E9B4B6;
  box-shadow: 0 0 0 4px rgba(192, 39, 45, .2), 0 18px 46px rgba(0, 0, 0, .24);
}

.search-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.8;
  stroke-linecap: round;
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.search-box input::placeholder {
  color: #98A2B3;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-box kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #E4E7EC;
  border-bottom-width: 2px;
  border-radius: 7px;
  color: #98A2B3;
  background: #F9FAFB;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
}

.clear-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
}

.clear-button:hover {
  color: var(--brand);
  background: var(--brand-050);
}

.clear-button .icon {
  width: 16px;
  height: 16px;
}

.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  overflow: hidden;
  color: rgba(255, 255, 255, .48);
  font-size: 12px;
  white-space: nowrap;
}

.quick-search span {
  margin-right: 2px;
}

.quick-search button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: rgba(255, 255, 255, .68);
  background: rgba(255, 255, 255, .045);
  font-size: 12px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.quick-search button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .22);
}

/* Categories and result count */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding: 0 var(--page-pad);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  height: 62px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  min-height: 62px;
  padding: 0 18px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.tab:hover {
  color: var(--ink);
  background: #FAFBFC;
}

.tab[aria-selected="true"] {
  color: var(--brand);
}

.tab[aria-selected="true"]::after {
  background: var(--brand);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  color: #8A94A6;
  background: #F2F4F7;
  font-size: 11px;
  font-weight: 650;
}

.tab[aria-selected="true"] .tab-count {
  color: var(--brand);
  background: var(--brand-050);
}

.result-count {
  flex: 0 0 auto;
  color: #8A94A6;
  font-size: 12px;
  white-space: nowrap;
}

.result-count strong {
  color: var(--ink-2);
  font-weight: 700;
}

/* Scrollable catalog */
.catalog {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px var(--page-pad) 30px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #C9D0DA transparent;
  background:
    radial-gradient(circle at 100% 0%, rgba(192, 39, 45, .035), transparent 30%),
    var(--page);
}

.catalog::-webkit-scrollbar {
  width: 8px;
}

.catalog::-webkit-scrollbar-track {
  background: transparent;
}

.catalog::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #C9D0DA;
  background-clip: padding-box;
}

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

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 164px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .18s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #DDB9BB;
  box-shadow: 0 12px 30px rgba(11, 23, 48, .08), 0 2px 6px rgba(11, 23, 48, .04);
}

.tool-card:hover::after {
  box-shadow: inset 0 0 0 1px rgba(192, 39, 45, .05);
}

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

.card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(11, 23, 48, .055);
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-050);
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -.03em;
  user-select: none;
}

.card-avatar[data-tone="red"] {
  color: #A61F25;
  background: #FDF0F0;
}

.card-avatar[data-tone="blue"] {
  color: #275D9B;
  background: #EDF4FC;
}

.card-avatar[data-tone="green"] {
  color: #247A52;
  background: #EDF8F2;
}

.card-avatar[data-tone="amber"] {
  color: #8A5A13;
  background: #FFF6E5;
}

.card-avatar[data-tone="orange"] {
  color: #A84B19;
  background: #FFF1E8;
}

.card-avatar[data-tone="slate"] {
  color: #344563;
  background: #EFF2F6;
}

.card-title-wrap {
  min-width: 0;
}

.card-title {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 730;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-subtitle {
  margin-top: 3px;
  overflow: hidden;
  color: #8A94A6;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .075em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.tags {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border: 1px solid #EAECF0;
  border-radius: 6px;
  color: #697386;
  background: #FAFBFC;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.tag-official {
  border-color: #F0D8D9;
  color: var(--brand-600);
  background: #FDF6F6;
}

.tag-local {
  border-color: #D8E9E0;
  color: #247A52;
  background: #F3FAF6;
}

.open-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: #98A2B3;
  font-size: 11px;
  white-space: nowrap;
  transition: color .18s ease, transform .18s ease;
}

.open-label .icon {
  width: 13px;
  height: 13px;
}

.tool-card:hover .open-label {
  color: var(--brand);
  transform: translateX(2px);
}

/* Empty state */
.empty-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #98A2B3;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.reset-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.reset-button:hover,
.primary-button:hover {
  border-color: var(--brand-600);
  background: var(--brand-600);
  transform: translateY(-1px);
}

.reset-button .icon {
  width: 16px;
  height: 16px;
}

/* Safety footer */
.safetybar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 0 var(--page-pad);
  color: #667085;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 11px;
  z-index: 10;
}

.safety-message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.safety-message .icon {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.safety-message span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

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

.text-button .icon {
  width: 13px;
  height: 13px;
}

.copyright {
  margin-left: auto;
  color: #98A2B3;
  white-space: nowrap;
}

/* Safety dialog */
.safety-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 40px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(11, 23, 48, .08);
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.safety-dialog::backdrop {
  background: rgba(5, 13, 28, .62);
  backdrop-filter: blur(5px);
}

.safety-dialog[open] {
  animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FCF8F8, #fff);
}

.dialog-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.dialog-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--brand);
  background: var(--brand-050);
}

.dialog-shield .icon {
  width: 23px;
  height: 23px;
}

.dialog-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.dialog-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.dialog-body {
  max-height: calc(100dvh - 248px);
  overflow-y: auto;
  padding: 22px 26px 24px;
}

.dialog-lead {
  margin: 0 0 20px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.75;
}

.safety-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: safety;
}

.safety-list li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  counter-increment: safety;
}

.safety-list li::before {
  content: counter(safety);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #F0D8D9;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-050);
  font-size: 11px;
  font-weight: 750;
}

.safety-list b {
  display: block;
  padding-top: 3px;
  font-size: 13px;
  line-height: 1.4;
}

.safety-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid #E8EAEE;
  border-radius: 11px;
  color: var(--ink-2);
  background: #F8F9FB;
  font-size: 12px;
  line-height: 1.65;
}

.privacy-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--brand);
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: #FAFBFC;
}

.dialog-foot > span {
  color: #98A2B3;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .13em;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #fff;
  background: var(--ink);
  text-align: center;
  line-height: 1.8;
}

.noscript a {
  color: #F3B7BA;
}

/* Tablet */
@media (max-width: 1050px) {
  :root {
    --page-pad: 22px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 1fr);
    gap: 32px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .trust-row {
    gap: 7px 12px;
  }

  .trust-row span + span::before {
    margin-right: 5px;
  }

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

  .tab {
    padding-inline: 14px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: 58px minmax(0, 1fr) 42px;
  }

  .brand-en {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: 0;
    padding-top: 25px;
    padding-bottom: 25px;
  }

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

  .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: 9px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .hero p {
    grid-column: 1 / -1;
    margin-top: 8px;
    font-size: 13px;
  }

  .trust-row {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    margin: 0 0 4px;
  }

  .trust-row span:not(:first-child) {
    display: none;
  }

  .search-panel {
    max-width: none;
  }

  .search-box {
    height: 58px;
  }

  .quick-search {
    margin-top: 11px;
  }

  .toolbar {
    min-height: 56px;
    gap: 16px;
  }

  .tabs {
    height: 56px;
  }

  .tab {
    min-height: 56px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .result-count {
    font-size: 11px;
  }

  .catalog {
    padding-top: 18px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --page-pad: 15px;
  }

  .app-shell {
    grid-template-rows: 54px minmax(0, 1fr) 42px;
  }

  .topbar {
    gap: 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 16px;
  }

  .top-actions {
    gap: 2px;
  }

  .top-actions a {
    display: none;
  }

  .quiet-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .top-actions a .icon {
    display: none;
  }

  .quiet-button .icon {
    width: 14px;
    height: 14px;
  }

  .hero {
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .hero::before {
    background-size: 32px 32px;
  }

  .hero-copy {
    display: block;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: 26px;
    letter-spacing: -.045em;
  }

  .hero p {
    margin-top: 7px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trust-row {
    display: none;
  }

  .search-box {
    height: 54px;
    gap: 9px;
    padding: 0 11px 0 15px;
    border-radius: 13px;
  }

  .search-icon {
    width: 20px;
    height: 20px;
  }

  .search-box input {
    font-size: 16px;
  }

  .search-box kbd {
    display: none;
  }

  .quick-search {
    gap: 6px;
    margin-top: 9px;
  }

  .quick-search span {
    display: none;
  }

  .quick-search button {
    min-height: 25px;
    padding: 0 9px;
    font-size: 11px;
  }

  .toolbar {
    min-height: 52px;
    gap: 10px;
  }

  .tabs {
    height: 52px;
    margin-right: -15px;
    padding-right: 15px;
  }

  .tab {
    min-height: 52px;
    gap: 5px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .tab::after {
    left: 10px;
    right: 10px;
  }

  .tab-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
  }

  .result-count {
    display: none;
  }

  .catalog {
    padding-top: 13px;
    padding-bottom: 20px;
    scrollbar-gutter: auto;
  }

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

  .tool-card {
    min-height: 158px;
    padding: 14px;
    border-radius: 14px;
  }

  .card-head {
    gap: 9px;
  }

  .card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-subtitle {
    font-size: 8px;
    letter-spacing: .045em;
  }

  .card-desc {
    margin: 12px 0;
    font-size: 11px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }

  .tags {
    gap: 4px;
  }

  .tag {
    min-height: 19px;
    padding: 0 5px;
    font-size: 9px;
  }

  .open-label {
    font-size: 0;
  }

  .open-label .icon {
    width: 14px;
    height: 14px;
  }

  .safetybar {
    gap: 10px;
    padding-inline: 15px;
    font-size: 10px;
  }

  .safety-message {
    gap: 6px;
  }

  .safety-message .icon {
    width: 14px;
    height: 14px;
  }

  .text-button {
    font-size: 10px;
  }

  .copyright {
    display: none;
  }

  .safety-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 17px;
  }

  .dialog-head {
    padding: 19px 18px 16px;
  }

  .dialog-shield {
    width: 39px;
    height: 39px;
    border-radius: 11px;
  }

  .dialog-title {
    gap: 10px;
  }

  .dialog-title h2 {
    font-size: 18px;
  }

  .dialog-body {
    max-height: calc(100dvh - 228px);
    padding: 18px;
  }

  .dialog-foot {
    padding: 14px 18px;
  }
}

@media (max-width: 430px) {
  .top-actions a {
    display: none;
  }
}

@media (max-width: 370px) {
  :root {
    --page-pad: 12px;
  }

  .hero h1 {
    font-size: 23px;
  }

  .quick-search button:last-child {
    display: none;
  }

  .tool-grid {
    gap: 8px;
  }

  .tool-card {
    padding: 12px;
  }

  .card-avatar {
    width: 32px;
    height: 32px;
  }

  .card-head {
    gap: 7px;
  }

  .card-title {
    font-size: 13px;
  }

  .safety-message span {
    max-width: 210px;
  }
}

@media (max-height: 720px) and (min-width: 821px) {
  .app-shell {
    grid-template-rows: 56px minmax(0, 1fr) 40px;
  }

  .hero {
    min-height: 218px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .trust-row {
    margin-top: 15px;
  }

  .toolbar,
  .tabs,
  .tab {
    min-height: 56px;
    height: 56px;
  }

  .catalog {
    padding-top: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
