/* BSE Course Finder: clean, one question per screen. */
.cf-shell, .cf-staff, .cf-sheet {
  --cf-navy: #03113F; --cf-ink: #1F2A37; --cf-muted: #6B7280; --cf-line: #E5E7EB; --cf-soft: #F4F1EA;
  --cf-sel: #E6EAF4; --cf-bg: #FFFFFF; --cf-warn-bg: #FAEEDA; --cf-warn: #633806; --cf-err: #A32D2D;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--cf-ink);
}
@media (prefers-color-scheme: dark) {
  .cf-shell, .cf-staff, .cf-sheet { --cf-navy: #E6EAF4; --cf-ink: #E9ECF2; --cf-muted: #9CA3AF; --cf-line: #2A3346; --cf-soft: #141B2E; --cf-sel: #1C2742; --cf-bg: #0B1226; --cf-warn-bg: #412402; --cf-warn: #FAC775; --cf-err: #F09595; }
}
.cf-shell { background: var(--cf-bg); border-radius: 16px; overflow: hidden; max-width: 760px; margin: 0 auto; box-sizing: border-box; }
.cf-shell *, .cf-staff * { box-sizing: border-box; }
.cf-bar { height: 2px; background: var(--cf-line); }
.cf-bar i { display: block; height: 2px; width: 0; background: var(--cf-navy); transition: width .5s ease; }
.cf-view { min-height: 540px; display: flex; justify-content: center; align-items: flex-start; padding: 56px 24px; }
.cf-v-hi, .cf-v-wait, .cf-v-rec, .cf-v-human { align-items: center; }
.cf-col { width: 100%; max-width: 440px; }
.cf-center { max-width: 460px; text-align: center; }
.cf-k { font-size: 12px; color: var(--cf-muted); margin: 0 0 10px; letter-spacing: .2px; display: block; }
.cf-q { font-size: 22px; font-weight: 500; line-height: 1.3; margin: 0 0 22px; color: var(--cf-ink); }
.cf-big { font-size: 28px; margin-bottom: 12px; }
.cf-sub { font-size: 15px; color: var(--cf-muted); margin: -10px 0 24px; line-height: 1.5; }
.cf-center .cf-sub { margin-top: 0; }
.cf-meta { font-size: 13px; color: var(--cf-muted); margin: 0 0 24px; }
.cf-opts { display: flex; flex-direction: column; gap: 8px; }
.cf-o { display: block; width: 100%; text-align: left; padding: 13px 16px; border: 1px solid var(--cf-line); border-radius: 10px; background: transparent; font: inherit; font-size: 15px; line-height: 1.4; color: var(--cf-ink); cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s; }
.cf-o:hover { border-color: var(--cf-muted); }
.cf-o:focus-visible, .cf-p:focus-visible, .cf-l:focus-visible { outline: 2px solid var(--cf-navy); outline-offset: 2px; }
.cf-o.cf-s { border-color: var(--cf-navy); background: var(--cf-sel); }
.cf-alts .cf-o b { display: block; font-weight: 500; }
.cf-alts .cf-o span { display: block; font-size: 13px; color: var(--cf-muted); margin-top: 2px; }
.cf-p { display: inline-block; background: var(--cf-navy); color: var(--cf-bg); border: 0; border-radius: 10px; padding: 12px 24px; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center; }
.cf-p[disabled] { opacity: .6; cursor: progress; }
.cf-l { background: none; border: 0; color: var(--cf-muted); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; }
.cf-l:hover { color: var(--cf-ink); }
.cf-row { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.cf-row-l { display: flex; gap: 18px; }
.cf-stack { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.cf-stack .cf-l { align-self: center; }
.cf-links { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.cf-input { width: 100%; padding: 12px 14px; border: 1px solid var(--cf-line); border-radius: 10px; font: inherit; font-size: 16px; color: var(--cf-ink); background: var(--cf-bg); }
.cf-input:focus { outline: none; border-color: var(--cf-navy); }
.cf-code { letter-spacing: 6px; font-size: 22px; text-align: center; }
.cf-err { color: var(--cf-err); font-size: 13px; margin: 10px 0 0; }
.cf-warn { background: var(--cf-warn-bg); color: var(--cf-warn); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.5; text-align: left; margin: 0 0 18px; }
.cf-note { font-size: 13px; color: var(--cf-muted); line-height: 1.5; margin: 0 0 14px; }
.cf-rings { position: relative; width: 104px; height: 104px; margin: 0 auto 30px; }
.cf-rings i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--cf-navy); opacity: .5; }
.cf-rings b { position: absolute; inset: 42px; border-radius: 50%; background: var(--cf-navy); }
.cf-wm { font-size: 15px; color: var(--cf-muted); margin: 0; }
.cf-dash { width: 100%; max-width: 600px; }
.cf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.cf-tile { background: var(--cf-soft); border-radius: 10px; padding: 12px 14px; }
.cf-tile span { display: block; font-size: 12px; color: var(--cf-muted); margin-bottom: 4px; }
.cf-tile b { font-size: 16px; font-weight: 500; }
.cf-week { list-style: none; margin: 0 0 18px; padding: 0; }
.cf-week li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cf-line); font-size: 14px; }
.cf-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--cf-muted); flex: none; }
.cf-t { flex: 1; }
.cf-tag { font-size: 12px; color: var(--cf-muted); }
.cf-tag.cf-b { color: var(--cf-navy); }
.cf-m { font-size: 12px; color: var(--cf-muted); width: 52px; text-align: right; }
.cf-habit { font-size: 14px; line-height: 1.5; border: 1px solid var(--cf-line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.cf-habit b { font-weight: 500; display: block; font-size: 12px; color: var(--cf-muted); margin-bottom: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .cf-in { animation: cf-up .5s cubic-bezier(.2,.8,.2,1) both; }
  .cf-fade { animation: cf-fade .5s ease both; }
  .cf-rings i { animation: cf-ring 2.4s cubic-bezier(.2,.6,.3,1) infinite; }
  .cf-rings i:nth-child(2) { animation-delay: .8s; } .cf-rings i:nth-child(3) { animation-delay: 1.6s; }
  @keyframes cf-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes cf-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes cf-ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
}
@media (max-width: 600px) {
  .cf-shell { border-radius: 0; }
  .cf-view { padding: 32px 16px; min-height: 100svh; }
  .cf-q { font-size: 20px; } .cf-big { font-size: 24px; }
  .cf-o { padding: 15px 16px; }
  .cf-p { width: 100%; padding: 14px 24px; }
  .cf-row { flex-direction: column-reverse; align-items: stretch; }
  .cf-row-l { justify-content: space-between; }
  .cf-tiles { grid-template-columns: 1fr; }
}

/* Staff version */
.cf-staff { max-width: 980px; }
.cf-staff h2 { font-size: 16px; font-weight: 500; margin: 0 0 12px; }
.cf-staff .cf-card { background: var(--cf-bg); border: 1px solid var(--cf-line); border-radius: 12px; padding: 18px 20px; margin: 0 0 16px; }
.cf-staff .cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.cf-staff label { display: block; font-size: 13px; color: var(--cf-muted); margin: 0 0 4px; }
.cf-staff select, .cf-staff input[type=email], .cf-staff input[type=text], .cf-staff textarea { width: 100%; max-width: none; padding: 8px 10px; border: 1px solid var(--cf-line); border-radius: 8px; font: inherit; font-size: 14px; color: var(--cf-ink); background: var(--cf-bg); }
.cf-staff textarea { min-height: 70px; }
.cf-staff .cf-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 18px; font-size: 14px; }
.cf-staff .cf-checks label { color: var(--cf-ink); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 4px 0; }
.cf-staff .cf-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cf-staff .cf-inline > div { flex: 1; min-width: 220px; }
.cf-staff .cf-tests label { display: flex; gap: 8px; color: var(--cf-ink); font-size: 14px; padding: 6px 0; }
.cf-staff .cf-recbox { background: var(--cf-soft); border-radius: 10px; padding: 14px 16px; }
.cf-staff .cf-recbox b { font-size: 18px; font-weight: 500; display: block; margin-bottom: 4px; }
.cf-staff .cf-p, .cf-staff .cf-o { width: auto; }
.cf-staff .cf-ok { color: #3B6D11; font-size: 14px; }
.cf-staff table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cf-staff td, .cf-staff th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--cf-line); font-weight: 400; }
.cf-staff th { color: var(--cf-muted); }

