:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-2: #eef3ed;
  --surface-3: #fbfaf6;
  --ink: #19211b;
  --muted: #5d675f;
  --line: #d9e0d7;
  --green: #1f8a5b;
  --teal: #0f7a78;
  --amber: #c47a16;
  --red: #b94336;
  --shadow: 0 18px 50px rgba(25, 33, 27, 0.08);
  --paper-shadow: 0 22px 70px rgba(25, 33, 27, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(31, 138, 91, 0.08), transparent 420px), var(--bg);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(217, 224, 215, 0.85);
  background: rgba(245, 247, 242, 0.94);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--green), var(--teal));
}
.brand h1 { margin: 0; font-size: 17px; line-height: 1.1; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}
.btn.primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn.danger { color: var(--red); }
.btn:hover { border-color: #b9c5b8; }

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-copy, .score-card, .panel, .report-section {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  background-image:
    linear-gradient(90deg, rgba(31, 138, 91, 0.09), transparent 28%),
    linear-gradient(180deg, #fff, var(--surface-3));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p:last-child { margin: 16px 0 0; color: var(--muted); line-height: 1.6; }

.score-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(140deg, #19211b, #233c36 55%, #0f7a78);
}
.score-card small { color: rgba(255,255,255,0.72); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.score-number { font-size: 72px; line-height: 0.9; font-weight: 850; }
.score-card p { margin: 0; color: rgba(255,255,255,0.84); line-height: 1.5; }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.two-col { grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel, .report-section, .report-cover {
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}
.panel-header { padding: 18px 18px 0; }
.panel-header h3, .report-section h3 { margin: 0; font-size: 18px; }
.panel-header p, .muted { color: var(--muted); }
.panel-header p { margin: 8px 0 0; line-height: 1.5; }
.panel-body, .report-section { padding: 18px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
input, textarea {
  min-width: 0;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 92px; resize: vertical; }

.list { display: grid; gap: 10px; }
.org-card, .domain-card, .question, .action-card, .metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.org-card { text-align: left; }
.org-card.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15, 122, 120, 0.12); }
.org-card strong, .domain-card strong { display: flex; justify-content: space-between; gap: 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: var(--surface-2);
}
.tag.low { color: var(--red); background: rgba(185, 67, 54, 0.11); }
.tag.mid { color: var(--amber); background: rgba(196, 122, 22, 0.13); }
.tag.high { color: var(--green); background: rgba(31, 138, 91, 0.12); }

.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e7ece5; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); }
.progress.low span { background: var(--red); }
.progress.mid span { background: var(--amber); }

.metric b { display: block; margin-bottom: 8px; font-size: 32px; line-height: 1; }
.metric span { color: var(--muted); font-size: 13px; }

.report { display: grid; gap: 16px; }
.report-section p, .report-section li { color: var(--muted); line-height: 1.55; }
.report-section h4 { margin: 0 0 8px; }
.report-section {
  position: relative;
  overflow: hidden;
  box-shadow: var(--paper-shadow);
}
.report-section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--green), var(--teal));
}
.report-section-feature {
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.08), transparent 42%),
    var(--surface);
}
.report-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: stretch;
  padding: 26px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 33, 27, 0.96), rgba(35, 60, 54, 0.94)),
    var(--ink);
  color: #fff;
  box-shadow: var(--paper-shadow);
}
.report-cover h3 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}
.report-cover p {
  max-width: 760px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.report-cover .eyebrow {
  color: #9ee0bf;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.report-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  color: rgba(255,255,255,0.84);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 750;
}
.score-seal {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-height: 190px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  text-align: center;
}
.score-seal small {
  color: rgba(255,255,255,0.68);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.score-seal strong {
  font-size: 72px;
  line-height: 0.9;
}
.score-seal span {
  color: rgba(255,255,255,0.82);
  font-weight: 750;
}
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.action-card h4 { margin: 0 0 8px; }
.chart-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.radar-wrap {
  display: grid;
  place-items: center;
  min-height: 300px;
}
.radar-chart {
  width: min(100%, 360px);
  height: auto;
}
.radar-chart text {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 750;
}
.risk-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.risk-tile {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.risk-tile b {
  display: block;
  margin-bottom: 6px;
}
.risk-tile.low { border-color: rgba(185,67,54,0.3); background: rgba(185,67,54,0.06); }
.risk-tile.mid { border-color: rgba(196,122,22,0.3); background: rgba(196,122,22,0.07); }
.risk-tile.high { border-color: rgba(31,138,91,0.3); background: rgba(31,138,91,0.07); }
.plan-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
}
.plan-table th,
.plan-table td {
  padding: 11px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.plan-table th {
  color: var(--ink);
  background: var(--surface-2);
}
.plan-table td {
  color: var(--muted);
  line-height: 1.45;
  background: #fbfcfa;
}
.service-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.service-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(15, 122, 120, 0.24);
  background: rgba(15, 122, 120, 0.06);
}
.service-card b { display: block; margin-bottom: 6px; }
.participant-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.participant-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.participant-table th,
.participant-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.participant-table th {
  color: var(--ink);
  background: var(--surface-2);
}
.participant-table td {
  color: var(--muted);
}
.participant-table tr:last-child td {
  border-bottom: 0;
}
.research-section {
  background:
    linear-gradient(135deg, rgba(196, 122, 22, 0.08), transparent 48%),
    var(--surface-3);
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.research-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(25, 33, 27, 0.1);
  background: rgba(255,255,255,0.72);
}
.research-card b {
  display: block;
  margin-bottom: 7px;
}
.research-card p,
.research-note {
  margin-bottom: 0;
  font-size: 13px;
}

.question { margin-bottom: 12px; }
.question p { margin: 0 0 12px; line-height: 1.45; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.scale input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scale label {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.scale span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 5px; font-weight: 850; }
.scale input:checked + span, .scale label:hover span { color: #fff; background: var(--teal); }
.scale-key { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }

.notice {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
}
.error { color: var(--red); border-color: rgba(185,67,54,0.25); background: rgba(185,67,54,0.08); }
.success { color: var(--green); border-color: rgba(31,138,91,0.25); background: rgba(31,138,91,0.09); }
.hidden { display: none !important; }

@media (max-width: 920px) {
  .hero, .two-col, .three-col, .action-grid, .report-grid, .service-strip, .report-cover { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  main { width: min(100% - 20px, 1240px); padding-top: 16px; }
  .hero-copy { padding: 20px; }
  .score-number { font-size: 58px; }
  .field-grid { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .plan-table { font-size: 13px; }
}

@media print {
  .topbar, .admin-form, .org-list-panel, .client-form, .no-print { display: none !important; }
  body { background: #fff; }
  main { width: 100%; padding: 0; }
  .hero, .two-col, .three-col, .action-grid, .report-grid, .service-strip, .report-cover { grid-template-columns: 1fr; }
  .panel, .hero-copy, .score-card, .report-section { box-shadow: none; break-inside: avoid; }
  .score-card { color: var(--ink); background: #fff; border: 1px solid var(--line); }
  .score-card p, .score-card small { color: var(--muted); }
}
