:root {
  --bg-accent: #1e3a52;
  --panel: rgba(255, 255, 255, 0.86);
  --text: #17302b;
  --muted: #4b5e5b;
  --line: rgba(23, 48, 43, 0.13);
  --brand: #1f7a63;
  --brand-dark: #0f4f44;
  --button-border: #05406e;
  --warm: #9f6a1b;
  --danger: #b24031;
  --shadow: 0 16px 38px rgba(16, 42, 37, 0.12);
  --radius: 24px;
  --section-gap: clamp(18px, 2vw, 24px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg-accent);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) 0 max(40px, env(safe-area-inset-bottom));
}

/* PDF Upload Styles */
.pdf-upload-panel {
  margin-bottom: var(--section-gap);
}

.pdf-upload-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pdf-upload-area {
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(31, 122, 99, 0.04);
}

.pdf-upload-area:hover {
  border-color: var(--brand-dark);
  background: rgba(31, 122, 99, 0.08);
}

.pdf-upload-area.drag-over {
  border-color: var(--brand-dark);
  background: rgba(31, 122, 99, 0.12);
  transform: scale(1.02);
}

.pdf-icon {
  width: 48px;
  height: 48px;
  color: var(--brand);
  margin: 0 auto 12px;
  opacity: 0.7;
}

.upload-text {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.upload-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pdf-upload-status {
  padding: 16px;
  background: rgba(31, 122, 99, 0.06);
  border-radius: 12px;
}

#uploadStatusText {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
}

.pdf-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(31, 122, 99, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.pdf-progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--brand);
  width: 100%;
  animation: progress-fill 0.6s ease;
}

@keyframes progress-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

.pdf-extracted-data {
  background: rgba(31, 122, 99, 0.08);
  border: 1px solid rgba(31, 122, 99, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

.pdf-data-summary {
  font-size: 14px;
  margin: 0;
  color: var(--text);
}

.pdf-data-summary strong {
  color: var(--brand);
}

.pdf-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.fireworks-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 1;
  animation: fireworks-explode linear forwards;
  will-change: transform, opacity;
}

@keyframes fireworks-explode {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--end-x, 0px), var(--end-y, 0px), 0) scale(0.5);
    opacity: 0;
  }
}

