body {
  margin: 0;
  background: white;
  color: #222;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

.header-inner, main {
  width: calc(100% - 2rem);
  max-width: 70rem;
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid #ddd; }
.header-inner { padding-block: 1rem; }
main { margin-block: 2rem; }
.participant-page, .submission-page { max-width: 48rem; }
.login-layout, .message-page { max-width: 30rem; }

.header-inner, .header-nav, .row-actions, .setup-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}

.header-inner { justify-content: space-between; }
.brand { font-weight: 600; }
.setup-actions, .button-row { margin-bottom: 1rem; }

h1, h2, h3 {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li + li { margin-top: .5rem; }

.page-heading, .counts, .steps { margin-bottom: 1.5rem; }
.page-heading p { margin-bottom: .5rem; }
.back-link { display: inline-block; margin-bottom: 1rem; }
.workspace-grid > * + *, .participant-grid > * + *, .submission-grid > * + * {
  margin-top: 2rem;
}

.counts > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.counts dd { margin: 0; font-weight: 600; }
.muted, .table-secondary { color: #595959; }
.small, .table-secondary { font-size: .875rem; }

a, .text-button { text-underline-offset: .15em; }
:focus-visible { outline: 2px solid #005fcc; outline-offset: 3px; }

input, select, button, .button {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #888;
  border-radius: .2rem;
  font: inherit;
}

input, select {
  width: 100%;
  background: white;
  color: inherit;
}

.stack-form, .device-grid p { max-width: 30rem; }
.stack-form label, .device-grid label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 600;
}
.stack-form br { display: none; }

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 10rem) minmax(0, 16rem) auto;
  align-items: end;
  gap: .5rem .75rem;
  margin-bottom: .75rem;
}
.filters p { min-width: 0; margin: 0; }
.filters label {
  display: block;
  margin-bottom: .25rem;
  color: #595959;
  font-size: .875rem;
  font-weight: 400;
}
.filters input, .filters select { min-width: 0; border-color: #aaa; }
.filters .filter-actions { display: flex; align-items: center; gap: .75rem; }
.filters .filter-actions a { display: inline-flex; align-items: center; min-height: 2.75rem; }

@media (width < 48rem) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .filter-search, .filters .filter-actions { grid-column: 1 / -1; }
}

.invite-dialog {
  box-sizing: border-box;
  width: 34rem;
  max-width: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.5rem;
  overflow: auto;
  border: 1px solid #888;
  border-radius: .2rem;
  background: white;
  color: inherit;
}
.invite-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.invite-dialog .invite-note { margin-bottom: 0; }

button, .button {
  display: inline-block;
  background: #f5f5f5;
  color: inherit;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

button:enabled, .button { cursor: pointer; }
button:enabled:hover, .button:hover { background: #eaeaea; }
button:disabled { color: #666; cursor: default; }
.text-button { background: transparent; border-color: transparent; text-decoration: underline; }

.header-nav form, .row-actions form { display: inline; }
.created-link, .participant-name, .task-name, .table-secondary { display: block; }
.participant-name, .task-name { font-weight: 600; }
.table-secondary { overflow-wrap: anywhere; }
.created-link { margin-block: .5rem; overflow-wrap: anywhere; }

.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
.table-scroll table { width: 100%; min-width: 40em; border-collapse: collapse; }
.participants-panel tbody tr:nth-child(odd) { background: white; }
.participants-panel tbody tr:nth-child(even) { background: #f5f5f5; }
th, td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}
th { font-weight: 600; }

.steps [aria-current="step"] { font-weight: bold; }
.notice { margin-bottom: 1.5rem; padding-left: 1rem; border-left: 3px solid #888; }
.notice.danger { border-color: #a12622; }
.recorder-body, .playback-details { margin-top: 1rem; }
.privacy-note { margin-top: 1.5rem; }
#capture-timer { margin-top: 1rem; font-variant-numeric: tabular-nums; font-weight: 600; }
progress { max-width: 100%; }

.camera-stage video, .submission-video {
  display: block;
  width: 640px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

#camera-preview { transform: scaleX(-1); }
.prose, .privacy-note, .invite-note { max-width: 65ch; }
.prose h2, .prose h3 { margin-top: 1.5rem; }
.prose img { max-width: 100%; height: auto; }
.prose pre { white-space: pre-wrap; }

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

.task-workspace { max-width: 52rem; }
.task-form label { display: block; margin-bottom: .5rem; font-weight: 600; }
.task-form input { width: 100%; }
.task-form textarea { display: block; width: 100%; min-height: 14rem; font: inherit; }
.task-form textarea[hidden] { display: none; }
.task-form .ql-toolbar { display: flex; flex-wrap: wrap; gap: .2rem; }
.task-form .ql-container { min-height: 14rem; font: inherit; }
.task-form .ql-editor { min-height: 14rem; font: inherit; line-height: 1.5; }
.task-form .ql-editor:focus-visible { outline: 2px solid #005fcc; outline-offset: -2px; }
.task-form .ql-toolbar button { min-height: 1.75rem; }
.task-form .ql-toolbar .ql-picker { max-width: 100%; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: 1rem 0; border-bottom: 1px solid #ddd; }
.task-list li:last-child { border-bottom: 0; }
.task-list .muted { display: block; }
