/* Stage 8 · Commercial features: resume role matching and interview report. */

.resume-role-match-section {
  --match-surface: rgba(13, 18, 30, 0.96);
  --match-soft: rgba(21, 28, 45, 0.82);
  --match-border: rgba(145, 166, 214, 0.18);
  --match-text: #f5f7fc;
  --match-muted: #909bb2;
  display: grid !important;
  gap: 18px;
  margin-top: 20px;
  padding: 26px;
  color: var(--match-text);
  background:
    radial-gradient(circle at 86% 0%, rgba(74, 116, 226, 0.13), transparent 34%),
    var(--match-surface);
  border: 1px solid var(--match-border);
  border-radius: 22px;
  box-shadow: 0 22px 56px rgba(3, 7, 18, 0.2);
}

html[data-theme="light"] .resume-role-match-section {
  --match-surface: rgba(255, 255, 255, 0.98);
  --match-soft: rgba(246, 248, 253, 0.98);
  --match-border: rgba(54, 70, 106, 0.14);
  --match-text: #151c2e;
  --match-muted: #6d7890;
  box-shadow: 0 22px 56px rgba(46, 63, 100, 0.12);
}

.resume-role-match-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.resume-role-match-section > header p,
.resume-role-match-section > header h2,
.resume-role-match-section > header span {
  margin: 0;
}

