/* Styles extracted from index.html without visual changes. */
    /* ──────────────────────────────────────────────────────────────────────────
       RESET & BASE
       ────────────────────────────────────────────────────────────────────────── */

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

    /* Font Awesome helper classes */
    .fa-icon {
      display: inline-block;
      vertical-align: middle;
      line-height: 1;
    }

    body {
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      background: #f8f7f5;
      color: #1b1918;
      min-height: 100vh;
      padding: 0 0 48px;
      transition: background 0.2s, color 0.2s;
    }

    body::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 16px;
      background: #f8f7f5;
      z-index: 99;
      transition: background 0.2s;
    }

    body.theme-transition,
    body.theme-transition::before,
    body.theme-transition .card,
    body.theme-transition .consult-card,
    body.theme-transition .intro-box,
    body.theme-transition .assessment-item,
    body.theme-transition .msg,
    body.theme-transition .toggle-note,
    body.theme-transition input,
    body.theme-transition select {
      transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
    }

    body.theme-transition .card:hover,
    body.theme-transition .consult-card:hover,
    body.theme-transition .assessment-item:hover {
      transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       UTILITY CLASSES
       ────────────────────────────────────────────────────────────────────────── */

    .hidden {
      display: none;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       HEADER BAR
       ────────────────────────────────────────────────────────────────────────── */

    .header-bar {
      position: sticky;
      top: 16px;
      z-index: 100;
      background: #bc0031;
      padding: 14px 28px;
      display: flex;
      align-items: center;
      gap: 18px;
      border-radius: 12px;
      margin: 16px 16px 0;
      box-shadow: 0 2px 12px rgba(255, 0, 0, 0.12);
    }

    .uva-logo-wrap {
      width: 44px;
      height: 44px;
      flex-shrink: 0;
    }

    .uva-logo-wrap img {
      width: 44px;
      height: 44px;
      object-fit: contain;
    }

    .header-text {
      flex: 1;
    }

    .header-text h1 {
      font-family: "Source Serif 4", "Times New Roman", serif;
      font-size: 1.2rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: 0.01em;
    }

    .header-text .course-subtitle {
      font-size: 0.85rem;
      color: rgba(255, 255, 255, 0.88);
      margin-top: 3px;
      font-style: italic;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    /* Header controls */
    .header-reset-btn,
    .theme-toggle {
      height: 34px;
      width: 40px;
      padding: 0;
      box-sizing: border-box;
      line-height: 1;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .header-reset-btn {
      background: rgba(255, 255, 255, 0.18);
      color: #ffffff;
      border: 2px solid rgba(255, 255, 255, 0.7);
      border-radius: 8px;
    }

    .header-reset-btn:hover {
      background: rgba(255, 255, 255, 0.3);
      border-color: #ffffff;
    }

    /* Language switcher */
    .lang-switcher {
      display: flex;
      height: 34px;
      box-sizing: border-box;
      border-radius: 8px;
      overflow: hidden;
      border: 2px solid rgba(255, 255, 255, 0.7);
      flex-shrink: 0;
    }

    .lang-btn {
      height: 30px;
      padding: 6px 11px;
      font-size: 0.78rem;
      font-weight: 700;
      border: none;
      cursor: pointer;
      background: transparent;
      color: rgba(255, 255, 255, 0.7);
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      letter-spacing: 0.05em;
      transition: background 0.15s, color 0.15s;
    }

    .lang-btn:first-child {
      border-right: 1px solid rgba(255, 255, 255, 0.4);
    }

    .lang-btn.active {
      background: rgba(255, 255, 255, 0.22);
      color: #fff;
    }

    .lang-btn:hover:not(.active) {
      background: rgba(255, 255, 255, 0.12);
      color: #fff;
    }

    /* Theme toggle */
    .theme-toggle {
      font-size: 0.78rem;
      font-weight: 500;
      border-radius: 8px;
      border: 2px solid rgba(255, 255, 255, 0.7);
      background: rgba(255, 255, 255, 0.12);
      color: #ffffff;
      letter-spacing: 0.05em;
    }

    .theme-toggle:hover {
      background: rgba(255, 255, 255, 0.22);
    }

    .github-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      box-sizing: border-box;
      line-height: 1;
      border: 2px solid rgba(255, 255, 255, 0.7);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.12);
      color: #ffffff;
      font-size: 1.05rem;
      text-decoration: none;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .github-link:hover {
      background: rgba(255, 255, 255, 0.22);
      border-color: #ffffff;
      color: #ffffff;
    }

    .theme-toggle.is-dark {
      background: #ffffff;
      color: #bc0031;
      border-color: #ffffff;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       MAIN LAYOUT
       ────────────────────────────────────────────────────────────────────────── */

    .main {
      max-width: 760px;
      margin: 28px auto 0;
      padding: 0 16px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       CARDS (Generic)
       ────────────────────────────────────────────────────────────────────────── */

    .card {
      background: #fff;
      border-radius: 12px;
      padding: 22px 24px;
      box-shadow: 0 1px 3px rgba(27, 25, 24, 0.1);
      transition: background 0.2s, box-shadow 0.5s;
    }

    .card:hover {
      box-shadow: 0 8px 24px rgba(155, 6, 6, 0.062);
      transition: box-shadow 0.5s;
    }

    .section-reveal-add,
    .section-reveal-structure,
    .section-reveal-feedback {
      animation: section-card-reveal 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    .section-reveal-add {
      animation-delay: 0s;
    }

    .section-reveal-structure {
      animation-delay: 0.08s;
    }

    .section-reveal-feedback {
      animation-delay: 0.16s;
    }

    @keyframes section-card-reveal {
      from {
        opacity: 0;
        transform: translateY(-12px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .card h2 {
      font-family: "Source Serif 4", "Times New Roman", serif;
      font-size: 0.88rem;
      font-weight: 700;
      margin-bottom: 14px;
      color: #1b1918;
      text-transform: uppercase;
      letter-spacing: 0.07em;
    }

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

    .card-header-row h2 {
      margin-bottom: 0;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       COURSE TITLE CARD
       ────────────────────────────────────────────────────────────────────────── */

    .course-title-input {
      padding: 9px 12px;
      border: 1px solid #d7d6d4;
      border-radius: 8px;
      font-size: 0.95rem;
      background: #faf9f8;
      color: #1b1918;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      transition: background 0.2s, border-color 0.2s, color 0.2s; /* ADD THIS */
    }

    .course-title-input:focus {
      outline: 2px solid #bc0031;
      outline-offset: 1px;
    }
    
    .course-title-row {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .course-title-input {
      flex: 1;          /* takes all remaining space */
      min-width: 0;     /* prevents flex overflow */
    }

    .faculty-select {
      flex: 0 0 90px;   /* fixed width, won't grow/shrink */
      padding: 9px 10px;
      border: 1px solid #d7d6d4;
      border-radius: 8px;
      font-size: 0.88rem;
      background: #faf9f8;
      color: #1b1918;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }

    .faculty-select-wrap {
      position: relative;
      flex: 0 0 90px;
    }

    .faculty-select-wrap::after {
      content: "";
      position: absolute;
      top: 50%;
      right: 12px;
      width: 4px;
      height: 4px;
      border-right: 1px solid #767270;
      border-bottom: 1px solid #767270;
      transform: translateY(-65%) rotate(45deg);
      pointer-events: none;
    }

    .faculty-select-wrap .faculty-select {
      width: 100%;
      color: transparent;
      text-indent: -9999px;
      appearance: none;
      -webkit-appearance: none;
    }

    .faculty-select-wrap .faculty-select option {
      color: #1b1918;
      text-indent: 0;
    }

    .faculty-select-display {
      position: absolute;
      inset: 1px 28px 1px 10px;
      display: flex;
      align-items: center;
      pointer-events: none;
      color: #1b1918;
      font-size: 0.88rem;
      white-space: nowrap;
      overflow: hidden;
    }

    .faculty-select-display.placeholder {
      color: #a8a29f;
    }

    body.dark-theme .faculty-select-display {
      color: #e5e7eb;
    }

    body.dark-theme .faculty-select-wrap::after {
      border-color: #9ca3af;
    }

    body.dark-theme .faculty-select-display.placeholder {
      color: #6b7280;
    }

    .faculty-select:focus {
      outline: 2px solid #bc0031;
      outline-offset: 1px;
    }

   .faculty-select:required:invalid {
      color: #a8a29f;
    }

    .faculty-select option {
      color: #1b1918;
    }

    body.dark-theme .faculty-select option {
      color: #e5e7eb;
    }

    body.dark-theme .faculty-select-wrap .faculty-select {
      color: transparent;
    }
    /* ──────────────────────────────────────────────────────────────────────────
       ADD ASSESSMENT CARD
       ────────────────────────────────────────────────────────────────────────── */

    .add-row-labels {
      display: flex;
      gap: 10px;
      flex-wrap: nowrap;
      margin-bottom: 4px;
      align-items: flex-end;
    }

    .add-row-labels span {
      font-size: 0.75rem;
      color: #6b6966;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      flex-shrink: 0;
    }

    .add-row-labels .lbl-type {
      flex: 2;
      min-width: 200px;
      text-align: left;
    }

    .add-row-labels .lbl-pct {
      flex: 0 0 80px;
      min-width: 60px;
      max-width: 90px;
      text-align: center;
    }

    .add-row-labels .lbl-note {
      flex: 2;
      min-width: 120px;
      text-align: left;
    }

    .add-row-labels .lbl-btn {
      flex: 0 0 110px;
    }

    .add-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: flex-end;
    }

    .add-row select,
    .add-row input {
      padding: 9px 12px;
      border: 1px solid #d7d6d4;
      border-radius: 8px;
      font-size: 0.88rem;
      background: #faf9f8;
      color: #1b1918;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      transition: background 0.2s, border-color 0.2s, color 0.2s; /* ADD THIS */
    }

    .add-row select:focus,
    .add-row input:focus {
      outline: 2px solid #bc0031;
      outline-offset: 1px;
    }

    .add-row select {
      flex: 2;
      min-width: 200px;
    }

    .add-row input[type="number"] {
      flex: 0 0 80px;
      min-width: 60px;
      max-width: 90px;
    }

    .add-row input[type="text"] {
      flex: 2;
      min-width: 120px;
    }

    .add-row button {
      flex: 0 0 120px;
      height: 36px;
      padding: 0 16px;
      background: #bc0031;
      color: #fff;
      border: none;
      border-radius: 8px;
      font-size: 0.86rem;
      cursor: pointer;
      font-weight: 700;
      letter-spacing: 0.03em;
      transition: background 0.15s;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .add-row button:hover {
      background: #840022;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       ASSESSMENT LIST & ITEMS
       ────────────────────────────────────────────────────────────────────────── */

    #assessment-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .assessment-item {
      border-radius: 10px;
      border: 1px solid #dedbd8;
      background: #f8f7f5;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(27, 25, 24, 0.11);
      transition: box-shadow 0.2s;
    }

    .assessment-item.is-entering {
      animation: assessment-item-enter 0.22s ease-out both;
    }

    .assessment-item.is-removing {
      animation: assessment-item-remove 0.18s ease-in both;
      pointer-events: none;
    }

    @keyframes assessment-item-enter {
      from {
        opacity: 0;
        transform: translateY(-5px) scale(0.99);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes assessment-item-remove {
      from {
        opacity: 1;
        transform: scale(1);
      }
      to {
        opacity: 0;
        transform: scale(0.98);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .assessment-item.is-entering,
      .assessment-item.is-removing {
        animation: none;
      }

      .section-reveal-add,
      .section-reveal-structure,
      .section-reveal-feedback {
        animation: none;
      }
    }

    .assessment-item:hover {
      box-shadow: 0 3px 10px rgba(27, 25, 24, 0.14);
    }

    .assessment-item.high {
      border-color: #e9b9c5;
      background: #fbedf1;
      box-shadow: 0 2px 8px rgba(188, 0, 49, 0.16);
    }

    .assessment-item.medium {
      border-color: #ecd1aa;
      background: #fdf5e9;
      box-shadow: 0 2px 8px rgba(180, 96, 0, 0.16);
    }

    .assessment-item.low {
      border-color: #bdd5c2;
      background: #edf5ef;
      box-shadow: 0 2px 8px rgba(37, 120, 53, 0.16);
    }

    .assessment-item.high:hover {
      box-shadow: 0 3px 10px rgba(188, 0, 49, 0.19);
    }

    .assessment-item.medium:hover {
      box-shadow: 0 3px 10px rgba(180, 96, 0, 0.19);
    }

    .assessment-item.low:hover {
      box-shadow: 0 3px 10px rgba(37, 120, 53, 0.19);
    }

    .item-main-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      flex-wrap: wrap;
    }

    .item-labels {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-width: 160px;
      gap: 2px;
    }

    .item-name {
      font-size: 0.88rem;
      font-weight: 600;
      color: #1b1918;
    }

    .item-note-input {
      font-size: 0.78rem;
      color: #555;
      font-style: italic;
      border: none;
      border-bottom: 1px dashed #c0bdbb;
      background: transparent;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      width: 100%;
      padding: 1px 2px;
      outline: none;
      transition: color 0.2s, border-bottom-color 0.2s, background 0.2s;
    }

    .item-note-input:focus {
      border-bottom-color: #bc0031;
    }

    .item-note-input::placeholder {
      color: #767270;
    }

    .item-badge {
      font-size: 0.68rem;
      font-weight: 700;
      padding: 3px 9px;
      border-radius: 3px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      white-space: nowrap;
    }

    .badge-high {
      background: #ebb3c1;
      color: #840022;
    }

    .badge-medium {
      background: #f8dab3;
      color: #a45c00;
    }

    .badge-low {
      background: #b7c6b0;
      color: #1a5425;
    }

    /* Assessment item toggles */
    .item-toggles {
      padding: 0 14px 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .toggle-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .toggle-label {
      font-size: 0.8rem;
      color: #555;
      min-width: 130px;
    }

    .toggle-btn-group {
      display: flex;
      border-radius: 8px;
      overflow: hidden;
      border: none;
      gap: 2px;
    }

    .toggle-btn {
      padding: 4px 14px;
      font-size: 0.78rem;
      font-weight: 600;
      border: none;
      cursor: pointer;
      background: #fff;
      color: #a8a29f;
      border-radius: 8px;
      transition: background 0.15s, color 0.15s;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
    }

    .toggle-btn:first-child {
      border-right: 1px solid #d7d6d4;
    }

    .toggle-btn.active-yes {
      background: #257835;
      color: #fff;
    }

    .toggle-btn.active-no {
      background: #bc0031;
      color: #fff;
    }

    .toggle-note {
      font-size: 0.78rem;
      line-height: 1.5;
      padding: 6px 10px;
      border: 1px solid #dedbd8;
      border-radius: 10px;
      margin-top: 2px;
    }

    .toggle-note.note-info {
      background: #f1f3f5;
      color: #374151;
      border-color: #cbd1d8;
    }

    .toggle-note.note-success {
      background: #e6f1e9;
      color: #1a5425;
      border-color: #bdd5c2;
    }

    .toggle-note.note-warn {
      background: #fff3de;
      color: #945400;
      border-color: #e2c18b;
    }

    .toggle-note.note-avv {
      background-color: #f1f3f5;
      border-color: #b9bec4;
      color: #374151;
      border-radius: 10px;
    }

    .item-pct-input {
      width: 56px;
      padding: 5px 8px;
      border: 1px solid #d7d6d4;
      border-radius: 8px;
      font-size: 0.88rem;
      text-align: center;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }

    .item-pct-input:focus {
      outline: 2px solid #bc0031;
      outline-offset: 1px;
    }

    .remove-btn {
      background: none;
      border: none;
      color: #a8a29f;
      font-size: 1rem;
      cursor: pointer;
      padding: 2px 5px;
      border-radius: 3px;
      transition: color 0.15s;
    }

    .remove-btn:hover {
      color: #bc0031;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       EXPOSURE SECTION
       ────────────────────────────────────────────────────────────────────────── */

    .exposure-group {
      margin-top: 16px;
    }

    .exposure-group-header {
      margin-bottom: 6px;
    }

    .exposure-item {
      padding: 8px 0;
      border-top: 1px solid #e6e5e3;
    }

    .exposure-item:first-of-type {
      border-top: none;
    }

    .exposure-item-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }

    .exposure-item p {
      font-size: 0.83rem;
      color: #555;
      line-height: 1.5;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       FEEDBACK CARD & SCORING
       ────────────────────────────────────────────────────────────────────────── */

    .help-btn {
      padding: 4px 10px;
      font-size: 0.86rem;
      line-height: 1;
      border: none;
      cursor: pointer;
    }

    .total-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.92rem;
      margin-bottom: 16px;
      padding-bottom: 14px;
      border-bottom: 1px solid #e6e5e3;
    }

    .total-label {
      font-weight: 600;
    }

    .total-value {
      font-size: 1.2rem;
      font-weight: 700;
    }

    .total-ok {
      color: #257835;
    }

    .total-warn {
      color: #e98300;
    }

    .total-error {
      color: #bc0031;
    }

    .score-section {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-bottom: 18px;
      flex-wrap: wrap;
    }

    .gauge-wrap {
      position: relative;
      width: 88px;
      height: 88px;
      flex-shrink: 0;
    }

    .gauge-wrap svg {
      width: 88px;
      height: 88px;
    }

    .gauge-progress {
      transition: stroke 0.3s ease;
    }

    .feedback-content-update {
      animation: feedback-content-update 0.22s ease-out both;
    }

    @keyframes feedback-content-update {
      from {
        opacity: 0.82;
      }
      to {
        opacity: 1;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .feedback-content-update {
        animation: none;
      }
    }

    .score-desc {
      flex: 1;
      min-width: 180px;
    }

    .score-desc .verdict {
      font-size: 0.98rem;
      font-weight: 700;
      margin-bottom: 5px;
    }

    .score-desc p {
      font-size: 0.83rem;
      color: #555;
      line-height: 1.55;
    }

    .breakdown-bar {
      height: 12px;
      border-radius: 2px;
      overflow: hidden;
      display: flex;
      margin-bottom: 7px;
      background: #e6e5e3;
    }

    .bar-high {
      background: #bc0031;
    }

    .bar-medium {
      background: #e98300;
    }

    .bar-low {
      background: #257835;
    }

    .breakdown-legend {
      display: flex;
      gap: 16px;
      font-size: 0.78rem;
      color: #555;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }

    .legend-dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      margin-right: 5px;
      vertical-align: middle;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       MESSAGES & FEEDBACK
       ────────────────────────────────────────────────────────────────────────── */

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

    .msg {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      padding: 10px 13px;
      border: 1px solid #dedbd8;
      border-radius: 10px;
      font-size: 0.83rem;
      line-height: 1.55;
      box-shadow: 0 2px 8px rgba(27, 25, 24, 0.11);
    }

    .msg-warn {
      background: #fdf5e9;
      border-color: #ecd1aa;
      box-shadow: 0 2px 8px rgba(180, 96, 0, 0.16);
    }

    .msg-danger {
      background: #fbedf1;
      border-color: #e9b9c5;
      box-shadow: 0 2px 8px rgba(188, 0, 49, 0.16);
    }

    .msg-success {
      background: #edf5ef;
      border-color: #bdd5c2;
      box-shadow: 0 2px 8px rgba(37, 120, 53, 0.16);
    }

    .msg-info {
      background: #edf3f8;
      border-color: #bfd0df;
      box-shadow: 0 2px 8px rgba(0, 78, 146, 0.14);
    }

    .msg-icon {
      font-size: 0.95rem;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .empty-state,
    .no-assessments-note {
      text-align: center;
      color: #a8a29f;
      font-size: 0.85rem;
      padding: 18px 0;
    }

    .no-assessments-note {
      padding: 10px 0;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       CONSULT CARD
       ────────────────────────────────────────────────────────────────────────── */

    .consult-card {
      background: #fff;
      border-radius: 12px;
      padding: 22px 24px;
      box-shadow: 0 1px 3px rgba(27, 25, 24, 0.1);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      transition: background 0.2s;
    }

    .consult-card:hover {
      box-shadow: 0 8px 24px rgba(155, 6, 6, 0.062);
      transition: box-shadow 0.5s;
    }

    .consult-card p {
      font-size: 0.95rem;
      color: #1b1918;
      font-weight: 600;
      flex: 1;
      min-width: 200px;
    }

    .consult-btn.hidden {
      display: none;
    }

    .consult-btn {
      display: inline-block;
      padding: 10px 22px;
      background: #bc0031;
      color: #fff;
      border-radius: 8px;
      font-size: 0.88rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-decoration: none;
      transition: background 0.15s;
      white-space: nowrap;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
    }

    .consult-btn:hover {
      background: #840022;
    }

    .consult-card .save-result-btn {
      background: #ffffff;
      color: #bc0031;
      border: 1px solid #bc0031;
      cursor: pointer;
    }

    .consult-card .save-result-btn:hover {
      background: #fce5eb;
      color: #840022;
      border-color: #bc0031;
    }

    .footer-text {
      color: #6b6562;
      font-size: 0.7rem;
      line-height: 1.5;
      margin: -8px auto 0;
      max-width: 680px;
      text-align: center;
    }

    .footer-text a {
      color: #840022;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .footer-text a:hover {
      color: #bc0031;
    }

    body.dark-theme .footer-text {
      color: #9ca3af;
    }

        body.dark-theme .footer-text a {
      color: #9b0b2f;
    }

    body.dark-theme .consult-card .save-result-btn {
      background: #1e293b;
      color: #fca5a5;
      border-color: #fca5a5;
    }

    body.dark-theme .consult-card .save-result-btn:hover {
      background: #3b0820;
      color: #fecaca;
      border-color: #fecaca;
    }

    .consult-btn.help-btn {
      border-radius: 8px;
    }

    .consult-btn[data-no-faculty="true"] {
      opacity: 0.4;
    }
    /* ──────────────────────────────────────────────────────────────────────────
       MODALS & OVERLAYS
       ────────────────────────────────────────────────────────────────────────── */

    .intro-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(3px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      padding: 16px;
    }

    /* Keep the temporary migration notice above every other overlay. */
    .migration-overlay {
      z-index: 10000;
    }

    #migration-body a {
      color: #bc0031;
      font-weight: 600;
      overflow-wrap: anywhere;
    }

    #migration-body a:hover {
      color: #840022;
    }

    .intro-box {
      max-width: 520px;
      background: #ffffff;
      border-radius: 12px;
      padding: 28px 22px 22px 28px;
      box-shadow: 0 8px 24px rgba(255, 0, 0, 0.007);
    }

    .intro-box h2 {
      font-family: "Source Serif 4", "Times New Roman", serif;
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 12px;
      color: #1b1918;
    }

    .intro-box p {
      margin-bottom: 20px;
      color: #444;
      font-size: 0.92rem;
      line-height: 1.65;
    }

    .intro-box-scrollable {
      max-height: 80vh;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      /* keep a stable gutter and reserve the existing right padding for the scrollbar
         so the scrollbar does not overlap the text content */
      scrollbar-gutter: stable;
      padding-right: 22px; /* match the .intro-box right padding so scrollbar sits in the white space */
    }

    .intro-box .lang-switcher {
      border: 2px solid rgba(0, 0, 0, 0.4);
    }

    .intro-box .lang-btn {
      color: rgba(0, 0, 0, 0.5);
    }

    .intro-box .lang-btn:first-child {
      border-right: 1px solid rgba(0, 0, 0, 0.2);
    }

    .intro-box .lang-btn.active {
      background: rgba(0, 0, 0, 0.15);
      color: rgba(0, 0, 0, 0.9);
    }

    .intro-box .lang-btn:hover:not(.active) {
      background: rgba(0, 0, 0, 0.05);
      color: rgba(0, 0, 0, 0.7);
    }

    #exposure-help-body {
      flex: 1;
      overflow-y: auto;
      margin-bottom: 16px;
      /* also ensure inner scrolling area leaves room for the scrollbar */
      padding-right: 8px;
      scrollbar-gutter: stable;
    }

    #exposure-help-close {
      display: block;
      margin: 0 auto;
      margin-right: 16px;
    }

    .intro-btn {
      display: inline-block;
      padding: 9px 22px;
      background: #bc0031;
      color: #fff;
      border-radius: 8px;
      border: none;
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      cursor: pointer;
      font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
      transition: background 0.15s;
    }

    .intro-btn:hover {
      background: #840022;
    }

    .download-confirm-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
    }

    .download-cancel-btn {
      background: transparent;
      color: #840022;
      border: 1px solid #bc0031;
    }

    .download-cancel-btn:hover {
      background: #fce5eb;
      color: #840022;
    }

    .intro-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 9px;
    }

    .intro-footer .lang-toggle {
      background-color: #0066cc;
      color: white;
      border: none;
      padding: 10px 16px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
    }

    .intro-footer .lang-toggle:hover {
      background-color: #0052a3;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       LABELS & BADGES
       ────────────────────────────────────────────────────────────────────────── */

    .avv-label {
      display: inline-block;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      padding: 2px 7px;
      border-radius: 3px;
      background: #e5e7eb;
      color: #6b7280;
    }

    /* ──────────────────────────────────────────────────────────────────────────
       DARK THEME
       ────────────────────────────────────────────────────────────────────────── */

    body.dark-theme {
      background: #020617;
      color: #e5e7eb;
    }

    body.dark-theme::before {
      background: #020617;
    }

    body.dark-theme .card,
    body.dark-theme .consult-card,
    body.dark-theme .intro-box {
      background: #162032;
      color: #e5e7eb;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    }

    body.dark-theme .consult-card:hover,
    body.dark-theme .card:hover {
      box-shadow: 0 2px 12px rgba(188, 0, 49, 0.4);
    }

    body.dark-theme input[type="number"]::-webkit-inner-spin-button,
    body.dark-theme input[type="number"]::-webkit-outer-spin-button {
      filter: invert(1);
    }

    body.dark-theme .course-title-input,
    body.dark-theme .faculty-select,
    body.dark-theme .add-row select,
    body.dark-theme .add-row input,
    body.dark-theme .item-pct-input,
    body.dark-theme .item-note-input {
      background: #162032;
      border-color: #4b5563;
      color: #e5e7eb;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }

    body.dark-theme .add-row button {
      background: #bc0031;
    }

    body.dark-theme .add-row button:hover {
      background: #840022;
    }

    body.dark-theme .empty-state,
    body.dark-theme .no-assessments-note {
      color: #9ca3af;
    }

      body.dark-theme .faculty-select:required:invalid {
        color: #6b7280;
      }

    /* Assessment items - dark */
    body.dark-theme .assessment-item {
      background: #162032;
      border-color: #4b5563;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .assessment-item.high {
      background: #3b0820;
      border-color: #85405a;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .assessment-item.medium {
      background: #3b2308;
      border-color: #865c2d;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .assessment-item.low {
      background: #052e16;
      border-color: #356344;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .assessment-item:hover {
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    }

    body.dark-theme .assessment-item.high:hover {
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    }

    body.dark-theme .assessment-item.medium:hover {
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    }

    body.dark-theme .assessment-item.low:hover {
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    }

    /* Messages - dark */
    body.dark-theme .msg-warn {
      background: #3b2308;
      border-color: #865c2d;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .msg-danger {
      background: #3b0820;
      border-color: #85405a;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .msg-success {
      background: #052e16;
      border-color: #356344;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .msg-info {
      background: #0b1120;
      border-color: #31506b;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    /* Toggle notes - dark */
    body.dark-theme .toggle-note.note-info {
      background: #020617;
      color: #e5e7eb;
      border-color: #4b5563;
    }

    body.dark-theme .toggle-note.note-success {
      background: #052e16;
      color: #b3eec8;
      border-color: #356344;
    }

    body.dark-theme .toggle-note.note-warn {
      background: #3b2308;
      color: #fed7aa;
      border-color: #865c2d;
    }

    body.dark-theme .toggle-note.note-avv {
      background-color: #020617;
      border-color: #4b5563;
      color: #d1d5db;
    }

    body.dark-theme .breakdown-bar {
      background: #1f2937;
    }

    body.dark-theme .intro-box p {
      color: #e5e7eb;
    }

    body.dark-theme .download-cancel-btn {
      background: transparent;
      color: #fca5a5;
      border-color: #fca5a5;
    }

    body.dark-theme .download-cancel-btn:hover {
      background: #3b0820;
      color: #fecaca;
    }

    body.dark-theme .avv-label {
      background: #374151;
      color: #d1d5db;
    }

    /* Text colors - dark */
    body.dark-theme .card h2,
    body.dark-theme .item-name,
    body.dark-theme .total-label,
    body.dark-theme .total-value,
    body.dark-theme .score-desc .verdict,
    body.dark-theme .consult-card p,
    body.dark-theme .intro-box h2 {
      color: #f1f5f9;
    }

    body.dark-theme .item-note-input {
      background: transparent;
      color: #e5e7eb;
      border-bottom-color: #6b7280;
    }

    body.dark-theme .score-desc p,
    body.dark-theme .exposure-item p,
    body.dark-theme .toggle-label,
    body.dark-theme .breakdown-legend,
    body.dark-theme .add-row-labels span,
    body.dark-theme .msg {
      color: #cbd5e1;
    }

    body.dark-theme .toggle-btn {
      background: #1e293b;
      color: #64748b;
      border-color: #1e293b;
    }

    body.dark-theme .toggle-btn.active-yes {
      background: #257835;
      color: #fff;
    }

    body.dark-theme .toggle-btn.active-no {
      background: #bc0031;
      color: #fff;
    }

    body.dark-theme .item-note-input::placeholder {
      color: #64748b;
    }

    .intro-box .lang-switcher {
      border: 2px solid rgba(0, 0, 0, 0.4);
    }

    .intro-box .lang-btn {
      color: rgba(0, 0, 0, 0.5);
    }

    .intro-box .lang-btn:first-child {
      border-right: 1px solid rgba(0, 0, 0, 0.2);
    }

    .intro-box .lang-btn.active {
      background: rgba(0, 0, 0, 0.15);
      color: rgba(0, 0, 0, 0.9);
    }

    .intro-box .lang-btn:hover:not(.active) {
      background: rgba(0, 0, 0, 0.05);
      color: rgba(0, 0, 0, 0.7);
    }

    body.dark-theme .intro-box .lang-switcher {
      border: 2px solid rgba(255, 255, 255, 0.4);
    }

    body.dark-theme .intro-box .lang-btn {
      color: rgba(255, 255, 255, 0.5);
    }

    body.dark-theme .intro-box .lang-btn:first-child {
      border-right: 1px solid rgba(255, 255, 255, 0.2);
    }

    body.dark-theme .intro-box .lang-btn.active {
      background: rgba(255, 255, 255, 0.15);
      color: rgba(255, 255, 255, 0.9);
    }

    body.dark-theme .intro-box .lang-btn:hover:not(.active) {
      background: rgba(255, 255, 255, 0.08);
      color: rgba(255, 255, 255, 0.7);
}

    /* ──────────────────────────────────────────────────────────────────────────
       RESPONSIVE
       ────────────────────────────────────────────────────────────────────────── */

    @media (max-width: 600px) {
      .header-bar {
        margin: 16px 10px 0 10px;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
      }

      .header-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
      }

      .header-reset-btn {
        font-size: 0.78rem;
        padding: 6px 12px;
      }

      .main {
        margin-top: 16px;
        padding: 0 10px;
      }

      .card {
        padding: 16px 14px;
      }

      .add-row {
        flex-direction: row;
        flex-wrap: wrap;
      }

      .add-row select {
        flex: 1 1 calc(100% - 90px);
        min-width: 0;
      }

      .add-row input[type="number"] {
        flex: 0 0 70px;
        max-width: 70px;
      }

      .add-row input[type="text"] {
        flex: 1 1 100%;
      }

      .add-row button {
        flex: 1 1 100%;
        max-width: unset;
      }

      .add-row-labels {
        display: none;
      }

      .item-main-row {
        flex-wrap: wrap;
        gap: 8px;
      }

      .item-labels {
        min-width: 0;
        width: 100%;
      }

      .item-pct-input {
        width: 50px;
      }

      .consult-card {
        flex-direction: column;
        align-items: flex-start;
      }

      .consult-card .consult-btn {
        width: 100%;
        text-align: center;
      }

      .consult-card #consult-btn {
        order: 1;
      }

      .consult-card .save-result-btn {
        order: 2;
      }

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

      .help-btn {
        width: auto;
        text-align: center;
        padding: 4px 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px !important;
      }

      input,
      select,
      textarea {
        font-size: 16px !important;
      }
    }
  #contact-orb {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      background-color: #f8f7f5;
      position:fixed;
      cursor: pointer;
      z-index: 9999;
      opacity: 0.8;
      transition: opacity 0.2s ease, transform 0.2s ease;
      box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }

  #orb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  body.dark-theme #contact-orb {
    background-color: #162032;
  }

  body.dark-theme #orb-img {
    filter: invert(1);
  }

  #contact-orb:hover {
      opacity: 1;
      transform: scale(1.08);
  }

  #contact-popup {
      position: fixed;
      bottom: 82px;
      right: 24px;
      background: #fff;
      border-radius: 10px;
      padding: 12px 16px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.15);
      font-size: 13px;
      color: #333;
      z-index: 9999;
      max-width: 220px;
      line-height: 1.5;
      transform-origin: bottom right;
      transform: scale(0.6) translateY(12px);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
  }


  body.dark-theme #contact-popup {
    background: #162032;
    color: #eee;
  }

  #contact-popup.visible {
      transform: scale(1) translateY(0);
      opacity: 1;
      pointer-events: all;
  }

  #contact-popup a {
      color: #bc0031;
      text-decoration: none;
  }

  #contact-popup a:hover {
      text-decoration: underline;
  }
