@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --asphalt: #1C1E22;
  --asphalt-2: #2A2D32;
  --paper: #F6F4EF;
  --paper-2: #FFFFFF;
  --line-yellow: #E8B93A;
  --line-yellow-dark: #B8890F;
  --ink: #262A2E;
  --ink-soft: #6B7280;
  --hairline: #DEDACF;
  --go: #2F7A4F;
  --go-bg: #E5F1E9;
  --stop: #B5392F;
  --stop-bg: #FBEAE8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3, .headline {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin: 0;
}

.topbar {
  background: var(--asphalt);
  color: var(--paper);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--line-yellow);
  position: relative;
  flex-shrink: 0;
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 3px;
  background: var(--asphalt);
  transform: translate(-50%, -50%);
  box-shadow: 0 -7px 0 0 var(--asphalt), 0 7px 0 0 var(--asphalt);
}

.brand-name {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--paper);
}

.topbar .who {
  font-size: 14px;
  color: #C9CBCF;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar button.link {
  background: none;
  border: none;
  color: var(--line-yellow);
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.lane-divider {
  height: 3px;
  margin: 32px 0;
  background-image: repeating-linear-gradient(to right, var(--line-yellow) 0, var(--line-yellow) 22px, transparent 22px, transparent 40px);
}

.hero { text-align: left; margin-bottom: 8px; }

.hero h1 { font-size: 34px; color: var(--asphalt); margin-bottom: 8px; }

.hero p { color: var(--ink-soft); font-size: 16px; max-width: 480px; }

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}

@media (max-width: 620px) {
  .role-grid { grid-template-columns: 1fr; }
}

.role-card {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 28px 24px;
  cursor: pointer;
  text-align: left;
  font-family: 'Work Sans', sans-serif;
}

.role-card:hover { border-color: var(--asphalt); }

.role-card h3 { font-size: 19px; color: var(--asphalt); margin-bottom: 6px; }

.role-card p { color: var(--ink-soft); font-size: 14px; margin: 0; }

.card {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 28px;
  max-width: 420px;
}

.card.wide { max-width: none; }

label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}

label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: 'Work Sans', sans-serif;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}

/* tick boxes sit in front of their text instead of stretching across the row */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

textarea { resize: vertical; min-height: 60px; line-height: 1.4; }

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--asphalt); }

input:disabled { background: var(--paper-2); color: var(--ink-soft); }

.btn {
  display: inline-block;
  padding: 11px 22px;
  font-family: 'Work Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  border-radius: 3px;
  border: 1px solid var(--asphalt);
  background: var(--asphalt);
  color: var(--paper);
  cursor: pointer;
}

.btn:hover { background: var(--asphalt-2); }

.btn.accent {
  background: var(--line-yellow);
  border-color: var(--line-yellow-dark);
  color: var(--asphalt);
}

