:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f3f8f5;
  --text: #202629;
  --muted: #77827d;
  --line: #e5eae7;
  --accent: #20b574;
  --accent-2: #e5f8ef;
  --shadow: 0 12px 35px rgba(30, 72, 49, .08);
  --radius: 14px;
}

body, body.light { background: var(--bg); color: var(--text); }
.ambient, .icon-btn { display: none !important; }
.topbar {
  height: 72px;
  justify-content: flex-start;
  background: rgba(255,255,255,.96);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}
.brand-mark { background: var(--accent); color: #fff; border-radius: 9px; }
.topbar nav { color: #58645e; }
.topbar nav a:hover, .submit-link:hover { color: var(--accent); }
.top-actions { gap: 18px; }
.submit-link { color: #65706b; font-size: 14px; }
.visit-blog { background: var(--accent); color: #fff; border-radius: 8px; }

.search-stage {
  max-width: none;
  padding: 66px max(24px, calc((100vw - 1000px)/2)) 62px;
  background: linear-gradient(180deg, #ebf8f1 0%, #f6f7f8 100%);
  border-bottom: 1px solid #e5eee9;
}
.eyebrow, .section-kicker { color: var(--accent); letter-spacing: .12em; }
.search-stage h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.15; margin-top: 18px; }
.search-stage h1 em { color: var(--accent); }
.search-stage > p { font-size: 16px; }
.search-box {
  height: 64px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(32,181,116,.13);
}
.engine-select select, .search-box input { color: var(--text); }
.search-box button, .empty-state button { color: #fff; border-radius: 7px; }
.quick-links a { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.quick-links a:hover { color: var(--accent); border-color: #a9dec4; }
.suggestions { background: #fff; }

.sponsor {
  background: #effaf4;
  border-color: #9edabb;
  box-shadow: none;
}
.sponsor a { background: #fff; }
.directory-shell { margin-top: 72px; }
.category-rail button.active, .category-rail button:hover {
  color: var(--accent);
  background: #e7f6ee;
}
.tool-category { margin-bottom: 40px; }
.tool-card {
  min-height: 120px;
  padding: 18px;
  border-radius: 11px;
  box-shadow: 0 2px 9px rgba(34,62,47,.025);
}
.tool-card:hover {
  background: #fff;
  border-color: #8cd1ae;
  box-shadow: 0 10px 24px rgba(34,83,55,.08);
  transform: translateY(-2px);
}

.lead-story {
  background: linear-gradient(145deg, #137c50, #25b979);
  color: #fff;
  border-radius: 16px;
}
.story-tag { background: #fff; color: #168456; }
.story-number, .lead-story time { color: #d3f1e2; }
.lead-story p { color: #dff4e9; }
.read-more { color: #fff; }
.story-list a:hover { background: #fff; }
.matrix-card, .channel-section { border-radius: 14px; border: 1px solid var(--line); }
.matrix-card:hover { box-shadow: 0 10px 24px rgba(34,83,55,.07); }
.mint { --card-color: #20b574; }
.channel-grid a:hover { background: #f4faf7; }
footer { border-color: var(--line); }

@media (max-width: 680px) {
  .submit-link { display: none; }
  .search-stage { padding: 52px 18px 44px; }
  .search-stage h1 { font-size: 38px; }
  .search-box { height: auto; }
}

/* Blue navigation palette */
:root {
  --accent: #4f8df7;
  --accent-2: #eaf2ff;
  --bg: #eef3f8;
  --surface-2: #f3f7fd;
}
body { background: #eef3f8; }
.brand-mark { background: #4f8df7; }
.search-stage {
  background:
    radial-gradient(circle at 8% 90%, rgba(45,223,202,.46) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 12%, rgba(255,255,255,.12) 0 110px, transparent 111px),
    linear-gradient(135deg,#4f8df7 0%,#67a1f4 58%,#5593ee 100%);
}
.search-box { box-shadow: 0 10px 24px rgba(31,88,180,.22); }
.category-rail button.active,
.category-rail button:hover {
  color: #fff;
  background: #ff6b22;
}
.rail-home { color: #4f8df7; }
.section-kicker,
.category-title span,
.story-list > a > span { color: #4f8df7; }
.tool-card:hover { border-color: #9bbdf8; box-shadow: 0 10px 24px rgba(45,91,168,.09); }

/* Reference-style category sidebar */
@media (min-width: 1001px) {
  .category-rail {
    width: 168px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .rail-title {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 0 0 8px;
    padding: 0 11px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(51,78,108,.06);
    color: #30363d;
    font-size: 14px;
    font-weight: 650;
  }
  .rail-title::after {
    content: '›';
    margin-left: auto;
    color: #8b949e;
    font-size: 18px;
    font-weight: 400;
  }
  .rail-title #resultCount { display: none; }
  .rail-home {
    display: grid;
    width: 21px;
    height: 21px;
    margin-right: 8px;
    place-items: center;
    border-radius: 6px;
    background: #2fc878;
    color: #fff;
    font-size: 13px;
  }
  .category-rail #categoryNav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .category-rail button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    color: #68737d;
    font-size: 14px;
    text-align: left;
  }
  .category-rail button .nav-icon {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    color: #68737d;
    font-size: 14px;
    line-height: 1;
  }
  .category-rail button.active,
  .category-rail button:hover {
    background: #ff6b22;
    color: #fff;
  }
  .category-rail button.active .nav-icon,
  .category-rail button:hover .nav-icon { color: #fff; }
}

@media (max-width: 1000px) {
  .category-rail #categoryNav { display: flex; flex-direction: row; }
  .category-rail button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
  }
  .category-rail button .nav-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
  }
}
.lead-story { background: linear-gradient(145deg,#3f7de9,#68a3f6); }
.story-tag { color: #3975dd; }
.sponsor {
  background: #fff7f1;
  border-color: #ffcaa9;
}
.ad-label { color: #ff6b22; }
.empty-state button,
.search-box button { background: #ff6b22; }
.channel-grid a:hover { background: #f2f6ff; border-color: #9bbdf8; }
.back-top { background: #4f8df7; color: #fff; border-color: #4f8df7; }

/* Keep the desktop rail visually separate from the category links. */
@media (min-width: 1001px) {
  .category-rail {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .rail-title {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 0 0 8px;
    padding: 0 11px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(51,78,108,.06);
    font-weight: 650;
  }
  .rail-title::after {
    content: '›';
    margin-left: auto;
    color: #8b949e;
    font-size: 18px;
    font-weight: 400;
  }
  .rail-title #resultCount { display: none; }
  .rail-home {
    display: grid;
    width: 21px;
    height: 21px;
    margin-right: 8px;
    place-items: center;
    border-radius: 6px;
    background: #2fc878;
    color: #fff;
    font-size: 13px;
  }
  .category-rail #categoryNav { display: flex; flex-direction: column; gap: 2px; }
  .category-rail button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    background: transparent;
    color: #68737d;
    text-align: left;
  }
  .category-rail button .nav-icon {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    color: inherit;
    line-height: 1;
  }
  .category-rail button.active,
  .category-rail button:hover { background: #ff6b22; color: #fff; }
}

/* Search channel tabs */
.search-panel { width: 100%; max-width: 920px; margin: 0 auto; }
.search-tabs {
  height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.search-tabs button {
  height: 34px;
  min-width: 68px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: rgba(255,255,255,.95);
  font-size: 14px;
  cursor: pointer;
}
.search-tabs button:hover { background: rgba(255,255,255,.12); }
.search-tabs button.active { background: #fff; color: #28384f; }
.engine-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.search-symbol { padding: 0 0 0 18px; color: #4f8df7; font-size: 20px; font-weight: 700; }
.search-box { border-radius: 8px; }
.search-box input { padding-left: 12px; }
.hot-search { color: #9aa4af; font-size: 13px; white-space: nowrap; margin-right: 10px; }
.search-box button { min-width: 112px; margin-left: 2px; white-space: nowrap; }
.quick-links { margin-top: 14px; }

@media (max-width: 680px) {
  .search-tabs { justify-content: flex-start; overflow-x: auto; }
  .search-tabs button { min-width: 62px; padding: 0 12px; }
  .hot-search, .search-symbol { display: none; }
  .search-box button { min-width: 0; }
}
.mint { --card-color: #4f8df7; }

/* Compact navigation layout */
body { background: #eef3f7; }
.topbar {
  height: 64px;
  padding-left: 24px;
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(21,48,35,.06);
}
.brand-mark { width: 34px; height: 34px; }
.search-stage {
  margin: 28px 24px 0 200px;
  max-width: none;
  min-height: 276px;
  padding: 38px clamp(40px,8vw,130px) 30px;
  border: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 90%, rgba(255,255,255,.14) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 12%, rgba(255,255,255,.12) 0 110px, transparent 111px),
    linear-gradient(135deg,#21b573,#46c995);
  color: #fff;
  overflow: visible;
}
.eyebrow { color: rgba(255,255,255,.82); }
.eyebrow span { background: rgba(255,255,255,.8); }
.search-stage h1 {
  margin: 10px 0 17px;
  font-size: clamp(30px,3.2vw,43px);
  color: #fff;
}
.search-stage h1 em { color: #fff; }
.search-stage > p { display: none; }
.search-box {
  height: 54px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(4,87,52,.18);
}
.search-box button { height: 42px; }
.quick-links { margin-top: 18px; color: rgba(255,255,255,.8); }
.quick-links a {
  color: #fff;
  border: 0;
  background: rgba(255,255,255,.17);
}
/* Keep border dimensions unchanged on hover to avoid reflowing the search panel. */
.quick-links a:hover { color: #fff; background: rgba(255,255,255,.26); }
.suggestions { top: 190px; left: clamp(40px,8vw,130px); right: clamp(40px,8vw,130px); }
.sponsor-wide { display: none; }
.directory-shell {
  display: block;
  max-width: none;
  margin: 26px 24px 0 200px;
}
.category-rail {
  position: fixed;
  top: 82px;
  left: 16px;
  bottom: 18px;
  width: 168px;
  padding: 12px 10px;
  overflow-y: auto;
  z-index: 8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(38,65,52,.06);
}
.rail-title {
  padding: 10px 9px 13px;
  margin: 0 0 6px;
  font-size: 14px;
  white-space: nowrap;
}
.rail-home { color: var(--accent); font-size: 17px; margin-right: 4px; }
.rail-title #resultCount { margin-left: auto; color: #a0aaa5; font-size: 11px; }
.category-rail button {
  min-height: 42px;
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
}
.category-rail button.active, .category-rail button:hover {
  color: #fff;
  background: var(--accent);
  box-shadow: none;
}
.directory-content > .section-heading { margin-bottom: 20px; }
.section-heading h2, .channel-section h2 { font-size: 25px; }
.section-kicker { font-size: 10px; }
.tool-category { margin-bottom: 32px; }
.category-title { margin-bottom: 13px; }
.tool-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.tool-card {
  min-height: 108px;
  padding: 15px;
  grid-template-columns: 40px 1fr 14px;
  gap: 11px;
  background: #fff;
}
.tool-icon { width: 40px; height: 40px; border-radius: 11px; font-size: 13px; }
.tool-card h4 { font-size: 14px; }
.tool-card p { font-size: 12px; line-height: 1.5; }
.insights-section, .matrix-section, .channel-section, footer {
  max-width: none;
  margin-left: 200px;
  margin-right: 24px;
}
.insights-section, .matrix-section { margin-top: 78px; }
.sponsor-card { margin-left: 200px; margin-right: 24px; max-width: none; }
.channel-section { margin-top: 78px; }
footer { margin-top: 78px; }

@media (max-width: 1180px) {
  .tool-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1000px) {
  .search-stage { margin: 20px 24px 0; }
  .directory-shell, .insights-section, .matrix-section, .channel-section, footer, .sponsor-card { margin-left: 24px; }
  .category-rail {
    position: static;
    width: auto;
    padding: 8px 0 12px;
    margin-bottom: 22px;
    overflow-x: auto;
    background: transparent;
    box-shadow: none;
  }
  .category-rail #categoryNav { display: flex; gap: 7px; min-width: max-content; }
  .category-rail button { width: auto; background: #fff; }
  .rail-title { display: none; }
  .tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .topbar { height: 58px; padding-left: 16px; }
  .search-stage { margin: 12px 12px 0; min-height: 244px; padding: 28px 16px 22px; border-radius: 12px; }
  .search-stage h1 { font-size: 29px; }
  .search-box { height: auto; }
  .suggestions { top: 150px; left: 16px; right: 16px; }
  .directory-shell, .insights-section, .matrix-section, .channel-section, footer, .sponsor-card { margin-left: 12px; margin-right: 12px; }
  .directory-shell { margin-top: 16px; }
  .tool-grid { grid-template-columns: 1fr; }
}

/* Final palette overrides */
body { background: #eef3f8; }
.brand-mark { background: #4f8df7; }
.search-stage {
  background:
    radial-gradient(circle at 8% 90%, rgba(38,220,204,.42) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 12%, rgba(255,255,255,.13) 0 110px, transparent 111px),
    linear-gradient(135deg,#4d88f0 0%,#66a0f4 58%,#568fe9 100%);
}
.search-box { box-shadow: 0 10px 24px rgba(31,88,180,.22); }
.search-box button,
.empty-state button { background: #ff6b22; }
.category-rail button.active,
.category-rail button:hover { background: #ff6b22; color: #fff; }
.rail-home,
.section-kicker,
.category-title span,
.story-list > a > span { color: #4f8df7; }
.tool-card:hover { border-color: #9bbdf8; box-shadow: 0 10px 24px rgba(45,91,168,.09); }
.lead-story { background: linear-gradient(145deg,#3f7de9,#68a3f6); }
.story-tag { color: #3975dd; }
.sponsor { background: #fff7f1; border-color: #ffcaa9; }
.ad-label { color: #ff6b22; }
.back-top { background: #4f8df7; color: #fff; border-color: #4f8df7; }
