:root {
  --bg: #f5f7f8;
  --panel: #fff;
  --ink: #17212b;
  --muted: #667585;
  --line: #dce4ea;
  --blue: #2176b8;
  --green: #0e8f43;
  --red: #bf3a22;
  --soft-blue: #eaf5fb;
  --soft-green: #e9f7ef;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 28px;
  line-height: 1.15;
}

h3 {
  font-size: 20px;
}

.steps {
  display: grid;
  gap: 8px;
}

.step {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.step.active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.step.done {
  border-color: #b8e0c5;
}

.main {
  padding: 26px 34px 44px;
}

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

.panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  padding: 24px;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 750;
  color: #2d3b48;
}

input,
textarea,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.consent-box {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.consent-box input {
  min-height: auto;
  margin-top: 3px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.primary,
.secondary,
.icon,
.mini {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 800;
}

.primary {
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.secondary {
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
}

.icon {
  width: 42px;
  background: #fff;
  font-size: 24px;
}

.question {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.question:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.answers {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.answer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}

.result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft-green);
  color: #0a6d31;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 18, 25, 0.48);
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(1180px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.candidate-photo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef3f6;
  flex: 0 0 54px;
}

.candidate-photo-button {
  width: 54px;
  height: 54px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.candidate-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
}

.candidate-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  align-items: end;
}

.candidate-list {
  display: grid;
  gap: 10px;
}

.candidate-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.candidate-item[open] {
  border-color: #b9d7eb;
}

.candidate-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
}

.candidate-item summary::-webkit-details-marker {
  display: none;
}

.candidate-summary {
  display: grid;
  grid-template-columns: 54px minmax(180px, 1.4fr) minmax(160px, 1fr) minmax(120px, 160px) 22px;
  gap: 12px;
  align-items: center;
}

.candidate-summary::after {
  content: "+";
  justify-self: end;
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.candidate-item[open] .candidate-summary::after {
  content: "−";
}

.candidate-main,
.candidate-contact,
.candidate-score {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.candidate-main strong,
.candidate-score strong {
  overflow-wrap: anywhere;
}

.candidate-main span,
.candidate-contact span,
.candidate-score span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.candidate-score {
  border-left: 4px solid var(--line);
  padding-left: 10px;
}

.candidate-score.strong {
  border-color: var(--green);
}

.candidate-score.good {
  border-color: var(--blue);
}

.candidate-score.reserve {
  border-color: #b48600;
}

.candidate-score.weak {
  border-color: var(--red);
}

.candidate-details {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #fbfdfe;
}

.candidate-details section {
  display: grid;
  gap: 10px;
}

.candidate-details h3 {
  font-size: 16px;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 15, 21, 0.76);
}

.photo-modal.hidden {
  display: none;
}

.photo-modal img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.photo-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

dl div,
.text-block,
.answer-review div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

dt,
.text-block span,
.answer-review span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd,
.text-block p {
  margin: 0;
  overflow-wrap: anywhere;
}

.score.compact {
  margin-top: 0;
}

.score.compact strong {
  font-size: 18px;
}

.risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-list span {
  border: 1px solid #ffd1c8;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff4f1;
  color: #8b2a18;
  font-weight: 800;
}

.answer-review {
  display: grid;
  gap: 8px;
}

.answer-review strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.score {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

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

.score span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.score strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

@media (max-width: 900px) {
  .shell,
  .grid,
  .score,
  .candidate-toolbar,
  .candidate-summary,
  dl {
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 20px;
  }

  .candidate-summary {
    position: relative;
    padding-right: 26px;
  }

  .candidate-summary::after {
    position: absolute;
    top: 4px;
    right: 0;
  }

  .candidate-score {
    border-left: 0;
    border-top: 4px solid var(--line);
    padding-left: 0;
    padding-top: 8px;
  }
}
