:root {
  --bg: #f2f4f7;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --text: #111827;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #1677ff;
  --primary-press: #0f62d5;
  --primary-soft: #eaf3ff;
  --success: #16a34a;
  --success-soft: #eaf9ef;
  --warning: #f59e0b;
  --warning-soft: #fffaeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 24px rgba(16, 24, 40, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --focus: 0 0 0 3px rgba(22, 119, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  background: radial-gradient(circle at top, #f8fbff 0%, var(--bg) 48%);
  color: var(--text);
  font-family: "Inter", "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.45;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.4rem, 1rem + 1.3vw, 2rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.02rem;
}

p,
li,
label,
input,
select,
textarea,
button,
small,
td,
th {
  font-size: 0.96rem;
}

small {
  color: var(--text-muted);
}

code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.84rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2px 6px;
  word-break: break-word;
}

pre {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f8fafc;
  overflow: auto;
}

.container,
.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 18px 36px;
}

.app-header,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row.wrap,
.app-header.wrap {
  flex-wrap: wrap;
}

.space-between,
.app-header {
  justify-content: space-between;
}

.muted,
.subtle {
  color: var(--text-muted);
}

.ok {
  color: var(--success);
}

.error {
  color: var(--danger);
  margin-top: 8px;
  margin-bottom: 0;
}

.notice {
  border-left: 4px solid var(--warning);
  background: var(--warning-soft);
  border-radius: 10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 12px;
}

.card,
.panel,
.capture-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.panel-muted {
  background: var(--surface-muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  margin-top: 6px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f9fafb;
  color: var(--text-muted);
}

button,
.btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.06s ease;
}

button:hover,
.btn:hover,
.link-btn:hover {
  background: var(--primary-press);
  text-decoration: none;
}

button:active,
.btn:active,
.link-btn:active {
  transform: translateY(1px);
}

button:focus-visible,
.btn:focus-visible,
.link-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button.secondary,
.btn-secondary,
.ghost-btn,
.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}

button.secondary:hover,
.btn-secondary:hover,
.ghost-btn:hover,
.btn-ghost:hover {
  background: #f3f4f6;
}

button.danger,
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #fca5a5;
}

button.danger:hover,
.btn-danger:hover {
  background: var(--danger-soft);
}

button:disabled,
.btn:disabled,
.link-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

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

th {
  background: #fafafa;
  color: var(--text-soft);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

th:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: 10px;
}

th:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: 10px;
}

td:first-child {
  border-left: 1px solid var(--border);
}

td:last-child {
  border-right: 1px solid var(--border);
}

tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.table-wrap {
  overflow: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--text-soft);
}

.status-pill.UPLOADED {
  border-color: #a7f3d0;
  color: #057a44;
  background: var(--success-soft);
}

.status-pill.FAILED,
.status-pill.EXPIRED {
  border-color: #fecaca;
  color: #b91c1c;
  background: var(--danger-soft);
}

.status-pill.CONSENTED,
.status-pill.UPLOADING,
.status-pill.CREATED {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: var(--primary-soft);
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4aa6ff 0%, var(--primary) 100%);
  transition: width 0.25s ease;
}

.icon-slot,
.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.icon-lg .icon-svg {
  width: 21px;
  height: 21px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.surface-code {
  margin-top: 6px;
  border: 1px solid var(--border);
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-shell {
  width: min(440px, 100%);
}

.auth-card {
  margin: 0;
  padding: 24px;
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-copy {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.app-top {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.capture-body {
  --capture-navy: #0f172a;
  --capture-sky: #dbeafe;
  --capture-sky-deep: #bfdbfe;
  --capture-gold: #f59e0b;
  --capture-mint: #dcfce7;
  --capture-ink-soft: #334155;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16) 0%, transparent 32%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.2) 0%, transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #ecf3fb 52%, #edf2f8 100%);
}

.capture-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.capture-card {
  width: min(1120px, 100%);
  margin-bottom: 0;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #fbfdff 100%);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.capture-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.22) 20%,
    rgba(245, 158, 11, 0.18) 54%,
    transparent 100%
  );
}

.capture-card h1 {
  margin-bottom: 6px;
}

.capture-card h2 {
  margin-bottom: 8px;
}

.capture-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 0;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(239, 246, 255, 0.96);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.stage-chip {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.92);
  color: var(--text-muted);
  padding: 11px 10px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.stage-chip.active {
  border-color: rgba(59, 130, 246, 0.24);
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
}

.stage-chip.done {
  border-color: rgba(34, 197, 94, 0.24);
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
}

.desktop-flow-layout,
.welcome-layout,
.capture-grid,
.review-layout {
  display: grid;
  gap: 22px;
  align-items: start;
}

.desktop-flow-layout,
.review-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
}

.welcome-layout,
.capture-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.desktop-helper-copy,
.capture-stage-summary {
  color: var(--capture-ink-soft);
}

.desktop-steps,
.welcome-flow-cards {
  display: grid;
  gap: 12px;
}

.desktop-step-card,
.readiness-card,
.welcome-form-card,
.flow-reminder-box,
.status-card-shell,
.retake-panel,
.review-summary-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.desktop-step-card {
  display: grid;
  gap: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.desktop-step-card strong,
.review-thumb-card span,
.step-item strong {
  color: var(--capture-navy);
}

.desktop-step-card span {
  color: var(--capture-ink-soft);
}

.desktop-qr-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.88) 0%, #ffffff 100%);
  padding: 18px;
}

.identity-hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.2) 0%, transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #0f2c57 48%, #1447a3 100%);
  color: #fff;
  padding: 22px;
  margin: 18px 0;
}

