/* tasks/ kit stylesheet — structure shared by every task demo page.
   Palette, fonts and dark mode come from /shared/tokens.css; branding
   lives in each page, not here. */

body {
  max-width: 50rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  font-family: var(--font-body, "Inter Tight", sans-serif);
}

.hidden {
  display: none !important;
}

/* ── header ─────────────────────────────────────────────────── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.kicker a {
  color: inherit;
  opacity: 0.7;
}

h1 {
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 2.1rem;
  margin: 0 0 0.4rem;
}

.lede {
  margin: 0;
  max-width: 34rem;
  opacity: 0.8;
}

/* Theme toggle: theme.js paints the [data-theme-glyph] and
   [data-theme-label] children; positioning is the page's business. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line, #ccc);
  background: var(--surface, transparent);
  color: inherit;
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover {
  border-color: var(--accent, currentColor);
}

/* ── setup panel, shown when config is missing ──────────────── */
.setup {
  border: 1px dashed var(--line, #ccc);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.setup code,
footer code {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
}

/* ── input bar + example chips ──────────────────────────────── */
.bar {
  display: flex;
  gap: 0.5rem;
  margin: 1.75rem 0 0.75rem;
}

.bar input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line, #ccc);
  border-radius: 0.5rem;
  background: var(--surface, transparent);
  color: inherit;
}

.bar button,
.chips button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line, #ccc);
  background: var(--surface, transparent);
  color: inherit;
  cursor: pointer;
}

.bar button {
  border-radius: 0.5rem;
}

.bar button:hover,
.chips button:hover {
  border-color: var(--accent, currentColor);
}

.chips button.active {
  border-color: var(--accent, currentColor);
  background: color-mix(in oklab, var(--accent, currentColor) 12%, transparent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.status {
  min-height: 1.2rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ── two-panel board ────────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 0.5rem;
}

.panel {
  border: 1px solid var(--line, #ccc);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  min-width: 0;
}

.panel h2 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  opacity: 0.7;
}

.panel-meta {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  opacity: 0.65;
  margin: 0 0 0.6rem;
  min-height: 1rem;
}

/* ── product cards ──────────────────────────────────────────────
   The image is the point of a shopping result, so it runs the full
   height of the card and the words sit beside it: name, leaf category,
   brand · price. One card shape for both pages — it is built in
   page.js (Rush.hit), so the markup and these rules move together. */
.hits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.hits li {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: color-mix(in oklab, var(--line, #ccc) 18%, transparent);
  min-width: 0;
}

/* The tile carries the product's initial behind its image: whichever the
   catalog's CDN allows is what shows, and page.js drops a refused image so no
   grey box is left in front of the letter. */
.hit-visual {
  position: relative;
  display: grid;
  width: 5.5rem;
  min-height: 5.5rem;
  align-self: stretch;
  border-radius: 0.4rem;
  overflow: hidden;
  flex: none;
}

.hit-visual > * {
  grid-area: 1 / 1;
}

.hit-monogram {
  display: grid;
  place-items: center;
  font-family: var(--display, "Bricolage Grotesque", sans-serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: color-mix(in oklab, var(--ink, #14162a) 42%, transparent);
  background: linear-gradient(
    155deg,
    color-mix(in oklab, var(--accent, #2c2ae0) 14%, transparent),
    color-mix(in oklab, var(--line, #ccc) 26%, transparent)
  );
}

.hit-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hit-body {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.hit-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.hit-cat,
.hits .hit-meta {
  margin: 0;
  font-size: 0.76rem;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hits li > .badge {
  align-self: flex-start;
  margin-left: auto;
}

/* A card with no product in it is a sentence, not a card. */
.hits li.hit-none {
  align-items: center;
  font-size: 0.82rem;
  opacity: 0.7;
}

.badge {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line, #ccc);
  white-space: nowrap;
  flex: none;
}

.badge.up {
  color: var(--ok, #1a7f37);
  border-color: currentColor;
}

.badge.down {
  color: var(--danger, #b42318);
  border-color: currentColor;
}

.badge.fallback {
  opacity: 0.7;
  border-style: dashed;
}

/* Below the cut: reranked-out rows fade but stay visible. */
.below-cut {
  opacity: 0.45;
}

/* ── rewrite states (right panel of the query demo) ─────────── */
.state {
  border: 1px solid var(--line, #ccc);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.6rem;
}

.state-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.state-n {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.72rem;
  opacity: 0.6;
}

.state-query {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.92rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.state-ms {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.65;
  white-space: nowrap;
}

.vals {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.val {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line, #ccc);
}

.state-why {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  opacity: 0.75;
}

.state-actions {
  margin-top: 0.6rem;
}

.state-actions button {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line, #ccc);
  background: var(--surface, transparent);
  color: inherit;
  cursor: pointer;
}

.state-actions button:hover {
  border-color: var(--accent, currentColor);
}

/* ── reflection strip ───────────────────────────────────────── */
.reflection {
  margin-top: 1.25rem;
  border-left: 3px solid var(--accent, currentColor);
  padding: 0.25rem 0 0.25rem 1rem;
  font-size: 0.9rem;
}

.reflection p {
  margin: 0.35rem 0;
}

.reflection .score {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.8rem;
}

footer {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  opacity: 0.65;
}

/* ── small screens: the board stacks, panels keep their width ─ */
@media (max-width: 48rem) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .bar {
    flex-wrap: wrap;
  }

  .bar input {
    flex-basis: 100%;
  }

  .board {
    grid-template-columns: 1fr;
  }
}
