:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #61716d;
  --line: #dce5e1;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #b7791f;
  --red: #b42318;
  --blue: #2563eb;
  --shadow: 0 12px 32px rgba(18, 38, 35, 0.12);
  --rating-chip-size: 30px;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(244, 247, 246, 0) 280px), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.pdf-viewer-open {
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -14px -14px 14px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #f4f7f6;
  border-bottom: 1px solid rgba(220, 229, 225, 0.9);
}

.topbar-row, .person-line, .time-row, .course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-title {
  display: inline-block;
  margin: 0 0 4px;
  padding-bottom: 2px;
  border-bottom: 3px solid rgba(183, 121, 31, 0.46);
  color: var(--ink);
  font-size: clamp(1.08rem, 4.4vw, 1.35rem);
  font-weight: 950;
  line-height: 1.05;
  text-transform: none;
}

.updated, .next-meta, .meta-row {
  color: var(--muted);
  font-size: 0.92rem;
}

.updated {
  display: grid;
  gap: 2px;
}

.sync-pill, .role-pill, .status-pill, .catalog-pill, .course-flags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #f7faf9;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.sync-pill.is-fresh { border-color: rgba(15, 118, 110, 0.28); color: var(--teal-dark); }
.role-pill { border-color: rgba(37, 99, 235, 0.25); color: #1e40af; }
.role-pill.instructor { border-color: rgba(183, 121, 31, 0.36); color: #87530f; }
.role-pill.staff { border-color: rgba(15, 118, 110, 0.32); color: var(--teal-dark); }

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--teal);
  color: white;
  font-size: 0.88rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.2);
}

.refresh-button:disabled {
  background: #9fb9b4;
}

.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 8px;
  background: radial-gradient(circle at right top, rgba(183, 121, 31, 0.16), transparent 230px), var(--panel);
  box-shadow: var(--shadow);
}

.person-line { align-items: flex-start; }

