/* Study abroad in the planner and the approved-course dialog. */
.term.exchange-term {
  opacity: 1;
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
}

.term.exchange-term .term-head,
.term:has([data-away]) .term-head {
  padding-inline-end: 50px;
}

.exchange-term .term-cog, .term:has([data-away]) .term-cog,
.exchange-term .course .x, .ex-step .fc-x {
  width: 44px;
  height: 44px;
}

.exchange-term .cog-menu, .term:has([data-away]) .cog-menu {
  top: 50px;
}

.exchange-term .cog-menu button, .term:has([data-away]) .cog-menu button,
.ex-step button, .ex-term-button, .ex-host .field {
  min-height: 44px;
}

.ex-term-host {
  display: grid;
  gap: 2px;
  margin-block: 6px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ex-term-host span {
  color: var(--muted);
  font-size: .85rem;
}

.ex-term-button {
  align-self: stretch;
  margin-block-start: auto;
  white-space: normal;
}

.fc-chip.is-exchange {
  opacity: 1;
  border-style: solid;
  border-color: color-mix(in srgb, var(--teal) 35%, var(--line));
}

.fc-chip.is-exchange .fc-ex-label {
  color: var(--teal);
  font-weight: 700;
}

.fc-modal-root:has(.ex-step) {
  z-index: 75;
}

.fc-modal.ex-picker {
  display: flex;
  flex-direction: column;
  width: min(650px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  padding: 20px 24px;
}

.ex-picker > p {
  margin-block: 0 12px;
  color: var(--muted);
  font-size: .9rem;
}

.ex-host {
  display: grid;
  gap: 4px;
  flex: none;
  margin-block-end: 12px;
}

.ex-host label { font-weight: 700; }
.ex-host .field { color: var(--ink); }

.ex-picker .ex-location {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.ex-list {
  display: grid;
  gap: 6px;
  min-height: min(135px, 28vh);
  margin: 0;
  padding: 2px 3px 4px;
  list-style: none;
  overflow: auto;
  overscroll-behavior: contain;
}

.ex-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.ex-row:has(input:checked) {
  border-color: var(--teal);
  background: var(--surface-2);
}

.ex-row:has(input:focus-visible) {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.ex-course {
  flex: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding-block: 7px;
  padding-inline: 0 10px;
  cursor: pointer;
}

.ex-course:has(input:disabled) { cursor: default; }
.ex-row > button { margin-inline-end: 6px; }
.ex-check { display: grid; place-items: center; min-height: 44px; }
.ex-check input { width: 19px; height: 19px; margin: 0; accent-color: var(--teal); }

.ex-copy { display: grid; gap: 2px; }
.ex-course-name { font-weight: 700; overflow-wrap: anywhere; }
.ex-code { white-space: nowrap; }
.ex-course-host, .ex-status, .ex-reason, .ex-sch { font-size: .82rem; line-height: 1.35; }
.ex-course-host, .ex-status { color: var(--muted); }
.ex-course-host { overflow-wrap: anywhere; }
.ex-sch { color: var(--muted); align-self: start; text-align: end; }
.ex-reason { color: var(--rose); font-weight: 700; }

.ex-picker .ex-drop-note {
  margin-block: 10px 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--amber);
  background: var(--surface-2);
  color: var(--ink);
}

.ex-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 12px;
  margin-block: 10px 0;
  padding-block: 9px 0;
  border-block-start: 1px solid var(--line);
}

.ex-limit { color: var(--rose); font-size: .86rem; }
.ex-picker .fc-actions { flex: none; flex-direction: row; align-items: center; }

@media (max-width: 640px) {
  .board .term.exchange-term { grid-column: 1 / -1; }
  .fc-modal.ex-picker {
    max-height: 100dvh;
    padding: 16px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .ex-list { min-height: min(150px, 30vh); }
}
