/* Progress indicator */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}
.step { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px solid #cbd5f5;
  background: #eef2ff;
  color: #4b5563;
}
.step-label { font-weight: 500; }
.step.done .step-dot,
.step.active-green .step-dot {
  border-color: #16a34a;
  background: #22c55e;
  color: #022c22;
}
.step.current .step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #f9fafb;
}
.step-line { width: 28px; height: 1px; background: #e5e7eb; }
.step-line.active { background: var(--primary); }

/* Test Information */
.testinfo-card {
  display: block;
  padding: 32px 32px 28px;
  min-height: 40vh;
  margin-top: 18px;
  background: radial-gradient(circle at top left, #eef2ff 0, #fff 42%, #f9fafb 100%);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15,23,42,.14);
  border: 1px solid rgba(148,163,184,.25);
  color: var(--text-primary);
}
.testinfo-title,
.testinfo-edition,
.testinfo-appointment,
.testinfo-name,
.testinfo-id,
.testinfo-divider,
.info-accent-card,
.testinfo-card > .action-btn { max-width: 780px; }
.testinfo-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: #111827;
}
.testinfo-edition {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.testinfo-appointment {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-dark);
}
.testinfo-name {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}
.testinfo-id { font-size: 14px; color: #6b7280; margin-bottom: 0; }
.testinfo-divider {
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  margin: 14px 0 22px;
}
.info-accent-card {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 22px;
}
.info-accent-card.purple {
  background: #f3f4ff;
  padding: 18px 20px;
  border-left: 4px solid var(--primary);
}
.info-accent-card.green {
  margin-top: 22px;
  padding: 14px 16px;
  background: #ecfdf3;
  border-left: 4px solid #16a34a;
}
.info-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary-dark);
}
.info-accent-card.green .info-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #166534;
}
.info-card-line { font-size: 14px; color: #374151; line-height: 1.6; }
.info-accent-card.green .info-card-line { margin-left: 12px; margin-bottom: 6px; color: #14532d; }
.action-btn {
  border: 0;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .3s ease;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--primary);
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(79,70,229,.35);
}
.action-btn:hover { background: var(--primary-dark); transform: translateY(-1px); text-decoration: none; }
.testinfo-card > .action-btn { margin-top: 0; }

/* Score report heading */
.report-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}
.report-title { margin: 6px 0; font-size: 28px; font-weight: 800; line-height: 1.25; color: var(--text-primary); }
.report-top-actions { display: flex; align-items: center; }
.back-inline,
.report-footer-link { color: var(--primary); padding: 6px 0; font-size: 13px; font-weight: 500; }
.more-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #555;
  width: 100%;
  flex-wrap: wrap;
}
.more-info-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.more-info-row a { color: var(--primary-dark); font-weight: 600; }