.identity-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -56px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.identity-hero h2,
.identity-hero p {
  position: relative;
  z-index: 1;
}

.identity-hero h2 {
  color: #ffffff;
  text-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
}

.identity-hero p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
  max-width: 38rem;
}

.field-note {
  margin: -4px 0 14px;
  color: var(--capture-ink-soft);
  font-size: 0.84rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.capture-stage-panel,
.capture-side-panel,
.review-main-panel,
.review-side-panel,
.welcome-intro-panel,
.welcome-preview-panel {
  min-width: 0;
}

.flow-preview-header {
  margin-bottom: 14px;
}

.flow-preview-header h2,
.capture-header-stack h1 {
  max-width: 18ch;
}

.capture-header-stack {
  margin-bottom: 16px;
}

.welcome-actions,
.capture-main-actions {
  display: flex;
  gap: 10px;
}

.welcome-actions button,
.capture-main-actions button {
  min-height: 50px;
}

.welcome-flow-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 12px;
}

.welcome-flow-copy p {
  margin: 6px 0 0;
  color: var(--capture-ink-soft);
}

.flow-reminder-box ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--capture-ink-soft);
}

.welcome-flow-art,
.guide-art-shell {
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85) 0%, transparent 45%),
    linear-gradient(180deg, #eaf3ff 0%, #f9fbff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
  position: relative;
}

.welcome-flow-art {
  min-height: 108px;
  padding: 10px;
}

.guide-art-shell {
  min-height: 290px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-flow-art::before,
.guide-art-shell::before {
  content: "";
  position: absolute;
  inset: auto auto -20% -10%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
}

.guide-art-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.08));
}

.capture-guide-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.14) 0%, transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.guide-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.guide-caption {
  font-size: 1rem;
  font-weight: 800;
  color: var(--capture-navy);
}

.motion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.motion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--capture-navy);
  font-size: 0.84rem;
  font-weight: 700;
}

.motion-chip.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.motion-chip.is-done {
  background: #dcfce7;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.script-card {
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9eb 0%, #ffffff 100%);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.script-card-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
}

.script-card p {
  margin: 0;
  color: var(--capture-navy);
  font-weight: 700;
  white-space: pre-line;
}

.tip-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--capture-ink-soft);
}

.tip-list.compact {
  gap: 8px;
}

.capture-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.step-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-soft);
  display: grid;
  gap: 10px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.step-item-top,
.step-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.step-item-heading {
  justify-content: flex-start;
}

.step-item-index {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.84rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #eef2f7;
  color: var(--text-muted);
}

.status-pill.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.done {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #eef2f7;
  color: var(--text-muted);
}