.person-name {
  margin: 0;
  font-size: clamp(1.9rem, 9vw, 3.15rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.next-panel {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #eef8f6;
}

.next-panel.is-done {
  border-color: rgba(37, 99, 235, 0.18);
  background: #eff6ff;
}

.next-test-note {
  margin-top: 4px;
  color: #87530f;
  font-size: 0.78rem;
  font-weight: 800;
}

.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.next-title, .course-title {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.18;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.tab {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #dff3ef;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0 6px;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 4px 10px rgba(18, 38, 35, 0.08);
}

.tab.is-active {
  background: var(--teal);
  color: white;
}

.panel, .catalog-list, .meta-grid, .catalog-tools {
  display: grid;
  gap: 12px;
}

.schedule-card, .course-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(18, 38, 35, 0.07);
}

.schedule-template-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(18, 38, 35, 0.07);
}

.schedule-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-template-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-template-table th,
.schedule-template-table td {
  border: 2px solid #111827;
  padding: 10px;
  color: #050505;
  font-size: 0.96rem;
  line-height: 1.2;
  text-align: left;
  vertical-align: top;
}

.schedule-template-table thead th {
  background: #d1d1d1;
  font-size: 1rem;
  font-weight: 900;
}

.schedule-template-table th:nth-child(1),
.schedule-template-table td:nth-child(1) {
  width: 96px;
}

.schedule-template-table th:nth-child(2),
.schedule-template-table td:nth-child(2) {
  width: 150px;
}

.schedule-template-table th:nth-child(4),
.schedule-template-table td:nth-child(4) {
  width: 130px;
}

.schedule-template-table tbody th {
  font-weight: 800;
}

.schedule-template-table tr.is-common th,
.schedule-template-table tr.is-common td {
  background: #fffdd2;
}

.schedule-template-table tr.is-empty .schedule-course-name {
  color: var(--muted);
  font-style: italic;
}

.schedule-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.schedule-card-list {
  display: grid;
  gap: 12px;
}

.schedule-card {
  display: grid;
  grid-template-columns: 6px 1fr;
}

.schedule-card .accent { background: var(--teal); }
.schedule-card.changed .accent { background: var(--gold); }
.schedule-card.canceled .accent { background: var(--red); }
.schedule-block-card.is-common .accent { background: var(--gold); }
.schedule-block-card.no-class .accent { background: #9fb9b4; }
.checkin-card.checked-in .accent { background: var(--blue); }

.card-body {
  display: grid;
  gap: 8px;
  padding: 15px;
}

.schedule-block-card .card-body {
  gap: 10px;
}

.schedule-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.session-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  background: #eef8f6;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-time {
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 850;
  text-align: right;
}

.schedule-block-card.is-common {
  border-color: rgba(183, 121, 31, 0.32);
  background: #fffdf1;
}

.schedule-block-card.no-class .course-title {
  color: var(--muted);
  font-style: italic;
}

.time { color: var(--teal-dark); font-size: 0.92rem; font-weight: 850; }

.meta-row { display: flex; align-items: center; gap: 8px; }

.meta-icon {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  padding: 0 7px;
  background: #eef2f1;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.status-pill { color: var(--teal-dark); font-size: 0.72rem; text-transform: capitalize; }
.status-pill.room_changed { border-color: rgba(183, 121, 31, 0.3); color: #87530f; background: #fff8eb; }
.status-pill.canceled { border-color: rgba(180, 35, 24, 0.24); color: var(--red); background: #fff1f0; }

.notice {
  border: 1px solid rgba(183, 121, 31, 0.32);
  border-radius: 8px;
  padding: 12px;
  background: #fff8eb;
  color: #69410a;
  font-weight: 700;
}

.info-notice {
  border-color: rgba(37, 99, 235, 0.24);
  background: #eff6ff;
  color: #1e40af;
}

.error-notice {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff1f0;
  color: var(--red);
}

.catalog-tools {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.catalog-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
}

.catalog-summary strong { color: var(--ink); font-size: 1.4rem; }

.catalog-search input, .lookup-form input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.filter-row, .pdf-row, .course-flags, .course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.catalog-session-row {
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
}

.catalog-select {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #dff3ef;
  color: var(--teal-dark);
  font-weight: 850;
  box-shadow: 0 5px 12px rgba(18, 38, 35, 0.08);
}

.catalog-pdf-menu-button,
.pdf-choice-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: white;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.18);
}

.catalog-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 12px;
  background: #dff3ef;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 5px 12px rgba(18, 38, 35, 0.08);
}

.catalog-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.course-card {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.course-card.in-schedule {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.course-code {
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.catalog-pill { color: #87530f; background: #fff8eb; border-color: rgba(183, 121, 31, 0.28); }
.course-card h2 { margin: 0; font-size: 1.18rem; line-height: 1.2; }
.course-card p { margin: 0; color: var(--muted); line-height: 1.42; }
.course-description {
  padding-top: 2px;
}
.course-details {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf9;
}
.course-offering-summary {
  border-radius: 8px;
  padding: 10px;
  background: #eef8f6;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.35;
}
.course-offering-list {
  display: grid;
  gap: 8px;
}
.course-offering-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}
.course-offering-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.course-offering-row strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}
.course-offering-row span,
.course-offering-empty {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.course-flags span { background: #f7faf9; }
.course-flags .in-schedule-pill { border-color: rgba(37, 99, 235, 0.28); color: #1e40af; background: #eff6ff; }

.course-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-top: 2px;
}

.map-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(18, 38, 35, 0.07);
}

.map-header {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.map-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-image-wrap {
  position: relative;
  height: min(68vh, 620px);
  min-height: 360px;
  overflow: auto;
  background: #f8faf9;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.map-image {
  display: block;
  width: calc(100% * var(--map-zoom, 1));
  min-width: 100%;
  max-width: none;
  height: auto;
  transform-origin: top left;
}

.map-image-wrap .loading-state {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
}

.map-zoom-button {
  padding: 0 8px;
}

.course-action-button {
  display: inline-flex;
  gap: 6px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--teal);
  color: white;
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.18);
}

.roster-toggle-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--blue);
  color: white;
  font-weight: 850;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.1);
}

.session-catalog-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--blue);
  color: white;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.16);
}

.course-action-button.description-toggle {
  background: var(--blue);
  color: white;
}

.course-action-button.pdf-link {
  background: var(--teal);
  color: white;
}

.button-kicker {
  display: inline-flex;
  min-width: 52px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-match {
  border-radius: 8px;
  padding: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 800;
}

.teaching-section {
  display: grid;
  gap: 12px;
}

.participant-section {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

.section-heading {
  display: grid;
  gap: 3px;
  padding: 2px 2px 0;
}

.teaching-card .accent {
  background: var(--blue);
}

.meta-label {
  display: inline-flex;
  min-width: 72px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 8px;
  background: #eef2f1;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.roster-list {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8faf9;
}

.roster-row {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(220, 229, 225, 0.9);
}

.roster-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.roster-row span {
  color: var(--ink);
  font-weight: 850;
}

.roster-row small {
  color: var(--muted);
  font-size: 0.8rem;
}

.floating-top-button {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 12;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--teal);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.floating-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.pdf-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 21, 0.36);
}

.pdf-choice-sheet {
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
  margin: 0 auto;
  border-radius: 14px 14px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--panel);
  box-shadow: 0 -16px 32px rgba(18, 38, 35, 0.18);
}

.pdf-choice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pdf-choice-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.pdf-choice-list {
  display: grid;
  gap: 8px;
}

