:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #1d2939;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ink: #1d2939;
  --muted: #667085;
  --line: #e6eaf0;
  --blue: #3157c8;
  --blue-dark: #2445aa;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
}

.site-header {
  padding: 48px 24px 76px;
  color: #fff;
  background: linear-gradient(120deg, #203f9d, #3866dc);
}

.header-content,
.page-content,
.site-footer {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: #aebfff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.15;
}

.header-description {
  margin-bottom: 0;
  color: #e0e7ff;
  font-size: 1rem;
}

.page-content {
  position: relative;
  margin-top: -34px;
}

.search-card,
.result-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 26px rgb(16 24 40 / 6%);
}

.search-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 12px 24px;
  padding: 24px;
}

.search-card h2,
.table-heading h2 {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.search-card p,
.table-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-form {
  display: flex;
  gap: 9px;
}

.search-form input {
  min-width: 0;
  flex: 1;
  padding: 11px 13px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
}

.search-form input:focus {
  outline: 3px solid rgb(49 87 200 / 18%);
  border-color: var(--blue);
}

.button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.button-primary {
  color: #fff;
  background: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  border-color: #d0d5dd;
  color: #344054;
  background: #fff;
}

.button-secondary:hover {
  background: #f8f9fc;
}

.search-message {
  grid-column: 2;
  min-height: 1em;
  margin: 0;
  color: #b42318;
  font-size: 0.85rem;
}

.result-section {
  margin-top: 22px;
  padding: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--blue);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.average-card {
  min-width: 145px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #eff3ff;
}

.average-label,
.detail-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.average-card strong {
  color: var(--blue-dark);
  font-size: 1.6rem;
}

.percent-sign {
  margin-left: 2px;
  font-size: 1rem;
}

.student-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 21px 0 26px;
}

.detail-item strong {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.session-tag {
  padding: 7px 10px;
  border-radius: 20px;
  color: #475467;
  background: #f2f4f7;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 0.87rem;
}

th {
  color: #475467;
  background: #f8f9fc;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

td:first-child {
  color: #344054;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.grade {
  display: inline-block;
  min-width: 31px;
  padding: 4px 7px;
  border-radius: 5px;
  color: #2445aa;
  background: #eff3ff;
  font-weight: 700;
  text-align: center;
}

.grading-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer {
  padding: 25px 0 32px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 700px) {
  .site-header {
    padding: 36px 0 62px;
  }

  .header-content,
  .page-content,
  .site-footer {
    width: min(100% - 28px, 1040px);
  }

  .search-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .search-message {
    grid-column: 1;
  }

  .result-section {
    padding: 21px 18px;
  }

  .student-details {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .search-form input {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: flex-start;
  }

  .average-card {
    min-width: 112px;
    padding: 10px 12px;
  }

  .average-card strong {
    font-size: 1.35rem;
  }

  .student-details {
    grid-template-columns: 1fr 1fr;
  }

  .table-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding: 11px 12px;
  }
}