.step-preview {
  min-height: 118px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: linear-gradient(180deg, #f8fafc 0%, #f2f7fb 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-preview.placeholder {
  border-style: dashed;
}

.step-preview.filled {
  border-style: solid;
}

.step-preview img,
.step-preview video {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.step-preview-placeholder {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
}

.step-item.active {
  border-color: rgba(59, 130, 246, 0.32);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.step-item.done {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  color: #166534;
}

.step-item.pending {
  opacity: 0.94;
}

.capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.capture-actions > * {
  flex: 1;
}

.retake-panel h3,
.readiness-card h3 {
  margin-bottom: 12px;
}

.retake-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.capture-qr-wrap,
.qr-box {
  max-width: 280px;
  margin: 0 auto 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 20px;
  padding: 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.capture-qr-wrap img,
.qr-box img {
  width: 100%;
  display: block;
  border-radius: 14px;
}

.review-video {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  margin-bottom: 0;
  background: #000;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.review-thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.review-thumb-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
}

.review-thumb-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #f8fafc;
}

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

.confirm-list label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.confirm-list input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.questionnaire-header {
  margin-bottom: 16px;
}

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

.questionnaire-grid label {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.questionnaire-grid label:focus-within {
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: var(--focus);
}

.questionnaire-grid input,
.questionnaire-grid select,
.questionnaire-grid textarea {
  margin-bottom: 0;
}

.questionnaire-grid button {
  grid-column: 1 / -1;
  min-height: 50px;
}

.progress-wrap {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
}

.consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.consent-modal[hidden] {
  display: none !important;
}

.consent-dialog {
  width: min(560px, 100%);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 24px;
}

.consent-dialog h2 {
  margin-bottom: 8px;
}

.consent-dialog p {
  margin: 0 0 14px;
  color: var(--text-soft);
}

.recorder-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.recorder-dialog {
  width: min(720px, 100%);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 20px;
  display: grid;
  gap: 14px;
  max-height: min(96dvh, 920px);
  overflow: auto;
}

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

.recorder-header h2 {
  margin-bottom: 0;
}

.recorder-status-block {
  display: grid;
  gap: 8px;
}

.recorder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.recorder-timer {
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--capture-navy);
}

.recorder-timer.is-live {
  color: #b91c1c;
}

.recorder-guide-shell {
  display: grid;
  gap: 12px;
}

.recorder-guide-art {
  min-height: 210px;
}

.recorder-stage-track {
  margin-top: 2px;
}

.recorder-motion-chips {
  margin-top: 0;
}

.recorder-preview {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #000;
  margin-top: 0;
  margin-bottom: 0;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.photo-capture-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.photo-capture-preview {
  width: 100%;
  height: min(56dvh, 520px);
  display: block;
  object-fit: cover;
  background: #000;
}

.photo-guide-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86%, 440px);
  aspect-ratio: 1.586 / 1;
  transform: translate(-50%, -50%);
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.42);
  pointer-events: none;
}

.photo-guide-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.recorder-footer {
  display: grid;
  gap: 10px;
}

.recorder-primary-row,
.recorder-secondary-row {
  display: grid;
  gap: 10px;
}

.recorder-primary-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr);
}

.recorder-secondary-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.recorder-hidden {
  display: none !important;
}

.kv-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.kv-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}

.kv-item .label {
  display: block;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.checklist-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text-soft);
}

.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;
}

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

  .row {
    flex-wrap: wrap;
  }

  th,
  td {
    min-width: 140px;
  }

  .desktop-flow-layout,
  .welcome-layout,
  .capture-grid,
  .review-layout,
  .capture-guide-card {
    grid-template-columns: 1fr;
  }

  .flow-preview-header h2,
  .capture-header-stack h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .container,
  .app-shell {
    padding: 16px 12px 28px;
  }

  .capture-shell {
    align-items: stretch;
    padding: 10px 0;
  }

  .capture-card {
    width: 100%;
    min-height: calc(100dvh - 20px);
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
    padding: 18px 14px 20px;
  }

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

  .welcome-flow-card {
    grid-template-columns: 1fr;
  }

  .welcome-flow-art {
    min-height: 132px;
  }

  .capture-actions > * {
    width: 100%;
    flex: auto;
  }

  .retake-actions,
  .questionnaire-grid,
  .review-thumb-grid {
    grid-template-columns: 1fr;
  }

  .step-item-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-item-heading {
    width: 100%;
  }

  .recorder-controls {
    grid-template-columns: 1fr;
  }

  .recorder-primary-row,
  .recorder-secondary-row {
    grid-template-columns: 1fr;
  }

  .recorder-toolbar {
    align-items: stretch;
  }

  .recorder-dialog {
    max-height: none;
  }

  .capture-main-actions button,
  .welcome-actions button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .capture-shell {
    padding: 0;
  }

  .capture-card {
    min-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .recorder-modal {
    padding: 0;
    align-items: stretch;
  }

  .recorder-dialog {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 16px 14px calc(22px + env(safe-area-inset-bottom));
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .recorder-preview {
    max-height: 48dvh;
  }

  .photo-capture-preview {
    height: min(46dvh, 420px);
  }

  .photo-guide-box {
    width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
