/* Caching — what-to-cache split, key segments, and the hit/miss path for the
   cache workzone page.
   Loaded by _workzone/caching.html on top of module.css.
   Placement convention: docs/architecture/README.md §Styling. */

/* ── Policy split — two cells, what is cached vs deliberately not ── */
.cch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.cch-cell {
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cch-cell--yes {
  border-left: 3px solid var(--accent);
}

.cch-cell--no {
  border-left: 3px dashed var(--border);
}

.cch-cell__h {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.cch-cell--no .cch-cell__h {
  color: var(--text-muted);
}

.cch-cell__d {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ── Policy rules — bullet list with bold leads ── */
.cch-rules {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.cch-rules b {
  color: var(--text);
  font-weight: 600;
}

/* ── Key segments — pills joined by + into the composite key ── */
.cch-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cch-seg {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.3rem 0.6rem;
  background: var(--tint-8);
  border: 1px solid var(--tint-15);
  border-radius: 6px;
}

.cch-key__op {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Hit/miss path — query → key → fork (hit | miss) ── */
.cch-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--tint-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cch-flow__step {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cch-flow__t {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.cch-flow__d {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.cch-flow__arr {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cch-flow__fork {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 14rem;
}

.cch-flow__path {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cch-flow__path--hit {
  border-left: 3px solid var(--accent);
}

.cch-flow__path--miss {
  border-left: 3px dashed var(--accent-muted);
}

.cch-flow__tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.cch-flow__path--miss .cch-flow__tag {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .cch-grid {
    grid-template-columns: 1fr;
  }
}
