html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  --csu-green: #00693e;
  --csu-green-deep: #004225;
  --csu-gold: #ffd700;
  --csu-gold-soft: #f3e29a;
  --csu-ink: #183126;
  --csu-border: rgba(0, 105, 62, 0.14);
  --csu-surface: #fffdf4;
  --neo-border: #183126;
  background:
    linear-gradient(135deg, #ffe37a 0 16%, transparent 16% 100%),
    linear-gradient(315deg, #d8f0dd 0 14%, transparent 14% 100%),
    linear-gradient(180deg, #f7f1cf 0%, #f4eed3 100%);
  min-height: 100vh;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  color: var(--csu-ink);
  font-weight: 400;
}

.page-shell {
  min-height: 100vh;
}

.app-frame {
  max-width: 1120px;
}

.calculator-card {
  border: 3px solid var(--neo-border);
  border-radius: 28px;
  box-shadow: 10px 10px 0 #183126;
}

.eyebrow,
.section-label,
.highlight-label,
.result-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
}

.eyebrow,
.section-label,
.highlight-label,
.form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.calculator-card {
  background: var(--csu-surface);
  padding: 1.5rem;
}

.calculator-header,
.result-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.calculator-section,
.result-panel,
.site-footer {
  border-top: 1px solid var(--csu-border);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

.calculator-header {
  align-items: flex-start;
}

.eyebrow-csu {
  color: var(--csu-green);
}

.page-title {
  font-family: "Lora", Georgia, serif;
  color: var(--csu-green-deep);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-copy {
  max-width: 34rem;
  line-height: 1.55;
  font-size: 0.96rem;
  font-weight: 400;
}

.section-label {
  color: var(--csu-green);
  margin: 0;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  background: #fff;
  color: var(--csu-green-deep);
  border: 2px solid var(--neo-border);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 4px 4px 0 #183126;
}

.summary-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 105, 62, 0.15);
}

.form-label {
  font-weight: 500;
  color: var(--csu-green-deep);
  font-size: 0.9rem;
}

.form-feedback {
  min-height: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.storage-status {
  min-height: 1.25rem;
  color: #42584d;
  font-size: 0.83rem;
}

.form-feedback-success {
  color: var(--csu-green);
}

.form-feedback-error {
  color: #b42318;
}

.form-control {
  border-radius: 14px;
  border: 2px solid var(--neo-border);
  min-height: 50px;
  padding: 0.85rem 0.95rem;
  background: #fff;
}

.form-select {
  border-radius: 14px;
  border: 2px solid var(--neo-border);
  min-height: 50px;
  padding: 0.85rem 2.6rem 0.85rem 0.95rem;
  background-color: #fff;
}

.form-control:focus {
  border-color: var(--csu-gold);
  box-shadow: 4px 4px 0 #ffd700;
}

.form-select:focus {
  border-color: var(--csu-gold);
  box-shadow: 4px 4px 0 #ffd700;
}

.form-control[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 4px 4px 0 #fda29b;
}

.form-select[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 4px 4px 0 #fda29b;
}

.input-note {
  margin-top: 0.45rem;
  color: #5c6f65;
  font-size: 0.8rem;
  line-height: 1.5;
}

.btn {
  border-radius: 14px;
  font-weight: 600;
  min-height: 50px;
}

.btn-csu {
  background: var(--csu-gold);
  color: var(--csu-green-deep);
  border: 2px solid var(--neo-border);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  box-shadow: 4px 4px 0 #183126;
}

.btn-csu:hover,
.btn-csu:focus {
  background: #ffe55a;
  color: var(--csu-green-deep);
  box-shadow: 6px 6px 0 #183126;
  transform: translate(-1px, -1px);
}

.btn-add {
  min-width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-calculate {
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-export {
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-outline-csu {
  color: var(--csu-green);
  border: 2px solid var(--neo-border);
  background: #fff;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  box-shadow: 4px 4px 0 #183126;
}

.btn-outline-csu:hover,
.btn-outline-csu:focus {
  background: var(--csu-gold-soft);
  color: var(--csu-green-deep);
  border-color: var(--neo-border);
  box-shadow: 6px 6px 0 #183126;
  transform: translate(-1px, -1px);
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.stats-section {
  background: #f5f0d5;
  border: 2px solid var(--neo-border);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 6px 6px 0 #183126;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.stat-card {
  background: #fff;
  border: 2px solid var(--neo-border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 4px 4px 0 #183126;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7a73;
  margin-bottom: 0.4rem;
}

.stat-value {
  display: block;
  font-family: "Lora", Georgia, serif;
  color: var(--csu-green-deep);
  font-size: 1.35rem;
  line-height: 1.1;
}

.table-shell {
  background: #fff;
  border: 3px solid var(--neo-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 8px 8px 0 #183126;
}

.subjects-table-wrap {
  width: 100%;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: #ffe37a;
  border-bottom: 3px solid var(--neo-border);
}

.table-caption,
.table-note {
  font-size: 0.88rem;
}

.table-caption {
  font-weight: 600;
  color: var(--csu-green-deep);
}

.table-note {
  color: #66756d;
}

.csu-table {
  background: transparent;
  margin-bottom: 0;
}

.table-csu th {
  background: #d8f0dd !important;
  color: var(--csu-green-deep) !important;
  border: none;
  border-bottom: 2px solid var(--neo-border);
  padding: 0.95rem 0.75rem;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.csu-table td {
  border-color: rgba(24, 49, 38, 0.14);
  padding: 1rem 0.75rem;
  vertical-align: middle;
}

.subject-name {
  display: block;
  font-weight: 600;
  color: var(--csu-green-deep);
}

.subject-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.subject-meta {
  font-size: 0.78rem;
  color: #74847c;
}

.csu-table td {
  font-size: 0.96rem;
}

.table-chip,
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.table-chip {
  background: #d8f0dd;
  color: var(--csu-green-deep);
  border: 2px solid var(--neo-border);
}

.grade-badge {
  background: #ffe37a;
  color: #7a5a00;
  border: 2px solid var(--neo-border);
}

.csu-table tbody tr {
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.csu-table tbody tr:nth-child(even) {
  background: #fffcf1;
}

.csu-table tbody tr:hover {
  background: #fff2b8;
}

.editing-row {
  background: #ffe894 !important;
}

.edit-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.edit-field-compact {
  align-items: center;
}

.edit-label {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--neo-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--csu-green-deep);
}

.csu-table .form-control {
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 3px 3px 0 #183126;
}

.editing-row .form-control {
  background: #fffef7;
}

.editing-row .form-control:focus {
  box-shadow: 4px 4px 0 #183126;
}

.empty-row td {
  color: #61756c;
  padding: 1.5rem 1rem;
  font-style: italic;
}

.action-cell {
  width: 1%;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 2px solid var(--neo-border);
  border-radius: 999px;
  padding: 0.16rem;
}

.btn-row-action,
.btn-row-save {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  font-size: 0.78rem;
}

.btn-row-save {
  min-height: 32px;
}

.btn-row-action i,
.btn-row-save i {
  font-size: 0.78rem;
  line-height: 1;
}

.btn-row-action {
  border: 2px solid var(--neo-border);
  background: #fff;
  color: var(--csu-green-deep);
}

.btn-row-save {
  box-shadow: none;
}

.btn-row-action:hover,
.btn-row-action:focus {
  background: #f5f0d5;
  color: var(--csu-green-deep);
  border-color: var(--neo-border);
}

.btn-utility {
  min-height: 44px;
  padding: 0.7rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.result-panel {
  align-items: stretch;
  flex-wrap: wrap;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.result-card {
  flex: 1 1 100%;
  background: #fff;
  border: 3px solid var(--neo-border);
  border-radius: 22px;
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 8px 8px 0 #183126;
}

.result-kicker {
  color: #6c7b73;
}

.result-value {
  font-family: "Lora", Georgia, serif;
  color: var(--csu-green-deep);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.result-message {
  color: #52655d;
  line-height: 1.6;
  font-size: 0.95rem;
}

.motivation-board {
  flex: 1 1 100%;
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 1.15rem;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 215, 0, 0.3),
      transparent 42%
    ),
    #eef7ef;
  border: 3px solid var(--neo-border);
  border-radius: 22px;
  padding: 1.2rem 1.3rem;
  box-shadow: 8px 8px 0 #183126;
  overflow: hidden;
}

.motivation-glow {
  position: absolute;
  inset: auto -56px -56px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.22);
  filter: blur(6px);
  pointer-events: none;
}

.motivation-icon-shell {
  position: relative;
  z-index: 1;
  width: 72px;
  min-width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 3px solid var(--neo-border);
  background: linear-gradient(180deg, #fffef6 0%, #ffe37a 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 5px 5px 0 #183126;
}

.motivation-icon {
  font-size: 1.9rem;
  color: var(--csu-green-deep);
}

.motivation-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.motivation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.motivation-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--neo-border);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: #fff;
  color: var(--csu-green-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.motivation-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--neo-border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.82);
  color: #5d6f66;
  font-size: 0.78rem;
  font-weight: 600;
}

.motivation-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motivation-title {
  font-family: "Lora", Georgia, serif;
  color: var(--csu-green-deep);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.2;
}

.motivation-message {
  color: #4d6258;
  line-height: 1.65;
  font-size: 0.95rem;
}

.motivation-tip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 2px dashed rgba(24, 49, 38, 0.35);
  border-radius: 16px;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
  color: #42584d;
  font-size: 0.88rem;
  line-height: 1.55;
}

.motivation-board.is-honors {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 215, 0, 0.38),
      transparent 42%
    ),
    linear-gradient(135deg, #fff6c7, #e7f7dd);
}

.motivation-board.is-pass {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 215, 0, 0.3),
      transparent 42%
    ),
    #eef7ef;
}

.motivation-board.is-review {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 215, 0, 0.26),
      transparent 42%
    ),
    #fff5d7;
}

.motivation-board.is-attention {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 215, 0, 0.18),
      transparent 42%
    ),
    #ffe6d9;
}

