:root {
  --ink: #000;
  --paper: #fff;
  --graphite: #5e5e5e;
  --line: #ddd;
  --wash: #f2f2f2;
  --danger: #8d1515;
  --success: #17683a;
  --warning: #765200;
  --font-latin: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-cjk: "PingFang SC", "Hiragino Sans", "Yu Gothic", "Apple SD Gothic Neo", "Malgun Gothic", "Microsoft YaHei", sans-serif;
  --font-mono: "Noto Mono", "SFMono-Regular", Consolas, monospace;
  --header-height: 64px;
  --register-width: 304px;
  --focus: 3px solid #000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

html[lang^="zh"],
html[lang^="ja"],
html[lang^="ko"] {
  font-family: var(--font-cjk);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

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

input[readonly] {
  border-color: var(--line);
  background: var(--wash);
  color: var(--graphite);
}

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

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button,
summary,
select,
[role="button"] {
  min-height: 44px;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .48;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

img,
video,
audio {
  max-width: 100%;
}

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

.skip-link {
  position: fixed;
  top: 0;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(calc(-100% - 8px));
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus-visible {
  transform: translateY(8px);
  opacity: 1;
  pointer-events: auto;
}

.network-status {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  right: 0;
  min-height: 40px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-size: .875rem;
  font-weight: 700;
  text-align: center;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 520px);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  padding: clamp(32px, 7vw, 96px);
  background: var(--ink);
  color: var(--paper);
}

.wordmark {
  width: min(360px, 80%);
  height: auto;
  margin-bottom: auto;
  filter: invert(1);
}

.login-index,
.meta-text,
.question-meta,
.save-state,
.assignment-label,
.admin-kicker {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  line-height: 1.45;
  text-transform: uppercase;
}

.login-brand h1 {
  max-width: 720px;
  margin: 20px 0 12px;
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .95;
}

.login-brand p {
  max-width: 600px;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.5;
}

.login-panel {
  align-self: center;
  width: 100%;
  padding: clamp(32px, 7vw, 88px);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.field > label,
.field-label {
  font-size: .875rem;
  font-weight: 700;
}

.field-hint,
.help-text,
.microcopy {
  color: var(--graphite);
  font-size: .875rem;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--graphite);
  border-radius: 2px;
  background: var(--paper);
  padding: 12px;
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

::placeholder {
  color: #666;
  opacity: 1;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
}

.button,
.text-button {
  min-height: 44px;
  border-radius: 2px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  padding: 11px 16px;
  background: var(--paper);
}

.button:hover:not(:disabled) {
  background: var(--wash);
}

.button:active:not(:disabled) {
  background: var(--line);
}

.button-primary {
  background: var(--ink);
  color: var(--paper);
}

.button-primary:hover:not(:disabled),
.button-primary:active:not(:disabled) {
  background: #262626;
}

.button-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.button-block {
  width: 100%;
}

.button-small {
  min-height: 44px;
  padding: 8px 12px;
  font-size: .875rem;
}

.text-button {
  border: 0;
  padding: 8px 10px;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover:not(:disabled) {
  background: var(--wash);
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.select-quiet {
  width: auto;
  min-width: 108px;
  min-height: 44px;
  border-color: var(--line);
  padding-right: 34px;
}

.inline-alert {
  margin: 16px 0;
  border: 1px solid currentColor;
  padding: 12px;
  font-size: .9375rem;
  line-height: 1.45;
}

.inline-alert-error {
  color: var(--danger);
}

.inline-alert-warning {
  color: var(--warning);
}

.inline-alert-success {
  color: var(--success);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: var(--register-width) 1fr auto;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.brand-link,
.header-context,
.header-actions {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding: 8px 20px;
}

.brand-link {
  border-right: 1px solid var(--line);
}

.header-wordmark {
  width: 168px;
  height: auto;
}

.header-context {
  min-width: 0;
  gap: 12px;
}

.header-context > :first-child {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-assignment {
  color: var(--graphite);
}

.header-actions {
  justify-content: flex-end;
  gap: 4px;
}

.participant-layout {
  display: grid;
  grid-template-columns: var(--register-width) minmax(0, 1fr);
  min-height: calc(100dvh - var(--header-height));
}

.question-register {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid #222;
  background: var(--ink);
  color: var(--paper);
  scrollbar-color: #555 var(--ink);
}

.register-summary {
  padding: 24px 20px 20px;
  border-bottom: 1px solid #333;
}

.assignment-label {
  color: #bdbdbd;
}

.assignment-value {
  margin: 6px 0 20px;
  font-size: 1.125rem;
  line-height: 1.35;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-copy strong {
  font-size: 1.25rem;
}

.progress-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  background: #444;
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  background: var(--paper);
}

.question-index {
  display: grid;
  padding: 8px 0 32px;
}

.question-index-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid #252525;
  padding: 13px 20px;
  background: transparent;
  color: #c4c4c4;
  text-align: left;
}

.question-index-button:hover {
  color: var(--paper);
  background: #171717;
}

.question-index-button[aria-current="step"] {
  color: var(--ink);
  background: var(--paper);
}

.question-index-button:focus-visible {
  outline-color: var(--paper);
  outline-offset: -4px;
}

.question-index-number {
  font-family: var(--font-mono);
  font-size: .75rem;
}

.question-index-title {
  overflow: hidden;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-index-state {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.question-index-state.is-complete {
  background: currentColor;
}

.question-index-state.is-error {
  border-radius: 0;
  background: currentColor;
  transform: rotate(45deg);
}

.participant-workspace {
  min-width: 0;
  background: var(--paper);
}

.mobile-progress {
  display: none;
}

.question-frame {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 6vw, 64px) calc(120px + env(safe-area-inset-bottom));
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.question-meta,
.save-state {
  color: var(--graphite);
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.save-state::before {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.save-state[data-state="saving"]::before {
  border-style: dashed;
  animation: spin 800ms linear infinite;
}

.save-state[data-state="saved"]::before {
  border-color: var(--success);
  background: var(--success);
}

.save-state[data-state="error"] {
  color: var(--danger);
}

.question-heading {
  max-width: 24ch;
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.14;
}

.question-prompt {
  max-width: 68ch;
  margin: 0 0 36px;
  color: var(--graphite);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.required-note {
  margin-left: 8px;
  color: var(--graphite);
  font-weight: 400;
}

.choice-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 52px;
  border: 1px solid var(--line);
  padding: 13px 14px;
}

.choice-row:hover {
  border-color: var(--ink);
}

.choice-row:has(input:checked) {
  border-color: var(--ink);
  background: var(--wash);
}

.choice-row input {
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--ink);
}

.char-count {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--graphite);
  font-size: .8125rem;
}

.field-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.upload-zone {
  border: 1px solid var(--graphite);
  padding: 20px;
}

.upload-zone.is-dragging {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.upload-zone-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.upload-zone-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-trigger {
  flex: 0 0 auto;
}

.upload-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.upload-file {
  min-width: 0;
}

.upload-name {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.upload-detail {
  margin-top: 3px;
  color: var(--graphite);
  font-size: .8125rem;
}

.upload-progress {
  width: 100%;
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  background: var(--line);
}

.upload-progress > span {
  display: block;
  width: var(--file-progress, 0%);
  height: 100%;
  background: var(--ink);
}

.upload-actions {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 2px;
}

.welcome-shell {
  display: grid;
  grid-template-columns: var(--register-width) minmax(0, 1fr);
  min-height: calc(100dvh - var(--header-height));
}

.welcome-register {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #222;
  padding: clamp(28px, 5vw, 56px) 28px;
  background: var(--ink);
  color: var(--paper);
}

.welcome-register-index {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 300;
  letter-spacing: -.07em;
  line-height: .9;
}

.welcome-register .assignment-label {
  color: #aaa;
}

.welcome-register .assignment-value {
  margin-top: 10px;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
}

.welcome-content {
  width: min(100%, 820px);
  padding: clamp(40px, 7vw, 84px) clamp(20px, 7vw, 72px) calc(72px + env(safe-area-inset-bottom));
}

.welcome-eyebrow {
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .05em;
}

.welcome-content h1 {
  max-width: 13ch;
  margin: 0 0 24px;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .96;
}

.welcome-lede {
  max-width: 58ch;
  margin: 0 0 40px;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.55;
}

.welcome-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  max-width: 720px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.welcome-details p {
  margin: 0;
  color: var(--graphite);
  line-height: 1.6;
}

.photo-use-note {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 20px;
  max-width: 720px;
  margin-top: 36px;
  border: 1px solid var(--ink);
  padding: 20px;
}

.photo-use-index {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .04em;
}

.photo-use-note p {
  margin: 0;
  font-weight: 700;
  line-height: 1.5;
}

.welcome-start {
  min-width: min(100%, 320px);
  margin-top: 32px;
}

.review-shell,
.submitted-shell {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 6vw, 64px) calc(80px + env(safe-area-inset-bottom));
}

.review-shell h1,
.submitted-shell h1 {
  max-width: 18ch;
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1;
}

.review-summary {
  max-width: 68ch;
  margin: 0 0 40px;
  color: var(--graphite);
  line-height: 1.6;
}

.review-list {
  border-top: 1px solid var(--ink);
}

.review-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  width: 100%;
  min-height: 68px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  background: transparent;
  text-align: left;
}

button.review-row:hover {
  background: var(--wash);
}

.review-row-index {
  font-family: var(--font-mono);
  font-size: .75rem;
}

.review-row-title {
  font-weight: 700;
  line-height: 1.4;
}

.review-row-state {
  color: var(--graphite);
  font-size: .875rem;
  white-space: nowrap;
}

.review-row-state.is-blocking {
  color: var(--danger);
  font-weight: 700;
}

.submission-token {
  display: inline-block;
  margin-top: 32px;
  border: 1px solid var(--ink);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

.admin-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: calc(100dvh - var(--header-height));
}

.credential-reveal {
  position: sticky;
  z-index: 30;
  top: var(--header-height);
  border-bottom: 2px solid var(--ink);
  padding: 20px clamp(20px, 4vw, 56px);
  background: var(--paper);
}

.credential-reveal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.credential-reveal h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.credential-reveal > .microcopy {
  margin: 8px 0 16px;
}

.credential-grid {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--ink);
}

.credential-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.credential-row dt {
  color: var(--graphite);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.credential-row dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin: 0;
}

.credential-row code {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: .8125rem;
}

.admin-register {
  border-right: 1px solid var(--line);
  background: var(--wash);
}

.admin-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 20px;
  background: var(--wash);
}

.admin-toolbar-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-toolbar input,
.admin-toolbar select {
  min-width: 0;
  background: var(--paper);
}

.admin-participant-list {
  display: grid;
}

.admin-person {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 84px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: transparent;
  text-align: left;
}

.admin-person:hover,
.admin-person[aria-current="true"] {
  background: var(--paper);
}

.admin-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--graphite);
  font-size: .8125rem;
}

.admin-detail {
  min-width: 0;
  padding: 32px clamp(20px, 4vw, 56px) 72px;
}

.admin-detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.admin-detail-header h1 {
  margin: 8px 0 5px;
  font-size: 2rem;
  letter-spacing: -.025em;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-action-panel {
  display: grid;
  gap: 18px;
  margin: -8px 0 32px;
  border: 1px solid var(--ink);
  border-left: 5px solid var(--signal);
  padding: 20px;
  background: var(--paper);
}

.admin-action-panel h2 {
  margin: 0 0 6px;
  font-size: 1.125rem;
}

.admin-action-panel p {
  max-width: 70ch;
  margin: 0;
  color: var(--graphite);
}

.admin-action-panel-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-reopen-field {
  margin: 0;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 36px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

.assignment-cell {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.assignment-cell dt {
  margin: 0 0 8px;
  color: var(--graphite);
  font-family: var(--font-mono);
  font-size: .6875rem;
  text-transform: uppercase;
}

.assignment-cell dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.admin-section {
  margin-top: 40px;
}

.admin-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}

.admin-section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.response-table {
  width: 100%;
  border-collapse: collapse;
}

.response-table th,
.response-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.response-table th {
  font-size: .75rem;
  text-transform: uppercase;
}

.response-table td {
  font-size: .875rem;
  line-height: 1.45;
}

.response-answer {
  max-width: 58ch;
  white-space: pre-wrap;
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--graphite);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--graphite);
  font-size: .75rem;
  font-weight: 700;
}

.status-label[data-status="submitted"],
.status-label[data-status="complete"],
.status-label[data-status="finalized"] {
  border-color: var(--success);
  color: var(--success);
}

.status-label[data-status="error"],
.status-label[data-status="failed"],
.status-label[data-status="blocked"] {
  border-color: var(--danger);
  color: var(--danger);
}

.empty-state {
  border-top: 1px solid var(--ink);
  padding: 32px 0;
  color: var(--graphite);
  line-height: 1.5;
}

.toast-region {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  margin-top: 8px;
  border: 1px solid var(--paper);
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.4;
}

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

@media (max-width: 960px) {
  :root {
    --register-width: 260px;
  }

  .app-header {
    grid-template-columns: var(--register-width) 1fr auto;
  }

  .admin-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  :root {
    --header-height: 58px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 310px;
    padding: 28px 24px 32px;
  }

  .wordmark {
    width: 220px;
    margin-bottom: 72px;
  }

  .login-brand h1 {
    font-size: 2.75rem;
  }

  .login-panel {
    align-self: start;
    padding: 32px 24px max(40px, env(safe-area-inset-bottom));
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-link {
    border-right: 0;
    padding: 8px 16px;
  }

  .header-wordmark {
    width: 132px;
  }

  .header-context {
    display: none;
  }

  .header-actions {
    padding: 6px 10px 6px 4px;
  }

  .header-actions .select-quiet {
    min-width: 88px;
    max-width: 112px;
  }

  .participant-layout {
    display: block;
  }

  .welcome-shell {
    display: block;
  }

  .welcome-register {
    display: none;
  }

  .welcome-content {
    margin: 0 auto;
    padding-top: 36px;
  }

  .question-register {
    display: none;
  }

  .mobile-progress {
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    display: grid;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    background: var(--paper);
  }

  .mobile-progress-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-progress .progress-track {
    background: var(--line);
  }

  .mobile-progress .progress-fill {
    background: var(--ink);
  }

  .question-frame {
    padding-top: 28px;
  }

  .question-topline {
    margin-bottom: 28px;
  }

  .question-actions {
    position: static;
    margin-right: -20px;
    margin-left: -20px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
  }

  .question-actions .button {
    min-width: 48px;
  }

  .question-actions-primary {
    flex: 1;
    justify-content: flex-end;
  }

  .question-actions-primary .button-primary {
    flex: 1;
  }

  .welcome-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .photo-use-note {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .upload-zone-head {
    display: grid;
  }

  .upload-zone-head .button {
    width: 100%;
  }

  .review-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .review-row-state {
    grid-column: 2;
    white-space: normal;
  }

  .admin-shell {
    display: block;
  }

  .admin-register {
    border-right: 0;
  }

  .admin-toolbar {
    position: static;
  }

  .admin-participant-list {
    max-height: 280px;
    overflow-y: auto;
  }

  .admin-detail {
    padding-top: 28px;
  }

  .admin-detail-header {
    display: grid;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .admin-action-panel-buttons {
    justify-content: flex-start;
  }

  .response-table,
  .response-table tbody,
  .response-table tr,
  .response-table th,
  .response-table td {
    display: block;
  }

  .response-table thead {
    display: none;
  }

  .response-table tr {
    border-bottom: 1px solid var(--ink);
    padding: 12px 0;
  }

  .response-table td {
    border-bottom: 0;
    padding: 6px 0;
  }

  .response-table td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--graphite);
    font-family: var(--font-mono);
    font-size: .6875rem;
    text-transform: uppercase;
    content: attr(data-label);
  }
}

@media (max-width: 420px) {
  .brand-link {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .header-wordmark {
    flex: 0 0 auto;
    width: min(46vw, 180px);
  }

  .login-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .login-footer .select-quiet {
    width: 100%;
  }

  .header-actions .text-button {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .question-frame {
    padding-right: 20px;
    padding-left: 20px;
  }

  .question-heading {
    font-size: 1.65rem;
  }

  .welcome-content h1 {
    font-size: 2.75rem;
  }

  .question-actions .button {
    padding-right: 12px;
    padding-left: 12px;
  }

  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-row {
    grid-template-columns: 1fr;
  }

  .credential-reveal {
    position: static;
  }

  .credential-reveal-header,
  .credential-row,
  .credential-row dd {
    align-items: stretch;
  }

  .credential-reveal-header,
  .credential-row {
    grid-template-columns: 1fr;
  }

  .credential-reveal-header {
    display: grid;
    gap: 8px;
  }

  .credential-row dd {
    flex-direction: column;
  }
}

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

@media (forced-colors: active) {
  .progress-fill,
  .question-index-state.is-complete,
  .upload-progress > span {
    background: CanvasText;
  }

  .button-primary {
    border: 2px solid ButtonText;
  }
}
