/* Course GPA — Quick (easy.html) only. Loads after site.css.
   Mobile first: pinned result head, list, target card, fixed action bar.
   ≥ 900px: two columns, sticky result card on the right. */

/* —— Page —— */
.easy-body .tool-page {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}
.easy-body .tool-page h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.45rem, 2.4vw, 1.7rem);
  letter-spacing: -0.374px;
}
.easy-body .tool-page .lead {
  margin: 0 0 1rem;
  color: var(--ink-muted-80);
  font-size: 17px;
  line-height: 1.35;
}

/* —— Inputs (artboard: 44px, radius 11, hairline) —— */
.easy-body .field input,
.easy-body .field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
.easy-body .field select {
  padding-right: 8px;
}
.easy-body .field input:focus,
.easy-body .field select:focus {
  border-color: var(--primary);
}
.easy-body .field input::placeholder {
  color: var(--ink-muted-48);
}
.easy-body .field-credits input,
.easy-body .prior-row input,
.easy-body .target-pair input {
  font-variant-numeric: tabular-nums;
}

/* —— Panel head + segmented control —— */
.easy-body .panel {
  margin: 0;
  padding: 0.85rem 1rem 0.9rem;
}
.easy-body .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0 0.6rem;
}
.easy-body .panel-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.374px;
}
.easy-body .segmented {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 0;
  border-radius: var(--pill);
  background: var(--parchment);
  min-inline-size: 0;
}
.easy-body .segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.easy-body .segmented label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--pill);
  color: var(--ink-muted-80);
  font-size: 14px;
  letter-spacing: -0.224px;
  cursor: pointer;
  user-select: none;
}
.easy-body .segmented input:checked + label {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--hairline);
}
.easy-body .segmented input:focus-visible + label {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}

/* —— Course rows —— */
.easy-body .courses {
  gap: 0;
  margin: 0;
  min-height: 12.2rem; /* three sample rows: no first-paint shift */
}
.easy-body .course-head,
.easy-body .course {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 3.5rem 2.75rem;
  gap: 0.35rem 0.5rem;
  align-items: center;
}
.easy-body .course-head {
  padding: 0 0 0.35rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted-48);
  font-size: 12px;
  letter-spacing: -0.12px;
}
.easy-body .course {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
}
.easy-body .course:last-child {
  border-bottom: 0;
  padding-bottom: 0.4rem;
}
.easy-body .course .field label,
.easy-body .course .field .score-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.easy-body .course .field {
  min-width: 0;
}
.easy-body .field-weight,
.easy-body .col-type,
.easy-body .field-qp,
.easy-body .col-pts {
  display: none;
}
.quick[data-method="weighted"] .field-weight {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 1 / 4;
}
.quick[data-method="weighted"] .field-weight label {
  position: static;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}
.easy-body .qp {
  min-height: 44px;
  font-size: 17px;
  letter-spacing: -0.374px;
}
.easy-body .qp[data-empty="true"] {
  color: var(--ink-muted-48);
}
.easy-body .btn-remove {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--pill);
  color: var(--ink-muted-48);
  font-size: 22px;
  line-height: 1;
}
.easy-body .btn-remove:disabled {
  visibility: hidden;
  pointer-events: none;
}

/* —— Actions, notice, prior —— */
.easy-body .tool-actions {
  margin: 0.15rem 0 0;
  gap: 0 1rem;
}
.easy-body .tool-actions .btn-plain {
  min-height: 44px;
  padding: 0 0.15rem;
  font-size: 14px;
  letter-spacing: -0.224px;
}
.easy-body .tool-actions .btn-plain[hidden] {
  display: none;
}
.easy-body .save-hint,
.easy-body .notice {
  margin-inline-start: auto;
}
.easy-body .notice {
  margin-block: 0;
  color: var(--ink-muted-80);
  font-size: 14px;
  letter-spacing: -0.224px;
}
.easy-body .notice[hidden] {
  display: none;
}
.easy-body .tool-actions.has-notice .save-hint {
  display: none;
}
.easy-body .btn-link {
  min-height: 44px;
  padding: 0 0.15rem;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  letter-spacing: -0.224px;
  cursor: pointer;
}
.easy-body .btn-link[hidden] {
  display: none;
}
.easy-body .prior-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--hairline);
}

