:root {
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --hairline: #d2d2d7;
  --divider: #e8e8ed;
  --blue: #0066cc;
  --blue-focus: #0071e3;
  --blue-wash: #f0f7ff;
  --danger: #b42318;
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--parchment);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--parchment); font-size: 17px; line-height: 1.47; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--blue-focus);
  outline-offset: 3px;
}

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 245, 247, .82);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; font-weight: 600; letter-spacing: -.014em; }
.brand small { color: var(--ink-soft); font-size: 10px; margin-top: 1px; letter-spacing: -.008em; }
main { flex: 1; width: 100%; }
footer { color: var(--ink-faint); font-size: 12px; text-align: center; padding: 40px 20px; }

.center-card { min-height: 62vh; display: grid; place-items: center; align-content: center; color: var(--ink-soft); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--divider); border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-layout {
  width: min(1180px, 100%);
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  align-items: stretch;
  background: var(--canvas);
}
.intro-copy {
  min-height: 670px;
  padding: clamp(70px, 9vw, 120px) clamp(40px, 7vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ink);
  color: white;
}
.eyebrow, .step-kicker {
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.014em;
  margin: 0 0 12px;
}
.intro-copy .eyebrow { color: #a8cfff; }
.year-shift { display: flex; align-items: center; gap: 14px; margin: 4px 0 28px; }
.year-shift span, .year-shift strong {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(46px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -.04em;
}
.year-shift span { color: #86868b; font-weight: 400; }
.year-shift strong { color: white; font-weight: 600; }
.year-shift i { width: clamp(34px, 4vw, 62px); height: 1px; background: #86868b; }
.intro-copy h1 {
  max-width: 660px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(38px, 4.5vw, 56px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.018em;
  margin: 0 0 28px;
}
.intro-copy > p:not(.eyebrow) { max-width: 590px; color: #cccccc; font-size: 17px; line-height: 1.55; word-break: keep-all; }
.intro-note { display: flex; align-items: center; gap: 10px; margin-top: 32px; color: #cccccc; font-size: 14px; }
.note-icon { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #86868b; border-radius: 50%; color: white; font-size: 12px; }

.glass-card { background: var(--canvas); }
.login-card { padding: clamp(42px, 7vw, 86px); display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.login-card h1, .login-card h2 { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.18; letter-spacing: -.015em; }
.muted { color: var(--ink-soft); line-height: 1.47; }
.login-card .muted { margin: 8px 0 22px; font-size: 14px; }
.field-label { font-size: 14px; font-weight: 600; margin-top: 5px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 11px;
  background: var(--canvas);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input, select { min-height: 48px; padding: 0 16px; }
textarea { min-height: 154px; padding: 16px; resize: vertical; line-height: 1.47; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-focus); box-shadow: 0 0 0 3px rgba(0, 113, 227, .14); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 40px; }
.select-wrap::after { content: "⌄"; position: absolute; right: 17px; top: 11px; color: var(--ink-soft); pointer-events: none; }

.primary-button, .secondary-button, .complete-button, .text-button {
  border: 0;
  font-weight: 400;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: opacity .15s, transform .12s;
}
.primary-button { min-height: 46px; padding: 0 22px; border-radius: 9999px; background: var(--blue); color: white; margin-top: 10px; }
.primary-button:hover { opacity: .88; }
.primary-button:active, .secondary-button:active, .complete-button:active, .text-button:active { transform: scale(.95); }
.primary-button.compact { min-height: 44px; padding: 0 22px; margin: 0; }
.secondary-button { min-height: 44px; padding: 0 22px; border: 1px solid var(--blue); border-radius: 9999px; background: transparent; color: var(--blue); }
.secondary-button:hover { background: var(--blue-wash); }
.secondary-button.full { width: 100%; margin-top: 24px; }
.text-button { min-height: 36px; padding: 0 14px; border-radius: 9999px; color: var(--blue); background: transparent; }
.text-button:hover { background: var(--blue-wash); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.admin-link { color: var(--blue); font-size: 12px; text-align: center; margin-top: 11px; text-underline-offset: 3px; }
.form-error { min-height: 20px; margin: 2px 0; color: var(--danger); font-size: 13px; line-height: 1.45; }
.form-error.center { text-align: center; margin-top: 16px; }

.workspace, .dashboard { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 80px; }
.dashboard { width: min(1180px, calc(100% - 40px)); }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; }
.workspace-heading h1 {
  margin: 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.018em;
}
.workspace-heading .muted { margin: 12px 0 0; font-size: 17px; }
.status-pill, .table-status { border-radius: 9999px; font-size: 12px; font-weight: 600; padding: 7px 13px; white-space: nowrap; }
.status-pill.draft, .table-status.draft { color: var(--ink-soft); background: #e8e8ed; }
.status-pill.complete, .table-status.complete { color: var(--blue); background: #e8f2ff; }
.table-status.not_started { color: var(--ink-faint); background: #f0f0f2; }

.steps { display: flex; justify-content: center; align-items: center; margin: 0 auto 32px; }
.step { min-height: 44px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-size: 13px; font-weight: 600; padding: 7px; }
.step span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--hairline); }
.step.active { color: var(--blue); }
.step.active span { color: white; border-color: var(--blue); background: var(--blue); }
.step.done { color: var(--ink); }
.step.done span { color: white; border-color: var(--ink); background: var(--ink); }
.step-line { height: 1px; width: min(9vw, 88px); margin: 0 10px; background: var(--hairline); }

.panel, .completion-card, .admin-card { background: var(--canvas); border: 1px solid var(--hairline); }
.panel { border-radius: 18px; padding: clamp(28px, 4vw, 48px); }
.panel-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-heading { margin-bottom: 32px; }
.panel-heading h2, .section-heading h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.015em; }
.panel-heading .muted { margin: 8px 0 0; font-size: 14px; }
.count-chip { border-radius: 9999px; background: var(--blue-wash); color: var(--blue); padding: 7px 13px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.role-card { min-width: 0; margin: 0; padding: 0 20px 20px; border: 1px solid var(--hairline); border-radius: 18px; background: var(--canvas); }
.role-card legend { padding: 0 10px; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.role-card legend small { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.role-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: white; font-size: 12px; background: var(--ink); }
.operator .role-icon, .role-tag.operator { background: var(--blue); }
.instructor .role-icon, .role-tag.instructor { background: var(--ink); }
.course-list { display: grid; gap: 4px; margin-top: 16px; }
.course-option { display: flex; align-items: center; gap: 12px; min-height: 46px; border-radius: 8px; padding: 8px; cursor: pointer; }
.course-option:hover { background: var(--parchment); }
.course-option input { appearance: none; flex: 0 0 auto; width: 20px; min-height: 20px; height: 20px; padding: 0; border-radius: 5px; }
.course-option input:checked { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 4px white; }
.instructor .course-option input:checked { background: var(--ink); border-color: var(--ink); }
.course-option span { font-size: 14px; line-height: 1.35; }
.sticky-actions { display: flex; justify-content: flex-end; margin-top: 32px; }

.response-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
.response-layout > *, .response-sidebar, .response-main { min-width: 0; max-width: 100%; }
.response-sidebar { position: sticky; top: 76px; align-self: start; }
.progress-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.progress-header strong { color: var(--ink); }
.progress-track { height: 4px; background: var(--divider); border-radius: 9999px; overflow: hidden; margin: 10px 0 20px; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--blue); transition: width .25s; }
.response-nav { display: grid; gap: 4px; }
.response-nav button { min-height: 48px; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px; border-radius: 8px; color: var(--ink-soft); }
.response-nav button:hover { background: var(--parchment); }
.response-nav button.active { background: var(--blue-wash); color: var(--blue); font-weight: 600; }
.nav-state { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid var(--hairline); border-radius: 50%; font-size: 10px; }
.response-nav button.is-complete .nav-state { background: var(--blue); color: white; border-color: var(--blue); }
.nav-copy { min-width: 0; }
.nav-copy strong, .nav-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-copy strong { font-size: 12px; }
.nav-copy small { font-size: 10px; margin-top: 2px; }
.response-card-header { padding-bottom: 24px; border-bottom: 1px solid var(--divider); margin-bottom: 32px; }
.role-tag { display: inline-flex; color: white; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 9999px; margin-bottom: 11px; }
.response-card-header h2 { font-size: 34px; font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.016em; }
.response-card-header p { margin: 9px 0 0; color: var(--ink-soft); font-size: 14px; }
.question-block { margin-bottom: 32px; max-width: 720px; }
.question-label { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 11px; margin-bottom: 11px; font-size: 17px; font-weight: 600; line-height: 1.47; }
.question-label > span:last-child { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
.question-number { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; color: var(--blue); border: 1px solid var(--blue); border-radius: 50%; font-size: 11px; }
.question-help { max-width: 68ch; color: var(--ink-soft); font-size: 14px; margin: -3px 0 11px 36px; line-height: 1.5; overflow-wrap: anywhere; }
.char-count { display: block; text-align: right; color: var(--ink-faint); font-size: 10px; margin-top: 5px; }
.priority-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.priority-option { position: relative; }
.priority-option input { position: absolute; opacity: 0; }
.priority-option span { display: block; min-height: 44px; border: 1px solid var(--hairline); border-radius: 9999px; padding: 10px 8px; text-align: center; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.priority-option input:focus-visible + span { outline: 2px solid var(--blue-focus); outline-offset: 2px; }
.priority-option input:checked + span { border: 2px solid var(--blue-focus); color: var(--ink); background: var(--canvas); font-weight: 600; padding: 9px 7px; }
.response-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--divider); padding-top: 24px; }
.save-status { flex: 1; color: var(--blue); font-size: 12px; text-align: center; }
.complete-button { width: 100%; min-height: 50px; margin-top: 12px; border-radius: 9999px; color: white; background: var(--ink); }
.complete-button:hover { opacity: .86; }

.completion-card { max-width: 720px; margin: 30px auto; padding: 72px 42px; border-radius: 18px; text-align: center; }
.completion-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 24px; border-radius: 50%; color: white; background: var(--blue); font-size: 22px; }
.completion-card h2 { font-size: 34px; font-weight: 600; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.016em; }
.completion-card > p:not(.step-kicker) { max-width: 560px; margin-left: auto; margin-right: auto; color: var(--ink-soft); line-height: 1.6; }
.completion-actions { display: flex; justify-content: center; gap: 10px; margin: 32px 0 14px; }
.small { font-size: 12px; }

.center-login { width: min(520px, calc(100% - 40px)); margin: 9vh auto; }
.login-card.narrow { min-height: 470px; padding: 52px; border: 1px solid var(--hairline); border-radius: 18px; }
.dashboard-heading { align-items: center; }
.export-actions { display: flex; gap: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 32px 0; }
.stat-card { background: var(--canvas); border: 1px solid var(--hairline); padding: 22px; border-radius: 18px; }
.stat-card span { color: var(--ink-soft); font-size: 12px; }
.stat-card strong { display: block; font-size: 34px; font-weight: 600; line-height: 1.1; margin-top: 8px; letter-spacing: -.02em; }
.admin-card { border-radius: 18px; padding: 28px; margin-bottom: 24px; }
.section-heading { align-items: center; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--ink-soft); font-size: 12px; text-align: left; font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--hairline); }
td { padding: 14px 12px; border-bottom: 1px solid var(--divider); }
tbody tr:last-child td { border-bottom: 0; }
.filter-row { display: grid; grid-template-columns: 1.4fr .7fr .7fr; gap: 9px; margin-bottom: 18px; }
.filter-row select { min-height: 44px; }
.course-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.course-summary-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-width: 0; padding: 12px; border-bottom: 1px solid var(--divider); }
.course-summary-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.course-summary-item b { color: var(--blue); font-size: 13px; }
.admin-responses { display: grid; gap: 8px; }
.admin-response { border-bottom: 1px solid var(--divider); background: var(--canvas); }
.admin-response summary { list-style: none; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 12px 4px; cursor: pointer; }
.admin-response summary::-webkit-details-marker { display: none; }
.admin-response summary::after { content: "+"; margin-left: auto; color: var(--ink-soft); font-size: 20px; font-weight: 300; }
.admin-response[open] summary::after { content: "−"; }
.admin-response-title { min-width: 0; }
.admin-response-title strong { font-size: 14px; font-weight: 600; }
.admin-response-title small { display: block; color: var(--ink-soft); margin-top: 2px; font-size: 12px; }
.admin-response-body { padding: 0 8px 24px; }
.answer-section { max-width: 76ch; margin-top: 20px; }
.answer-section strong { display: block; color: var(--ink-soft); font-size: 12px; margin-bottom: 6px; }
.answer-section p { margin: 0; white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
.empty-state { color: var(--ink-soft); text-align: center; padding: 48px 20px; }

@media (max-width: 850px) {
  .login-layout { grid-template-columns: 1fr; }
  .intro-copy { min-height: auto; padding: 72px max(24px, 7vw); }
  .login-card { padding: 64px max(24px, 7vw); }
  .role-grid { grid-template-columns: 1fr; }
  .response-layout { grid-template-columns: 1fr; gap: 36px; }
  .response-sidebar { position: static; }
  .response-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding-bottom: 0; }
  .response-nav button { width: 100%; min-width: 0; }
  .response-sidebar .full { width: 100%; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { padding: 0 12px; }
  .brand small { display: none; }
  .intro-copy { padding: 56px 24px; }
  .year-shift span, .year-shift strong { font-size: 48px; }
  .intro-copy h1 { font-size: 34px; }
  .login-card { padding: 48px 24px; }
  .workspace, .dashboard { width: calc(100% - 24px); padding: 48px 0 64px; }
  .workspace-heading, .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .workspace-heading h1 { font-size: 34px; }
  .steps { justify-content: flex-start; overflow: hidden; }
  .step { white-space: nowrap; font-size: 11px; }
  .step-line { width: 20px; margin: 0 2px; }
  .panel { padding: 28px 17px; }
  .panel-heading { flex-direction: column; }
  .role-card { padding-left: 12px; padding-right: 12px; }
  .response-card-header h2 { font-size: 28px; }
  .question-label { font-size: 16px; }
  .question-help { margin-left: 0; }
  textarea { display: block; width: 100%; max-width: 100%; min-height: 180px; }
  .priority-options { grid-template-columns: 1fr; }
  .response-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .save-status { grid-column: 1 / -1; grid-row: 1; }
  .completion-card { padding: 52px 22px; }
  .completion-actions, .export-actions { width: 100%; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .filter-row, .course-summary-grid { grid-template-columns: 1fr; }
  .admin-card { padding: 22px 16px; }
}

@media (max-width: 419px) {
  .intro-copy h1 { font-size: 28px; }
  .year-shift span, .year-shift strong { font-size: 40px; }
  .response-nav { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
