/* Office-hours booking -- the single copy, shared by every course page.
   Pairs with scheduler.js. Availability comes from /office-windows.json and
   /schedule-blocks.txt; bookings go through the Netlify functions. */

#schedOverlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 30%, rgba(0,0,0,0.35));
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  padding: 1.2rem;
}
#schedOverlay.open { display: flex; }

    #schedOverlay.open, #quizOverlay.open { display: flex; }
    .sched-modal {
      position: relative;
      background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
      max-width: 780px; width: 100%; max-height: 88vh; overflow-y: auto;
      padding: 1.2rem 1.8rem 2rem;
      box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    }
    .sched-x {
      position: absolute; top: 0.7rem; right: 0.8rem;
      font-size: 1.5rem; line-height: 1; color: var(--text-muted);
      background: none; border: none; cursor: pointer; padding: 0.3rem 0.5rem;
    }
    .sched-x:hover { color: var(--text); }
    #schedOverlay .sched-wrap { margin: 0.6rem 0 0; max-width: none; }
    .sched-wrap h2 {
      font-size: 1.25rem; border: none; padding: 0; margin-bottom: 0.3rem;
    }
    .sched-lede { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.4rem; font-family: Arial, sans-serif; }
    .sched-card {
      background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
      padding: 1.6rem 1.8rem; box-shadow: 0 8px 30px rgba(0,0,0,0.07);
    }
    .sched-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; }
    .sched-field { display: flex; flex-direction: column; gap: 0.3rem; }
    .sched-field.full { grid-column: 1 / -1; }
    .sched-field label {
      font-family: Arial, sans-serif; font-size: 0.75rem; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--text-pale);
    }
    .sched-field input, .sched-field select, .sched-field textarea {
      font-family: Arial, sans-serif; font-size: 0.92rem; color: var(--text);
      background: var(--tag-bg); border: 1px solid var(--border); border-radius: 5px;
      padding: 0.55rem 0.7rem; width: 100%; box-sizing: border-box;
    }
    .sched-field textarea { resize: vertical; min-height: 72px; }
    .sched-field input:focus, .sched-field select:focus, .sched-field textarea:focus {
      outline: 2px solid rgba(44,95,138,0.35); outline-offset: 1px;
    }
    .email-hint { font-family: Arial, sans-serif; font-size: 0.75rem; color: var(--text-muted); }
    .email-hint.err { color: #b04a3a; }
    .prefill-note { display: none; font-family: Arial, sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.9rem; }
    .prefill-note a { color: inherit; text-decoration: underline; cursor: pointer; }
    .sched-submit {
      margin-top: 1.3rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    }
    .sched-submit button {
      font-family: Arial, sans-serif; font-size: 0.9rem; font-weight: 600;
      background: var(--accent, #2c5f8a); color: #fff; border: none; border-radius: 6px;
      padding: 0.65rem 1.6rem; cursor: pointer;
    }
    .sched-submit button:disabled { opacity: 0.55; cursor: default; }
    .sched-note { font-family: Arial, sans-serif; font-size: 0.78rem; color: var(--text-muted); }
    .sched-success {
      display: none; text-align: center; padding: 2.2rem 1rem;
      font-family: Arial, sans-serif;
    }
    .sched-success .big { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
    .sched-success .small { font-size: 0.88rem; color: var(--text-muted); }
    .sched-error {
      display: none; margin-top: 1rem; font-family: Arial, sans-serif; font-size: 0.85rem;
      color: #b04a3a;
    }
    .hp-field { position: absolute; left: -9999px; opacity: 0; }
    .cal-title {
      font-family: Arial, sans-serif; font-size: 0.75rem; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--text-pale); margin-bottom: 0.5rem;
    }
    .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
    .cal-dow {
      font-family: Arial, sans-serif; font-size: 0.66rem; letter-spacing: 0.05em;
      color: var(--text-pale); text-align: center; text-transform: uppercase; padding-bottom: 2px;
    }
    .cal-day {
      border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.1rem 0.85rem;
      text-align: center; font-family: Arial, sans-serif; background: var(--tag-bg);
      color: var(--text); cursor: pointer; position: relative; user-select: none;
    }
    .cal-day .cal-mon { display: block; font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; }
    .cal-day .cal-num { font-size: 0.95rem; font-weight: 600; }
    .cal-day.off { opacity: 0.32; cursor: default; background: transparent; }
    .cal-day.avail::after {
      content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
      width: 5px; height: 5px; border-radius: 50%; background: var(--accent, #2c5f8a);
    }
    .cal-day.selected { outline: 2px solid var(--accent, #2c5f8a); outline-offset: 1px; }
    .slot-row { margin-top: 0.9rem; display: none; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
    .slot-row.show { display: flex; }
    .slot-label { font-family: Arial, sans-serif; font-size: 0.78rem; color: var(--text-muted); margin-right: 0.3rem; }
    .slot-btn {
      font-family: Arial, sans-serif; font-size: 0.85rem; border: 1px solid var(--border);
      background: var(--tag-bg); color: var(--text); border-radius: 16px;
      padding: 0.4rem 1rem; cursor: pointer;
    }
    .slot-btn.selected { background: var(--accent, #2c5f8a); color: #fff; border-color: var(--accent, #2c5f8a); }
    .sel-summary {
      margin-top: 0.9rem; font-family: Arial, sans-serif; font-size: 0.88rem;
      color: var(--text); display: none;
    }
    .sel-summary strong { color: var(--accent, #2c5f8a); }
    .cal-none { font-family: Arial, sans-serif; font-size: 0.8rem; color: var(--text-muted); }
    .sched-fields.show { display: block; animation: fieldsIn 0.35s ease; }
/* the floating tab that opens the booking modal on every course page */
.oh-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 190; display: flex; align-items: center; gap: 0.45rem;
  font-family: Arial, sans-serif; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: #fff; background: var(--accent, #2c5f8a);
  border: none; cursor: pointer; padding: 0.95rem 0.55rem;
  border-radius: 5px 0 0 5px; box-shadow: 0 2px 14px rgba(0,0,0,0.22);
  writing-mode: vertical-rl; text-orientation: mixed;
  transition: padding 0.16s ease, background 0.16s ease;
}
.oh-tab:hover { padding-right: 0.85rem; background: #24506f; }
.oh-tab:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.oh-tab .oh-dot { writing-mode: horizontal-tb; font-size: 0.9rem; line-height: 1; }
@media (max-width: 700px) {
  .oh-tab { font-size: 0.68rem; padding: 0.8rem 0.45rem; letter-spacing: 0.09em; }
  .sched-grid { grid-template-columns: 1fr; }
}
@media print { .oh-tab { display: none; } }

/* meeting-mode picker and calendar wrapper */
/* ── calendar picker ── */
    .cal-wrap { margin-bottom: 1.4rem; }
.mode-btns { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.mode-btn {
      font-family: Arial, sans-serif; font-size: 0.88rem; font-weight: 600;
      border: 1.5px solid var(--border); background: var(--tag-bg); color: var(--text);
      border-radius: 8px; padding: 0.6rem 1.2rem; cursor: pointer; flex: 1; min-width: 110px;
    }
.mode-btn.selected { background: var(--accent, #2c5f8a); color: #fff; border-color: var(--accent, #2c5f8a); }
.mode-hint { font-family: Arial, sans-serif; font-size: 0.75rem; color: #b04a3a; display: none; }
.mode-btns.err .mode-btn:not(.selected) { border-color: #b04a3a; box-shadow: 0 0 0 3px rgba(176,74,58,0.18); }