/* Main score and MyBest cards */
.report-card { background: #fff; }
.report-primary-card {
  border: 1px solid rgba(148,163,184,.45);
  border-radius: 18px;
  padding: 18px 18px 20px;
  margin-bottom: 18px;
  width: 100%;
}
.report-card-date { font-weight: 800; font-size: 16px; color: #111827; }
.report-card-meta {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: #4b5563;
  font-weight: 400;
}
.meta-bar { color: #9ca3af; margin: 0 2px; }
.report-card-divider { height: 1px; background: #e5e7eb; padding: 0; margin: 10px 0 12px; }
.score-row {
  display: grid;
  grid-template-columns: minmax(260px, 320px) repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: start;
  padding-left: 4px;
  width: 100%;
}
.overall-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.overall-title { font-weight: 500; margin: 0 0 10px; font-size: 16px; color: #111827; }
.gauge { width: 280px; max-width: 100%; }
.gauge-arc { width: 280px; height: 96px; position: relative; margin: 0 auto; max-width: 100%; }
.gauge-svg { width: 100%; height: 100%; display: block; }
.gauge-track,
.gauge-progress { fill: none; stroke-width: 16; stroke-linecap: butt; }
.gauge-track { stroke: #e5e7eb; }
.gauge-progress { stroke: #8e97fd; }
.gauge-orange .gauge-progress { stroke: var(--best); }
.gauge-scoreline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  color: #020617;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}
.gauge-score-unit { font-size: 13px; font-weight: 400; color: #020617; }
.gauge-meta { text-align: center; margin-top: 6px; font-size: 13px; line-height: 1.6; color: #4b5563; }
.gauge-meta strong { font-weight: 700; }
.skill-col { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.skill-title {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 2px 0 8px;
  justify-content: flex-start;
  padding-left: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #111827;
}
.icon { width: 22px; height: 22px; flex-shrink: 0; color: #111; }
.skill-box {
  width: 100%;
  background: #e6e7ff;
  border: 1px solid #d7d9ff;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.skill-score {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  color: #020617;
  font-family: "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .01em;
}
.skill-date { font-size: 10px; color: #4b5563; margin-top: 4px; line-height: 1.2; font-weight: 400; }

.mybest-card {
  border: 1px solid rgba(148,163,184,.45);
  border-radius: 18px;
  overflow: hidden;
  width: 100%;
  background: #fff;
  margin-bottom: 18px;
}
.mybest-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 0; background: #fff; }
.bookmark-icon {
  width: 26px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: var(--best);
  transform: scale(1.2);
  transform-origin: left center;
  flex-shrink: 0;
}
.bookmark-ribbon {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}
.mybest-head-copy { display: flex; flex-direction: column; flex: 1; }
.mybest-date { font-weight: 800; color: #111827; font-size: 17px; }
.mybest-sub { color: #4b5563; margin-top: 2px; font-size: 13px; }
.mybest-divider { height: 1px; background: var(--best); border-radius: 1px; margin: 8px 16px 0 54px; }
.mybest-score-row {
  grid-template-columns: minmax(220px, 260px) repeat(4, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}
.mybest-score-row .skill-box { background: var(--best-bg); border: 1px solid var(--best-br); }

/* My Tests */
.table-card {
  margin-top: 18px;
  padding: 18px 20px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15,23,42,.14);
  border: 1px solid rgba(148,163,184,.25);
}
.table-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.table-head strong { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.table-head span { font-size: 13px; color: var(--text-muted); }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.tests-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
.tests-table th,
.tests-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.tests-table th { font-weight: 600; color: #4b5563; background: #f9fafb; }
.tests-table td { color: #374151; }
.status-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-pill.green { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.status-pill.blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Registration */
.register-card {
  margin-top: 20px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.45);
  background: radial-gradient(circle at top right, #eef2ff 0, #fff 40%, #f9fafb 100%);
  display: block;
}
.register-copy h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.register-copy p { font-size: 13px; color: var(--text-muted); margin: 0; }
.register-card .action-btn { display: flex; width: max-content; margin: 10px 0 0 auto; }

/* Additional info */
.detail-tabs { display: flex; gap: 12px; margin-top: 22px; align-items: flex-start; flex-wrap: wrap; }
.detail-tab {
  border: 1px solid #d7dcfc;
  background: #f4f4ff;
  color: var(--primary-dark);
  margin-top: 10px;
  width: auto;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
}
.detail-card {
  margin-top: 20px;
  padding: 16px 18px;
  background: #f9fafb;
  border-radius: 16px;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.detail-title { font-size: 18px; margin: 0 0 10px; font-weight: 700; }
.assessment-item { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.assessment-item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.assessment-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assessment-title-row strong { font-size: 14px; }
.cefr-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.cefr-badge.green { background: #d4edda; color: #155724; }
.assessment-copy { margin-top: 8px; font-size: 14px; line-height: 1.6; }
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.student-field { display: flex; flex-direction: column; line-height: 1.3; }
.student-field label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .08em; }
.student-field div { font-size: 13px; font-weight: 700; line-height: 1.3; }

@media (max-width: 900px) {
  .score-row,
  .mybest-score-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-left: 0;
  }
  .overall-block { grid-column: 1 / -1; }
  .skill-title { padding-left: 0; }
  .report-primary-card,
  .mybest-card,
  .table-card,
  .register-card,
  .detail-card { overflow: hidden; }
}

@media (max-width: 520px) {
  .stepper { font-size: 11px; gap: 6px; padding: 6px 8px; }
  .step-line { width: 18px; }

  .testinfo-card { padding: 18px 16px; margin-top: 10px; min-height: auto; }
  .testinfo-title { font-size: 22px; line-height: 1.15; }
  .testinfo-edition { font-size: 12px; margin-bottom: 14px; }
  .testinfo-appointment { font-size: 15px; margin-bottom: 14px; word-break: break-word; }
  .testinfo-name { font-size: 17px; line-height: 1.2; }
  .testinfo-id,
  .info-card-line { font-size: 13px; }
  .testinfo-divider { margin: 14px 0; }
  .info-accent-card.purple,
  .info-accent-card.green { padding: 14px; }
  .info-card-title { font-size: 15px; }
  .info-accent-card.green .info-card-title { font-size: 15px; }
  .info-accent-card.green .info-card-line { margin-left: 0; }
  .testinfo-card > .action-btn { width: 100%; }

  .report-topbar { margin-bottom: 16px; gap: 8px; align-items: center; flex-wrap: nowrap; }
  .report-title {
    font-size: 23px;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .report-top-actions { flex: 0 0 auto; margin-left: auto; }
  .back-inline { white-space: nowrap; }
  .more-info-row { font-size: 12px; margin-bottom: 12px; }
  .report-primary-card { padding-left: 14px; padding-right: 14px; }
  .report-card-date {
    font-size: 16px;
    white-space: nowrap;
  }
  .report-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
    font-size: 13px;
  }
  .report-card-meta > span { white-space: nowrap; }
  .report-card-meta .meta-bar { display: none; }
  .score-row,
  .mybest-score-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-left: 0; }
  .overall-title { font-size: 16px; margin-bottom: 10px; }
  .gauge { width: 220px; }
  .gauge-arc { width: 220px; height: 78px; }
  .gauge-scoreline { font-size: 15px; bottom: 4px; }
  .gauge-score-unit { font-size: 12px; }
  .gauge-meta { font-size: 12px; margin-top: 4px; line-height: 1.6; }
  .skill-title { margin: 2px 0 6px; padding-left: 0; font-size: 12px; line-height: 1.2; }
  .icon { width: 22px; height: 22px; }
  .skill-box { min-height: 58px; padding: 8px; border-radius: 10px; }
  .skill-score { font-size: 15px; line-height: 1.1; font-weight: 500; }
  .skill-date { font-size: 10px; margin-top: 3px; }

  .section-heading { font-size: 19px; margin: 16px 0 10px; }
  .mybest-head { padding: 12px 14px 0; }
  .bookmark-icon {
    width: 26px;
    height: 30px;
    transform: scale(1);
  }
  .bookmark-ribbon { width: 18px; height: 18px; }
  .mybest-date { font-size: 15px; }
  .mybest-sub { font-size: 12px; }
  .mybest-divider { margin-left: 48px; margin-right: 14px; }
  .mybest-score-row { padding: 14px; }

  .table-card { padding-left: 14px; padding-right: 14px; }
  .table-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .table-head strong { font-size: 15px; }
  .table-head span { font-size: 12px; }
  .tests-table th,
  .tests-table td { padding: 8px; font-size: 12px; }

  .register-card { padding-left: 14px; padding-right: 14px; }
  .register-copy h3 { font-size: 16px; }
  .register-copy p { font-size: 13px; }
  .register-card .action-btn { width: 100%; margin-left: 0; }

  .detail-tabs { flex-direction: column; align-items: stretch; }
  .detail-tab { width: 100%; }

  /* Skill Assessment mobile fine-tuning:
     Reference at 440px renders body/title text at 16px with 25.6px line-height.
     Use 15px / 24px here for a clearly perceptible but still subtle reduction. */
  .assessment-title-row strong {
    font-size: 15px;
    line-height: 1.6;
    font-weight: 700;
  }
  .assessment-copy {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
  }
  .assessment-title-row {
    column-gap: 8px;
    row-gap: 4px;
  }
  .cefr-badge {
    font-size: 11px;
    line-height: 1.4;
  }

  .student-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* v15.5 — Mobile vertical proportions matched to the saved reference.
   These adjustments only affect the score report at phone widths. */
@media (max-width: 520px) {
  /* The reference inserts 14px of results padding after the progress indicator. */
  .report-stepper + .report-topbar {
    /* Reference fold at 440x956 starts the report content a little lower.
       Moving the whole report block preserves internal proportions and leaves
       only the top of the MyBest gauge visible at the bottom of the first view. */
    margin-top: 30px;
  }

  /* In the reference, Overall Score and the skills block are separated by 14px.
     Our flattened grid previously used only 8px vertically. */
  .report-primary-card .score-row,
  .mybest-card .mybest-score-row {
    column-gap: 8px;
    row-gap: 14px;
  }

  /* Preserve the 8px spacing between the two rows of skill cards while giving
     the overall-score block the larger 14px separation used by the reference. */
  .report-primary-card .skill-col:nth-of-type(n+4),
  .mybest-card .skill-col:nth-of-type(n+4) {
    margin-top: -6px;
  }

  /* Reference MyBest banner has 12px bottom padding around its text/rule area.
     Restore that vertical breathing room without changing icon/text sizing. */
  .mybest-head {
    padding-bottom: 12px;
  }
}

/* Mobile MyBest spacing retained from the previous fine-tuning. */
@media (max-width: 520px) {
  .report-primary-card + .section-heading {
    margin-top: 34px;
  }
}

/* Detail selectors behave as toggles, matching the reference interaction. */
.detail-tab.is-active {
  background: #e6e7ff;
  color: #111827;
}

/* No artificial end-of-page spacer: the reference keeps the natural document
   height for both detail panels. */
