:root {
  --ink: #071a2a;
  --muted: #607181;
  --paper: #f3f6f6;
  --card: rgba(255, 255, 255, 0.82);
  --line: #d9e0e1;
  --teal: #17b89a;
  --teal-dark: #087c6b;
  --lime: #c9f45b;
  --navy: #0b2639;
  --shadow: 0 22px 60px rgba(8, 29, 45, 0.1);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  line-height: 1.5;
  max-width: 100%;
  overflow-x: clip;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button, select, input, label { touch-action: manipulation; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}
.ambient-one {
  width: 480px;
  height: 480px;
  top: -210px;
  right: -130px;
  background: radial-gradient(circle, rgba(201,244,91,.36), rgba(201,244,91,0) 68%);
}
.ambient-two {
  width: 520px;
  height: 520px;
  top: 460px;
  left: -340px;
  background: radial-gradient(circle, rgba(23,184,154,.14), rgba(23,184,154,0) 68%);
}

.site-header, main, footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}
.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 11px 11px 11px 3px;
}
.ghost-button, .share-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 17px;
  color: var(--ink);
  background: rgba(255,255,255,.58);
  font-weight: 700;
  transition: .2s ease;
}
.ghost-button:hover, .share-button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.hero {
  min-height: 550px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  align-items: center;
  gap: 80px;
  padding: 60px 5% 80px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.55)),
    linear-gradient(45deg, #e8f7f1, #f8f9ee);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.85);
  overflow: hidden;
}
.hero > * { min-width: 0; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2 { font-family: "Manrope", sans-serif; }
h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  line-height: .96;
  letter-spacing: -.065em;
}
h1 span { color: var(--teal-dark); }
.hero-description {
  max-width: 590px;
  margin: 28px 0 34px;
  color: var(--muted);
  font-size: 1.08rem;
}
.hero-meta {
  display: flex;
  gap: 38px;
}
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta strong { font: 800 1.3rem "Manrope", sans-serif; }
.hero-meta span { color: var(--muted); font-size: .83rem; }

