/* SVG geometry is shared by the picker and translation controls. */
.language-flag {
  display: inline-block;
  width: 14px;
  height: 14px;
  /* The SVG clips its own circle. CSS viewport clipping can trim the lower
     antialiased edge at fractional browser zoom/device scales. */
  overflow: visible;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}
.course-field { display: grid; gap: 8px; }
.course-picker { position: relative; min-width: 0; }
.course-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg, var(--panel));
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}
.course-select-value { display: flex; align-items: center; gap: 12px; min-width: 0; }
.course-picker .language-flag { width: 20px; height: 20px; }
.translation-label { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
#aiTranslateEn, #aiTranslateEs, #readerAi { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.course-select-chevron { display: flex; color: var(--muted); }
.course-select-chevron svg, .course-option-mark svg { width: 20px; height: 20px; display: block; }
.course-select-trigger[aria-expanded="true"] .course-select-chevron { transform: rotate(180deg); }
.course-select-trigger:hover { background: var(--hover-bg); }
.course-select-trigger[aria-expanded="true"] { border-color: var(--accent); }
.course-select-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.course-options {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.28);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  z-index: 100;
}
.course-options[hidden] { display: none; }
.course-options-inline { position: static; margin-top: 6px; box-shadow: none; }
.course-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  touch-action: manipulation;
}
.course-option-flag { display: flex; flex: none; }
.course-option-name { flex: 1; min-width: 0; }
.course-option.is-active[aria-disabled="false"] { background: var(--hover-bg); }
.course-option-mark { display: flex; align-items: center; flex: none; font-size: 12px; color: var(--muted); }
.course-option[aria-selected="false"] .course-option-mark svg { visibility: hidden; }
.course-option[aria-selected="true"] .course-option-mark { color: var(--accent); }
.course-option[aria-disabled="true"] { cursor: default; color: var(--muted); }
