:root {
  color-scheme: light;
  --ink: #292620;
  --muted: #686157;
  --line: #d9d2c6;
  --panel: #fffefa;
  --bg: #f5f1e8;
  --green: #35604a;
  --teal: #50634b;
  --amber: #855b15;
  --red: #a3342c;
  --blue: #93452c;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  font-weight: 400;
}

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #eee9df;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #17212b;
  font-weight: 650;
}

.eyebrow,
.panel-label,
.metric-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar .eyebrow,
.sidebar .panel-label {
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

h2 {
  margin-bottom: 0;
  max-width: 760px;
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #686157;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #eee2d5;
  border-color: #d8c4ae;
  color: var(--blue);
}

.panel,
.join-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: none;
}

.compact {
  background: #eee9df;
  border-color: #d9d2c6;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: auto;
  box-shadow: none;
}

.compact p:last-child {
  margin-bottom: 0;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 32px;
  display: grid;
  align-content: start;
  gap: 24px;
}

.topbar,
.section-heading,
.notification-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.topbar-status {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.status-pill,
.turn-badge,
.forecast-note {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 11px;
  background: #e9f0e8;
  color: var(--green);
  font-weight: 650;
  font-size: 0.82rem;
}

.live-clock {
  display: grid;
  justify-items: end;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fffefa;
}

.live-clock span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
}

.live-clock strong {
  color: var(--ink);
  font-size: 1rem;
}

.section-access {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.zoom-link {
  width: fit-content;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.status-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.68) 45%, transparent 70%);
  transform: translateX(-120%);
  animation: status-sheen 2.8s ease-in-out infinite;
}

.pulse {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(21, 132, 92, 0.14);
  animation: pulse-ring 1.6s ease-out infinite;
}

.signal-bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -1px;
}

.signal-bars i {
  width: 3px;
  border-radius: 999px;
  background: var(--green);
  animation: signal-rise 1.15s ease-in-out infinite;
}

.signal-bars i:nth-child(1) {
  height: 5px;
}

.signal-bars i:nth-child(2) {
  height: 8px;
  animation-delay: 120ms;
}

.signal-bars i:nth-child(3) {
  height: 11px;
  animation-delay: 240ms;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 132, 92, 0.32);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(21, 132, 92, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(21, 132, 92, 0);
  }
}

@keyframes signal-rise {
  0%,
  100% {
    transform: scaleY(0.64);
    opacity: 0.7;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes status-sheen {
  0%,
  42% {
    transform: translateX(-120%);
  }

  78%,
  100% {
    transform: translateX(120%);
  }
}

.hero-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
}

.queue-form {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.queue-form label:first-child,
.queue-form label:nth-child(3),
.queue-form .form-section,
.queue-form button {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c3baad;
  border-radius: 8px;
  padding: 12px;
  background: #fffefa;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 104px;
}

.primary-action,
.secondary-action,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
}

.primary-action {
  padding: 14px 16px;
  background: var(--blue);
  color: #fff;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.82;
}

.primary-action.loading {
  position: relative;
  overflow: hidden;
}

.primary-action.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.32) 46%, transparent 72%);
  animation: button-sheen 1.1s ease-in-out infinite;
}

.secondary-action {
  padding: 11px 14px;
  border: 1px solid #c3baad;
  background: #fff;
  color: var(--ink);
}

.refresh-action {
  padding-inline: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  background: #f0e9df;
  color: var(--blue);
  font-size: 1.1rem;
}

.queue-state {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #f3e8dc;
  border: 1px solid #ddc9b4;
}

.hidden {
  display: none;
}

.big-number {
  color: var(--blue);
  font-size: 2rem;
  font-weight: 650;
}

.meter {
  height: 14px;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e2d6;
}

