.gpa-shell {
  width: min(1080px, calc(100% - 32px));
}

.gpa-shell .mort-layout {
  gap: 16px;
}

.gpa-shell .gpa-form {
  display: grid;
  gap: 14px;
}

.gpa-shell .gpa-course-table-wrap {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #ffffff;
  overflow-x: auto;
  padding: 10px;
}

.gpa-shell .gpa-course-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.gpa-shell .gpa-course-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 4px 8px;
}

.gpa-shell .gpa-course-table td {
  padding: 0 8px;
  vertical-align: middle;
}

.gpa-shell .gpa-course-table td .gpa-inline-affix,
.gpa-shell .gpa-course-table td input,
.gpa-shell .gpa-course-table td select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  padding: 0 10px;
  box-sizing: border-box;
}

.gpa-shell .gpa-course-table td input:focus,
.gpa-shell .gpa-course-table td select:focus {
  outline: none;
  border-color: #2f6fdf;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.gpa-shell .gpa-inline-affix {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  padding: 0;
}

.gpa-shell .gpa-inline-affix input {
  border: 0;
  border-radius: 0;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  min-width: 0;
}

.gpa-shell .gpa-inline-affix span {
  min-width: 38px;
  border-left: 1px solid #c8d3e7;
  background: #f4f7fd;
  color: #0f2454;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.gpa-shell .gpa-col-actions {
  width: 1%;
  white-space: nowrap;
}

