/* RN Common Review Setup — one stylesheet for every screen.
 *
 * The mockups (docs/track2/mockups/01–04) each carried their own inline
 * <style>, repeating the same ~60% verbatim. That was correct for design
 * artifacts a reviewer opens one at a time; it is wrong for a running app,
 * where a token that differs between two screens is a bug nobody notices.
 * Tokens and the shared furniture live here once.
 *
 * External file, not inline: the F-3 CSP is `default-src 'self'` with no
 * nonce, and an inline <style> would need one.
 *
 * Register (docs/track2/05_PROJECT-INSTRUCTIONS.md): there is no red in this
 * file, deliberately. Nothing on these screens is a failure state — an
 * un-entered metric is optional (RN-ADR-021), a carried-forward list is a
 * legitimate decision (RN-ADR-019). The one destructive action (removing a
 * topic from a unit) is maroon TEXT on white, not a filled red button.
 */

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #dfe3e8;
  --ink: #1c2430;
  --muted: #5a6572;
  --accent: #0b5c8a;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #eef7f1;
  --attn: #8a6d1f;
  --attn-bg: #fdf6e6;
  --sel-bg: #f2f7fa;
  --danger-ink: #8a2b2b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap { max-width: 860px; margin: 2.5rem auto 4rem; padding: 0 1rem; }

.crumb { color: var(--muted); font-size: 13px; margin-bottom: 0.75rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
}

.card + .card { margin-top: 1rem; }

.card-head { border-bottom: 1px solid var(--line); padding-bottom: 0.9rem; margin-bottom: 1.1rem; }

h1 { font-size: 22px; margin: 0 0 0.3rem; }
h2 { font-size: 17px; margin: 1.6rem 0 0.6rem; }
.cycle { color: var(--muted); font-size: 14px; margin: 0; }
.unit { font-size: 19px; font-weight: 600; margin: 0.2rem 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 0.6rem 0; }