.meter span {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: var(--amber);
  transition: width 300ms ease, background 300ms ease;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-row > div {
  padding: 14px;
  border-radius: 8px;
  background: #f0ece3;
}

.metric-row strong,
.queue-state strong {
  font-size: 1.35rem;
}

.recommendations,
.forecast {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.recommendation,
.forecast-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fffefa;
}

.recommendation strong,
.forecast-row strong {
  display: block;
  margin-bottom: 3px;
}

.tag {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 650;
}

.tag.low {
  background: #e9f0e8;
  color: var(--green);
}

.tag.medium {
  background: #f6edda;
  color: var(--amber);
}

.tag.high {
  background: #f9e8e3;
  color: var(--red);
}

.bar {
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e9e2d6;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.notification-panel {
  align-items: center;
}

.notification-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  max-width: 720px;
}

.staff-panel {
  display: grid;
  gap: 20px;
}

.staff-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1.18fr);
  gap: 18px;
}

.current-student {
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  padding: 18px;
  background: #f8f5ef;
}

.current-student h3 {
  margin-bottom: 8px;
}

.current-student p:last-of-type {
  color: var(--muted);
}

.staff-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.staff-queue-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.joined-sessions-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.joined-session {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fffefa;
}

.joined-session.active {
  border-color: #b68566;
  background: #f3e8dc;
}

.joined-session strong,
.joined-session span,
.joined-session small {
  display: block;
}

.joined-session span,
.joined-session small {
  margin-top: 3px;
  color: var(--muted);
}

.staff-queue-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fffefa;
}

.staff-queue-item strong,
.staff-queue-item span {
  display: block;
}

.staff-queue-item span:not(.tag):not(.queue-position) {
  color: var(--muted);
  margin-top: 2px;
}

.student-question,
.ai-summary,
.ai-source,
.file-chip {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.student-question {
  color: var(--ink);
}

.queue-content-block {
  margin-top: 11px;
  padding: 11px 12px;
  border-radius: 8px;
}

.student-question-block {
  border: 1px solid var(--line);
  background: #fff;
}

.ai-summary-block {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: var(--panel);
}

.queue-content-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  color: #686157;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.staff-queue-item .queue-content-label span {
  display: inline;
  margin: 0;
}

.queue-content-label > span:last-child:not(.ai-label-mark) {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
}

.ai-label-mark {
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff !important;
  font-size: 0.62rem;
}

.queue-content-block .student-question,
.queue-content-block .ai-summary {
  margin: 0;
}

.ai-source {
  font-weight: 650;
}

#currentStudentNeed {
  display: grid;
  gap: 8px;
}

#currentStudentNeed strong {
  color: var(--ink);
}

.file-chip {
  width: max-content;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f0e9df;
  color: var(--blue);
  font-weight: 650;
}

.queue-position {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0e3d4;
  color: var(--blue);
  font-weight: 650;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #c3baad;
  border-radius: 8px;
  color: var(--muted);
  background: #fffefa;
}

.availability-panel {
  display: grid;
  gap: 18px;
}

.availability-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.slot-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.slot-button {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 13px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.slot-button:hover,
.slot-button.selected {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(36, 87, 166, 0.12);
}

.slot-button.selected {
  background: #f3e8dc;
}

.slot-button span,
.slot-button small {
  color: var(--muted);
}

.slot-remove {
  width: max-content;
  border: 1px solid #f0beb9;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff4f2;
  color: var(--red);
  font-weight: 650;
  cursor: pointer;
}

.selected-slot-label {
  margin: 0;
  color: var(--blue);
  font-weight: 650;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
  vertical-align: 2px;
}

.loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: loading-bounce 900ms ease-in-out infinite;
}

.loading-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.loading-dots i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes loading-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes button-sheen {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

.settings-workspace { max-width: 1100px; width: 100%; }
.settings-card { max-width: 720px; width: 100%; margin: 0; }
.settings-card form { display: grid; gap: 10px; }
.settings-card input:not([type="checkbox"]) { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.settings-readonly { color: var(--muted); }
.settings-card hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 20px 0 8px; }
.check-row { display: flex; align-items: center; gap: 10px; }
.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

.form-error {
  color: var(--red);
  font-weight: 650;
}

.notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #bdd9cc;
  border-radius: 8px;
  background: #edf1e8;
  color: var(--green);
  font-weight: 650;
}