.gpa-shell .gpa-remove-course {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.gpa-shell .gpa-remove-course:hover,
.gpa-shell .gpa-remove-course:focus-visible {
  border-color: #2f6fdf;
  color: #1f5cc9;
}

.gpa-shell .gpa-grade-field {
  display: none;
}

.gpa-mode-letter .gpa-grade-field-letter,
.gpa-mode-percentage .gpa-grade-field-percentage,
.gpa-mode-points .gpa-grade-field-points {
  display: block;
}

.gpa-weighted-off .gpa-col-level {
  display: none;
}

.gpa-terms-off .gpa-col-term {
  display: none;
}

.gpa-shell .gpa-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gpa-shell .gpa-link-btn {
  border: 0;
  background: transparent;
  color: #1f5cc9;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.gpa-shell .gpa-link-btn:hover,
.gpa-shell .gpa-link-btn:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gpa-shell .gpa-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gpa-shell .gpa-btn {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

.gpa-shell .gpa-btn:hover,
.gpa-shell .gpa-btn:focus-visible {
  border-color: #2f6fdf;
}

.gpa-shell .gpa-btn-primary {
  border-color: #1b56c0;
  background: #1b56c0;
  color: #ffffff;
}

.gpa-shell .gpa-btn-primary:hover,
.gpa-shell .gpa-btn-primary:focus-visible {
  border-color: #1b56c0;
  background: #1b56c0;
  opacity: 0.92;
}

.gpa-shell .gpa-settings {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #fcfdff;
  padding: 10px 12px;
}

.gpa-shell .gpa-settings > summary {
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gpa-shell .gpa-settings > summary::-webkit-details-marker {
  display: none;
}

.gpa-shell .gpa-settings > summary::after {
  content: '▾';
  color: #64748b;
  font-size: 13px;
  transition: transform 0.16s ease;
}

.gpa-shell .gpa-settings[open] > summary::after {
  transform: rotate(180deg);
}

.gpa-shell .gpa-settings-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gpa-shell .gpa-settings-grid label {
  display: grid;
  gap: 6px;
}

.gpa-shell .gpa-settings-grid label span {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.gpa-shell .gpa-settings-grid select,
.gpa-shell .gpa-settings-grid input {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  padding: 0 10px;
  box-sizing: border-box;
}

.gpa-shell .gpa-settings-grid select:focus,
.gpa-shell .gpa-settings-grid input:focus {
  outline: none;
  border-color: #2f6fdf;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.gpa-shell .gpa-course-table td select,
.gpa-shell .gpa-settings-grid select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rp-select-chevron-color, #334155) 50%),
    linear-gradient(135deg, var(--rp-select-chevron-color, #334155) 50%, transparent 50%);
  background-position:
    calc(100% - var(--rp-select-chevron-right, 18px)) 50%,
    calc(100% - var(--rp-select-chevron-right-inner, 13px)) 50%;
  background-size:
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px),
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px);
  background-repeat: no-repeat;
  padding-right: var(--rp-select-padding-right, 36px);
}

.gpa-shell .gpa-switch-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.gpa-shell .gpa-switch-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.gpa-shell .gpa-settings-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #64748b;
}

.gpa-weighted-off .gpa-weight-setting,
.gpa-past-off .gpa-past-setting {
  opacity: 0.55;
}

.gpa-shell .gpa-result-note {
  margin: 12px 0 0;
  color: #475569;
  font-size: 14px;
}

.gpa-shell .gpa-breakdown-wrap {
  margin-top: 12px;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  background: #ffffff;
  overflow-x: auto;
}

.gpa-shell .gpa-breakdown-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.gpa-shell .gpa-breakdown-table th,
.gpa-shell .gpa-breakdown-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}

.gpa-shell .gpa-breakdown-table th {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gpa-shell .gpa-breakdown-table tbody tr:last-child td {
  border-bottom: 0;
}

.gpa-shell .gpa-term-summary {
  margin-top: 12px;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.gpa-shell .gpa-term-summary h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.gpa-shell .gpa-term-summary ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.gpa-shell .gpa-term-summary li {
  margin: 0;
  font-size: 14px;
  color: #334155;
}

.gpa-shell .gpa-planning-card > p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #475569;
}

.gpa-shell .gpa-planning-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gpa-shell .gpa-planning-form label {
  display: grid;
  gap: 6px;
}

.gpa-shell .gpa-planning-form label span {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.gpa-shell .gpa-planning-form input {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  padding: 0 10px;
  box-sizing: border-box;
}

.gpa-shell .gpa-plan-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
}

.gpa-shell .gpa-plan-result-article {
  grid-column: 1 / -1;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.gpa-shell .gpa-plan-result-article h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #667085;
}

.gpa-shell .gpa-plan-result {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .gpa-shell .gpa-settings-grid {
    grid-template-columns: 1fr;
  }

  .gpa-shell .gpa-planning-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .gpa-shell {
    width: calc(100% - 22px);
    margin: 20px auto 42px;
  }

  .gpa-shell .mort-card {
    padding: 14px;
  }

  .gpa-shell .gpa-course-table-wrap {
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .gpa-shell .gpa-course-table {
    min-width: 0;
    border-spacing: 0;
  }

  .gpa-shell .gpa-course-table thead {
    display: none;
  }

  .gpa-shell .gpa-course-table tbody {
    display: grid;
    gap: 10px;
  }

  .gpa-shell .gpa-course-table tr[data-gpa-row] {
    display: block;
    border: 1px solid #dbe5f4;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
  }

  .gpa-shell .gpa-course-table td {
    display: block;
    margin: 0 0 12px;
    padding: 0;
  }

  .gpa-shell .gpa-course-table td.gpa-col-actions {
    width: auto;
    white-space: normal;
    margin-top: 4px;
    text-align: right;
  }

  .gpa-shell .gpa-course-table td:last-child {
    margin-bottom: 0;
  }

  .gpa-shell .gpa-course-table td::before {
    display: block;
    margin: 0 0 4px;
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    content: '';
  }

  .gpa-shell .gpa-course-table td:nth-child(1)::before {
    content: 'Course';
  }

  .gpa-shell .gpa-course-table td:nth-child(2)::before {
    content: 'Credits';
  }

  .gpa-shell .gpa-course-table td:nth-child(3)::before {
    content: 'Grade';
  }

  .gpa-shell .gpa-course-table td:nth-child(4)::before {
    content: 'Course level';
  }

  .gpa-shell .gpa-course-table td:nth-child(5)::before {
    content: 'Term';
  }

  .gpa-shell .gpa-course-table td.gpa-col-actions::before {
    display: none;
  }

  .gpa-shell .gpa-remove-course {
    display: inline-block;
    width: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    padding: 0;
    text-transform: lowercase;
  }

  .gpa-shell .gpa-remove-course::before {
    content: '- ';
  }

  .gpa-shell .gpa-remove-course:hover,
  .gpa-shell .gpa-remove-course:focus-visible {
    border: 0;
    color: #334155;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .gpa-weighted-off .gpa-course-table td.gpa-col-level {
    display: none;
  }

  .gpa-terms-off .gpa-course-table td.gpa-col-term {
    display: none;
  }

  .gpa-shell .gpa-breakdown-table {
    min-width: 0;
  }

  .gpa-shell .gpa-breakdown-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .gpa-shell .gpa-breakdown-table thead {
    display: none;
  }

  .gpa-shell .gpa-breakdown-table tbody {
    display: grid;
    gap: 10px;
  }

  .gpa-shell .gpa-breakdown-table tbody tr {
    display: block;
    border: 1px solid #dbe5f4;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
  }

  .gpa-shell .gpa-breakdown-table td {
    display: block;
    border: 0;
    margin: 0 0 8px;
    padding: 0;
    font-size: 15px;
  }

  .gpa-shell .gpa-breakdown-table td:last-child {
    margin-bottom: 0;
  }

  .gpa-shell .gpa-breakdown-table td::before {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    content: '';
  }

  .gpa-shell .gpa-result-note {
    font-size: 16px;
    line-height: 1.45;
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(1)::before {
    content: 'Course';
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(2)::before {
    content: 'Credits';
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(3)::before {
    content: 'Grade input';
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(4)::before {
    content: 'Grade points';
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(5)::before {
    content: 'Quality points';
  }

  .gpa-shell .gpa-breakdown-table td:nth-child(6)::before {
    content: 'Term';
  }

  .gpa-shell .gpa-breakdown-table td[colspan] {
    margin: 0;
    color: #64748b;
  }

  .gpa-shell .gpa-breakdown-table td[colspan]::before {
    display: none;
  }

  .gpa-terms-off .gpa-breakdown-table .gpa-breakdown-term {
    display: none !important;
  }

  .gpa-shell .gpa-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gpa-shell .gpa-action-btns {
    width: 100%;
  }

  .gpa-shell .gpa-btn {
    width: 100%;
    flex: 1 1 auto;
  }

  .gpa-shell .gpa-link-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .gpa-shell .gpa-planning-form {
    grid-template-columns: 1fr;
  }
}
