/* Series accents — brand logo stays --brand-gradient in site-nav */
[data-series="crypto"] {
  --series-gradient: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  --series-accent: #ff8a5b;
  --crypto-gradient: var(--series-gradient);
}

[data-series="image"] {
  --series-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --series-accent: #8b7cf6;
}

[data-series="file"] {
  --series-gradient: linear-gradient(135deg, #64748b 0%, #38bdf8 100%);
  --series-accent: #38bdf8;
}

[data-series="life"] {
  --series-gradient: linear-gradient(135deg, #f97316 0%, #e11d48 100%);
  --series-accent: #fb7185;
}

[data-series="video"] {
  --series-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --series-accent: #00d4ff;
}

[data-series="text"] {
  --series-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --series-accent: #f472b6;
}

[data-series="dev"] {
  --series-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --series-accent: #38bdf8;
}

[data-series="popular"] {
  --series-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  --series-accent: #fb923c;
}

[data-series="markets"] {
  --series-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --series-accent: #2dd4bf;
}

/* UU-style shell: sidebar rail | main (search lives in main). Keep current colors. */
.tools-hub,
.tool-workspace {
  display: grid;
  grid-template-columns: 13.25rem minmax(0, 1fr);
  width: 100%;
  max-width: none;
  margin: 0;
}

.tools-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  padding: 1.15rem 0.45rem 2rem 0.65rem;
}

.tools-sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  margin: 0 0.65rem 0.85rem;
  font-weight: 600;
}

.tools-cat {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  background: transparent;
  text-decoration: none;
  color: var(--text-primary, inherit);
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tools-cat:hover,
.tools-cat.is-active {
  background: color-mix(in srgb, var(--series-accent, #00f2fe) 16%, transparent);
  color: var(--series-accent, #00f2fe);
}

.tools-cat i {
  width: 1.15rem;
  text-align: center;
  flex-shrink: 0;
}

.tools-sidebar-rule {
  height: 1px;
  margin: 0.7rem 0.65rem;
  background: var(--border-color, rgba(255, 255, 255, 0.12));
}

.tools-main,
.tool-workspace-main {
  min-width: 0;
  padding: 1.15rem 1.25rem 2.5rem 0.75rem;
}

.tool-workspace .page-header {
  padding-top: 0.5rem;
}

.tool-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tool-switcher-item {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  color: var(--text-secondary, rgba(255, 255, 255, 0.75));
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.tool-switcher-item:hover {
  color: var(--text-primary, #fff);
  border-color: var(--series-accent, #00f2fe);
}

.tool-switcher-item.is-active {
  color: var(--text-primary, #fff);
  border-color: transparent;
  background: var(--series-gradient);
}

.tools-search-bar {
  margin: 0 0 1.15rem;
}

.tools-search {
  width: 100%;
  margin: 0;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M11.74 10.66h-.75l-.26-.26a6 6 0 1 0-.67.67l.26.26v.75L15 16.25 16.25 15l-4.51-4.34zm-5.52 0A4.16 4.16 0 1 1 10.38 6.5a4.16 4.16 0 0 1-4.16 4.16z'/%3E%3C/svg%3E") 0.85rem 50% no-repeat;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.tools-search:focus {
  outline: none;
  border-color: var(--series-accent, var(--accent-color));
}

.tools-search::placeholder {
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .tools-hub,
  .tool-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-sidebar {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
    overflow-x: auto;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--navbar-bg, rgba(10, 10, 10, 0.92));
    backdrop-filter: blur(16px);
  }

  .tools-sidebar h2 {
    display: none;
  }

  .tools-cat {
    width: auto;
    flex: 0 0 auto;
  }

  .tools-sidebar-rule {
    width: 1px;
    height: 1.4rem;
    margin: 0 0.25rem;
    align-self: center;
  }

  .tools-main,
  .tool-workspace-main {
    padding: 1rem 0.85rem 2rem;
  }
}

@media (max-width: 480px) {
  .tool-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 1rem;
    padding-bottom: 0.15rem;
  }

  .tool-switcher-item {
    flex: 0 0 auto;
  }
}
