/* 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; }
.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; }
}
