/* ===========================================================================
   Crawler directory (/crawlers, crawlerlar.php)
   Loaded after nmos-glass-site.css and nmos-site-components.css.
   =========================================================================== */

/* ---------- Control row: search + three selects + apply ------------------ */
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 16px;
  margin: 0;
  padding: 20px;
  background: var(--surface-container-lowest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--on-surface-variant);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field :is(input, select) {
  width: 100%;
  min-width: 0;
  font-size: 15px;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8296' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field select option {
  background: var(--surface-container);
  color: var(--on-surface);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-apply { min-height: 44px; }

/* ---------- Result count, clear link, category jump ---------------------- */
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 24px 0 0;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-total {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface-variant);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-clear {
  font-size: 14px;
  line-height: 20px;
  color: var(--primary);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-clear:hover { color: var(--primary-hover); }
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-jump .crawler-hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-jump-count {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--outline);
}

/* ---------- Category groups ----------------------------------------------- */
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-group {
  margin: 64px 0 0;
  scroll-margin-top: 96px;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 0 0 16px;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-group-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: 0;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-group-count {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--outline);
}

/* Two columns of equal rows: name, operator (the family), safety */
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-list {
  columns: 2;
  column-gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-subtle);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-list > li {
  margin: 0;
  break-inside: avoid;
  border-bottom: 1px solid var(--border-subtle);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 168px) 104px;
  align-items: center;
  gap: 16px;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--on-surface);
  transition: background-color var(--t-fast) var(--ease);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-row:hover { background: var(--surface-container); }
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-row:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: -1px;
  background: var(--surface-container);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) :is(.crawler-dir-name, .crawler-dir-op) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-name { font-size: 15px; line-height: 24px; }
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-op {
  font-size: 13px;
  line-height: 20px;
  color: var(--outline);
}
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-safety {
  font-size: 13px;
  line-height: 20px;
  color: var(--on-surface-variant);
}

body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-empty { margin: 40px 0 0; }
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-empty p {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 28px;
  color: var(--on-surface-variant);
}

/* ---------- Narrower screens ---------------------------------------------- */
@media (max-width: 1024px) {
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-field--search { grid-column: 1 / -1; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-apply { justify-self: start; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-list { columns: 1; }
}
@media (max-width: 640px) {
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-apply { justify-self: stretch; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-group { margin-top: 48px; }
  /* One line per crawler: the name keeps its room, the operator gives way first */
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 4px;
  }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-name { flex: 0 1 auto; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-op { flex: 1 1 0; }
  body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-safety { flex: none; margin-left: auto; }
}
/* Safety is told by the dot and a neutral word; red text stays with "unverified" in log lines */
body.sentinel-body:is(.sentinel-flow, .sentinel-home):not(.auth-body) .crawler-dir-safety .nmos-dot-label { color: var(--on-surface-variant); }
