/* Shared styles for the document pages — the objective map and the build log.
 *
 * Both are long, text-heavy and read rather than scanned, so the measure stays narrow and nothing
 * competes with the prose. */

.docs-wrap { max-width: 54rem; }

/* ── navigation ──
   Added once there were five pages. Four pages linking to each other from footers was navigable;
   five was not. */
.nav {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  padding: .7rem clamp(1.25rem, 5vw, 2rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.nav a {
  font-size: .88rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: .35rem .7rem;
  border-radius: 5px;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a.on { color: var(--accent); font-weight: 600; }
/* The nav is sticky, so the panel must sit below it rather than under it. */
html.orb-open .nav { padding-right: calc(var(--orb-w, 0px) + 36px); }

/* ── coverage rollup ── */
.domains { list-style: none; margin: 0; padding: 0; }
.dom {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 7rem 6rem;
  gap: .3rem .8rem;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.dom:last-child { border-bottom: 0; }
.dom-id { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); }
.dom-name { color: var(--ink); }
.dom-weight { font-family: var(--mono); font-size: .75rem; color: var(--ink-faint); text-align: right; }
.dom-counts { font-size: .78rem; color: var(--ink-faint); text-align: right; }
.dom-counts b { color: #c0392b; }
@media (prefers-color-scheme: dark) { .dom-counts b { color: #ff8b7d; } }

/* A bar rather than a number alone: the shape of "one domain is behind" is visible at a glance in a
   way five percentages are not. */
.bar {
  grid-column: 2 / 4;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--accent); }

/* ── scenarios ── */
.scenarios { margin: 0; padding: 0 0 0 1.4rem; }
.scen { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.scen:last-child { border-bottom: 0; }
.scen b { display: block; }
.scen-brief { display: block; color: var(--ink-soft); font-size: .9rem; line-height: 1.55; margin-top: .2rem; }
.scen-dom { display: block; font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); margin-top: .3rem; }

/* ── objectives ── */
.filters { display: flex; gap: .4rem; margin: 0 0 1rem; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: .85rem; cursor: pointer;
  padding: .35rem .85rem; border-radius: 5px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
}
.filters button:hover { border-color: var(--ink-faint); color: var(--ink); }
.filters button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.objectives { list-style: none; margin: 0; padding: 0; }
.obj { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.obj:last-child { border-bottom: 0; }
.obj-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.obj-key { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); min-width: 2.6rem; }
.obj-title { flex: 1; min-width: 14rem; font-weight: 550; }
.obj-body { margin-top: .3rem; padding-left: 3.2rem; font-size: .88rem; color: var(--ink-soft); }
.obj-how { display: block; line-height: 1.55; }
.obj-where { display: block; font-size: .74rem; color: var(--ink-faint); margin-top: .2rem; }
.obj-counts { display: block; font-size: .74rem; color: var(--ink-faint); margin-top: .15rem; }

.tag {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap;
}
/* Only the states that need attention are coloured. Colouring "covered" too would make the page a
   wash of green and hide the five that matter. */
.tag-full { color: var(--ink-faint); }
.tag-partial { color: #b8860b; }
.tag-none { color: #c0392b; }
@media (prefers-color-scheme: dark) {
  .tag-partial { color: #e0b341; }
  .tag-none { color: #ff8b7d; }
}

/* ── build log ── */
.log-controls { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.log-search {
  flex: 1; font: inherit; font-size: .95rem;
  padding: .55rem .8rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.log-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.log-count { font-size: .8rem; color: var(--ink-faint); white-space: nowrap; }
.log-count b { color: var(--ink-soft); }

.log { list-style: none; margin: 0; padding: 0; }
.log-entry { border-bottom: 1px solid var(--line); }
.log-entry summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  padding: .8rem 0;
}
.log-entry summary::-webkit-details-marker { display: none; }
.log-entry summary::after {
  content: ""; margin-left: auto;
  width: 0; height: 0;
  border-left: 5px solid var(--ink-faint);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .2s ease; transform-origin: 40% 50%;
}
.log-entry details[open] > summary::after { transform: rotate(90deg); }
.log-entry summary:hover .e-title { color: var(--accent); }
.e-id { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); }
.e-title { font-weight: 550; flex: 1; min-width: 12rem; }
.e-date { font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); }

.e-body { padding: 0 0 1.25rem; max-width: 44rem; }
.e-body p { margin: 0 0 .8rem; line-height: 1.65; color: var(--ink-soft); }
.e-body strong { color: var(--ink); font-weight: 650; }
.e-body code {
  font-family: var(--mono); font-size: .85em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: .1em .3em; border-radius: 3px;
}
.e-body ul { margin: 0 0 .9rem; padding-left: 1.3rem; }
.e-body li { margin-bottom: .35rem; line-height: 1.6; color: var(--ink-soft); }

/* Tables carry the before/after numbers, so they must stay readable rather than be flattened. Wide
   ones scroll inside their own container instead of making the page scroll sideways. */
.tw { overflow-x: auto; margin: 0 0 1rem; }
.e-body table { border-collapse: collapse; font-size: .88rem; min-width: 20rem; }
.e-body th, .e-body td {
  text-align: left; padding: .4rem .7rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.e-body th {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.e-body td { color: var(--ink-soft); }

.empty { color: var(--ink-faint); padding: 2rem 0; }
.mono { font-family: var(--mono); font-size: .82em; }

@media (max-width: 44rem) {
  .dom { grid-template-columns: 2.2rem 1fr; }
  .dom-weight, .dom-counts { text-align: left; grid-column: auto; }
  .bar { grid-column: 1 / -1; }
  .obj-body { padding-left: 0; }
}