.site-footer {
  background: #f5f0d5;
  border: 3px solid var(--neo-border);
  border-radius: 24px;
  padding: 1.3rem;
  box-shadow: 8px 8px 0 #183126;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.footer-block,
.footer-brand {
  background: #fff;
  border: 2px solid var(--neo-border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 4px 4px 0 #183126;
}

.footer-title {
  font-family: "Lora", Georgia, serif;
  color: var(--csu-green-deep);
  font-size: 1.2rem;
  line-height: 1.2;
}

.footer-copy,
.footer-note,
.footer-meta-copy {
  color: #51645c;
  line-height: 1.6;
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-text-link {
  color: var(--csu-green-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-text-link:hover,
.footer-text-link:focus {
  color: var(--csu-green);
}

.footer-link-button {
  padding: 0;
  border: none;
  background: transparent;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.social-link {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--csu-green);
  background: #fff;
  border: 2px solid var(--neo-border);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
  font-size: 1.2rem;
  box-shadow: 4px 4px 0 #183126;
}

.social-link:hover,
.social-link:focus {
  background: var(--csu-gold-soft);
  color: var(--csu-green-deep);
  transform: translateY(-2px);
}

a {
  color: var(--csu-green);
  font-weight: 600;
}

a:hover,
a:focus {
  color: var(--csu-green-deep);
}

:focus-visible {
  outline: 3px solid #183126;
  outline-offset: 3px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px dashed rgba(24, 49, 38, 0.25);
  margin-top: 1.2rem;
  padding-top: 1rem;
}

.modal-csu {
  border: 3px solid var(--neo-border) !important;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 8px 8px 0 #183126;
}

.modal-csu-header {
  background: var(--csu-green);
}

.text-csu-ink {
  color: var(--csu-ink);
}

.modal-body a {
  text-underline-offset: 0.18em;
}

.certificate-preview-body {
  background: linear-gradient(180deg, #fffdf4 0%, #f5f0d5 100%);
}

.certificate-preview-frame {
  background:
    radial-gradient(circle at top, rgba(255, 215, 0, 0.28), transparent 42%),
    #fff;
  border: 3px solid var(--neo-border);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 6px 6px 0 #183126;
}

.certificate-preview-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #fff;
}

@media (max-width: 991px) {
  .calculator-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-heading-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .calculator-card {
    border-radius: 22px;
  }

  .calculator-card {
    padding: 1.25rem;
  }

  .summary-pill,
  .result-panel {
    width: 100%;
  }

  .input-note {
    min-height: 0;
  }

  .summary-pill {
    justify-content: space-between;
  }

  .stats-section {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    border-radius: 18px;
    box-shadow: 5px 5px 0 #183126;
  }

  .subjects-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-toolbar {
    padding: 0.85rem 0.95rem;
  }

  .table-shell {
    min-width: 640px;
  }

  .csu-table {
    width: 100%;
  }

  .table-caption,
  .table-note {
    font-size: 0.82rem;
  }

  .site-footer {
    border-radius: 18px;
    box-shadow: 5px 5px 0 #183126;
    padding: 1rem;
  }

  .motivation-board {
    flex-direction: column;
    padding: 1rem;
    border-radius: 18px;
    box-shadow: 5px 5px 0 #183126;
  }

  .motivation-icon-shell {
    width: 64px;
    min-width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 4px 4px 0 #183126;
  }

  .motivation-header {
    align-items: flex-start;
  }

  .certificate-preview-frame {
    padding: 0.65rem;
    border-radius: 18px;
    box-shadow: 4px 4px 0 #183126;
  }

  .btn-calculate {
    width: 100%;
  }

  .result-actions {
    width: 100%;
  }

  .btn-export {
    width: 100%;
  }

  .csu-table th,
  .csu-table td {
    font-size: 0.92rem;
  }

  .calculator-card,
  .result-card,
  .motivation-board,
  .stats-section,
  .site-footer,
  .summary-pill,
  .stat-card,
  .footer-block,
  .footer-brand,
  .social-link {
    box-shadow: 4px 4px 0 #183126;
  }
}