.lookup-panel, .error-panel, .loading-panel {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 28px);
  align-content: center;
  padding: 22px;
  border-radius: 8px;
}

.lookup-card, .error-card, .loading-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lookup-card, .error-card { display: grid; gap: 14px; padding: 20px; }
.lookup-card h1, .error-card h1, .loading-panel h1 { margin: 0; font-size: 2rem; line-height: 1; }
.lookup-card p, .error-card p, .loading-panel p { margin: 0; color: var(--muted); }

.loading-state {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  background: #eef8f6;
  color: var(--teal-dark);
  font-weight: 850;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(15, 118, 110, 0.22);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

button .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lookup-form { display: flex; gap: 8px; }
.lookup-form input { text-transform: uppercase; }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: white;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.2);
}

.primary-button:disabled { background: #9fb9b4; }
.checkin-button { width: 100%; }

.checkin-stamp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 850;
}

.survey-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(18, 38, 35, 0.07);
}

.survey-header,
.survey-form,
.survey-question-group,
.survey-course-card {
  display: grid;
  gap: 10px;
}

.survey-step-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.survey-step-button,
.survey-secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #dff3ef;
  color: var(--teal-dark);
  font-weight: 850;
}

.survey-step-button.is-active {
  background: var(--teal);
  color: white;
}

.survey-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.survey-inline-button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--red);
  color: white;
  font-weight: 850;
}

.survey-question {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.survey-question-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.survey-question.compact {
  padding: 10px;
}

.survey-radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.survey-radio-option {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f7faf9;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.15;
}

.survey-radio-option:has(input:checked) {
  background: #dff3ef;
  color: var(--teal-dark);
}

.survey-radio-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.survey-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.survey-check-option {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f7faf9;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.15;
}

.survey-check-option:has(input:checked) {
  background: #dff3ef;
  color: var(--teal-dark);
}

.survey-check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.survey-check-with-input,
.survey-radio-with-input {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(108px, 0.42fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.survey-check-with-input input[type="text"],
.survey-radio-with-input input[type="text"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  min-width: 0;
}

.survey-text-question {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.survey-text-question textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  line-height: 1.35;
}

.survey-course-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8faf9;
}

.survey-rating-section {
  gap: 10px;
}

.survey-rating-list,
.survey-course-rating-list {
  display: grid;
  gap: 5px;
}

.survey-rating-row {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.survey-rating-row > span {
  min-width: 0;
  padding: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.survey-rating-control {
  display: grid;
  justify-items: end;
}

.survey-rating-scale {
  display: flex;
  justify-self: end;
  justify-content: space-between;
  width: calc((var(--rating-chip-size) * 5) + 16px);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
}

.survey-compact-rating {
  display: grid;
  grid-template-columns: repeat(5, var(--rating-chip-size));
  gap: 4px;
}

.survey-rating-chip {
  position: relative;
  display: grid;
  place-items: center;
}

.survey-rating-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.survey-rating-chip span {
  display: grid;
  width: var(--rating-chip-size);
  height: var(--rating-chip-size);
  place-items: center;
  border-radius: 8px;
  background: #dff3ef;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 900;
}

.survey-rating-chip:has(input:checked) span {
  background: var(--teal);
  color: white;
}

.survey-action-row {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
}

.survey-wide-button,
.survey-submit-button {
  width: 100%;
}

.survey-submit-meta {
  border-radius: 8px;
  padding: 9px 10px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: stretch;
  background: #0f1715;
  overscroll-behavior: contain;
}

.pdf-viewer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
}

.pdf-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line);
}

.pdf-viewer-title {
  min-width: 0;
  flex: 1 1 210px;
}

.pdf-viewer-header h2 {
  margin: 2px 0 0;
  font-size: 1rem;
  line-height: 1.2;
}

.pdf-viewer-actions {
  display: flex;
  flex: 1 1 300px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pdf-viewer-frame-wrap {
  min-height: 0;
  overflow: auto;
  background: #111827;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.pdf-viewer-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8faf9;
  touch-action: pan-x pan-y pinch-zoom;
}

.close-button, .pdf-action-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: white;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.18);
}

.pdf-action-button {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

.footer-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (min-width: 640px) {
  .app { padding-top: 22px; }
  .topbar { margin-top: -22px; }

  .tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .course-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .map-actions {
    grid-template-columns: repeat(4, max-content);
  }

  .pdf-viewer-panel {
    width: min(100%, 980px);
  }
}

@media (max-width: 430px) {
  :root {
    --rating-chip-size: 28px;
  }

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

  .course-offering-row {
    grid-template-columns: 1fr;
  }

  .survey-check-with-input,
  .survey-radio-with-input {
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
  }
}
