:root {
  --bg: #f2f7f3;
  --surface: #ffffff;
  --ink: #0c1f13;
  --muted: #5d7766;
  --brand: #09571c;   /* primary green (rgb 9,87,28) */
  --brand-dark: #064112;
  --brand-deep: #031b09;  /* header / footer green */
  --accent: #2eae58;
  --border: #d3e4da;
  --ok: #2f855a;
  --danger: #b23b3b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(12, 31, 19, .08), 0 8px 24px rgba(12, 31, 19, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--brand-deep); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 20px; gap: 10px; }
.brand { display: flex; flex-direction: column; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-line { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 28px; width: auto; display: block; border-radius: 4px; }
.brand-badge { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: #8fd6a8; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: #d8ece0; }
.nav a { color: #d8ece0; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; }
.inline { display: inline; }
.link-button { background: none; border: none; color: #d8ece0; cursor: pointer; font: inherit; padding: 0; }
.link-button:hover { color: var(--accent); }

.phase-banner { background: #e9f6ee; border-bottom: 1px solid var(--border); color: #1f5c37; font-size: 14px; padding: 8px 0; }
.phase-banner.phase-open { background: #e9f6ee; }
.phase-detail { opacity: .8; }
.pill {
  display: inline-block; background: #dff3e4; color: #09571c; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 600; margin-right: 6px;
}
.pill-muted { background: #e4ede7; color: #4f6b5a; }
.pill-danger { background: #f8d6d6; color: #8a1f1f; }

/* ---------- Layout ---------- */
.page { padding-top: 10px; padding-bottom: 60px; min-height: 70vh; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 6px 0; font-size: 30px; line-height: 1.2; }
.muted { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h2 { margin-top: 0; color: var(--brand-dark); }
.card h3 { margin: 0 0 6px; }

.highlight-card { border-color: var(--accent); background: #eaf8ee; }
.notice { background: #e8f6ed; border: 1px solid #bfe0cd; border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.notice.info, .notice.success { background: #e9f6ee; border-color: #b9dcc6; }
.notice.success strong { color: var(--ok); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 9px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; background: #f0f7f2; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: #b23b3b; border-color: #b23b3b; color: #fff; }
.btn-danger:hover { background: #8f2626; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.link-button { font-size: 14px; }

.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.card-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-card { max-width: 720px; }
.form-card-wide { max-width: none; width: 100%; }
.auth-wrap { display: flex; justify-content: center; }
.auth-card { max-width: 620px; width: 100%; }
.field { margin-bottom: 16px; }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.field-check input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.field-check label { font-weight: 600; margin: 0; }
.field-check .help, .field-check .error { grid-column: 2; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.help { color: var(--muted); font-size: 12.5px; display: block; margin-top: 4px; }
.error { color: var(--danger); font-size: 13px; display: block; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }

.tooltip-wrap { position: relative; display: inline-flex; align-items: center; margin-left: 6px; }
.tooltip-icon { width: 16px; height: 16px; line-height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
  cursor: help; user-select: none; }
.tooltip { position: absolute; top: 24px; left: 0; z-index: 20; width: 280px; padding: 10px 12px;
  background: #222; color: #fff; font-size: 12.5px; font-weight: 400; border-radius: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease; }
.tooltip strong { display: block; margin: 2px 0; color: #9fe0bf; }
.tooltip::before { content: ""; position: absolute; top: -6px; left: 10px;
  border: 6px solid transparent; border-bottom-color: #222; }
.tooltip-wrap:hover .tooltip, .tooltip-icon:focus + .tooltip,
.tooltip-wrap:focus-within .tooltip { opacity: 1; visibility: visible; transform: translateY(0); }

.role-picker label { margin-bottom: 8px; }
.role-options { display: grid; gap: 10px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #f0f8f2; }
.role-option:has(input:checked) { border-color: var(--brand); background: #e0f4e6; }
.role-option strong { font-size: 14px; }
.role-option small.help { margin-top: 2px; }

.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.filters select, select.score-select { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); font: inherit; }
.filters input[type=search] { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); font: inherit; background: #fff; color: var(--ink); }

/* ---------- Lists / rows ---------- */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.sub-row { padding: 8px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }

.problem-list { display: grid; gap: 16px; }
.problem-card h2 { margin: 6px 0; }
.problem-card h2 a { color: var(--ink); }
.problem-card h2 a:hover { color: var(--brand-dark); }
.problem-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

/* ---------- Problem bank table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-count { margin: 0 0 8px; font-size: 13px; }
.problem-table { min-width: 760px; }
.problem-table th:first-child, .problem-table td:first-child { width: 32%; }
.problem-table .excerpt { display: block; margin-top: 4px; }
.problem-table .row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.problem-table .col-actions { width: 1%; white-space: nowrap; }

/* The Domain / Value chain / Status labels are long sentences, so they wrap
   inside a narrow cell. A 999px pill radius bulges into a rounded blob at
   that size; a fixed radius keeps them reading as rounded rectangles. */
.problem-table .pill { border-radius: 6px; }

/* Shed the secondary columns before the table has to scroll. */
@media (max-width: 1100px) {
  .problem-table .col-hide-md { display: none; }
}

/* ---------- Modal + rich text editor ---------- */
.modal { border: none; border-radius: var(--radius); padding: 0; margin: auto;
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow);
  resize: vertical; overflow-y: auto; }
.modal::backdrop { background: rgba(12, 31, 19, .45); }
.modal-card { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; color: var(--brand-dark); font-size: 19px; }

.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wysiwyg-toolbar button { border: 1px solid var(--border); background: #fff; color: var(--ink);
  border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.wysiwyg-toolbar button:hover { background: #f0f7f2; }

.wysiwyg { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: #fff;
  color: var(--ink); font-size: 14.5px; line-height: 1.7;
  /* A note is written in sentences, so the empty box is sized in whole line
     boxes rather than a pixel count the font could undercut: eight lines of
     text, plus the padding and the two borders. The modal is drag-resizable,
     so this is a starting size and not a ceiling. */
  min-height: calc(8 * 1.7em + 26px); }
.wysiwyg:focus { outline: 2px solid var(--accent); border-color: transparent; }
.wysiwyg p { margin: 0 0 8px; }
.wysiwyg h3 { margin: 0 0 8px; font-size: 17px; }
.wysiwyg ul, .wysiwyg ol { margin: 0 0 8px; padding-left: 22px; }
.wysiwyg blockquote { margin: 0 0 8px; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }

.qa dt { font-weight: 700; margin-top: 14px; font-size: 14px; color: var(--brand-dark); }
.qa dd { margin: 4px 0 0; }
.qa dt:first-child { margin-top: 0; }

/* ---------- Challenge detail ---------- */
.page-head-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head-actions { flex: 0 0 auto; }

.phase-card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; }

.cta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #eaf8ee; border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 16px 18px; margin-top: 24px; width: 100%;
}
.cta p { margin: 0; }
.cta-title { font-weight: 700; }
.cta-text { flex: 1 1 260px; }
.cta-actions { margin-top: 0; }

.solutions-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; aspect-ratio: 1 / 1; overflow-y: auto;
}
.solutions-card h3 { font-size: 15px; color: var(--brand-dark); }
.solutions-card .sub-row { display: block; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.solutions-card .sub-row:last-child { border-bottom: 0; }
.solutions-card .muted { font-size: 13px; }
.solutions-card .notice { padding: 8px 10px; font-size: 12.5px; margin: 8px 0 0; }

/* ---------- Hero & steps ---------- */
.hero { text-align: center; padding: 10px 0; }
.hero h1 { font-size: 40px; line-height: 1.15; margin-bottom: 12px; }
.hero h1 .accent { color: var(--brand); }
.hero p { max-width: 720px; margin: 0 auto 20px; font-size: 17px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 30px; color: var(--brand-dark); }
.hero-stats span { color: var(--muted); font-size: 13px; }

blockquote { border-left: 4px solid var(--accent); margin: 14px 0; padding: 6px 16px; color: #3d5c49; font-style: italic; }
.column { display: flex; flex-direction: column; }
.dash-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ---------- DISC process flow diagram ---------- */
.disc-flow {
  --f1:#2563eb; --f1-bg:#eaf1ff;
  --f2:#1a7a4c; --f2-bg:#eaf7ef;
  --f3:#6d28d9; --f3-bg:#f2ecfd;
  --f4:#d9670b; --f4-bg:#fdf0e3;
  --f5:#0f8a8a; --f5-bg:#e6f7f7;
  --f6:#b8860b; --f6-bg:#fdf6e3;
  --f7:#be185d; --f7-bg:#fce9f2;
  --f8:#1d4ed8; --f8-bg:#e9eefd;
  --f9:#15803d; --f9-bg:#eaf6ee;
  --ink:#031b09;
  max-width: 100%; margin: 0 auto 26px;
}
.flow-masthead {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--ink); color: #fff; padding: 20px 40px; border-radius: 14px;
  width: fit-content; margin: 0 auto 8px;
}
.flow-masthead .flow-rocket { font-size: 28px; }
.flow-masthead h1 { margin: 0; font-size: 26px; letter-spacing: .5px; font-weight: 800; }
.flow-masthead .flow-spark { font-size: 20px; opacity: .9; }
.flow-subtitle { text-align: center; color: #5b6472; font-size: 14px; margin: 14px 0 28px; }

.flow-row { display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; gap: 6px 0; }
.flow-stage {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--bg, #fff); border: 2px solid var(--accent, #333);
  border-radius: 12px; padding: 14px 16px; flex: 1 1 0; min-width: 0;
  color: var(--ink); margin: 4px 0;
}
.flow-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left;
}
.flow-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--accent, #333); line-height: 1.2; }
.flow-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--accent, #333); color: #fff;
}
.flow-stage p { margin: 0; font-size: 12px; color: #3c4451; line-height: 1.3; text-align: left; }
.flow-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 22px; padding: 0 6px; flex: 0 0 auto;
  min-width: 0;
}
.flow-divider { width: 100%; display: flex; justify-content: center; margin: 5px 0; }
.flow-phase-label {
  text-align: center; font-size: 11px; letter-spacing: 1px; color: #8b93a1;
  margin-bottom: 14px; font-weight: 700; text-transform: uppercase;
}

@media (max-width: 900px) {
  .flow-row { flex-direction: column; align-items: center; }
  .flow-arrow { transform: rotate(90deg); padding: 8px 0; }
  .flow-stage { max-width: 340px; width: 100%; flex: none; text-align: center; align-items: center; }
  .flow-stage .flow-head { justify-content: center; }
  .disc-flow .flow-stage h3, .disc-flow .flow-stage p { text-align: center !important; }
}

.pathway { font-weight: 600; line-height: 2; }
.pathway li::marker { color: var(--brand); }

.phase-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 20px 0; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); }
.step-num { display: inline-block; width: 28px; height: 28px; line-height: 28px; text-align: center;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { font-size: 13px; color: var(--muted); margin: 0; }

.penta { background: #ffffff; border-radius: var(--radius); padding: 26px; margin: 20px 0; }
.penta-image { text-align: center; margin: 18px 0; }
.penta-image img { max-width: 50%; height: auto; }

/* ---------- Feedback loop ---------- */
.feedback-item { border-left: 3px solid var(--border); padding: 8px 0 8px 16px; margin-bottom: 14px; }
.feedback-meta { font-size: 13px; color: var(--muted); }
.feedback-question { background: #edf7ee; border: 1px solid #c3e2cc; border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.feedback-reply { background: #eef6ee; border: 1px solid #bfdcbf; border-radius: 8px; padding: 8px 12px; margin-top: 6px; }

/* ---------- Score board ---------- */
.score-board { background: #f0f8f2; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
.score-grid strong { display: block; font-size: 30px; color: var(--brand-dark); }
.score-grid span { color: var(--muted); font-size: 13px; }
.score-total strong { font-size: 34px !important; color: var(--ok) !important; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.kpi { background: #eef7f0; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.kpi strong { font-size: 24px; color: var(--brand-dark); display: block; }
.kpi span { font-size: 12px; }
.kpi small { color: var(--muted); }
.kpi-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; margin: 12px 0; }
.kpi-form label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; font-weight: 600; }
.kpi-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%; }

.messages { margin-bottom: 8px; }
.message { padding: 12px 16px; border-radius: 9px; margin-bottom: 8px; font-size: 14px; }
.message-success { background: #e9f6ee; border: 1px solid #b9dcc6; color: #1f5c37; }
.message-error { background: #fbeaea; border: 1px solid #ecc5c5; color: #8a1f1f; }
.message-warning { background: #eef7f0; border: 1px solid #bfe0cd; color: #1f5c37; }
.message-info { background: #e9f1fb; border: 1px solid #c0d4ec; color: #1f4e7a; }

.footer { background: var(--brand-deep); color: #d8ece0; padding: 26px 0; margin-top: 40px; }
.footer p { margin: 6px 0; }
.footer strong { color: #fff; }
.footer .muted { color: #7d9686; }

/* ---------- Public identity ---------- */
.identity.is-anonymized {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Participant agreement ---------- */

/* The published text is plain, frozen prose flattened from the clause rows, so
   it is set as a reading column rather than as a UI component. */
.agreement-doc .agreement-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: #17301f;
  max-width: 78ch;
}
.agreement-body p { margin: 0 0 12px; }
.agreement-body p:first-child { font-weight: 600; }

/* Long text shown inside a form or a <details> is capped so the control the
   participant has to act on stays reachable without a very long scroll. */
.agreement-excerpt {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 16px;
  background: #fbfdfc;
  font-size: 13.5px;
  line-height: 1.65;
}

.agreement-disclosure { border: 1px solid var(--border); border-radius: 9px; padding: 10px 14px; }
.agreement-disclosure > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-dark);
  list-style-position: inside;
}
.agreement-disclosure[open] > summary { margin-bottom: 10px; }
.agreement-disclosure .agreement-excerpt { margin-top: 4px; }

.footer .footer-legal { font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; margin-top: 16px; }
.footer .footer-legal a { color: #9fe0bf; }
.footer .footer-legal a:hover { color: #fff; }

@media (max-width: 820px) {
  .grid-2, .grid-3, .phase-steps { grid-template-columns: 1fr; }
  .phase-card-layout { grid-template-columns: 1fr; }
  .solutions-card { aspect-ratio: auto; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }

  /* ---------- Problem bank table ---------- */
  .problem-table { min-width: 0; }
  .problem-table .col-hide-sm { display: none; }
  .problem-table th:first-child, .problem-table td:first-child { width: auto; }

  /* ---------- Responsive topbar ---------- */
  .topbar-inner { flex-wrap: wrap; }
  .brand-sub { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; padding: 10px; background: none; border: 0; cursor: pointer;
    border-radius: 8px;
  }
  .nav-toggle:hover { background: rgba(255, 255, 255, .08); }
  .nav-toggle-bar { width: 22px; height: 2.5px; background: #d8ece0; border-radius: 2px; transition: transform .18s ease, opacity .18s ease; }
  .nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  .nav { display: none; flex-direction: column; align-items: stretch; width: 100%; gap: 0; order: 3; }
  .nav.open { display: flex; }
  .nav a, .nav form { padding: 12px 2px; display: block; }
  .nav a { border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .nav form { margin: 0; }
  .nav .link-button { font-size: 15px; padding: 0; display: inline; }
  .nav .btn { margin-top: 10px; text-align: center; background: var(--brand); color: #fff; }
}