/* "More tools" dropdown. Uses the colour tokens each site defines in its own style.css. */

.mt-menu { position: relative; flex-shrink: 0; margin-right: -8px; }

.mt-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 0.9rem var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.mt-menu-btn:hover, .mt-menu.is-open .mt-menu-btn { color: var(--text); border-color: var(--border-strong); }
.mt-menu-btn svg { width: 17px; height: 17px; }
.mt-menu-btn .mt-chev { width: 14px; height: 14px; margin-left: -2px; transition: transform 0.15s; }
.mt-menu.is-open .mt-chev { transform: rotate(180deg); }

.mt-menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.08);
}
.mt-menu-pop[hidden] { display: none; }
.mt-menu-pop ul { list-style: none; margin: 0; padding: 0; }

.mt-menu-head {
  margin: 4px 10px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mt-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.mt-item:hover, .mt-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.mt-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.mt-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.mt-icon svg { width: 18px; height: 18px; }

.mt-text { display: grid; gap: 1px; min-width: 0; }
.mt-name { font-weight: 600; font-size: 0.93rem; }
.mt-desc { color: var(--text-2); font-size: 0.83rem; line-height: 1.35; }
.mt-host { color: var(--muted); font: 0.75rem var(--mono); }

.mt-here {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: 1px;
}
.mt-item[aria-current="page"] { background: var(--surface-2); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mt-menu-pop { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
}
:root[data-theme="dark"] .mt-menu-pop { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

/* Icon-only button on narrow screens. */
@media (max-width: 720px) {
  .mt-menu-label, .mt-menu-btn .mt-chev { display: none; }
  .mt-menu-btn { width: 36px; padding: 0; justify-content: center; }
}