/* Premium Feature Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--panel);
  border: 2px solid rgba(31, 122, 99, 0.3);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: modal-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(31, 122, 99, 0.1);
  border-radius: 999px;
  font-size: 28px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(31, 122, 99, 0.15);
  transform: scale(1.1);
}

.modal-body {
  padding: 40px 32px;
  text-align: center;
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  animation: modal-pulse 2s ease-in-out infinite;
}

@keyframes modal-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.modal-title {
  font-family: "Fraunces", serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.modal-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}

.modal-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
}

.modal-tagline {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 24px;
  letter-spacing: 0.05em;
}

.modal-cta {
  display: inline-block;
  min-height: 48px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #f9fdfa;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(31, 122, 99, 0.3);
}

.modal-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(31, 122, 99, 0.4);
}

.modal-cta:active {
  transform: translateY(0);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: var(--section-gap);
  align-items: stretch;
  margin-bottom: var(--section-gap);
}

.hero-copy,
.hero-card,
.panel,
.semester-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(20px, 3vw, 28px);
}

.brand-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31, 122, 99, 0.1);
  border: 1px solid rgba(31, 122, 99, 0.18);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.brand-wordmark {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.94rem;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(31, 122, 99, 0.92), rgba(15, 79, 68, 0.95));
  color: #f7fbf8;
}

.hero-card ul {
  padding-left: 18px;
  margin: 16px 0 0;
}

.hero-card li + li {
  margin-top: 10px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--warm);
}

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(1.7rem, 3.8vw, 3rem);
  max-width: 16ch;
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.hero-text,
.note,
.trend-note {
  color: var(--muted);
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--section-gap);
  align-items: start;
}

.controls-panel {
  grid-column: span 5;
}

.pdf-upload-panel {
  grid-column: span 7;
}

.summary-panel {
  grid-column: span 8;
}

.scale-panel {
  grid-column: span 4;
}

.panel {
  padding: 24px;
}

.controls-panel .section-title {
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(15, 109, 86, 0.2);
  border-color: var(--brand);
}

.controls-actions,
.semester-actions,
.semester-header,
.semester-header-actions,
.trend-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.controls-actions {
  margin-top: 18px;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.remove-course-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  min-height: 46px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-btn {
  color: #f9fdfa;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.ghost-btn {
  background: rgba(15, 109, 86, 0.1);
  color: var(--brand-dark);
}

.danger-btn {
  background: rgba(178, 64, 49, 0.12);
  color: var(--danger);
}

.icon-btn {
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  background: rgba(178, 64, 49, 0.1);
  color: var(--danger);
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.remove-course-btn:hover,
.summary-jump:hover {
  transform: translateY(-1px);
}

.summary-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 109, 86, 0.18), rgba(15, 109, 86, 0.08));
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 109, 86, 0.08);
}

.semester-section .summary-jump {
  background: rgba(54, 190, 215, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.semester-section .section-kicker {
  color: #a8c9ff;
}

.semester-section h2 {
  color: #f8fbff;
}

.semester-section .summary-jump-icon {
  background: rgba(255, 255, 255, 0.18);
}

.semester-section .ghost-btn.add-semester-btn {
  background: rgba(54, 190, 215, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.semester-card-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.semester-card-actions .semester-add-inline-btn {
  min-width: auto;
  padding: 0.75rem 1rem;
  max-width: 240px;
  border: 1px solid var(--button-border);
  color: #05406e !important;
}

.semester-card-actions .semester-add-inline-btn .summary-jump-icon {
  background: rgba(54, 190, 215, 0.3);
  border: 1px solid var(--button-border);
}

.semester-footer-actions {
  margin: 1.25rem 0 0;
  display: flex;
  justify-content: flex-end;
}

.summary-jump-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(54, 190, 215, 0.3);
  font-size: 0.95rem;
  line-height: 1;
}

.add-semester-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.remove-course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  background: rgba(178, 64, 49, 0.12);
  color: var(--danger);
  font-weight: 700;
}

.remove-course-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(178, 64, 49, 0.18);
  font-size: 0.88rem;
  line-height: 1;
}

.remove-course-text {
  white-space: nowrap;
}

.summary-grid,
.trend-stats,
.semester-summary {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric-card,
.trend-stat-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.class-card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.82);
}

@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.class-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--ring-angle),
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #32ade6,
    #5856d6,
    #af52de,
    #ff2d55,
    #ff3b30
  );
  animation: class-card-ring-flow 2.8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.class-card > * {
  position: relative;
  z-index: 1;
}

.class-card strong {
  font-size: 1.45rem;
}

.medals-container {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.medal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 2px solid;
}

.medal.gold {
  background: #FFD700;
  color: #8B6914;
  border-color: #B8860B;
}

.medal.silver {
  background: #E8E8E8;
  color: #606060;
  border-color: #A9A9A9;
}

.medal.bronze {
  background: #D4944A;
  color: #5C3D2E;
  border-color: #8B6F47;
}

@keyframes class-card-ring-flow {
  to {
    --ring-angle: 1turn;
  }
}

.metric-card.accent {
  background: linear-gradient(135deg, rgba(15, 109, 86, 0.92), rgba(213, 128, 47, 0.92));
  color: #fffef9;
}

/* CGPA Performance Container */
.cgpa-performance-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.cgpa-dial-section,
.cgpa-graph-section {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.cgpa-dial-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

#cgpaDial {
  display: block;
  max-width: 100%;
  height: auto;
}

.cgpa-dial-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cgpa-dial-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: "Fraunces", serif;
  color: var(--brand);
}

.cgpa-dial-text {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.cgpa-graph-section {
  padding: 16px;
}

.cgpa-graph-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.cgpa-graph-title {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  flex: 1 1 140px;
}

.cgpa-change-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.cgpa-change-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: "Fraunces", serif;
  line-height: 1.15;
}

.cgpa-change-value.positive {
  color: #34c759;
}

.cgpa-change-value.warning {
  color: #c78020;
}

.cgpa-change-value.negative {
  color: #b24031;
}

.cgpa-change-value.neutral {
  color: var(--muted);
}

.cgpa-change-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.cgpa-graph-wrapper {
  width: 100%;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(244, 248, 247, 0.8), rgba(240, 248, 245, 0.6));
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 12px;
}

#cgpaGraph {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.cgpa-analysis-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.cgpa-analysis-card {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.cgpa-analysis-card.risk {
  background: linear-gradient(180deg, rgba(178, 64, 49, 0.09), rgba(255, 255, 255, 0.9));
}

