:root {
  --navy: #013e61;
  --orange: #f48202;
  --orange-dark: #d86d00;
  --orange-soft: #fff0df;
  --ink: var(--navy);
  --muted: #607684;
  --line: #d9e3e8;
  --paper: #ffffff;
  --surface: #f3f7f9;
  --green: var(--orange);
  --green-dark: var(--orange-dark);
  --green-soft: var(--orange-soft);
  --lime: var(--navy);
  --coral: var(--navy);
  --shadow: 0 24px 60px rgba(1, 62, 97, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--surface);
  font-family: "DM Sans", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(620px, 1.2fr);
  min-height: 100vh;
}

.editor-panel {
  padding: 46px clamp(32px, 4vw, 66px) 56px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.eyebrow,
.report-kicker {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor-heading h1,
.preview-toolbar h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
}

.editor-heading h1 {
  max-width: 470px;
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.editor-heading > p:last-child {
  max-width: 520px;
  margin: 14px 0 34px;
  color: var(--muted);
  line-height: 1.65;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

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

.field > span,
legend {
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-weight: 400;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfb;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"],
input[type="date"],
select {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 88px;
  padding: 13px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 112, 95, 0.12);
}

fieldset {
  margin: 30px 0 0;
  padding: 0;
  border: 0;
}

.fieldset-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.fieldset-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.selection-counter {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
}

.skills-list {
  display: block;
}

.skill-category {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfd;
}

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

.skill-category-heading h3 {
  margin: 0;
  color: var(--navy);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

.skill-category-heading > span {
  flex: 0 0 auto;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
}

.skill-category-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.skill-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 9px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #40514f;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.45;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.skill-option:hover {
  border-color: #9ebbb4;
  transform: translateY(-1px);
}

.skill-option:has(input:checked) {
  border-color: #8bbcac;
  color: var(--green-dark);
  background: #f1f8f5;
}

.skill-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #afbfbb;
  border-radius: 5px;
  background: white;
}

.skill-option input:focus-visible + .custom-check {
  outline: 3px solid rgba(30, 112, 95, 0.2);
  outline-offset: 2px;
}

.skill-option input:checked + .custom-check {
  border-color: var(--green);
  background: var(--green);
}

.skill-option input:checked + .custom-check::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.notes-field {
  margin-top: 24px;
}

.recommendation-inputs {
  display: grid;
  gap: 16px;
}

.placement-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.score-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}

.score-input-table,
.report-score-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.score-input-table th,
.score-input-table td {
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.score-input-table thead th {
  color: white;
  background: var(--navy);
  font-size: 9px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.score-input-table th:first-child {
  width: 76px;
}

.score-input-table th:nth-child(3),
.score-input-table th:nth-child(4) {
  width: 75px;
  text-align: center;
}

.score-input-table td:nth-child(3),
.score-input-table td:nth-child(4) {
  text-align: center;
}

.score-input-table tr:last-child > * {
  border-bottom: 0;
}

.score-input-table tr > *:last-child {
  border-right: 0;
}

.task-score {
  width: 52px;
  height: 38px;
  padding: 0 5px;
  border: 1px solid #bfcdd3;
  border-radius: 7px;
  outline: 0;
  color: var(--navy);
  background: white;
  font-weight: 700;
  text-align: center;
}

.task-score:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(244, 130, 2, 0.14);
}

.form-message {
  min-height: 20px;
  margin: 9px 0 3px;
  color: #b74730;
  font-size: 12px;
  font-weight: 600;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 26px rgba(30, 112, 95, 0.2);
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.preview-panel {
  padding: 44px clamp(28px, 4vw, 64px) 70px;
  background:
    radial-gradient(circle at 92% 8%, rgba(244, 130, 2, 0.18), transparent 25%),
    var(--surface);
  overflow: visible;
}

.preview-toolbar {
  display: flex;
  max-width: 760px;
  align-items: end;
  justify-content: space-between;
  margin: 0 auto 22px;
}

.preview-toolbar h2 {
  font-size: 21px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3bb273;
  box-shadow: 0 0 0 4px rgba(59, 178, 115, 0.12);
}

.report-page {
  position: relative;
  display: flex;
  width: min(100%, 760px);
  min-height: 1074px;
  margin: 0 auto;
  padding: 42px 50px 34px;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-page::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 12px;
  background: linear-gradient(90deg, var(--orange) 0 38%, var(--navy) 38%);
  content: "";
}

.report-header,
.report-footer,
.report-meta,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-header {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.report-logo {
  display: block;
  width: 145px;
  height: auto;
}

.report-type {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-type span {
  color: var(--orange-dark);
}

.report-type i {
  color: #a7b4ba;
  font-style: normal;
}

.report-hero {
  padding: 22px 0 24px;
}

.report-hero > p {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.report-hero h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.report-meta {
  justify-content: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.report-meta span {
  padding: 6px 10px;
  border-radius: 6px;
  color: #50615e;
  background: #f0f4f2;
  font-size: 10px;
}

.report-meta strong {
  color: var(--green);
}

.report-summary {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 25px;
  padding: 25px 29px;
  border-radius: 18px;
  background: #f1f6f8;
}

.score-ring {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #d6e5e0 0);
}

.score-ring::before {
  grid-area: 1 / 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  content: "";
}

.score-ring > div {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  text-align: center;
}

.score-ring strong {
  font-family: "Manrope", sans-serif;
  font-size: 27px;
  line-height: 1;
}

.score-ring span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.report-summary h3,
.report-skills h3,
.report-written-test h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.025em;
}

.report-summary h3 {
  font-size: 20px;
}

.report-summary > div:last-child > p:last-child {
  margin: 8px 0 0;
  color: #5e706c;
  font-size: 11px;
  line-height: 1.55;
}

.report-skills {
  padding: 24px 0 17px;
}

.report-skills h3 {
  font-size: 16px;
}

.section-title-row > span {
  color: var(--muted);
  font-size: 10px;
}

.report-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.report-written-test {
  padding: 18px 20px;
  border-radius: 13px;
  background: #f1f6f8;
}

.report-written-test h3 {
  margin: 0;
  font-size: 17px;
}

.report-total-score {
  color: var(--orange-dark);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.report-score-table {
  margin-top: 12px;
  background: white;
}

.report-score-table th,
.report-score-table td {
  padding: 6px 7px;
  border: 1px solid #dce5e9;
  color: #435a67;
  font-size: 8px;
  line-height: 1.25;
  text-align: left;
}

.report-score-table thead th {
  color: white;
  background: var(--navy);
  font-size: 7px;
  text-transform: uppercase;
}

.report-score-table th:first-child {
  width: 48px;
}

.report-score-table th:nth-child(3),
.report-score-table th:nth-child(4) {
  width: 68px;
  text-align: center;
}

.report-score-table td:nth-child(3),
.report-score-table td:nth-child(4) {
  color: var(--navy);
  font-weight: 700;
  text-align: center;
}

.report-skill-category {
  padding: 11px 12px;
  border: 1px solid #e0e8eb;
  border-top: 3px solid var(--orange);
  border-radius: 8px;
  break-inside: avoid;
}

.report-skill-category:last-child {
  grid-column: 1 / -1;
}

.report-skill-category h4 {
  margin: 0 0 7px;
  color: var(--navy);
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  line-height: 1.25;
}

.report-skill-category ul {
  margin: 0;
  padding: 0 0 0 13px;
}

.report-skill-category:last-child ul {
  columns: 2;
  column-gap: 24px;
}

.report-skill-category li {
  margin: 0 0 3px;
  color: #405661;
  font-size: 7.5px;
  line-height: 1.25;
}

.report-skill-category li::marker {
  color: var(--orange);
}

.report-category-empty {
  margin: 0;
  color: #8b9ba2;
  font-size: 7.5px;
  font-style: italic;
}

.report-page--compact .report-skill-category {
  padding: 8px 10px;
}

.report-page--compact .report-skill-category h4 {
  margin-bottom: 5px;
}

.report-page--compact .report-skill-category li {
  margin-bottom: 2px;
  font-size: 7px;
}

.report-page--dense .report-hero {
  padding: 24px 0 20px;
}

.report-page--dense .report-skills {
  padding: 16px 0 11px;
}

.report-page--dense .report-skills-grid {
  gap: 6px;
  margin-top: 12px;
}

.report-page--dense .report-skill-category li {
  font-size: 6.4px;
  line-height: 1.15;
}

.report-skill {
  position: relative;
  min-height: 38px;
  padding: 9px 10px 9px 29px;
  border: 1px solid #e2e9e7;
  border-radius: 8px;
  color: #344744;
  font-size: 9.5px;
  line-height: 1.35;
}

.report-skill::before {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  content: "✓";
  font-size: 7px;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed #cad7d3;
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.report-recommendation {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  margin-top: auto;
  padding: 16px 18px;
  border-left: 3px solid var(--coral);
  background: #fff7ed;
}

.recommendation-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--orange-dark);
  background: #ffe5c7;
}

.recommendation-icon svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.report-recommendation-content {
  display: grid;
  gap: 10px;
}

.report-recommendation-item + .report-recommendation-item {
  padding-top: 9px;
  border-top: 1px solid #f1d9c8;
}

.report-recommendation-item > p:last-child {
  margin: 0;
  color: #5d5551;
  font-size: 10px;
  line-height: 1.5;
}

.report-placement {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.report-placement > div {
  padding: 11px 13px;
  border: 1px solid var(--navy);
  border-top: 3px solid var(--orange);
  border-radius: 8px;
  background: var(--navy);
}

.report-placement p {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.report-placement strong {
  display: block;
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  line-height: 1.3;
}

.report-footer {
  margin-top: 25px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: #71807e;
  font-size: 8.5px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .preview-panel {
    min-height: 100vh;
  }
}

@media (max-width: 620px) {
  .editor-panel,
  .preview-panel {
    padding: 28px 18px 40px;
  }

  .field-grid,
  .placement-inputs,
  .skill-category-options {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    align-items: flex-start;
    gap: 20px;
  }

  .live-indicator {
    display: none;
  }

  .report-page {
    min-height: auto;
    padding: 28px 23px;
  }

  .report-hero h2 {
    font-size: 29px;
  }

  .report-summary {
    grid-template-columns: 78px 1fr;
    padding: 20px;
  }

  .report-written-test {
    padding: 14px;
  }

  .score-ring {
    width: 72px;
    height: 72px;
  }

  .score-ring::before {
    width: 56px;
    height: 56px;
  }

  .score-ring strong {
    font-size: 21px;
  }

  .report-skills-grid {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    height: 297mm;
    background: white;
  }

  .editor-panel,
  .preview-toolbar {
    display: none !important;
  }

  .app-shell,
  .preview-panel {
    display: block;
    min-height: 0;
    padding: 0;
    background: white;
  }

  .report-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    padding: 12mm 14mm 10mm;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-page::before {
    width: 48mm;
    height: 3mm;
  }

  .report-header {
    padding-bottom: 6mm;
  }

  .report-hero {
    padding: 5mm 0 5mm;
  }

  .report-hero h2 {
    font-size: 23pt;
  }

  .report-summary {
    padding: 5mm 6mm;
  }

  .report-skills {
    padding: 7mm 0 5mm;
  }

  .report-skills-grid {
    gap: 2mm;
    margin-top: 4mm;
  }

  .report-skill {
    min-height: 9mm;
    break-inside: avoid;
  }

  .report-recommendation {
    break-inside: avoid;
  }

  .report-placement {
    break-inside: avoid;
  }
}