/* —— Result: mobile (pinned head, card, fixed bar) —— */
.easy-body .tool-split {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.easy-body .tool-side {
  display: contents;
}
.easy-body .result-head {
  order: -1;
  position: sticky;
  top: 52px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 -1rem;
  padding: 0.7rem 1rem 0.6rem;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.easy-body .result-main,
.easy-body .result-need {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.easy-body .result-need {
  align-items: flex-end;
  text-align: right;
  padding-bottom: 0.2rem;
}
.easy-body .result-need[hidden] {
  display: none;
}
.easy-body .score-label {
  margin-bottom: 0;
}
.easy-body .score-value {
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.easy-body .score-value[data-empty="true"] {
  color: var(--ink-muted-48);
  font-weight: 600;
}
.easy-body .formula-line {
  margin: 0.1rem 0 0;
  color: var(--ink-muted-80);
  font-size: 12px;
  letter-spacing: -0.12px;
}
.easy-body .formula-line[hidden] {
  display: none;
}
.easy-body .cum-line b {
  font-weight: 600;
}
.easy-body .need-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.easy-body .result-need[data-state="impossible"] .need-value {
  color: var(--err);
}
.easy-body .need-sub {
  color: var(--ink-muted-80);
  font-size: 12px;
  letter-spacing: -0.12px;
}

.easy-body .result-body {
  order: 1;
  padding: 0.9rem 1rem 1rem;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.easy-body .target-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.easy-body .whatif {
  margin: 0.7rem 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.374px;
}
.easy-body .whatif b {
  font-weight: 600;
}
.easy-body .whatif[data-state="idle"] {
  color: var(--ink-muted-48);
  font-size: 14px;
  letter-spacing: -0.224px;
}
.easy-body .whatif[data-state="impossible"] b {
  color: var(--err);
}

.easy-body .result-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  gap: 0.65rem;
  padding: 0.6rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
}
.easy-body .result-actions .btn {
  flex: 1;
  min-height: 44px;
  font-size: 17px;
}
.easy-body .btn-quiet {
  background: var(--canvas);
  color: var(--primary);
  border-color: var(--hairline);
}
.easy-body {
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 899px) {
  /* focus scrolling clears the pinned head and the fixed action bar */
  html {
    scroll-padding: calc(52px + 8rem) 0 5rem;
  }
}

/* —— ≥ 600px: points column back, type inline —— */
@media (min-width: 600px) {
  .easy-body .field-qp,
  .easy-body .col-pts {
    display: block;
  }
  .easy-body .course-head,
  .easy-body .course {
    grid-template-columns: minmax(0, 1.3fr) 6.5rem 5rem 4rem 2.75rem;
  }
  .quick[data-method="weighted"] .col-type {
    display: block;
  }
  .quick[data-method="weighted"] .field-weight {
    grid-column: auto;
  }
  .quick[data-method="weighted"] .field-weight label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .quick[data-method="weighted"] .course-head,
  .quick[data-method="weighted"] .course {
    grid-template-columns: minmax(0, 1.2fr) 6.5rem 5rem 6.5rem 4rem 2.75rem;
  }
}

/* —— ≥ 900px: two columns, sticky result card —— */
@media (min-width: 900px) {
  html {
    scroll-padding-top: 4rem;
  }
  .easy-body .tool-page {
    padding-top: 1.5rem;
  }
  .easy-body .tool-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22.5rem;
    gap: 1.5rem;
    align-items: start;
  }
  .easy-body .panel {
    padding: 0.9rem 1.15rem 0.9rem;
  }
  .easy-body .panel-title {
    color: var(--ink-muted-48);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.12px;
  }
  .easy-body .segmented label {
    min-height: 32px;
    padding: 0 12px;
  }
  .easy-body .course-head,
  .easy-body .course {
    grid-template-columns: minmax(0, 1.6fr) 7.5rem 6.75rem 4rem 2.75rem;
    gap: 0.35rem 0.75rem;
  }
  .quick[data-method="weighted"] .course-head,
  .quick[data-method="weighted"] .course {
    grid-template-columns: minmax(0, 1.4fr) 7.5rem 6.75rem 7rem 4rem 2.75rem;
  }
  .easy-body .tool-actions .btn-plain,
  .easy-body .btn-link {
    min-height: 36px;
  }

  .easy-body .tool-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: calc(52px + 1.25rem);
    padding: 1.25rem 1.35rem 1.3rem;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
  }
  .easy-body .result-head {
    order: 0;
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }
  .easy-body .result-need {
    display: none;
  }
  .easy-body .score-value {
    font-size: 3.5rem;
  }
  .easy-body .formula-line {
    margin-top: 0.15rem;
    font-size: 14px;
    letter-spacing: -0.224px;
  }
  .easy-body .result-body {
    order: 0;
    margin-top: 1.1rem;
    padding: 1.1rem 0 0;
    border: 0;
    border-top: 1px solid var(--hairline);
    border-radius: 0;
  }
  .easy-body .result-actions {
    position: static;
    margin-top: 1.1rem;
    padding: 1.1rem 0 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    border-top: 1px solid var(--hairline);
  }
  .easy-body .result-actions .btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 18px;
    font-size: 15px;
  }
  .easy-body {
    padding-bottom: 0;
  }
}

@media (hover: hover) and (pointer: fine) {
  .easy-body .btn-remove:hover {
    color: var(--ink);
    text-decoration: none;
  }
  .easy-body .btn-quiet:hover {
    background: var(--pearl);
  }
  .easy-body .segmented label:hover {
    color: var(--ink);
  }
}

/* —— Print: list + result only —— */
@media print {
  .site-head,
  .site-foot,
  .skip,
  .noscript,
  .easy-body .result-actions,
  .easy-body .result-need,
  .easy-body .tool-actions,
  .easy-body .segmented,
  .easy-body .course:not(.is-filled),
  .easy-body .btn-remove,
  .easy-body .faq {
    display: none !important;
  }
  .easy-body {
    background: var(--canvas);
    padding-bottom: 0;
  }
  .easy-body .tool-split {
    display: block;
  }
  .easy-body .tool-side {
    display: block;
    position: static;
    margin-top: 1rem;
    padding: 0;
    border: 0;
  }
  .easy-body .result-head {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .easy-body .result-body {
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
  }
  .easy-body .panel,
  .easy-body .prose {
    break-inside: avoid;
  }
}
