/* GPA suite: cool-blue academic paper over the shared warm-paper system. */
:root {
  --paper: #eef1f7;
  --paper-deep: #dfe4ee;
  --card: #fffdf8;
  --card-soft: #f7f8fc;
  --ink: #171a24;
  --muted: #687086;
  --line: #1e2433;
  --soft-line: #cfd5e3;
  --accent: #3457d5;
  --accent-dark: #1d348f;
  --accent-soft: #dce3ff;
  --green: #176a55;
  --green-soft: #d9f0c8;
  --warning: #9a3412;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-soft: 3px 3px 0 var(--ink);
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 92% 4%, rgba(52, 87, 213, .13), transparent 27rem),
    radial-gradient(circle at 4% 31%, rgba(52, 87, 213, .055), transparent 20rem),
    linear-gradient(rgba(23, 26, 36, .038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 36, .038) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

::selection { color: #fff; background: var(--accent); }
.site-header { border-bottom-color: rgba(30, 36, 51, .16); }
.brand-mark { color: #fff; background: var(--accent); }
.top-nav a::after { height: 3px; border-radius: 2px; }

/* Hero */
.gpa-hero {
  grid-template-columns: minmax(0, 1.28fr) minmax(310px, .72fr);
  gap: clamp(38px, 7vw, 92px);
  padding-block: clamp(48px, 7vw, 88px) 64px;
}
.gpa-hero h1 {
  max-width: 760px;
  font-size: clamp(48px, 6.8vw, 86px);
  line-height: .99;
  letter-spacing: -.065em;
}
.gpa-hero h1 em { color: var(--accent-dark); white-space: nowrap; }
.gpa-hero h1 em::after {
  right: -.03em;
  bottom: .055em;
  height: .19em;
  background: var(--accent);
  opacity: .2;
  border-radius: 2px;
  transform: rotate(-1.2deg);
}
.gpa-hero .hero-lead { max-width: 640px; margin-block: 24px 20px; }
.hero-note {
  max-width: 660px;
  margin: 22px 0 0;
  padding: 12px 15px;
  color: #4c556b;
  background: rgba(255, 253, 248, .58);
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  font-size: 11.5px;
  line-height: 1.75;
}
.hero-note strong { color: var(--ink); }

.hero-transcript {
  position: relative;
  min-width: 0;
  padding: 18px;
  color: #f5f3ed;
  background: #171c2a;
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 11px 11px 0 var(--accent);
  transform: rotate(.5deg);
}
.hero-transcript::before {
  content: "";
  position: absolute;
  top: 60px;
  right: -9px;
  width: 8px;
  height: 110px;
  background: repeating-linear-gradient(to bottom, var(--accent) 0 10px, transparent 10px 18px);
  border-radius: 2px;
}
.transcript-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  color: #939db4;
  border-bottom: 1px solid #323b50;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .1em;
}
.transcript-top b { color: #aed7c1; font-weight: 600; }
.transcript-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0 14px;
}
.transcript-head small {
  display: block;
  margin-bottom: 2px;
  color: #8f9ab1;
  font-size: 9.5px;
}
.transcript-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.transcript-stamp {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  color: var(--ink);
  background: #c8ff76;
  border: 1px solid #e9ffd0;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-7deg);
}
.transcript-rows { border-top: 1px solid #323b50; }
.transcript-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 35px 52px 43px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #30394d;
  font-size: 10.5px;
}
.transcript-rows span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8dce6; }
.transcript-rows i,
.transcript-rows b,
.transcript-rows em { font-family: var(--font-mono); font-style: normal; font-weight: 500; text-align: right; }
.transcript-rows i { color: #8e99b0; }
.transcript-rows b { color: #f4d9a6; }
.transcript-rows em { color: #a9bcff; }
.transcript-total {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 16px;
}
.transcript-total div { min-width: 0; }
.transcript-total small { display: block; color: #8f9ab1; font-size: 8.5px; }
.transcript-total strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.2;
}
.transcript-total div:first-child strong { color: #c8ff76; }
.transcript-note {
  margin: 15px 0 0;
  color: #7f8aa2;
  font-size: 9px;
  line-height: 1.5;
}

/* Tool */
.gpa-tool {
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, .78fr);
  gap: 26px;
  scroll-margin-top: 20px;
}
.course-card { padding: clamp(20px, 3.2vw, 34px); }
.course-card .card-heading { align-items: flex-start; }
.course-card .card-heading p:not(.section-index) { max-width: 600px; }

.semester-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 10px 13px;
  background: #f1f3fa;
  border: 1px solid var(--soft-line);
  border-radius: 9px;
  font-size: 11px;
}
.semester-strip-label { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; }
.semester-strip strong { font-size: 13px; }
.semester-strip-state { margin-left: auto; color: var(--muted); font-size: 10.5px; }

.algo-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.algo-tab {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 11px 12px;
  color: var(--ink);
  background: #f8f9fd;
  border: 1.5px solid var(--soft-line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.algo-tab b { font-size: 12.5px; line-height: 1.3; }
.algo-tab small { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.algo-tab:hover { border-color: var(--accent); transform: translateY(-1px); }
.algo-tab.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--accent);
}
.algo-tab.is-active small { color: #aeb8d0; }
.algo-tab:focus-visible { outline-offset: 2px; }

.course-table {
  overflow: hidden;
  border: 1.5px solid #aeb6c8;
  border-radius: 12px;
  background: #fff;
}
.course-head,
.course-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 100px 44px;
  gap: 8px;
  align-items: center;
}
.course-head {
  padding: 9px 12px;
  color: #687086;
  background: #eef1f8;
  border-bottom: 1px solid #c8cfdd;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .05em;
}
.course-head span:nth-child(2),
.course-head span:nth-child(3) { text-align: center; }
.course-list { display: grid; }
.course-row {
  position: relative;
  padding: 8px 10px;
  border-bottom: 1px solid #e3e7f0;
  transition: background .15s ease;
}
.course-row:last-child { border-bottom: 0; }
.course-row:hover { background: #f8faff; }
.course-row.is-invalid { background: #fff2ed; }
.course-field { min-width: 0; }
.course-field input {
  min-height: 42px;
  padding: 8px 10px;
  background: #fbfcff;
  border-color: #c4cbda;
  border-radius: 7px;
  font-size: 12.5px;
}
.course-field input:focus { background: #fff; }
.course-name-field input { font-weight: 600; }
.credit-field input,
.grade-field input { text-align: center; font-family: var(--font-mono); }
.grade-field input { letter-spacing: .015em; }
.mobile-field-label { display: none; }
.course-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #7b8499;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.course-remove:hover { color: #fff; background: var(--warning); }
.course-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.course-count { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; }
.course-run-row { margin-top: 18px; }
.course-run-row .run-button { min-width: 190px; }
#formError { padding: 9px 11px; background: #fff0ea; border-radius: 7px; }
#formError[hidden] { display: none !important; }
#formNote { margin-top: 10px; color: var(--muted); font-weight: 500; }

/* Result card */
.gpa-result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3.4vw, 32px);
  color: #f7f5ef;
  background: #171c2a;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--accent);
}
.gpa-result-card::after {
  content: "";
  position: absolute;
  right: -86px;
  top: -106px;
  width: 210px;
  height: 210px;
  border: 32px solid var(--accent);
  border-radius: 50%;
  opacity: .2;
  pointer-events: none;
}
.result-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8e99b1;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .09em;
}
.result-topline span { display: flex; align-items: center; gap: 7px; }
.result-topline b { color: #aab8ff; font-weight: 600; }
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  background: #c8ff76;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(200, 255, 118, .13);
}
.result-caption {
  position: relative;
  z-index: 1;
  margin: 22px 0 4px;
  color: #bac2d4;
  font-size: 11px;
}
.result-number-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
#result {
  margin: 0;
  padding: 0;
  max-width: 100%;
  color: #fff;
  background: none;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: clamp(54px, 8vw, 78px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.075em;
  white-space: nowrap;
}
#result:empty::before { content: "—"; }
#resultScale { color: #98a3bb; font-family: var(--font-mono); font-size: 16px; }
.result-meter {
  position: relative;
  z-index: 1;
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  background: #343d52;
  border-radius: 100px;
}
.result-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #c8ff76);
  border-radius: inherit;
  transition: width .35s ease;
}
.result-hint {
  position: relative;
  z-index: 1;
  min-height: 34px;
  margin: 11px 0 0;
  color: #8f9ab1;
  font-size: 10.5px;
  line-height: 1.6;
}
.result-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  background: #343d52;
  border: 1px solid #343d52;
  border-radius: 10px;
}
.result-stats > div { min-width: 0; padding: 11px 9px; background: #202738; }
.result-stats span,
.result-stats small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8995ad; font-size: 8.5px; }
.result-stats strong {
  display: block;
  margin-block: 2px;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
}
.result-stats > div:first-child strong { color: #c8ff76; }
.result-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 13px;
  color: #78849d;
  font-size: 9px;
}

/* Method mini card */
.method-mini { padding: 22px; }
.mini-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.method-mini h3 { margin: 4px 0 8px; font-family: var(--font-display); font-size: 23px; letter-spacing: -.03em; }
.method-mini > p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.75; }
.scale-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.scale-preview span {
  padding: 5px 8px;
  color: #3d4760;
  background: #f0f3fa;
  border: 1px solid var(--soft-line);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

/* Method section */
.method-shell { margin-top: 50px; scroll-margin-top: 20px; }
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 20px;
  margin-top: 22px;
}
.method-table-card { padding: clamp(18px, 2.6vw, 26px); }
.method-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.method-table-head h3 { margin: 0; font-size: 16px; }
.method-table-head span { color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .06em; }
.method-table { font-variant-numeric: tabular-nums; }
.method-table th { padding: 8px 7px; color: #59627a; background: #f0f3fa; }
.method-table td { padding: 6px 7px; font-family: var(--font-mono); font-size: 11.5px; }
.method-table td + td,
.method-table th + th { text-align: center; }
.method-table td:last-child { color: var(--accent-dark); }
.method-table tbody tr:nth-child(-n+2) td { background: #f8faff; }
.method-table tbody tr:hover td { background: #edf1ff; }
.table-caption { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.grade-map-card { padding: clamp(20px, 3vw, 28px); align-self: start; }
.grade-map-card h3 { margin: 3px 0 13px; font-family: var(--font-display); font-size: 22px; line-height: 1.25; letter-spacing: -.03em; }
.grade-chip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.grade-chip-grid span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px;
  padding: 6px 7px;
  background: #f4f6fb;
  border: 1px solid #d8deea;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 8.5px;
}
.grade-chip-grid b { color: var(--accent-dark); font-size: 9.5px; }
.grade-map-card > p:not(.section-index) { margin: 14px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.honesty-note {
  margin-top: 14px;
  padding: 10px 11px;
  color: #42506e;
  background: #edf1fb;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  font-size: 10px;
  line-height: 1.65;
}

/* Premium */
.premium-zone { margin-top: 54px; scroll-margin-top: 20px; }
.premium-heading { margin-bottom: 22px; }
.premium-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 22px; }
.premium-work { min-width: 0; padding: clamp(21px, 3.2vw, 31px); }
.work-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.work-heading h3 { margin: 3px 0 0; font-family: var(--font-display); font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.lock-note { color: #283d98; background: #edf0ff; border-left-color: var(--accent); }
.semester-manager { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; margin-top: 17px; }
.semester-manager .field { min-width: 0; }
.semester-name-field { margin-top: 12px; }
.semester-name-row { display: flex; gap: 8px; align-items: stretch; }
.semester-name-row input { flex: 1; min-width: 0; }
.semester-name-row .button { flex: 0 0 auto; }
.semester-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.semester-status { min-height: 35px; margin: 13px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.semester-summary { display: grid; gap: 6px; margin-top: 4px; }
.semester-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  background: #f5f7fb;
  border: 1px solid #dde3ee;
  border-radius: 7px;
  font-size: 10px;
}
.semester-summary-row.is-active { background: #edf1ff; border-color: #b8c4ea; }
.semester-summary-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.semester-summary-row span { color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; }
.semester-summary-row b { color: var(--accent-dark); font-family: var(--font-mono); font-size: 11px; }
.premium-footnote { margin: 12px 0 0; color: #858da0; font-size: 9px; line-height: 1.6; }

.compare-intro { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.compare-table-wrap { margin-top: 16px; border: 1px solid #d4dbe8; border-radius: 9px; }
.compare-table { font-variant-numeric: tabular-nums; }
.compare-table th { padding: 8px 9px; background: #f0f3fa; }
.compare-table td { padding: 8px 9px; font-size: 11px; }
.compare-table td:first-child { font-weight: 650; }
.compare-table td:nth-child(2) { color: var(--accent-dark); font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.compare-table td:nth-child(3) { color: var(--muted); font-size: 9px; }
.compare-table tr.is-wes td:nth-child(2) { color: #16745d; }
.compare-button { margin-top: 14px; }
.compare-status { min-height: 17px; margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.compare-note { margin: 13px 0 0; padding-top: 12px; color: #69728a; border-top: 1px dashed var(--soft-line); font-size: 9.5px; line-height: 1.7; }
.compare-note strong { color: var(--ink); }
body:not(.is-premium) .semester-summary { opacity: .58; }
body:not(.is-premium) .compare-table tbody { opacity: .55; }

/* FAQ and unlock accent */
.gpa-faq details[open] { background: #fbfcff; }
.gpa-faq details[open] summary { background: #f1f4fb; }
.unlock-section { margin-top: 50px; }
.premium-map ul { margin-bottom: 22px; }
.referral-card { box-shadow: 7px 7px 0 var(--accent); }

@media (max-width: 1000px) {
  .hero-transcript { transform: none; }
  .gpa-tool { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); }
  .method-grid { grid-template-columns: 1fr; }
  .grade-map-card { max-width: none; }
  .grade-chip-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .gpa-hero { grid-template-columns: 1fr; }
  .hero-transcript { width: min(100%, 480px); justify-self: start; }
  .gpa-tool { grid-template-columns: 1fr; }
  .gpa-result-card { box-shadow: 6px 6px 0 var(--accent); }
  .premium-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr); }
}

@media (max-width: 700px) {
  .gpa-hero { gap: 36px; padding-top: 42px; padding-bottom: 50px; }
  .gpa-hero h1 { font-size: clamp(45px, 13.5vw, 66px); }
  .gpa-hero h1 em { white-space: normal; }
  .side-stack { grid-template-columns: 1fr; }
  .method-shell,
  .premium-zone { margin-top: 42px; }
  .hero-note { font-size: 10.5px; }
  .hero-transcript { padding: 16px; box-shadow: 7px 7px 0 var(--accent); }
  .course-card { padding: 20px; }
  .grade-chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .algo-switch { grid-template-columns: 1fr; gap: 7px; }
  .algo-tab { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 48px; padding: 9px 11px; }
  .algo-tab small { text-align: right; }
  .course-head { display: none; }
  .course-list { gap: 7px; padding: 8px; background: #f6f8fc; }
  .course-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    grid-template-areas:
      "name name remove"
      "credit grade remove";
    gap: 6px 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #d6ddea;
    border-radius: 8px;
  }
  .course-row:last-child { border-bottom: 1px solid #d6ddea; }
  .course-name-field { grid-area: name; }
  .credit-field { grid-area: credit; }
  .grade-field { grid-area: grade; }
  .course-remove { grid-area: remove; align-self: stretch; height: auto; }
  .mobile-field-label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: .04em;
  }
  .course-field input { min-height: 44px; padding: 7px 9px; background: #fbfcff; }
  .credit-field input,
  .grade-field input { text-align: left; }
  .course-count { width: 100%; margin-left: 0; text-align: right; }
  .semester-manager { grid-template-columns: 1fr; }
  .semester-manager .button { width: 100%; }
  .semester-name-row { flex-direction: column; }
  .semester-name-row .button { width: 100%; }
  .semester-actions .button { flex: 1 1 100%; }
  .result-stats strong { font-size: 17px; }
}

@media (max-width: 400px) {
  .gpa-hero h1 { font-size: clamp(41px, 13vw, 54px); }
  .transcript-rows > div { grid-template-columns: minmax(0, 1fr) 30px 45px 35px; gap: 6px; font-size: 9.5px; }
  .transcript-total strong { font-size: 17px; }
  .course-card { padding: 17px; }
  .course-run-row .run-button { min-width: 100%; }
  .course-run-row .button { width: 100%; }
  .result-stats { gap: 0; }
  .result-stats > div { padding-inline: 7px; }
  .result-stats strong { font-size: 16px; }
  .grade-chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