/* Recap table — used on the landing screen. */
.recap { width: 100%; border-collapse: collapse; margin: 0.5rem 0 0; }
.recap th, .recap td { text-align: left; padding: 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.recap th { font-weight: 500; color: var(--muted); width: 42%; }
.recap tr:last-child th, .recap tr:last-child td { border-bottom: none; }

/* The change block. It is rendered ONLY when there is a change — never as an
   empty block reading "none". RN-ADR-018's recognition rule, literally. */
.changes { background: var(--attn-bg); border: 1px solid #eadfbf; border-radius: 6px; padding: 0.9rem 1rem; margin: 1rem 0; }
.changes h2 { margin-top: 0; }

.item { border: 1px solid var(--line); border-radius: 6px; padding: 0.85rem 1rem; margin: 0.6rem 0; }
.item.done { background: var(--ok-bg); border-color: #cfe6da; }
.item .label { font-weight: 600; }
.item .sub { color: var(--muted); font-size: 13px; margin: 0.25rem 0 0.6rem; }
.tag { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.55rem; margin-left: 0.4rem; vertical-align: 1px; }
.check { color: var(--ok); font-size: 13px; }

.btn {
  font: inherit;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: #c3c9d1; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); }
.btn-quiet { border-color: transparent; color: var(--accent); padding-left: 0.4rem; padding-right: 0.4rem; }
.btn-danger { color: var(--danger-ink); background: var(--card); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-lg { padding: 12px 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }

.linkish { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

ul.plain { list-style: none; padding: 0; margin: 0.4rem 0; }
ul.plain li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }

/* Metrics rows (screen 04). Selected rows tint; unselected rows render NO
   entry block at all — the recognition rule again. */
.metric { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem; margin: 0.5rem 0; }
.metric.on { background: var(--sel-bg); border-color: #cfdde6; }
.metric-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.metric-name { font-weight: 500; }
.mentry { margin-top: 0.7rem; padding-left: 1.6rem; }
.mentry label { margin-right: 1rem; }
.mentry input[type="text"] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; width: 160px; }
.mentry select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; max-width: 100%; }
.field { margin: 0.7rem 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 0.25rem; }
/* A field that carries a helper line needs its NAME to look like a name.
   Without this the label and the helper compute identically (13px, 400,
   same colour), so "Additional roles for your unit" reads as the first line
   of a two-line grey paragraph rather than as the field it labels. Found by
   looking at the screen in its default state, 2026-08-29; no string test
   can see it. Scoped to labelled-with-helper fields so the other screens
   are untouched. */
.field label.field-name { font-weight: 600; color: var(--ink); margin-bottom: 0.15rem; }
.field .hint { margin: 0 0 0.35rem; }
.field input[type="text"], .field textarea, .field select {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.counter { font-size: 12px; color: var(--muted); }

.paths { border: 1px solid var(--line); border-radius: 6px; margin-top: 0.8rem; }
.path { border-bottom: 1px solid var(--line); }
.path:last-child { border-bottom: none; }
.path-head { width: 100%; text-align: left; font: inherit; background: none; border: none; padding: 0.8rem 1rem; cursor: pointer; }
.path-head .t { font-weight: 500; display: block; }
.path-head .d { color: var(--muted); font-size: 13px; }
.path-body { padding: 0 1rem 1rem; }
.na-first { background: var(--ok-bg); border: 1px solid #cfe6da; border-radius: 6px; padding: 0.9rem 1rem; }

.notice { border-left: 3px solid var(--accent); padding-left: 0.9rem; margin: 1rem 0; }
.problem { background: var(--attn-bg); border: 1px solid #eadfbf; border-radius: 6px; padding: 0.8rem 1rem; margin: 1rem 0; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .wrap { margin-top: 1.25rem; }
  .card { padding: 1.1rem; }
  .metric-head { flex-direction: column; gap: 0.15rem; }
}

/* D98 — checkbox rows (Activities & Efforts curation; State include flag). */
.field.check-row { display: flex; align-items: flex-start; gap: 0.5rem; }
.field.check-row input[type="checkbox"] { margin-top: 0.2rem; flex: none; }
.field.check-row label { display: inline; font-size: 14px; color: var(--ink); margin-bottom: 0; }

/* D106 — the setup sheet. */
.holds { margin-top: 1.2rem; }
.holds h2, h2.sheet-h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 1.4rem 0 0.4rem; }
.section-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
}
.section-row:last-of-type { border-bottom: none; }
.section-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.section-name { font-weight: 600; }
.section-state { color: var(--muted); font-size: 13px; }
.section-row.done .section-name::before {
  content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--ok); margin-right: 0.5rem; vertical-align: 1px;
}
.section-row .btn { flex: none; }
.check-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.5rem; }
@media (min-width: 640px) { .check-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .section-row { flex-direction: column; align-items: flex-start; }
}

/* D108 — the topics screen by verb, resources per topic, activities in groups.
   The register above holds: the one destructive text action (Remove, and
   "Remove it anyway") is maroon text on white, never a filled red control. */

/* The add control: one search box over the offerable catalog. */
.adder { margin: 0.4rem 0 0.2rem; }
.adder .box { position: relative; }
.adder input[type="text"] { font: inherit; width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.adder input::placeholder { color: var(--muted); }
.adder .glyph, .filter .glyph { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; color: var(--muted); }
.results { border: 1px solid var(--line); border-top: none; border-radius: 0 0 6px 6px; background: var(--card); margin-top: -1px; overflow: hidden; }
.results .opt { display: block; width: 100%; text-align: left; font: inherit; background: none; border: none; border-bottom: 1px solid var(--line); padding: 0.55rem 0.9rem; cursor: pointer; color: var(--ink); }
.results .opt:hover, .results .opt:focus-visible { background: var(--sel-bg); }
.results .opt mark { background: none; color: inherit; font-weight: 600; }
.results .none { padding: 0.55rem 0.9rem; color: var(--muted); font-size: 13px; }
.results .propose { border-bottom: none; background: var(--sel-bg); }
.results .propose .sub { display: block; font-size: 13px; color: var(--muted); }
.adder-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 0; }

/* The list is the workspace. */
ul.topics { list-style: none; padding: 0; margin: 0.4rem 0 0; border-top: 1px solid var(--line); }
ul.topics > li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.55rem 0.25rem 0.55rem 0; }
.row .name { flex: 1 1 auto; min-width: 0; }
.row .name.struck { color: var(--muted); text-decoration: line-through; }
.row .sub-line { display: block; font-size: 13px; color: var(--muted); margin-top: 0.1rem; }
.row .state { display: flex; align-items: center; gap: 0.6rem; flex: none; font-size: 13px; }
.row .state .why { color: var(--muted); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li.pending .row { background: var(--sel-bg); margin: 0 -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; }
.linkish.remove { color: var(--muted); text-decoration: none; font-size: 13px; }
.linkish.remove:hover { color: var(--danger-ink); text-decoration: underline; }
.linkish.danger { color: var(--danger-ink); }
.tag.ok { color: var(--ok); border-color: #cfe6da; background: var(--ok-bg); }
.tag.attn { color: var(--attn); border-color: #eadfbf; background: var(--attn-bg); }

/* Inline decision panel, opened from a row. */
.decide { background: var(--sel-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem 1rem 1rem; margin: 0 0 0.8rem; }
.decide .q { font-weight: 600; margin: 0 0 0.5rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.choice { text-align: left; font: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.85rem; cursor: pointer; color: var(--ink); }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice .t { display: block; font-weight: 500; }
.choice .d { display: block; color: var(--muted); font-size: 13px; margin-top: 0.15rem; }
.decide .na-first { margin-top: 0.8rem; }
.decide .problem { margin: 0.6rem 0 0; padding: 0.6rem 0.9rem; font-size: 14px; }

/* Resources under a topic row. */
.res-toggle { background: none; border: none; padding: 0; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
.res-toggle::before { content: "\25B8"; display: inline-block; width: 0.9em; color: var(--muted); }
.res-toggle[aria-expanded="true"]::before { content: "\25BE"; }
.resources { margin: 0 0 0.8rem 1.2rem; padding: 0.6rem 0.9rem 0.8rem; border-left: 2px solid var(--line); }
.resources .intro { font-size: 13px; color: var(--muted); margin: 0 0 0.4rem; }
.res { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; font-size: 14px; }
.res .sys { flex: none; min-width: 7.5rem; font-size: 12px; color: var(--muted); }
.res .val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .val a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.res .val a:hover { text-decoration-color: var(--accent); }
.res .tag { flex: none; }
.res-add { display: grid; grid-template-columns: 11.5rem 1fr auto; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.res-add select, .res-add input[type="text"] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); min-width: 0; }
.res-add .btn { padding: 6px 14px; }
.res-add.one { grid-template-columns: 1fr auto; }
.res-hint { font-size: 12px; color: var(--muted); margin: 0.3rem 0 0; }

/* Activities in groups. */
.filter { position: relative; margin: 0.6rem 0 0.2rem; }
.filter input[type="text"] { font: inherit; width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.group { margin-top: 1.1rem; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; margin-bottom: 0.3rem; }
.group-head h3 { font-size: 15px; margin: 0; }
.group-head .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field.check-row.off label { color: var(--muted); }
.empty { border: 1px dashed var(--line); border-radius: 6px; padding: 1rem; color: var(--muted); margin-top: 0.6rem; }

@media (max-width: 640px) {
  .choices { grid-template-columns: 1fr; }
  .res-add { grid-template-columns: 1fr; }
  .res .sys { min-width: 0; }
  .row { flex-wrap: wrap; }
  .row .state .why { max-width: 100%; white-space: normal; }
}