.btn.accent:hover { background: #DCAB2C; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}

.btn.ghost:hover { border-color: var(--asphalt); }

.btn.small { padding: 7px 14px; font-size: 13px; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.form-actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; }

.tabs {
  display: flex;
  flex-wrap: wrap;   /* the instructor has six tabs: let them wrap on a phone */
  gap: 0 4px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px;
}
@media (max-width: 620px) {
  .tab { padding: 9px 10px; font-size: 14px; white-space: nowrap; }
}

.tab {
  padding: 10px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  background: none;
  border-top: none; border-left: none; border-right: none;
}

.tab.active { color: var(--asphalt); border-bottom-color: var(--line-yellow); }

.auth-toggle { display: flex; gap: 18px; margin-bottom: 20px; }

.auth-toggle button {
  background: none;
  border: none;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 0 6px;
  border-bottom: 3px solid transparent;
}

.auth-toggle button.active { color: var(--asphalt); border-bottom-color: var(--line-yellow); }

.error-msg {
  background: var(--stop-bg);
  color: var(--stop);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 3px;
  margin-top: 14px;
}

.success-msg {
  background: var(--go-bg);
  color: var(--go);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 3px;
  margin-bottom: 20px;
}

.date-group { margin-bottom: 28px; }

.date-heading {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--asphalt);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.slot-time {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  color: var(--asphalt);
  min-width: 70px;
}

.slot-meta { font-size: 13px; color: var(--ink-soft); flex: 1; }

.slot-price { font-family: 'Oswald', sans-serif; font-size: 15px; color: var(--asphalt); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.badge.available { background: var(--go-bg); color: var(--go); }
.badge.booked { background: var(--stop-bg); color: var(--stop); }
.badge.paid { background: var(--go-bg); color: var(--go); }
.badge.unpaid { background: #FBF2E0; color: #8C5E0B; }

.slot-actions { display: flex; gap: 8px; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px dashed var(--hairline);
  border-radius: 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 30, 34, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  background: var(--paper-2);
  border-radius: 4px;
  padding: 30px;
  max-width: 380px;
  width: 100%;
  margin: auto;                 /* vertically centre when it fits */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal h3 { font-size: 20px; color: var(--asphalt); margin-bottom: 4px; }
.modal .lesson-summary { font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }

.footer-note {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-soft);
}

.setup-notice {
  background: #FBF2E0;
  border: 1px solid var(--line-yellow-dark);
  border-radius: 4px;
  padding: 20px 24px;
  color: #6b4e0b;
  font-size: 14px;
}

.setup-notice h3 { color: #6b4e0b; margin-bottom: 8px; font-size: 17px; }
.setup-notice code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

.hours-grid { display: flex; flex-direction: column; gap: 10px; }

.hours-row {
  display: grid;
  grid-template-columns: 150px 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.hours-row input[type="time"] { width: 100%; }

.hours-day {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.hours-day input { width: auto; }

@media (max-width: 560px) {
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-row .hours-day { grid-column: 1 / -1; }
  .hours-row span { display: none; }
}

.balance-banner {
  background: var(--go-bg);
  border: 1px solid #BBD9C6;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--ink);
}

.student-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.student-balance {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--asphalt);
  background: var(--go-bg);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--go-bg); border: 1px solid #BBD9C6; border-radius: 14px;
  padding: 3px 4px 3px 12px; font-size: 14px; color: var(--ink);
}
.chip-x {
  border: none; background: transparent; cursor: pointer; font-size: 16px; line-height: 1;
  width: 22px; height: 22px; border-radius: 50%; color: var(--ink-soft);
}
.chip-x:hover { background: rgba(0,0,0,.08); }
.fs-add { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.fs-add input { width: 150px; }

/* ---- Student lesson history (Students tab) ---- */
.lesson-log { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.lesson-log summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--asphalt); }
.lesson-log-empty { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); }
.log-list { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.log-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--ink);
}
.log-row:last-child { border-bottom: none; }
.log-when { white-space: nowrap; }
.log-row.cancelled { color: #B3261E; }
.log-row.cancelled .log-when { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.log-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--hairline); color: var(--ink-soft);
}
.log-badge.cancelled { background: #FBE4E2; color: #B3261E; }
/* what happened to a cancelled lesson: hours back on the balance, or charged */
.log-out { font-size: 12px; font-weight: 600; }
.log-out.refunded { color: var(--go); }
.log-out.charged { color: #B3261E; }
.lesson-log .log-list { margin-top: 10px; }
/* on the student's own page the history sits alone in its card */
.card.wide > .lesson-log:only-child { margin-top: 0; padding-top: 0; border-top: none; }

.sms-link {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px;
  background: var(--line-yellow); color: var(--asphalt); font-weight: 600;
  font-size: 12px; text-decoration: none; white-space: nowrap;
}
.sms-link:hover { background: #DCAB2C; }

/* ---- Instructor "Today" page ---- */
.today-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.today-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper-2); border: 1px solid var(--hairline);
  border-left: 4px solid var(--hairline); border-radius: 4px;
  padding: 14px 16px; margin-bottom: 12px;
}
.today-card.next { border-left-color: var(--line-yellow-dark); background: #FFFBF0; }
.today-card.now { border-left-color: var(--go); background: var(--go-bg); }
.today-card.done { opacity: .6; }
.today-time { min-width: 52px; font-family: 'Oswald', sans-serif; color: var(--asphalt); line-height: 1.2; }
.today-time b { display: block; font-size: 20px; }
.today-time span { font-size: 13px; color: var(--ink-soft); }
.today-main { flex: 1; min-width: 0; }
.today-name { font-weight: 600; font-size: 16px; color: var(--ink); }
/* ---- Student progress ---- */
.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.seg-btn {
  padding: 9px 16px; border: none; background: var(--paper); cursor: pointer;
  font-family: 'Work Sans', sans-serif; font-size: 14px; color: var(--ink-soft);
}
.seg-btn + .seg-btn { border-left: 1px solid var(--hairline); }
.seg-btn.on { background: var(--line-yellow); color: var(--asphalt); font-weight: 600; }
.prog-inline { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.prog-inline-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--asphalt); }
.prog-inline-pct { font-family: 'Oswald', sans-serif; font-size: 22px; }
.prog-details { margin-top: 10px; }
.prog-details > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--asphalt); }
.prog-bar { height: 10px; background: var(--hairline); border-radius: 6px; overflow: hidden; }
.prog-bar > span { display: block; height: 100%; background: var(--go); border-radius: 6px; transition: width .25s; }
.prog-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.prog-pct { font-family: 'Oswald', sans-serif; font-size: 38px; line-height: 1; color: var(--asphalt); }
.prog-pct-label { font-family: 'Oswald', sans-serif; font-size: 15px; color: var(--ink-soft); }

.prog-row { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.prog-row:last-child { border-bottom: none; }
.prog-name { font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 8px; }
.rate-group { display: flex; gap: 6px; }
.rate-btn, .rate-dot {
  width: 42px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--paper);
  font-family: 'Oswald', sans-serif; font-size: 16px; color: var(--ink-soft);
}
.rate-btn { cursor: pointer; }
.rate-btn:hover { border-color: var(--asphalt); }
.rate-btn.on, .rate-dot.on { background: var(--go-bg); border-color: var(--go); color: var(--asphalt); }
.rate-btn[aria-pressed="true"] { background: var(--go); border-color: var(--go); color: #fff; }
.rate-dot { width: 34px; height: 30px; font-size: 14px; }
.prog-level { margin: 6px 0 0; }

.prog-student {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 4px;
  padding: 12px 14px; margin-bottom: 8px; font-family: 'Work Sans', sans-serif; color: var(--ink);
}
.prog-student:hover { border-color: var(--asphalt); }
.prog-student-name { flex: 1.2; font-weight: 600; font-size: 15px; min-width: 0; }
.prog-student-bar { flex: 1; min-width: 60px; }
.prog-student-pct { width: 44px; text-align: right; font-family: 'Oswald', sans-serif; color: var(--asphalt); }
.cat-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.cat-row input { flex: 1; min-width: 0; }
.cat-row .btn { padding: 8px 10px; }
@media (max-width: 620px) {
  .prog-student { flex-wrap: wrap; }
  .prog-student-name { flex: 1 1 100%; }
  .prog-student-bar { flex: 1; }
}

.name-link {
  border: none; background: none; padding: 0; cursor: pointer; text-align: left;
  font: inherit; font-weight: 600; color: var(--asphalt);
  text-decoration: underline; text-decoration-color: var(--line-yellow-dark);
  text-underline-offset: 3px;
}
.name-link:hover { color: var(--line-yellow-dark); }
.student-back { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.today-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; vertical-align: 1px;
  background: #F3E3B0; color: var(--asphalt);
}
.today-tag.now { background: var(--go); color: #fff; }
.today-tag.done { background: var(--hairline); color: var(--ink-soft); }

.len-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 14px; }
.len-check { display: flex; align-items: center; margin: 0; font-size: 14px; color: var(--ink); cursor: pointer; }

.length-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.length-opt {
  flex: 1 1 0; min-width: 72px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px; border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-family: 'Work Sans', sans-serif;
}
.length-opt b { font-size: 14px; font-weight: 600; }
.length-opt span { font-size: 12px; color: var(--ink-soft); }
.length-opt.on { border-color: var(--asphalt); background: var(--line-yellow); }
.length-opt.on span { color: var(--asphalt); }
.length-opt.none:not(.on) { opacity: .45; }

.use-prepaid-row {
  display: flex; align-items: center; margin: 0 0 12px;
  font-size: 14px; color: var(--ink); cursor: pointer;
}

.student-toolbar {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.student-toolbar input { width: 100%; }
.student-toolbar .btn { white-space: nowrap; }

.grant-form { margin-top: 4px; }

.student-contact { margin-top: 6px; }
.student-edit-form { margin-top: 6px; }

.addr-link {
  display: inline-block;
  color: var(--go);
  font-size: 13px;
  text-decoration: none;
  line-height: 1.35;
}
.addr-link:hover { text-decoration: underline; }

.cal-ev-pin {
  display: inline-block;
  margin: 2px 0;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--line-yellow);
  color: var(--asphalt);
  white-space: nowrap;
}
.cal-ev-pin:hover { background: #DCAB2C; }

.credit-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.credit-line {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 2px 0;
}

/* ---- Week calendar ---- */
.cal-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn.small { padding: 6px 12px; }
.cal-range { font-family: 'Oswald', sans-serif; font-size: 15px; color: var(--asphalt); }

.cal-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-soft); margin-bottom: 10px;
}
.cal-legend .sw {
  display: inline-block; width: 12px; height: 12px; border-radius: 2px;
  margin-right: 5px; vertical-align: -1px;
}
.sw.online { background: var(--go-bg); border-left: 3px solid var(--go); }
.sw.credit { background: #E7EEF6; border-left: 3px solid #3D6AA8; }
.sw.manual { background: #FBF2E0; border-left: 3px solid var(--line-yellow-dark); }
.sw.off { background: repeating-linear-gradient(45deg, #E6E2D8, #E6E2D8 4px, #EFECE4 4px, #EFECE4 8px); }

.cal-scroll {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}
/* mirror scrollbar shown above the calendar when its own is off-screen */
.cal-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--hairline);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
.cal-scroll-top > div { height: 1px; }
.cal-grid {
  --cal-head: 48px;   /* header row height */
  --cal-row: 22px;    /* height of each half hour */
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(116px, 1fr));
  min-width: 840px;
  background: var(--paper-2);
}
/* top-left corner: frozen on both axes */
.cal-corner {
  grid-column: 1; grid-row: 1;
  position: sticky; top: 0; left: 0; z-index: 6;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
/* day headers: frozen while scrolling vertically */
.cal-dayhead {
  grid-row: 1; text-align: center;
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper-2);
  font-family: 'Oswald', sans-serif; font-size: 12px; color: var(--ink-soft);
  padding: 4px; line-height: 1.25;
  border-bottom: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.cal-dayhead b { display: block; font-size: 17px; color: var(--asphalt); }
.cal-dayhead.is-today b { color: var(--line-yellow-dark); }

/* time labels: frozen while scrolling sideways */
.cal-hour {
  grid-column: 1;
  position: sticky; left: 0; z-index: 5;
  background: var(--paper-2);
  font-size: 11px; color: var(--ink-soft); text-align: right;
  padding: 1px 6px 0 0;
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.cal-cell {
  border-left: 1px solid var(--hairline);
}
.cal-cell.hour { border-top: 1px solid var(--hairline); }
.cal-cell.open { background: var(--paper-2); cursor: pointer; }
.cal-cell.open:hover { background: #FBF3DE; }
.cal-cell.closed { background: #F1EEE7; }

.cal-event {
  margin: 1px 2px; border: none; border-left: 3px solid var(--go);
  background: var(--go-bg); border-radius: 3px; padding: 2px 5px;
  font-family: 'Work Sans', sans-serif; font-size: 11px; line-height: 1.15;
  text-align: left; cursor: pointer; overflow: hidden; z-index: 3;
}
.cal-event.online { background: var(--go-bg); border-left-color: var(--go); }
.cal-event.manual { background: #FBF2E0; border-left-color: var(--line-yellow-dark); }
.cal-event.credit { background: #E7EEF6; border-left-color: #3D6AA8; }
.cal-event.awaiting { opacity: .55; border-left-style: dashed; }
.cal-event:hover { filter: brightness(0.97); }
.cal-ev-time { font-family: 'Oswald', sans-serif; font-weight: 600; color: var(--asphalt); display: block; }
.cal-ev-name { color: var(--ink); display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.cal-off {
  margin: 1px 2px; z-index: 2; border: none; border-radius: 2px; cursor: pointer;
  background: repeating-linear-gradient(45deg, #E6E2D8, #E6E2D8 5px, #EFECE4 5px, #EFECE4 10px);
  font-family: 'Work Sans', sans-serif; font-size: 10px; color: #6B6555;
  text-align: center; padding: 2px 4px; line-height: 1.2;
}
.cal-off:hover { filter: brightness(0.96); }
.cal-off-day { display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; }

/* ---- Week calendar on a phone: squeeze the whole week onto the screen ---- */
@media (max-width: 620px) {
  .cal-grid {
    --cal-head: 36px;
    --cal-row: 16px;
    grid-template-columns: 34px repeat(7, minmax(0, 1fr));
    min-width: 0;
  }
  .cal-scroll { max-height: 72vh; }
  .cal-hint { display: none; }
  .cal-legend { gap: 10px; font-size: 11px; margin-bottom: 8px; }
  .cal-bar { margin-bottom: 8px; }
  .cal-range { font-size: 13px; }
  .cal-dayhead { font-size: 9px; padding: 2px 0; }
  .cal-dayhead b { font-size: 13px; }
  .cal-hour { font-size: 9px; padding-right: 3px; }
  .cal-event { margin: 1px; padding: 1px 2px 1px 3px; font-size: 9px; border-left-width: 2px; }
  .cal-ev-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.1; }
  .cal-ev-pin { font-size: 10px; padding: 0 3px; margin: 1px 0; }
  .cal-ev-pin .pin-txt { display: none; }
  .cal-off { font-size: 8px; padding: 1px 2px; margin: 1px; }
}

/* ---- Student month picker ---- */
.month-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.month-label { font-family: 'Oswald', sans-serif; font-size: 17px; color: var(--asphalt); }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month-dow {
  text-align: center; font-size: 11px; letter-spacing: 0.5px;
  font-family: 'Oswald', sans-serif; color: var(--ink-soft); padding-bottom: 2px;
}
.month-cell {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--paper-2); color: var(--ink-soft); font-size: 14px;
}
.month-cell.blank { border: none; background: transparent; }
.month-cell.muted { opacity: 0.45; }
.month-cell.has-avail {
  color: var(--asphalt); font-weight: 600;
  background: var(--go-bg); border-color: #BBD9C6; cursor: pointer;
}
.month-cell.has-avail:hover { background: #D6EADF; }
.month-cell.is-today { border-color: var(--asphalt); }
.month-cell.picked { outline: 2px solid var(--asphalt); outline-offset: -1px; }
.mc-dot {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--go);
}

.qty-row {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 10px 0 6px;
}
.qty-row .btn { min-width: 44px; font-size: 18px; padding: 6px 0; }
.qty-val {
  font-family: 'Oswald', sans-serif; font-size: 18px; color: var(--asphalt);
  text-align: center; min-width: 118px;
}
.qty-val .note { display: block; margin-top: 2px; }

.day-modal { max-width: 420px; }
.day-slots {
  max-height: 55vh; overflow-y: auto;
  margin-top: 4px; border-top: 1px solid var(--hairline);
}
.day-slots .slot-row { padding: 10px 12px; margin-bottom: 6px; }