.score-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 34px;
  color: white;
  background:
    radial-gradient(circle at 90% 0%, rgba(201,244,91,.18), transparent 36%),
    var(--navy);
  border-radius: 26px;
  box-shadow: 0 25px 48px rgba(5,28,43,.24);
}
.score-label { color: #a9becb; font-weight: 600; }
.score-value {
  margin-top: 14px;
  font: 800 clamp(4.5rem, 8vw, 7.5rem)/.95 "Manrope", sans-serif;
  letter-spacing: -.08em;
}
.score-scale { color: #a9becb; text-align: right; }
.progress-track {
  height: 8px;
  margin: 27px 0 18px;
  overflow: hidden;
  background: rgba(255,255,255,.13);
  border-radius: 99px;
}
.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  border-radius: inherit;
  transition: width .4s ease;
}
.score-detail {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #c2d0d8;
  font-size: .83rem;
}
.score-detail b { color: white; }
.score-message {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: var(--lime);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.calculator { padding: 100px 0 55px; }
.pathway-panel {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 46px;
  margin-bottom: 76px;
  padding: 38px 42px;
  background: white;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.pathway-panel h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.pathway-panel p:last-child { margin-bottom: 0; color: var(--muted); }
.pathway-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pathway-toggle label { position: relative; cursor: pointer; }
.pathway-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pathway-toggle span {
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  transition: .2s ease;
}
.pathway-toggle small { color: var(--muted); }
.pathway-toggle input:checked + span {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: 0 12px 28px rgba(11,38,57,.2);
}
.pathway-toggle input:checked + span small { color: var(--lime); }
.pathway-toggle input:focus-visible + span { outline: 3px solid rgba(23,184,154,.3); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -.04em;
}
.toolbar { display: flex; align-items: center; gap: 10px; }
.search-box input {
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 17px;
  color: var(--ink);
  background: white;
  outline: none;
}
.search-box input:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(23,184,154,.12);
}
.share-button { color: white; background: var(--ink); border-color: var(--ink); }
.legend {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: .78rem;
}
.legend span {
  padding: 5px 10px;
  background: white;
  border-radius: 99px;
}
.legend span:first-child { padding-left: 0; background: transparent; font-weight: 700; }

.module-group { margin-bottom: 44px; }
.group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}
.group-code {
  padding: 5px 9px;
  color: white;
  background: var(--teal-dark);
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 800;
}
.term-group .group-code { min-width: 86px; text-align: center; }
.term-green .group-code { color: #194b31; background: #c7efad; }
.term-violet .group-code { color: #66345f; background: #edc7e9; }
.term-blue .group-code { color: #12516a; background: #bce5f4; }
.term-peach .group-code { color: #7a4937; background: #f7d7c5; }
.term-yellow .group-code { color: #655300; background: #f5e66e; }
.group-title { font: 800 1.16rem "Manrope", sans-serif; }
.group-credits { margin-left: auto; color: var(--muted); font-size: .8rem; }
.module-list {
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 20px;
  box-shadow: 0 9px 30px rgba(8,29,45,.055);
}
.module-row {
  display: grid;
  grid-template-columns: 48px minmax(230px, 1fr) 75px 155px;
  align-items: center;
  min-height: 76px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
}
.module-row:last-child { border-bottom: 0; }
.module-row:hover { background: white; }
.module-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: #e5f6f2;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 800;
}
.module-name { padding-right: 20px; font-weight: 700; line-height: 1.25; }
.module-name small { display: block; margin-top: 5px; }
.pf-badge { color: var(--teal-dark); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.exam-badge {
  width: fit-content;
  padding: 3px 8px;
  color: #8a3f23;
  background: #ffeadc;
  border: 1px solid #f5c5aa;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.module-code, .module-credit { color: var(--muted); font-size: .78rem; }
.module-credit b { color: var(--ink); font-size: .95rem; }
.grade-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 34px 9px 11px;
  color: var(--ink);
  background: white;
  font-weight: 700;
  outline: none;
}
.grade-select:focus { border-color: var(--teal-dark); }
.grade-select.pass-fail { color: var(--teal-dark); background: #ecfaf6; border-color: #bce8dc; }
.term-summary {
  display: flex;
  justify-content: flex-end;
  gap: 46px;
  padding: 19px 24px;
  color: white;
  background: var(--navy);
}
.term-summary span { min-width: 125px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.term-summary small { color: #a9becb; font-size: .72rem; font-weight: 700; }
.term-summary b { color: var(--lime); font: 800 1.2rem "Manrope", sans-serif; }
.empty-state { padding: 60px; text-align: center; color: var(--muted); }

.planning-tools { padding: 55px 0 45px; }
.tools-heading { max-width: 650px; margin-bottom: 30px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-card {
  min-width: 0;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: white;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(8,29,45,.07);
}
.tool-card h3 { margin: 18px 0 7px; font: 800 1.3rem "Manrope", sans-serif; }
.tool-card > p { min-height: 48px; margin: 0 0 22px; color: var(--muted); font-size: .88rem; }
.tool-number { color: var(--teal-dark); font: 800 .72rem "Manrope", sans-serif; letter-spacing: .12em; }
.field-label { margin: 12px 0 6px; color: var(--muted); font-size: .74rem; font-weight: 700; }
.tool-card input, .tool-card select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
.tool-card input:focus, .tool-card select:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgba(23,184,154,.12); }
.target-control { display: flex; align-items: center; gap: 9px; }
.target-control input { font: 800 1.35rem "Manrope", sans-serif; }
.target-control span { color: var(--muted); white-space: nowrap; }
.tool-result {
  margin-top: auto;
  padding: 16px;
  color: var(--ink);
  background: #eff9f5;
  border-left: 3px solid var(--teal);
  border-radius: 4px 12px 12px 4px;
  font-size: .84rem;
  font-weight: 700;
}
.tool-result strong { color: var(--teal-dark); font-size: 1.05rem; }
.tool-button {
  display: grid;
  place-items: center;
  min-height: 47px;
  margin-top: 11px;
  padding: 10px 14px;
  border: 1px solid var(--navy);
  border-radius: 11px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: .2s ease;
}
.tool-button:hover { transform: translateY(-1px); }
.tool-button.primary { color: white; background: var(--navy); }
.tool-button.secondary { color: var(--navy); background: white; }
.backup-card small { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: .7rem; }

.validation-panel {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 56px;
  margin: 50px 0 100px;
  padding: 46px 50px;
  color: white;
  background: var(--navy);
  border-radius: 28px;
}
.validation-heading h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.validation-heading > p:last-child { margin-top: 18px; color: #a9becb; }
.validation-list { display: grid; gap: 11px; }
.validation-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px 16px;
  color: #d8e3e8;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  font-size: .82rem;
}
.validation-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #bce5f4;
  border-radius: 50%;
  font-size: .73rem;
  font-weight: 900;
}
.validation-item.success .validation-icon { background: var(--lime); }
.validation-item.warning .validation-icon { background: #ffc59f; }
.validation-item strong { color: white; }
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 45px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}
.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.visitor-counter img {
  display: block;
  height: 20px;
  width: auto;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 10;
  padding: 11px 18px;
  color: white;
  background: var(--ink);
  border-radius: 99px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.tool-card input.sr-only {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 46px; padding: 65px 7%; }
  .score-card { max-width: 520px; }
  .validation-panel { grid-template-columns: 1fr; gap: 30px; }
  .pathway-panel { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .tool-card > p { min-height: 0; }
  .tool-result, .backup-card small { margin-top: 24px; }
  .module-row { grid-template-columns: 40px 1fr 120px; padding: 14px; }
  .module-credit { display: none; }
  .grade-select { grid-column: 3; grid-row: 1; }
}
@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 66px;
    padding: 8px 0;
    background: rgba(243,246,246,.9);
    backdrop-filter: blur(14px);
  }
  .brand { font-size: .9rem; }
  .brand-mark { width: 32px; height: 32px; }
  .ghost-button { min-height: 44px; padding: 8px 13px; font-size: .75rem; }
  .hero { min-height: 0; padding: 52px 22px; border-radius: 24px; }
  h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .hero-description { margin: 22px 0 28px; font-size: .98rem; }
  .hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .hero-meta strong { font-size: 1.12rem; }
  .hero-meta span { font-size: .7rem; }
  .score-card { width: 100%; max-width: 100%; padding: 26px 22px; }
  .score-value { font-size: 4.8rem; }
  .score-detail { flex-direction: column; gap: 4px; }
  .calculator { padding-top: 70px; }
  .pathway-panel { padding: 28px 20px; margin-bottom: 60px; }
  .pathway-toggle { grid-template-columns: 1fr; }
  .pathway-toggle span { min-height: 80px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box input { width: 100%; }
  .group-header { flex-wrap: wrap; }
  .group-title { font-size: .96rem; }
  .module-row {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 0;
    gap: 4px 8px;
    padding: 16px 14px;
  }
  .module-number { grid-column: 1; grid-row: 1; }
  .module-name { grid-column: 2; grid-row: 1; min-width: 0; padding-right: 0; font-size: .9rem; overflow-wrap: anywhere; }
  .module-credit { display: none; }
  .grade-select {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 46px;
    margin-top: 9px;
    padding: 10px 12px;
    font-size: .86rem;
  }
  .term-summary { justify-content: space-between; gap: 14px; padding: 17px 14px; }
  .term-summary span { min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; }
  .group-credits { display: none; }
  .legend { gap: 6px; }
  .legend span { padding: 5px 8px; }
  .planning-tools { padding-top: 38px; }
  .tool-card { padding: 23px 20px; border-radius: 18px; }
  .tool-card input, .tool-card select, .tool-button { min-height: 48px; }
  .validation-panel { margin-bottom: 65px; padding: 35px 22px; }
  footer { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media (max-width: 380px) {
  .site-header, main, footer { width: min(100% - 16px, 1180px); }
  .brand span:last-child { display: none; }
  .hero { padding: 42px 17px; }
  h1 { font-size: 2.8rem; }
  .score-card { padding: 23px 18px; }
  .pathway-panel { padding: 25px 16px; }
  .tool-card { padding-inline: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