.auth-panel,
.course-card,
.section-hero {
  display: grid;
  gap: 18px;
}

.auth-panel {
  width: min(520px, 100%);
  justify-self: start;
  align-content: start;
  padding: 28px;
}

#googleSignInButton {
  display: flex;
  align-items: center;
  min-height: 44px;
}

#googleSignInButton > div {
  max-width: 100%;
}

.stack-form,
.section-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.dashboard-actions,
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 18px;
}

.course-card-summary {
  min-height: 0;
  align-content: start;
  border-top: 3px solid var(--blue);
}

.course-card-summary .section-heading {
  flex-direction: column;
  gap: 16px;
}

.course-card-summary .muted {
  margin: 10px 0 0;
}

.compact-mode .course-list {
  gap: 12px;
}

.compact-mode .course-card-summary {
  min-height: 0;
  padding: 16px;
}

.course-tools {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
}

.course-share-card {
  display: grid;
  gap: 18px;
}

.share-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.share-choice {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #f8f5ef;
}

.share-choice code {
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  background: #f0e3d4;
  color: var(--blue);
  font-weight: 650;
}

.share-choice .share-row {
  justify-content: flex-start;
}

.course-schedule-panel,
.course-past-panel {
  display: grid;
  gap: 18px;
}

.course-week-grid {
  grid-template-columns: repeat(7, minmax(145px, 1fr));
}

.course-week-grid .day-column {
  min-height: 260px;
  padding: 14px;
}

.course-week-grid .section-mini {
  padding: 12px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.share-panel {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.share-panel small {
  color: var(--muted);
  font-weight: 650;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.day-column {
  min-height: 170px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #f8f5ef;
}

.day-column > strong {
  color: var(--blue);
}

.section-mini,
.past-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9d2c6;
  border-radius: 8px;
  background: #fff;
}

.section-mini.highlighted,
.section-hero.highlighted {
  border-color: #e0a321;
  background: #fffaf0;
}

.change-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff2cc;
  color: #8a5800;
  font-weight: 650;
}

.link-button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.link-button span,
.link-button small {
  color: var(--muted);
}

.mini-editor {
  border-top: 1px solid #d9d2c6;
  padding-top: 8px;
}

.mini-editor summary,
.add-section summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 650;
}

.compact-form {
  margin-top: 10px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
}

.danger-action {
  border: 1px solid #f0beb9;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff4f2;
  color: var(--red);
  cursor: pointer;
  font-weight: 650;
}

.past-list {
  display: grid;
  gap: 10px;
}

.past-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.past-item span,
.past-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.back-button {
  width: max-content;
}

.section-hero {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.section-hero p:last-child {
  margin-bottom: 0;
}

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

  .sidebar {
    min-height: auto;
  }

  .hero-grid,
  .content-grid,
  .staff-grid,
  .dashboard-actions,
  .two-column,
  .section-hero,
  .role-grid,
  .availability-form {
    grid-template-columns: 1fr;
  }

  .course-tools,
  .share-choice-grid {
    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(160px, 1fr));
  }

  .share-panel {
    justify-items: start;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .notification-panel,
  .queue-state {
    flex-direction: column;
    display: flex;
  }

  .topbar-status,
  .live-clock {
    justify-items: start;
  }

  .queue-form,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .status-pill,
  .turn-badge,
  .forecast-note {
    white-space: normal;
  }

  .staff-actions {
    flex-direction: column;
  }

  .staff-queue-item {
    grid-template-columns: 34px 1fr;
  }

  .joined-session {
    grid-template-columns: 1fr;
  }

  .staff-queue-item .tag {
    grid-column: 2;
    width: max-content;
  }
}

