/* retrieval.css - the Retrieval node's own sheet.
 *
 * Same two constraints as every other module page here: nothing floats over
 * content (no position fixed/absolute/sticky, no transform, no z-index - this
 * page is ordinary flow inside one column), and no shared token is forked, so
 * the taskbar is whatever the shell owner last shipped.
 *
 * The reading order is the argument the page makes: freshness, then method,
 * then stores, then limits. Nothing here reorders it.
 */

.retrieval-main {
  padding: calc(var(--shell-bar-height) + 0.75rem) 1rem 3rem;
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.r-head h1 { margin: 0 0 0.15rem; font-size: 1.35rem; }
.r-head .lede { margin: 0 0 0.35rem; max-width: 62ch; }
.r-generated { margin: 0; color: var(--muted); font-size: 0.82rem; max-width: 70ch; }

/* ---- freshness: the first thing, because a stale index answers confidently */
.r-freshness {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--ui-radius, 6px);
  background: var(--surface-subtle);
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.3rem;
}
.r-freshness[data-state="clean"] { border-left-color: var(--status-success); }
.r-freshness[data-state="findings"] { border-left-color: var(--status-error); }
.r-freshness[data-state="void"] { border-left-color: var(--status-warning); }

.r-section { display: grid; gap: 0.6rem; }
.r-section h2 { margin: 0.6rem 0 0; font-size: 1.05rem; }
.r-detail { margin: 0; color: var(--muted); font-size: 0.86rem; max-width: 72ch; }
.r-list { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; display: grid; gap: 0.2rem; }
.r-list li { overflow-wrap: anywhere; }

/* ---- the method ---------------------------------------------------------- */
.r-method { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.8rem; }
.r-method li { display: grid; gap: 0.3rem; }
.r-method strong { font-size: 0.95rem; }

/* A command a reader will copy. It scrolls inside its own box so a long line
 * never makes the page scroll sideways - the phone failure that rule exists
 * for. */
.r-code {
  margin: 0;
  background: #0d1526;
  color: #d7e2f5;
  border-radius: var(--ui-radius, 6px);
  padding: 0.45rem 0.6rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

/* ---- stores -------------------------------------------------------------- */
.r-store {
  border: 1px solid var(--line);
  border-radius: var(--ui-radius, 6px);
  background: var(--surface-subtle);
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.4rem;
}
.r-store[data-ok="false"] { border-color: var(--status-warning); }
.r-store h3 { margin: 0; font-size: 1rem; }
.r-role { margin: 0; font-weight: 700; font-size: 0.86rem; }
.r-store dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.2rem 0.6rem;
  font-size: 0.84rem;
}
.r-store dt { color: var(--muted); }
.r-store dd { margin: 0; overflow-wrap: anywhere; }
.r-unmeasured { color: var(--status-warning); font-style: italic; }
.r-decision {
  margin: 0;
  font-size: 0.84rem;
  border-left: 3px solid var(--line);
  padding-left: 0.6rem;
}

/* ---- limits -------------------------------------------------------------- */
.r-limit {
  border: 1px solid var(--line);
  border-left: 4px solid var(--status-warning);
  border-radius: var(--ui-radius, 6px);
  padding: 0.6rem 0.8rem;
  display: grid;
  gap: 0.25rem;
}
.r-limit h3 { margin: 0; font-size: 0.95rem; }
/* The consequence is the load-bearing half - a limit nobody acts on is trivia. */
.r-consequence { margin: 0; font-size: 0.86rem; font-weight: 700; }

@media (max-width: 860px) {
  .retrieval-main { padding-left: 0.6rem; padding-right: 0.6rem; }
  .r-store dl { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .r-store dt { margin-top: 0.3rem; }
}
