/* Contract: contracts/web/rules.md
 * The line above the grid that says what it is showing (web/scope.js), and
 * what an empty grid offers instead of "nothing matched" (web/scope-empty.js).
 *
 * Last in the cascade, so the one rule here that overrides an earlier sheet
 * (the sticky pills' offset, from 05-chrome.css) wins by source order.
 */

/* Sticky inside the results column, so a filter set an hour ago is still on
   screen three hundred cards down. That is the moment it gets forgotten. */
.scope {
  position: sticky; top: 0; z-index: 19;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  user-select: none; -webkit-user-select: none;
}
.scope[hidden] { display: none; }
.scope-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-dim);
}
.scope-pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

.scopepill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 3px 0 11px; max-width: 280px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
}
/* Where you are standing reads differently from what is narrowing it: the
   place is the one you change by going somewhere else, the rest you take off. */
.scopepill.place { border-color: var(--accent); font-weight: 560; }
.scopepill .ico { width: 15px; height: 15px; flex: none; color: var(--ink-dim); }
.scopepill.place .ico { color: var(--accent); }
.scopepill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scopepill-x {
  display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-dim);
  font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
.scopepill-x:hover { background: var(--panel-2); color: var(--ink); }
.scopepill-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.scope-btn { height: 30px; padding: 0 12px; }
.scope-btn[hidden] { display: none; }
/* Start over sits at the far end, where the eye ends a sentence. */
#scope-reset { margin-left: auto; }

/* The pills that say something landed or is being made. They were stuck 10px
   from the top of the column, which with the line up is on top of it. */
.gridpills { top: calc(var(--scope-h, 0px) + 10px); }

/* ---------- an empty grid ---------- */
.emptyhelp {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: -40px 20px 48px;
}
.emptyhelp[hidden] { display: none; }
.emptyhelp-lead { margin: 0; color: var(--ink-dim); font-size: 13px; }
.emptyhelp-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.emptyhelp-try {
  height: 34px; padding: 0 14px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 13px; cursor: pointer;
}
.emptyhelp-try:hover { border-color: var(--accent); color: var(--accent); }

.uploads-show { margin-top: 10px; }
.uploads-show[hidden] { display: none; }

/* A phone has no room for the word "Showing" and needs every pixel of the
   column it has. The pills wrap; Start over keeps its place at the end. */
@media (max-width: 720px), (pointer: coarse) {
  .scope { padding: 8px 12px; gap: 6px; }
  .scope-label { display: none; }
  .scopepill { max-width: 200px; }
}