/* Slide-up sheet */
.cf-sheet { position: fixed; inset: 0; z-index: 2147483600; display: flex; align-items: flex-end; justify-content: center; }
.cf-sheet[hidden] { display: none; }
.cf-sheet-bg { position: absolute; inset: 0; background: rgba(3, 17, 63, .45); opacity: 0; transition: opacity .35s ease; }
.cf-sheet-panel { position: relative; width: 100%; height: calc(100% - 28px); background: var(--cf-bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .5s cubic-bezier(.2,.85,.25,1); overflow-y: auto; overscroll-behavior: contain; }
.cf-sheet.cf-open .cf-sheet-bg { opacity: 1; }
.cf-sheet.cf-open .cf-sheet-panel { transform: translateY(0); }
.cf-sheet-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; align-items: center; height: 44px; background: var(--cf-bg); border-radius: 22px 22px 0 0; touch-action: none; cursor: grab; }
.cf-sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--cf-line); }
.cf-sheet-x { position: absolute; right: 14px; top: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--cf-soft); color: var(--cf-ink); font-size: 18px; line-height: 32px; cursor: pointer; padding: 0; }
.cf-sheet .cf-shell { border-radius: 0; max-width: 760px; }
.cf-sheet .cf-view { min-height: calc(100vh - 120px); }
html.cf-lock, html.cf-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .cf-sheet-bg, .cf-sheet-panel { transition: none; } }