.cgpa-analysis-card.growth {
  background: linear-gradient(180deg, rgba(31, 122, 99, 0.1), rgba(255, 255, 255, 0.9));
}

.cgpa-analysis-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.cgpa-analysis-value {
  display: block;
  font-size: 1.55rem;
  font-family: "Fraunces", serif;
  line-height: 1.1;
}

.cgpa-analysis-card.risk .cgpa-analysis-value {
  color: var(--danger);
}

.cgpa-analysis-card.growth .cgpa-analysis-value {
  color: var(--brand-dark);
}

.cgpa-graph-footer {
  width: 100%;
}

.cgpa-graph-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.metric-label,
.summary-label {
  display: block;
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.78;
}

.metric-card strong,
.trend-stat-card strong,
.semester-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  font-family: "Fraunces", serif;
}

.scale-table {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-top: 18px;
}

.scale-row,
.course-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.scale-row {
  grid-template-columns: 0.7fr 1fr 0.7fr 1.3fr;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.66);
}

.scale-row + .scale-row {
  border-top: 1px solid var(--line);
}

.scale-table .optional-band {
  display: none;
}

.scale-table.show-optional .optional-band {
  display: grid;
}

.scale-head,
.course-head {
  font-weight: 700;
  background: rgba(15, 109, 86, 0.12);
}

.trend-panel,
.semester-section {
  margin-top: 32px;
}

.trend-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
  gap: 20px;
  margin-top: 20px;
}

.trend-stage {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 245, 0.85));
}

#trendChart {
  display: block;
  width: 100%;
  height: auto;
}

.trend-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

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

.summary-return-wrap {
  margin-top: 18px;
}

.scale-toggle-btn {
  margin-top: 14px;
}

.summary-return-jump {
  color: #f9fdfa;
  background: linear-gradient(135deg, rgba(15, 79, 68, 0.95), rgba(31, 122, 99, 0.9));
}

.summary-return-jump .summary-jump-icon {
  background: rgba(255, 255, 255, 0.2);
}

.bottom-summary-jump-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.bottom-summary-jump {
  background: linear-gradient(135deg, rgba(9, 79, 63, 0.95), rgba(15, 109, 86, 0.82));
  color: #f9fdfa;
}

.bottom-summary-jump .summary-jump-icon {
  background: rgba(255, 255, 255, 0.18);
}

.semester-container {
  display: grid;
  gap: 20px;
  margin-top: 18px;
}

.semester-card {
  padding: 24px;
}

.semester-topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
}

.semester-topbar > div:first-child {
  flex: 1 1 240px;
}

.semester-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 280px);
  gap: 14px;
  margin-top: 18px;
}

.semester-label-input[readonly] {
  background: rgba(15, 109, 86, 0.06);
  color: var(--brand-dark);
  font-weight: 700;
}

