:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #eef4ef;
  --ink: #17211b;
  --muted: #5d6b61;
  --line: #d9e0da;
  --accent: #1f6f50;
  --accent-dark: #15513a;
  --amber: #a85f12;
  --blue: #2f5f91;
  --shadow: 0 12px 35px rgba(30, 45, 36, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
select {
  font: inherit;
}

.app-header {
  align-items: end;
  background: #163c2d;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 180px;
  padding: 32px clamp(18px, 4vw, 56px) 28px;
}

.eyebrow {
  color: #c7d8cd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.98;
  margin-bottom: 0;
}

h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.18rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

main {
  margin: 0 auto;
  max-width: 1320px;
  padding: 28px clamp(16px, 3vw, 36px) 56px;
}

.tabs {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  display: flex;
  padding: 4px;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #eef5f0;
  cursor: pointer;
  min-height: 42px;
  padding: 0 18px;
}

.tab.is-active {
  background: #fff;
  color: #173a2b;
  font-weight: 700;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading p {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 720px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.assessment-guide {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.4fr);
  margin-bottom: 18px;
  padding: 20px;
}

.assessment-guide h3 {
  margin-bottom: 8px;
}

.assessment-guide p {
  color: var(--muted);
  margin-bottom: 10px;
}

.assessment-guide .reminder {
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0;
}

.dimension-guide {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.dimension-guide div {
  background: #f8fbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.dimension-guide dt {
  font-weight: 800;
  margin-bottom: 4px;
}

.dimension-guide dd {
  color: var(--muted);
  margin: 0;
}

button.primary,
button.secondary {
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 16px;
}

button.primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.assessment-grid,
.report-list {
  display: grid;
  gap: 16px;
}

.competency-card,
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.competency-main {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(180px, 230px);
  padding: 20px 20px 14px;
}

.competency-title p,
.report-card header p {
  color: var(--muted);
  margin-bottom: 0;
}

.why-matters {
  background: #f8fbf8;
  border-top: 1px solid var(--line);
  padding: 14px 20px;
}

.why-matters h4 {
  color: var(--accent-dark);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.why-matters p {
  color: var(--muted);
  margin: 0;
}

.field label {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

select {
  appearance: none;
  background: #fff
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 15px center / 7px 7px no-repeat;
  border: 1px solid #bfcac2;
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 34px 0 12px;
  width: 100%;
}

.target-field {
  background: #edf5fb;
  border: 1px solid #b9d2e6;
  border-radius: 8px;
  padding: 12px;
}

.target-field label {
  color: var(--blue);
}

.target-field select {
  background: #ffffff
    linear-gradient(45deg, transparent 50%, var(--blue) 50%) right 15px center / 7px 7px no-repeat;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 95, 145, 0.12);
  color: #173756;
  font-weight: 700;
}

.computed-status {
  align-items: center;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
}

.score-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill {
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 118px;
  padding: 8px 12px;
  text-align: center;
}

.status-pill.needs-work {
  background: #e8f3ed;
  color: var(--accent-dark);
}

.status-pill.no-gap {
  background: #f5eadf;
  color: var(--amber);
}

.subsection-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 20px 20px;
}

.subsection-field {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.criteria-text {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  margin: 12px 0 0;
  padding-top: 10px;
}

.details-toggle {
  background: var(--surface-soft);
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
  padding: 13px 20px;
  text-align: left;
  width: 100%;
}

.guidance {
  border-top: 1px solid var(--line);
  display: none;
  padding: 18px 20px 20px;
}

.guidance.is-open {
  display: block;
}

.guidance-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guidance-panel {
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.guidance-panel h4 {
  font-size: 0.94rem;
  margin: 0 0 8px;
}

.guidance-panel p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.summary-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.summary-item strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 4px;
}

.summary-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.maturity-summary {
  border-left: 5px solid var(--accent);
}

.target-summary {
  border-left-color: var(--blue);
}

.maturity-summary strong {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.maturity-summary em {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  font-style: normal;
}

.report-card header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.level-path {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.score-path {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: min(260px, 100%);
}

.score-path span {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
}

.score-path .target-score-box {
  background: #edf5fb;
  border-color: #b9d2e6;
  box-shadow: inset 0 4px 0 var(--blue);
  color: #173756;
  font-weight: 700;
}

.score-path strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.score-path .target-score-box strong {
  color: #173756;
}

.recommendation-row {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recommendation-column {
  border-right: 1px solid var(--line);
  padding: 18px 20px 20px;
}

.recommendation-column:last-child {
  border-right: 0;
}

.recommendation-column h4 {
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.recommendation-column ul {
  margin: 0;
  padding-left: 20px;
}

.recommendation-column li {
  margin-bottom: 8px;
}

.no-recommendation-note {
  background: #fff7ee;
  border-radius: 7px;
  color: #70430f;
  font-weight: 700;
  margin: 0;
  padding: 12px;
}

.action-recommendations {
  background: #eef4ef;
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
}

.action-recommendations > h4 {
  color: var(--accent-dark);
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.action-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-tab {
  background: #ffffff;
  border: 1px solid #c9d8ce;
  border-radius: 8px 8px 6px 6px;
  box-shadow: inset 0 4px 0 var(--accent);
  padding: 14px;
}

.action-tab.no-action-gap {
  background: #fffaf3;
  box-shadow: inset 0 4px 0 #d69342;
}

.action-tab h5 {
  color: var(--ink);
  font-size: 0.94rem;
  margin: 0 0 10px;
}

.action-tab ul {
  margin: 0;
  padding-left: 18px;
}

.action-tab li {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .app-header,
  .section-heading,
  .report-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs,
  .actions {
    justify-content: stretch;
  }

  .tab,
  .actions button {
    flex: 1 1 auto;
  }

  .competency-main,
  .assessment-guide,
  .guidance-grid,
  .summary-strip,
  .recommendation-row,
  .subsection-grid,
  .dimension-guide,
  .action-row {
    grid-template-columns: 1fr;
  }

  .status-pill {
    justify-self: start;
  }

  .level-path {
    white-space: normal;
  }

  .score-path {
    min-width: 0;
  }

  .score-path span {
    overflow-wrap: anywhere;
  }

  .recommendation-column {
    border-right: 0;
    border-top: 1px solid var(--line);
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-header,
  #assessment-page,
  .actions {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .page {
    display: block !important;
  }

  .report-card,
  .summary-item {
    box-shadow: none;
    break-inside: avoid;
  }
}