.resume-role-match-section > header p {
  color: #79a2ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.resume-role-match-section > header h2 {
  margin-top: 6px;
  font-size: clamp(23px, 2.5vw, 31px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.resume-role-match-section > header span {
  display: block;
  margin-top: 8px;
  color: var(--match-muted);
  font-size: 13px;
}

.resume-role-match-section > header > em {
  padding: 8px 11px;
  color: #a9c0ff;
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.22);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.resume-role-match-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  background: var(--match-soft);
  border: 1px solid var(--match-border);
  border-radius: 16px;
}

.resume-role-match-form label {
  display: grid;
  gap: 7px;
}

.resume-role-match-form label > span,
.resume-role-match-result > div > span {
  color: var(--match-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.resume-role-match-form input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: var(--match-text);
  background: color-mix(in srgb, var(--match-surface) 90%, transparent);
  border: 1px solid var(--match-border);
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-weight: 700;
}

.resume-role-match-form input:focus {
  border-color: rgba(91, 140, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

.resume-role-match-form .primary-btn {
  min-width: 120px;
  height: 44px;
}

.resume-role-match-result {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 0.85fr) minmax(220px, 1.2fr);
  gap: 12px;
}

.resume-role-match-result > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 17px;
  background: var(--match-soft);
  border: 1px solid var(--match-border);
  border-radius: 16px;
}

.resume-role-match-score {
  position: relative;
  justify-content: center;
  overflow: hidden;
}

.resume-role-match-score::after {
  position: absolute;
  right: -36px;
  bottom: -46px;
  width: 104px;
  height: 104px;
  border: 13px solid rgba(91, 140, 255, 0.12);
  border-top-color: #5b8cff;
  border-radius: 50%;
  content: "";
  transform: rotate(118deg);
}

.resume-role-match-score strong {
  color: #7ca3ff;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.resume-role-match-score em {
  color: #63d3a2;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.resume-role-match-evidence > div,
.resume-role-match-gaps > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.resume-role-match-evidence strong,
.resume-role-match-gaps strong {
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11px;
}

.resume-role-match-evidence strong {
  color: #7ce0b4;
  background: rgba(42, 182, 115, 0.1);
}

.resume-role-match-gaps strong {
  color: #f0a6a6;
  background: rgba(226, 89, 89, 0.1);
}

.resume-role-match-training > strong {
  font-size: 15px;
  line-height: 1.35;
}

.resume-role-match-training > p {
  margin: 0;
  color: var(--match-muted);
  font-size: 11px;
  line-height: 1.55;
}

.resume-role-match-training .primary-btn {
  margin-top: auto;
  min-height: 36px;
  font-size: 12px;
}

body[data-active-panel="training-summary"] .training-summary-page {
  width: min(1120px, 100%) !important;
  margin: 0 auto !important;
  padding: 22px clamp(18px, 2.4vw, 34px) 44px !important;
  gap: 16px !important;
}

body[data-active-panel="training-summary"] .training-summary-hero {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 174px !important;
}

body[data-active-panel="training-summary"] .training-summary-flow,
body[data-active-panel="training-summary"] .training-summary-achievements,
body[data-active-panel="training-summary"] .training-summary-grid,
body[data-active-panel="training-summary"] .training-summary-chain {
  display: none !important;
}

.interview-commercial-report {
  --report-surface: rgba(13, 18, 30, 0.96);
  --report-soft: rgba(22, 29, 47, 0.82);
  --report-border: rgba(145, 166, 214, 0.18);
  --report-text: #f6f8fd;
  --report-muted: #929db4;
  display: grid;
  gap: 15px;
  padding: 25px;
  color: var(--report-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(91, 140, 255, 0.15), transparent 32%),
    var(--report-surface);
  border: 1px solid var(--report-border);
  border-radius: 22px;
  box-shadow: 0 22px 58px rgba(3, 7, 18, 0.2);
}

html[data-theme="light"] .interview-commercial-report {
  --report-surface: rgba(255, 255, 255, 0.98);
  --report-soft: rgba(247, 249, 253, 0.98);
  --report-border: rgba(54, 70, 106, 0.14);
  --report-text: #151c2e;
  --report-muted: #6d7890;
  box-shadow: 0 22px 58px rgba(46, 63, 100, 0.12);
}

.interview-commercial-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.interview-commercial-report-head :is(p, h3, span) {
  margin: 0;
}

.interview-commercial-report-head h3 {
  margin-top: 5px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.interview-commercial-report-head span {
  display: block;
  margin-top: 7px;
  color: var(--report-muted);
  font-size: 12px;
}

.interview-commercial-report-head > em {
  padding: 8px 11px;
  color: #76ddb0;
  background: rgba(42, 182, 115, 0.1);
  border: 1px solid rgba(42, 182, 115, 0.2);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.interview-commercial-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.interview-commercial-score-grid article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  padding: 17px;
  background: var(--report-soft);
  border: 1px solid var(--report-border);
  border-radius: 15px;
}

.interview-commercial-score-grid span {
  color: var(--report-muted);
  font-size: 12px;
  font-weight: 750;
}

.interview-commercial-score-grid strong {
  color: #7da4ff;
  font-size: 29px;
  line-height: 1;
}

.interview-commercial-score-grid i {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  background: rgba(126, 145, 185, 0.14);
  border-radius: 999px;
}

.interview-commercial-score-grid i::after {
  display: block;
  width: var(--score, 0%);
  height: 100%;
  background: linear-gradient(90deg, #5b8cff, #8a77f7);
  border-radius: inherit;
  content: "";
}

.interview-commercial-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 11px;
}

.interview-commercial-insight-grid > article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  border-radius: 16px;
}

.interview-commercial-insight-grid article > span {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.interview-commercial-insight-grid article > strong {
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.interview-commercial-insight-grid article > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.interview-commercial-problem {
  color: #ffdcdc;
  background: linear-gradient(145deg, rgba(166, 59, 67, 0.18), rgba(96, 39, 49, 0.09));
  border: 1px solid rgba(231, 111, 118, 0.2);
}

.interview-commercial-problem > p {
  color: #cda9ad;
}

.interview-commercial-next {
  color: var(--report-text);
  background: linear-gradient(145deg, rgba(67, 105, 202, 0.2), rgba(89, 65, 175, 0.12));
  border: 1px solid rgba(112, 144, 228, 0.23);
}

.interview-commercial-next > span {
  color: #a9c0ff;
}

.interview-commercial-next > p {
  color: var(--report-muted);
}

.interview-commercial-next > div {
  display: flex;
  gap: 9px;
  margin-top: auto;
}

.interview-commercial-next :is(.primary-btn, .ghost-btn) {
  min-height: 38px;
  font-size: 12px;
}

@media (max-width: 920px) {
  .resume-role-match-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .resume-role-match-section,
  .interview-commercial-report {
    padding: 18px;
    border-radius: 18px;
  }

  .resume-role-match-section > header,
  .interview-commercial-report-head {
    display: grid;
  }

  .resume-role-match-section > header > em,
  .interview-commercial-report-head > em {
    justify-self: start;
  }

  .resume-role-match-form,
  .resume-role-match-result,
  .interview-commercial-score-grid,
  .interview-commercial-insight-grid {
    grid-template-columns: 1fr;
  }

  .resume-role-match-form .primary-btn {
    width: 100%;
  }

  body[data-active-panel="training-summary"] .training-summary-hero {
    grid-template-columns: 1fr !important;
  }

  body[data-active-panel="training-summary"] .training-summary-score-card {
    justify-self: stretch !important;
  }

  .interview-commercial-next > div {
    display: grid;
    width: 100%;
  }
}