.course-table {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.course-row {
  grid-template-columns: minmax(120px, 1.4fr) 0.75fr 0.75fr 0.8fr 0.75fr minmax(120px, 0.95fr);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.course-row + .course-row {
  border-top: 1px solid var(--line);
}

.course-row output {
  font-weight: 700;
  text-align: center;
}

.course-row > * {
  min-width: 0;
}

.semester-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.semester-summary > div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.site-footer {
  margin-top: 32px;
  padding: 20px 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero,
  .layout,
  .trend-grid {
    grid-template-columns: 1fr;
  }

  .controls-panel,
  .pdf-upload-panel,
  .summary-panel,
  .scale-panel {
    grid-column: auto;
  }

  .semester-config-grid {
    grid-template-columns: minmax(0, 280px);
  }

  .hero-copy {
    order: 1;
  }

  .hero-card {
    order: 2;
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-panel,
  .pdf-upload-panel,
  .summary-panel,
  .scale-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .course-row {
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(84px, 1fr)) minmax(110px, 0.9fr);
  }

  .remove-course-btn {
    padding-inline: 12px;
  }

  .remove-course-text {
    font-size: 0.92rem;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
  }

  .hero-copy,
  .hero-card,
  .panel,
  .semester-card {
    padding: 20px;
  }

  h1 {
    max-width: none;
  }

  .controls-actions,
  .semester-header,
  .semester-header-actions,
  .trend-header {
    align-items: stretch;
  }

  .controls-actions > *,
  .semester-header-actions > *,
  .semester-actions > *,
  .summary-return-wrap .summary-jump,
  .bottom-summary-jump-wrap .summary-jump {
    width: 100%;
  }

  .summary-grid,
  .semester-summary,
  .trend-grid,
  .cgpa-performance-container {
    grid-template-columns: 1fr;
  }

  .semester-config-grid {
    grid-template-columns: 1fr;
  }

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

  .course-head {
    display: none;
  }

  .course-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .course-row input,
  .course-row select,
  .course-row output,
  .course-row button,
  .summary-jump {
    width: 100%;
    text-align: left;
  }

  .course-row output {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 109, 86, 0.06);
  }

  .trend-stage {
    min-height: 280px;
    padding: 12px;
  }

  .metric-card strong,
  .trend-stat-card strong,
  .semester-summary strong {
    font-size: 1.7rem;
  }

  .cgpa-dial-wrapper {
    width: 200px;
    height: 200px;
  }

  #cgpaDial {
    width: 200px;
    height: 200px;
  }

  .cgpa-dial-value {
    font-size: 1.7rem;
  }

  .cgpa-dial-section,
  .cgpa-graph-section {
    padding: 16px;
  }

  .cgpa-analysis-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 14px, 100%);
  }

  .hero-copy,
  .hero-card,
  .panel,
  .semester-card {
    padding: 16px;
    border-radius: 20px;
  }

  .eyebrow,
  .section-kicker {
    letter-spacing: 0.08em;
    font-size: 0.7rem;
  }

  .brand-strip {
    width: 100%;
    border-radius: 14px;
  }

  .summary-grid,
  .cgpa-performance-container {
    grid-template-columns: 1fr;
  }

  .scale-row {
    grid-template-columns: 1fr 1fr;
    font-size: 0.92rem;
  }

  .semester-topbar,
  .semester-actions,
  .semester-header,
  .semester-header-actions,
  .trend-header {
    gap: 10px;
  }

  .metric-card,
  .trend-stat-card,
  .semester-summary > div,
  .trend-stage,
  .course-table,
  .scale-table,
  .cgpa-dial-section,
  .cgpa-graph-section {
    border-radius: 16px;
  }

  .trend-empty {
    padding: 18px;
    font-size: 0.94rem;
  }

  .cgpa-dial-wrapper {
    width: 180px;
    height: 180px;
  }

  #cgpaDial {
    width: 180px;
    height: 180px;
  }

  .cgpa-dial-value {
    font-size: 1.5rem;
  }

  .cgpa-graph-section {
    padding: 12px;
  }

  #cgpaGraph {
    width: 100%;
    height: auto;
  }
}

@media (hover: none) and (pointer: coarse) {
  .primary-btn:hover,
  .ghost-btn:hover,
  .danger-btn:hover,
  .icon-btn:hover,
  .remove-course-btn:hover,
  .summary-jump:hover {
    transform: none;
  }
}

/* Modal responsive styles */
@media (max-width: 560px) {
  .modal-overlay {
    padding: 16px;
  }

  .modal-content {
    border-radius: 20px;
    max-width: 100%;
  }

  .modal-body {
    padding: 32px 24px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-icon {
    font-size: 40px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}

/* =========================================================
   UG Score Pilot Pro — Intelligence Dashboard Extensions
   Non-breaking enhancement layer
========================================================= */

/* =========================
   New Analytics Sections
========================= */

#scenario-sandbox,
#target-planner,
#risk-dashboard,
#course-impact {
  position: relative;
  overflow: hidden;
}

#scenario-sandbox::before,
#target-planner::before,
#risk-dashboard::before,
#course-impact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      rgba(31, 122, 99, 0.04),
      rgba(5, 64, 110, 0.03)
    );

  pointer-events: none;
}

/* =========================
   Intelligence Outputs
========================= */

#scenario-result,
#target-output,
#risk-output p,
#impact-output p {
  position: relative;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.92),
      rgba(244,248,247,0.88)
    );

  border: 1px solid rgba(15,109,86,0.12);

  border-left: 4px solid var(--brand);

  border-radius: 16px;

  padding: 16px 18px;

  margin-top: 14px;

  box-shadow:
    0 10px 24px rgba(16,42,37,0.06);

  line-height: 1.5;

  animation: insight-fade-up 0.35s ease;
}

@keyframes insight-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   Risk State System
========================= */

.risk-low {
  border-left-color: #22c55e !important;
}

.risk-medium {
  border-left-color: #f59e0b !important;
}

