/* The course box (course-box.js): the page's own text field with a chevron
   that turns over while the list is open. The list drops under it as a
   paper sheet with the menu's lift, grouped like the courses page: code,
   then the name, then a note such as a price. The active option (arrows
   or mouse) is Clear's selection tint; the picked one has a selection-blue
   tick. Every color is a Clear token or a page.css token. */
.cbox { position: relative; }
.cbox .cbox__input { padding-right: 44px; text-overflow: ellipsis; }
.cbox .cbox__input::placeholder { color: var(--muted-foreground); }
.cbox::after { content: ""; position: absolute; right: 16px; top: 24px; width: 16px; height: 16px; margin-top: -8px; background: var(--muted-foreground); pointer-events: none; transition: transform 200ms var(--ease-signature);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") center / 16px 16px no-repeat; }
.cbox.is-open::after { transform: rotate(180deg); }
.cbox__pop { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: min(340px, 52vh); max-height: min(340px, 52svh); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--lift-2); }
.cbox__group { padding: 12px 10px 6px; font-size: 12px; line-height: 16px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); }
.cbox__pop [role="group"]:first-child > .cbox__group { padding-top: 6px; }
.cbox__opt { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto 16px; column-gap: 12px; align-items: baseline; padding: 9px 10px; border-radius: var(--radius-lg); cursor: pointer; }
.cbox__code { grid-column: 1; font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--card-foreground); white-space: nowrap; }
/* A course with no code (a VEE part, a skills course): its name takes
   the code's place and runs across both columns. */
.cbox__code--wide { grid-column: 1 / 3; white-space: normal; font-weight: 600; letter-spacing: 0; }
.cbox__name { grid-column: 2; font-size: 14.5px; line-height: 20px; color: var(--muted-foreground); text-wrap: pretty; }
.cbox__note { grid-column: 3; font-size: 14.5px; line-height: 20px; font-weight: 600; color: var(--card-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbox__opt.is-active { background: color-mix(in srgb, var(--selection) 10%, var(--paper)); }
.cbox__opt.is-active .cbox__name { color: var(--on-tint-muted); }
.cbox__opt[aria-selected="true"]::after { content: ""; grid-column: 4; align-self: center; width: 16px; height: 16px; background: var(--selection);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") center / 16px 16px no-repeat; }
.cbox__none { padding: 10px 10px 12px; font-size: 15px; line-height: 1.45; color: var(--muted-foreground); }
.cbox__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .cbox::after { transition: none; } }
@media (forced-colors: active) {
  .cbox::after { background: CanvasText; }
  .cbox__pop { border-color: CanvasText; }
  .cbox__opt.is-active { outline: 2px solid Highlight; outline-offset: -2px; }
  .cbox__opt[aria-selected="true"]::after { background: CanvasText; }
}
@media (max-width: 600px) {
  .cbox__opt { grid-template-columns: 72px minmax(0, 1fr) auto 16px; column-gap: 10px; }
}