/* Navigation and shared interaction states. */
.sidebar-toggle { align-self: flex-end; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; font-size: 1.35rem; }
.nav-item { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.nav-icon { width: 20px; flex-shrink: 0; text-align: center; font-size: 1.2rem; }
.shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding-inline: 12px; }
.sidebar-collapsed .brand { justify-content: center; }
.sidebar-collapsed .brand > div, .sidebar-collapsed .nav-label, .sidebar-collapsed .compact { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 10px; }
.sidebar-collapsed .sidebar-toggle { align-self: center; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #93452c; outline-offset: 3px; }
.primary-action:hover { background: #75351f; }
.secondary-action:hover, .icon-button:hover { background: #eee7dc; border-color: #b9a68e; }
.course-card-summary:hover { border-color: #b9a68e; box-shadow: 0 4px 14px rgba(16, 42, 67, 0.06); }
.course-card-summary h3 { line-height: 1.35; overflow-wrap: anywhere; }
.course-card-summary .primary-action { padding: 10px 14px; }
.course-card-summary .muted { font-size: 0.85rem; line-height: 1.5; }
.compact-mode .course-card-summary .section-heading { gap: 10px; }
.topbar-status { display: flex; align-items: center; flex-wrap: wrap; }
.live-clock { padding: 0 0 0 14px; border: 0; border-left: 1px solid var(--line); background: transparent; }
.status-pill::after { display: none; }
.pulse { animation: none; box-shadow: none; }
input, select, textarea { padding: 10px 12px; background: #fff; }
input[type="checkbox"] { width: auto; accent-color: var(--blue); }
#courseForm { grid-template-columns: minmax(80px, 0.7fr) minmax(120px, 1fr) auto; }
.dashboard-actions { align-items: start; }
.panel, .join-panel, .role-hero, .role-card { border-radius: 6px; }
.settings-card h3 { margin-bottom: 10px; }

/* Weekly calendar: fixed time scale, independently scrollable on small screens. */
#courseCalendar { min-width: 0; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.calendar-toolbar p { margin: 5px 0 0; }
.calendar-empty { margin-bottom: 12px; }
.calendar-scroll { overflow: auto; max-height: 640px; border: 1px solid var(--line); border-radius: 10px; }
.time-calendar { display: grid; grid-template-columns: 56px repeat(var(--day-count), minmax(125px, 1fr)); min-width: 690px; }
.calendar-corner, .calendar-day-heading { position: sticky; top: 0; z-index: 4; background: #fff; border-bottom: 1px solid var(--line); padding: 12px; }
.calendar-corner { font-size: 0.7rem; color: var(--muted); padding: 24px 8px; }
.calendar-day-heading { display: flex; align-items: center; justify-content: center; gap: 8px; border-left: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.calendar-day-heading strong { display: grid; place-items: center; width: 30px; height: 30px; font-size: 1rem; color: var(--ink); }
.calendar-day-heading.is-today strong { background: var(--blue); color: #fff; border-radius: 50%; }
.calendar-hours, .calendar-day { position: relative; height: var(--calendar-height); }
.calendar-hours span { position: absolute; right: 8px; font-size: 0.68rem; color: var(--muted); padding-top: 4px; }
.calendar-day { border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, #e4ded2 63px, #e4ded2 64px); }
.calendar-day.is-today { background-color: #f5efe4; }
.calendar-event { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; overflow: hidden; padding: 7px; border: 1px solid #d5bba0; border-left: 3px solid #93452c; border-radius: 5px; background: #f2e6d7; color: #773b26; text-align: left; cursor: pointer; font-size: 0.73rem; }
.calendar-event span { overflow-wrap: anywhere; }
.calendar-event:hover, .calendar-event:focus-visible { z-index: 2; background: #e8d6bf; }
.calendar-event.highlighted { background: #fff4dc; border-color: #deb55f; color: #775414; }
.current-time-line { position: absolute; z-index: 3; left: 0; right: 0; height: 2px; background: #d34b4b; pointer-events: none; }
.current-time-line span { position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d34b4b; }
.schedule-details summary { cursor: pointer; font-size: 0.88rem; color: var(--blue); font-weight: 650; }
.schedule-agenda { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: start; gap: 12px; margin-top: 16px; }
@media (max-width: 1100px) { .dashboard-actions { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell, .shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 16px 20px; gap: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-toggle { position: absolute; top: 20px; right: 20px; }
  .sidebar .brand { justify-content: flex-start; }
  .sidebar .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar .compact { display: none; }
  .sidebar-collapsed .sidebar { padding: 16px 20px; }
  .sidebar-collapsed .brand > div { display: block; }
  .sidebar-collapsed .nav { display: none; }
  .workspace { padding: 24px; }
}
@media (max-width: 620px) {
  .workspace { padding: 18px; gap: 18px; }
  .inline-form, #courseForm, .share-choice-grid { grid-template-columns: 1fr; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .role-page { padding: 16px; }
  .role-hero { padding: 24px; }
  .settings-actions { flex-wrap: wrap; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep sparse pages and collapsed tools sized to their content. */
.workspace { width: 100%; max-width: 1440px; }
.add-section-panel { padding: 16px 20px; }
.add-section .section-form { margin-top: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.add-section .section-form label:first-child,
.add-section .section-form label:nth-child(n+4),
.add-section .section-form button { grid-column: 1 / -1; }
.nav-icon svg { display: block; width: 22px; height: 22px; }
.change-note { border: 1px solid #dfb155; border-left: 4px solid #a96b00; background: #fff4d9; color: #694300; font-size: 0.85rem; }
.change-heading { display: block; margin-bottom: 8px; }
.change-note p { margin: 0; font-weight: 400; line-height: 1.5; }
.change-list { margin: 0; display: grid; gap: 10px; }
.change-list dt { font-weight: 650; margin-bottom: 3px; }
.change-list dd { margin: 0; overflow-wrap: anywhere; line-height: 1.5; font-weight: 400; }
.change-before { text-decoration: line-through; color: #76613c; }
.calendar-event.highlighted { border: 2px solid #b77a10; border-left-width: 4px; background: #fff0c4; }
.calendar-event.highlighted:hover, .calendar-event.highlighted:focus-visible { background: #ffe6a0; }
.change-badge { background: #855300; color: white; border-radius: 3px; padding: 1px 4px; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.section-mini.highlighted, .section-hero.highlighted { border-left: 4px solid #b77a10; }
.calendar-empty { padding: 24px; margin: 0; border: 1px dashed var(--line); border-radius: 8px; background: #f8f5ef; line-height: 1.6; }
.calendar-empty + .calendar-scroll { display: none; }

/* Reading rhythm and navigation cues shared across all workspaces. */
.nav-item.active { box-shadow: inset 3px 0 var(--blue); font-weight: 650; }
.nav-item:hover { border-color: #b9a68e; }
.topbar { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.topbar-status { justify-content: flex-end; gap: 12px; }
.panel h3, .join-panel h3 { line-height: 1.35; }
.panel p { line-height: 1.6; }
.primary-action, .secondary-action, .danger-action, .slot-remove { min-height: 44px; }
button, a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
.primary-action:disabled:hover { background: var(--blue); }
input::placeholder, textarea::placeholder { color: #776f64; opacity: 1; }
input:disabled { background: #f0ece3; color: var(--muted); }
input, select, textarea { min-height: 44px; }
input[type="checkbox"] { min-height: auto; width: 18px; height: 18px; flex-shrink: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.metric-row strong, .big-number, .queue-position, .live-clock strong { font-variant-numeric: tabular-nums; }
.calendar-hours span { font-size: 0.75rem; }
.calendar-event { font-size: 0.8rem; line-height: 1.35; }
.status-pill:has(.pulse) { background: #eee9df; color: var(--ink); }
.auth-panel { width: min(560px, 100%); }
.auth-panel .muted { margin: 12px 0 0; }
@media (max-width: 900px) {
  .sidebar { background: #eee9df; }
  .shell { align-content: start; }
}
@media (max-width: 620px) {
  .topbar-status { justify-content: flex-start; }
  .topbar h2 { overflow-wrap: anywhere; }
  .hero-grid, .content-grid, .staff-grid, .dashboard-actions,
  .two-column, .course-tools, .course-list { grid-template-columns: minmax(0, 1fr); }
  .add-section .section-form { grid-template-columns: minmax(0, 1fr); }
  .share-row { justify-content: flex-start; }
}

/* Task-first workspace layouts. */
.dashboard-layout, .course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 32px;
  align-items: start;
}
.course-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.dashboard-main, .course-main, .dashboard-rail, .course-rail {
  display: grid;
  gap: 32px;
  min-width: 0;
}
.directory-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.count-label {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font: 500 0.85rem "Segoe UI", sans-serif;
}
.text-link { color: var(--blue); font-size: 0.88rem; text-underline-offset: 4px; }
.course-directory { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.course-directory .directory-row {
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.course-code-badge {
  padding: 16px 10px;
  background: #e9e2d5;
  border-radius: 5px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
}
.course-row-copy { min-width: 0; }
.course-directory .muted { margin: 6px 0 0; }
.course-directory .directory-row:hover { background: #f0ece3; }
.course-directory .empty-state p { margin-bottom: 0; }
.dashboard-rail { gap: 18px; scroll-margin-top: 24px; }
.dashboard-rail .panel { padding: 24px; }
.dashboard-rail h3 { margin-bottom: 10px; }
.join-course-panel:focus-within { border-color: var(--blue); }
.dashboard-rail #courseForm { grid-template-columns: minmax(0, 1fr); }
.create-course-panel summary, .course-past-panel > summary, .section-settings > summary {
  cursor: pointer;
  font-weight: 650;
}
.create-course-panel[open] summary { margin-bottom: 16px; }
.rail-help { padding: 4px 10px; font-size: 0.88rem; color: var(--muted); }
.upcoming-overview { margin-top: 8px; }
.upcoming-list { border-top: 1px solid var(--line); }
.upcoming-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.upcoming-row:hover { background: #f0ece3; }
.upcoming-row strong, .upcoming-row .muted { display: block; }
.upcoming-row strong { font-size: 0.95rem; font-weight: 600; }
.upcoming-row .muted { margin-top: 4px; font-size: 0.85rem; }
.upcoming-date { font-size: 0.85rem; color: var(--blue); }
.upcoming-arrow { color: var(--blue); }
.empty-agenda { margin: 0; padding: 24px 0; color: var(--muted); line-height: 1.6; }
.course-layout .primary-agenda { grid-template-columns: minmax(0, 1fr); margin-top: 0; gap: 12px; }
.course-agenda-panel { min-width: 0; }
.course-agenda-panel > .small { margin: 8px 0 18px; }
.primary-agenda .section-mini { padding: 14px; background: #f8f5ef; }
.primary-agenda .link-button { gap: 5px; min-height: 44px; }
.primary-agenda .link-button strong { font-size: 0.95rem; }
.primary-agenda .link-button span, .primary-agenda .link-button small { font-size: 0.85rem; }
.primary-agenda .link-button::after { content: "View section →"; margin-top: 6px; color: var(--blue); font-weight: 600; }
.primary-agenda .mini-editor { margin-top: 6px; }
.course-main > *, .course-schedule-panel > * { min-width: 0; }
.course-layout .course-past-panel { display: block; }
.course-past-panel[open] > summary { margin-bottom: 20px; }
.course-rail { gap: 22px; }
.course-rail .share-choice-grid { grid-template-columns: minmax(0, 1fr); }
.course-rail .add-section .section-form { grid-template-columns: minmax(0, 1fr); }
.section-settings > .two-column { margin-top: 20px; }
.section-settings > .two-column > .panel { background: #f8f5ef; }
@media (max-width: 1180px) {
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  .dashboard-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .course-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-agenda-panel { grid-column: 1 / -1; }
  .course-agenda-panel .primary-agenda { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
}
@media (max-width: 620px) {
  .dashboard-layout, .course-layout { gap: 28px; }
  .dashboard-rail, .course-rail { grid-template-columns: minmax(0, 1fr); }
  .course-rail { order: -1; }
  .directory-heading { align-items: flex-start; }
  .course-directory .directory-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .directory-row .secondary-action { grid-column: 2; justify-self: start; }
  .course-code-badge { align-self: start; font-size: 0.78rem; }
  .course-row-copy h3 { font-size: 1.05rem; }
  .upcoming-row { grid-template-columns: minmax(0, 1fr) 20px; gap: 6px; }
  .upcoming-date { grid-column: 1; }
  .upcoming-arrow { grid-column: 2; grid-row: 1 / span 2; }
}

/* Homepage layout */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding: 18px clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.home-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.home-demo-link,
.home-text-link {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.home-demo-link span,
.home-text-link span {
  margin-left: 8px;
}

.home-demo-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
}

.home-demo-link:hover { background: #75351f; text-decoration: none; }

.home-text-link:hover,
.home-chooser-note a:hover {
  text-decoration: underline;
}

.home-main {
  max-width: 1600px;
  margin: 0 auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: clamp(48px, 8vw, 130px);
  padding: clamp(70px, 9vw, 140px) clamp(24px, 7vw, 110px);
}

.home-eyebrow {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-intro .home-eyebrow span {
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 8px 4px 0;
  background: currentColor;
}

.home-intro h1 {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 6.6vw, 6.8rem);
  font-weight: 400;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.home-intro h1 em {
  color: var(--blue);
  font-weight: 400;
}

.home-intro-copy {
  max-width: 430px;
  margin: 30px 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.home-chooser {
  padding: clamp(25px, 3.2vw, 46px);
  border: 1px solid #d8cbbd;
  background: var(--panel);
  box-shadow: 12px 12px 0 #e8dfd2;
}

.home-chooser-heading {
  margin-bottom: 30px;
}

.home-chooser-heading .home-eyebrow {
  margin-bottom: 12px;
}

.home-chooser-heading h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
}

.home-chooser-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.home-role {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 16px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.home-role-number,
.home-steps li > span {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-role-content {
  display: grid;
  gap: 4px;
}

.home-role-content strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
}

.home-role-content > span {
  color: var(--muted);
  font-size: 0.87rem;
}

.home-role-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d8c4ae;
  border-radius: 50%;
  color: var(--blue);
  transition: background 0.15s, color 0.15s;
}

.home-role:hover .home-role-arrow,
.home-role:focus-visible .home-role-arrow {
  background: var(--blue);
  color: white;
}

.home-chooser-note {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.home-chooser-note a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

.home-how {
  padding: 50px clamp(24px, 7vw, 110px) 65px;
  border-top: 1px solid var(--line);
  background: #eee9df;
}

.home-how-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 35px;
}

.home-how-heading .home-eyebrow {
  margin: 0;
}

.home-how-heading h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 35px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-steps li {
  display: flex;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid #c9bfb0;
}

.home-steps h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.home-steps p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 70px;
    padding-bottom: 80px;
  }

  .home-intro h1 {
    max-width: 600px;
  }

  .home-chooser {
    max-width: 600px;
  }

  .home-how-heading {
    display: block;
  }

  .home-how-heading .home-eyebrow {
    margin-bottom: 12px;
  }
}

@media (max-width: 560px) {
  .home-header {
    min-height: 72px;
  }

  .home-intro h1 {
    font-size: clamp(3rem, 12vw, 4.5rem);
  }

  .home-steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