.risk-high {
  border-left-color: #ef4444 !important;
}

.risk-low::after,
.risk-medium::after,
.risk-high::after {
  position: absolute;
  top: 14px;
  right: 16px;

  font-size: 0.72rem;
  font-weight: 800;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}

.risk-low::after {
  content: "LOW RISK";
  color: #22c55e;
}

.risk-medium::after {
  content: "MODERATE";
  color: #f59e0b;
}

.risk-high::after {
  content: "HIGH RISK";
  color: #ef4444;
}

/* =========================
   Scenario Simulation UI
========================= */

#scenario-sandbox button,
#target-planner button,
#risk-dashboard button,
#course-impact button {
  margin-top: 10px;
}

#scenario-result strong,
#target-output strong {
  color: var(--brand-dark);
}

/* =========================
   Analytics Grid Layout
========================= */

.analytics-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(280px, 1fr));

  gap: 20px;

  margin-top: 24px;
}

/* =========================
   Insight Cards
========================= */

.insight-card {
  position: relative;

  padding: 18px;

  border-radius: 18px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.88),
      rgba(247,251,248,0.82)
    );

  border: 1px solid rgba(15,109,86,0.12);

  box-shadow:
    0 10px 28px rgba(16,42,37,0.08);

  overflow: hidden;
}

.insight-card::before {
  content: "";

  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at top right,
      rgba(31,122,99,0.08),
      transparent 60%
    );

  pointer-events: none;
}

.insight-title {
  font-size: 0.82rem;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  font-weight: 800;

  color: var(--brand);

  margin-bottom: 10px;
}

.insight-value {
  font-family: "Fraunces", serif;

  font-size: 2rem;

  line-height: 1.1;

  color: var(--text);
}

.insight-meta {
  margin-top: 10px;

  color: var(--muted);

  line-height: 1.5;

  font-size: 0.95rem;
}

/* =========================
   Forecast Trend Styles
========================= */

.trend-improving {
  color: #16a34a;
}

.trend-declining {
  color: #dc2626;
}

.trend-stable {
  color: #64748b;
}

/* =========================
   Highlight Glow Effects
========================= */

.metric-card.accent,
.class-card,
.cgpa-analysis-card.growth {
  position: relative;
  overflow: hidden;
}

.metric-card.accent::after,
.class-card::after,
.cgpa-analysis-card.growth::after {
  content: "";

  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at top right,
      rgba(255,255,255,0.14),
      transparent 55%
    );

  pointer-events: none;
}

/* =========================
   Interactive Hover System
========================= */

.metric-card,
.trend-stat-card,
.semester-summary > div,
.cgpa-analysis-card,
.insight-card {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

.metric-card:hover,
.trend-stat-card:hover,
.semester-summary > div:hover,
.cgpa-analysis-card:hover,
.insight-card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 16px 34px rgba(16,42,37,0.14);

  border-color:
    rgba(31,122,99,0.18);
}

/* =========================
   Advanced Mobile Refinement
========================= */

@media (max-width: 760px) {

  #scenario-result,
  #target-output,
  #risk-output p,
  #impact-output p {
    padding: 14px;
  }

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

  .insight-value {
    font-size: 1.7rem;
  }
}

.analytics-panel h2,
.analytics-panel label,
.analytics-panel p,
.analytics-panel .trend-note {
  color: var(--text);
}

/* =========================================
   What-If Predictor
========================================= */

.predictor-panel {
  margin-top: 28px;
}

.predictor-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));

  gap: 16px;

  margin: 20px 0;
}

.predictor-output {
  margin-top: 20px;
}

.predictor-result-card {

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.92),
      rgba(244,248,247,0.88)
    );

  border-radius: 20px;

  border: 1px solid rgba(15,109,86,0.12);

  padding: 22px;

  box-shadow:
    0 12px 28px rgba(16,42,37,0.08);

  animation:
    predictorFade 0.3s ease;
}

@keyframes predictorFade {

  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.predictor-cgpa {

  font-size: 2.5rem;

  font-family: "Fraunces", serif;

  color: var(--brand-dark);

  margin: 10px 0;
}

.predictor-standing {

  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 10px 14px;

  border-radius: 999px;

  background:
    rgba(15,109,86,0.08);

  color: var(--brand-dark);

  font-weight: 700;

  margin-top: 10px;
}

.predictor-note {

  margin-top: 16px;

  color: var(--muted);

  line-height: 1.6;
}