/* Tool explorer: shared across the product navigation on every tool. */
html[data-theme] .global-tool-nav {
  --explorer-bg: #fff;
  --explorer-soft: #f3f6fc;
  --explorer-text: #17243c;
  --explorer-muted: #56657b;
  --explorer-line: #d9e1ed;
  --explorer-accent: #2457d6;
  --explorer-active: #eaf0ff;
}
html[data-theme="dark"] .global-tool-nav {
  --explorer-bg: #182337;
  --explorer-soft: #101b2d;
  --explorer-text: #edf3ff;
  --explorer-muted: #b0bfd5;
  --explorer-line: #37465d;
  --explorer-accent: #94b6ff;
  --explorer-active: #203355;
}
html[data-theme] .tool-mega-trigger {
  min-height: 44px;
  font-size: 13px;
  border-radius: 12px;
  background: var(--explorer-bg);
  color: var(--explorer-text);
  border-color: var(--explorer-line);
}
html[data-theme] .tool-mega-label { font-size: 10px; color: var(--explorer-muted); }
html[data-theme] .tool-mega-panel {
  width: min(960px, calc(100vw - 40px));
  max-height: calc(100dvh - 110px);
  display: flex;
  flex-direction: column;
  color: var(--explorer-text);
  background: var(--explorer-bg);
  border: 1px solid var(--explorer-line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgb(8 24 54 / 26%);
}
html[data-theme] .tool-mega-header {
  flex-shrink: 0;
  padding: 24px;
  gap: 20px;
  background: var(--explorer-bg);
  border-color: var(--explorer-line);
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) 40px;
}
html[data-theme] .tool-mega-header p { color: var(--explorer-accent); font-size: 10px; line-height: 1.5; }
html[data-theme] .tool-mega-header strong { font-size: 25px; letter-spacing: -.035em; line-height: 1.3; }
html[data-theme] .tool-mega-header small { color: var(--explorer-muted); font-size: 13px; line-height: 1.5; }
html[data-theme] .tool-mega-search {
  height: 46px;
  padding: 0 12px;
  background: var(--explorer-soft);
  border-color: var(--explorer-line);
  margin: 0;
}
html[data-theme] .tool-mega-search:focus-within { border-color: var(--explorer-accent); box-shadow: 0 0 0 3px var(--explorer-active); }
html[data-theme] .global-tool-nav .tool-mega-search input {
  height: 42px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--explorer-text);
  font: 400 14px/1.5 Inter, system-ui, sans-serif;
}
html[data-theme] .tool-mega-search input::placeholder { color: var(--explorer-muted); }
html[data-theme] .tool-mega-search kbd { font-size: 10px; color: var(--explorer-muted); background: var(--explorer-bg); border-color: var(--explorer-line); }
html[data-theme] .tool-mega-close { width: 40px; height: 40px; color: var(--explorer-muted); background: var(--explorer-soft); border-color: var(--explorer-line); }
html[data-theme] .tool-mega-close:hover { color: var(--explorer-accent); background: var(--explorer-active); }
html[data-theme] .tool-mega-groups {
  min-height: 0;
  max-height: none;
  padding: 24px;
  gap: 26px 20px;
  background: var(--explorer-soft);
}
html[data-theme] .tool-mega-group h2 { color: var(--explorer-muted); font: 650 11px/1.5 Inter, system-ui, sans-serif; letter-spacing: .09em; margin-bottom: 10px; }
html[data-theme] .tool-mega-group > div { gap: 10px; }
html[data-theme] .global-tool-nav .tool-mega-card {
  min-height: 100px;
  padding: 16px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  color: var(--explorer-text);
  background: var(--explorer-bg);
  border: 1px solid var(--explorer-line);
  border-radius: 13px;
  box-shadow: 0 2px 5px rgb(15 30 55 / 3%);
  text-decoration: none;
}
html[data-theme] .global-tool-nav .tool-mega-card:hover,
html[data-theme] .global-tool-nav .tool-mega-card:focus-visible {
  border-color: var(--explorer-accent);
  background: var(--explorer-bg);
  color: var(--explorer-text);
  box-shadow: 0 6px 18px rgb(36 87 214 / 10%);
}
html[data-theme] .global-tool-nav .tool-mega-card.active { background: var(--explorer-active); border-color: var(--explorer-accent); color: var(--explorer-text); }
html[data-theme] .tool-mega-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
html[data-theme] .tool-mega-copy { gap: 5px; }
html[data-theme] .tool-mega-copy strong { font-size: 14px; white-space: normal; line-height: 1.4; font-weight: 650; }
html[data-theme] .tool-mega-copy small { font-size: 12px; color: var(--explorer-muted); white-space: normal; line-height: 1.5; }
html[data-theme] .tool-mega-card em { padding: 5px 7px; border-radius: 6px; background: var(--explorer-bg); color: var(--explorer-accent); font-size: 9px; letter-spacing: .02em; }
html[data-theme] .tool-mega-card b { color: var(--explorer-accent); font-size: 18px; }
html[data-theme] .tool-mega-footer { flex-shrink: 0; padding: 14px 24px; background: var(--explorer-bg); border-color: var(--explorer-line); gap: 12px; }
html[data-theme] .global-tool-nav .tool-mega-footer a { color: var(--explorer-accent); font-size: 12px; }
html[data-theme] .tool-mega-footer a :is(span, b) { color: var(--explorer-accent); }
html[data-theme] .tool-mega-footer small { color: var(--explorer-muted); font-size: 11px; }
html[data-theme] .tool-mega-empty { margin: 40px 0; color: var(--explorer-muted); font-size: 14px; line-height: 1.6; }
html[data-theme] .global-tool-nav [hidden] { display: none; }
html[data-theme] .global-tool-nav :is(a, button, summary):focus-visible { outline: 3px solid var(--explorer-accent); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .tool-mega[open] .tool-mega-panel { animation: explorer-open .2s ease-out; }
  .tool-mega-card { transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
  @keyframes explorer-open { from { opacity: 0; margin-top: -6px; } to { opacity: 1; margin-top: 0; } }
}
@media (max-width: 900px) {
  html[data-theme] .tool-mega-panel { width: auto; max-height: none; inset: 12px; }
  html[data-theme] .tool-mega-header { grid-template-columns: minmax(0, 1fr) 40px; padding: 20px; gap: 14px; }
  html[data-theme] .tool-mega-header > div { grid-column: 1 / -1; }
  html[data-theme] .tool-mega-groups { padding: 20px; grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  html[data-theme] .tool-mega-panel { inset: 8px; border-radius: 16px; }
  html[data-theme] .tool-mega-header { padding: 16px; }
  html[data-theme] .tool-mega-header strong { font-size: 23px; }
  html[data-theme] .tool-mega-groups { padding: 14px; }
  html[data-theme] .global-tool-nav .tool-mega-card { padding: 12px; grid-template-columns: 36px minmax(0, 1fr); }
  html[data-theme] .tool-mega-mark { width: 36px; height: 36px; }
  html[data-theme] .tool-mega-card > b { display: none; }
  html[data-theme] .tool-mega-card > em { grid-column: 2; justify-self: start; }
  html[data-theme] .tool-mega-footer { padding: 12px 16px; }
}
/* Full-width categories avoid empty columns when group sizes differ. */
html[data-theme] .tool-mega-groups { grid-template-columns: minmax(0, 1fr); }
html[data-theme] .tool-mega-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-theme] body .global-tool-nav .tool-mega-search input[type="search"] { min-height: 0; background: transparent; border-radius: 0; }
@media (max-width: 620px) {
  html[data-theme] .tool-mega-group > div { grid-template-columns: minmax(0, 1fr); }
}
