@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #BF360C;
  --secondary: #E64A19;
  --accent: #FF8F00;
  --accent-light: #FFB74D;
  --light: #FFF3E0;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --grade-a: #16a34a;
  --grade-b: #2563eb;
  --grade-c: #d97706;
  --grade-d: #ea580c;
  --grade-f: #dc2626;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

::selection {
  background: var(--accent-light);
  color: var(--primary);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

/* Header */
.app-header {
  text-align: center;
  padding: 32px 0 16px;
}

.app-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  margin-top: 4px;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  position: sticky;
  top: 8px;
  z-index: 50;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab-icon {
  font-size: 1rem;
}

/* Main Content */
.app-main {
  min-height: 50vh;
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s ease both;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  margin-top: 28px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--secondary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-light);
  color: var(--text);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--surface-alt);
}

.btn-danger-icon:hover {
  background: var(--danger-bg);
}

.btn-icon-sm {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-icon-sm:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.course-form {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.form-course-name {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-alt);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: var(--surface);
}

select.form-input {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* Weights */
.weights-section {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
}

.weights-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.weights-grid .form-group {
  margin-bottom: 8px;
}

.weight-total {
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 6px;
  border-radius: 6px;
}

.weight-total.valid {
  color: var(--success);
  background: var(--success-bg);
}

.weight-total.invalid {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Course Cards */
.courses-grid {
  display: grid;
  gap: 14px;
}

.course-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.course-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.course-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.credit-badge {
  background: var(--light);
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.weight-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.weight-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weight-bar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.weight-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.weight-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.weight-bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  width: 36px;
  text-align: right;
}

.course-card-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

/* Grade Log */
.course-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.course-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.course-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.course-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.score-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.score-row .form-group {
  flex: 1;
}

.score-divider {
  font-size: 1.5rem;
  color: var(--text-muted);
  padding-bottom: 20px;
  font-weight: 300;
}

.preview-percentage {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 0;
}

.grades-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-section {
  border-left: 3px solid var(--accent);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.category-icon {
  font-size: 1.1rem;
}

.category-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.category-weight {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 10px;
}

.category-avg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.avg-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.avg-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.no-grades-msg {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 12px;
}

.grade-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
  animation: slideUp 0.3s ease both;
}

.grade-item:hover {
  background: var(--surface-alt);
}

.grade-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grade-item-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.grade-item-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grade-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grade-item-pct {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Grade Colors */
.grade-a { color: var(--grade-a); }
.grade-b { color: var(--grade-b); }
.grade-c { color: var(--grade-c); }
.grade-d { color: var(--grade-d); }
.grade-f { color: var(--grade-f); }

/* Dashboard */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
  padding: 16px 12px;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.gpa-card {
  border-top: 3px solid var(--accent);
}

.gpa-value {
  font-size: 2rem;
}

/* Chart */
.chart-container {
  margin-bottom: 20px;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.chart-wrapper {
  height: 220px;
  position: relative;
}

/* Target Calculator */
.target-section {
  margin-bottom: 20px;
}

.target-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.target-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.target-input-row .form-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.target-input {
  max-width: 100px;
}

.target-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.target-course-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.target-needed {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.target-needed strong {
  color: var(--accent);
}

.target-status {
  font-size: 0.85rem;
  font-weight: 600;
}

.target-status.on-track {
  color: var(--success);
}

.target-status.off-track {
  color: var(--danger);
}

.no-data-msg {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 16px;
}

/* Breakdown Cards */
.course-breakdown {
  margin-top: 8px;
}

.breakdown-card {
  margin-bottom: 10px;
}

.breakdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.breakdown-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}

.breakdown-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.breakdown-letter {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.progress-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.skeleton-title {
  height: 28px;
  width: 180px;
}

.skeleton-btn {
  height: 40px;
  width: 120px;
}

.skeleton-card {
  height: 120px;
  margin-bottom: 14px;
}

.skeleton-chips {
  height: 36px;
  width: 60%;
  margin-bottom: 20px;
}

.skeleton-stat {
  height: 80px;
}

.skeleton-chart {
  height: 240px;
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 20px 0 12px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .tab-label {
    display: none;
  }

  .tab-icon {
    font-size: 1.2rem;
  }

  .tab-btn {
    padding: 12px 8px;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 12px 16px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

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

  .section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .target-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .breakdown-header {
    flex-wrap: wrap;
  }

  .score-row {
    flex-wrap: nowrap;
  }

  .weight-bar-label {
    width: 70px;
    font-size: 0.75rem;
  }
}

@media (min-width: 641px) {
  .app-container {
    padding-top: 16px;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to GradeTrack — your academic performance companion. The Dashboard shows your GPA overview, course performance chart, and a target calculator.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Start by adding your courses. Tap the Courses tab to set up your classes with their grading schemes.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Tap '+ Add Course' to create a new course. Enter the name, credit hours, and how the grade is split between assignments, midterm, and final.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 4, "narration": "The grading scheme must total 100%. Adjust the percentages for assignments, midterm, and final exam to match your syllabus.", "view": "user", "highlight_selector": ".weights-section", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Now switch to the Grades tab to start logging individual scores for your courses.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Select a course using the chips at the top, then tap '+ Log Grade' to record a score. Choose the category (assignment, midterm, or final), give it a label, and enter your score.", "view": "user", "highlight_selector": ".course-selector", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Back on the Dashboard, you'll see your running GPA calculated from all logged grades. The chart shows your current percentage in each course.", "view": "user", "highlight_selector": ".gpa-card", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "Use the Target Calculator to set your desired GPA. It shows exactly what percentage you need on remaining work in each course to hit your goal.", "view": "user", "highlight_selector": ".target-section", "wait_for": "tap_to_continue"}
]
-->

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

.auth-gate {
  max-width: 520px;
  margin: 24px auto 0;
  text-align: center;
}

.auth-loading {
  padding: 32px 24px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  color: var(--secondary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.auth-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.auth-button {
  min-width: 220px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.auth-avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
}

.auth-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.auth-user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.auth-user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-logout {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .auth-header {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-user {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .auth-user-info {
    flex: 1;
    min-width: 0;
  }

  .auth-logout {
    width: 100%;
    justify-content: center;
  }
}

.dashboard-analytics {
  margin-top: 24px;
}

.dashboard-analytics-header {
  margin-bottom: 12px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-card {
  min-height: 320px;
}

.chart-caption {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.analytics-canvas {
  width: 100% !important;
  height: 240px !important;
}

@media (max-width: 640px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-card {
    min-height: 280px;
  }
}

.what-if-section {
  margin-bottom: 20px;
}

.what-if-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.what-if-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
}

.what-if-delta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.what-if-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.what-if-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.what-if-course-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.what-if-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.what-if-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.what-if-input {
  max-width: 160px;
}

.what-if-outcome {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  justify-content: flex-end;
}

.what-if-grade {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.what-if-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.what-if-muted {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .what-if-row {
    flex-direction: column;
    align-items: stretch;
  }

  .what-if-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .what-if-input {
    max-width: none;
  }

  .what-if-outcome {
    justify-content: space-between;
  }
}

.section-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.advisor-modal { width: 100%; max-width: 640px; }
.advisor-header { margin-bottom: 12px; }
.advisor-preview { margin-top: 10px; }
.advisor-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.advisor-textarea { min-height: 180px; resize: vertical; font-family: var(--font-body); }
.advisor-actions { margin-top: 16px; }
.advisor-error { margin-top: 12px; color: var(--danger); font-size: 0.9rem; }
.advisor-result { margin-top: 14px; background: var(--surface-alt); }
.advisor-result-title { font-family: var(--font-display); font-size: 1rem; margin-bottom: 8px; color: var(--primary); }
.advisor-result-text { white-space: pre-wrap; word-break: break-word; font-family: var(--font-body); font-size: 0.92rem; color: var(--text); background: transparent; }

.section-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.advisor-modal { width: 100%; max-width: 640px; }
.advisor-header { margin-bottom: 12px; }
.advisor-preview { margin-top: 10px; }
.advisor-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.advisor-textarea { min-height: 180px; resize: vertical; font-family: var(--font-body); }
.advisor-actions { margin-top: 16px; }
.advisor-error { margin-top: 12px; color: var(--danger); font-size: 0.9rem; }
.advisor-result { margin-top: 14px; background: var(--surface-alt); }
.advisor-result-title { font-family: var(--font-display); font-size: 1rem; margin-bottom: 8px; color: var(--primary); }
.advisor-result-text { white-space: pre-wrap; word-break: break-word; font-family: var(--font-body); font-size: 0.92rem; color: var(--text); background: transparent; }
.transcript-pdf-source {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.transcript-paper {
  width: 816px;
  min-height: 1056px;
  padding: 32px;
  background: #ffffff;
  color: #111827;
  font-family: var(--font-body);
}
.transcript-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.transcript-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 6px;
}
.transcript-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.transcript-subtitle {
  margin-top: 6px;
  color: #475569;
  font-size: 0.92rem;
}
.transcript-meta-block {
  min-width: 220px;
  font-size: 0.9rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
}
.transcript-section {
  margin-top: 18px;
}
.transcript-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #0f172a;
}
.transcript-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.transcript-table th,
.transcript-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.transcript-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}
.transcript-history-table td:nth-child(4) {
  word-break: break-word;
}
.transcript-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #64748b;
}