/* Translucent (frosted glass) sheet */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cf-sheet-bg { background: rgba(3, 17, 63, .16); }
  .cf-sheet-panel, .cf-sheet-top { background: color-mix(in srgb, var(--cf-bg) 68%, transparent); }
  .cf-sheet-panel { -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); box-shadow: 0 -1px 0 rgba(255, 255, 255, .35) inset; }
  .cf-sheet-top { background: transparent; }
  .cf-sheet .cf-shell { background: transparent; }
  .cf-sheet .cf-o { background: color-mix(in srgb, var(--cf-bg) 55%, transparent); border-color: color-mix(in srgb, var(--cf-line) 70%, transparent); }
  .cf-sheet .cf-o.cf-s { background: color-mix(in srgb, var(--cf-sel) 85%, transparent); }
  .cf-sheet .cf-tile, .cf-sheet .cf-sheet-x { background: color-mix(in srgb, var(--cf-soft) 60%, transparent); }
  .cf-sheet .cf-input { background: color-mix(in srgb, var(--cf-bg) 75%, transparent); }
}

/* Language picker */
.cf-shell { position: relative; }
.cf-lang { position: absolute; top: 14px; right: 16px; z-index: 3; display: flex; gap: 4px; }
.cf-shell[dir="rtl"] .cf-lang { right: auto; left: 16px; }
.cf-lang button { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 13px; font-weight: 400; color: var(--cf-muted); cursor: pointer; border-radius: 6px; }
.cf-lang button.cf-on { color: var(--cf-navy); font-weight: 500; }
.cf-lang button:focus-visible { outline: 2px solid var(--cf-navy); outline-offset: 1px; }
.cf-shell[dir="rtl"] .cf-o, .cf-shell[dir="rtl"] .cf-col { text-align: right; }
