/* Shared tokens come from global.css */

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
body.viewer-screen-active #app {
  padding: 0;
  align-items: stretch;
}
body.marketing-mode {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(58, 62, 152, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(4, 137, 218, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 15% 80%, rgba(70, 250, 10, 0.06) 0%, transparent 60%),
    #0d0d14;
  color: #fff;
}
body.marketing-mode::after { display: none; }
.hidden { display: none !important; }

.brand-logo-inline {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}
.brand-logo-hero {
  width: auto;
  height: auto;
  max-width: min(220px, 75%);
  max-height: 96px;
  object-fit: contain;
  border-radius: 0;
  display: block;
  margin: 0 auto 28px;
}

/* ─── Progress Bar ───────────────────────────────────────────────────────────── */
#progress-bar-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--progress-height);
  background: var(--border);
  z-index: 100;
  opacity: 0;
  transition: opacity var(--transition);
}
#progress-bar-container.visible { opacity: 1; }
#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-tertiary), var(--accent-tertiary-2));
  width: 0%;
  transition: width 600ms cubic-bezier(.4,0,.2,1);
  border-radius: 0 2px 2px 0;
}

/* ─── Layout ──────────────────────────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px clamp(16px, 3vw, 48px) 80px;
}
body.marketing-mode #app {
  min-height: 0;
  padding: 0;
}

.marketing-landing {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.marketing-header {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto auto;
  gap: 20px;
  align-items: center;
}

.marketing-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
}

.marketing-brand-lockup {
  display: block;
  width: clamp(170px, 18vw, 266px);
  height: auto;
  filter: drop-shadow(0 10px 34px rgba(20, 22, 63, 0.24));
}

.marketing-nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  justify-self: center;
}

.marketing-nav a {
  color: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  font-weight: 500;
}

.marketing-nav a:hover,
.marketing-nav a:focus-visible {
  color: #fff;
}

.marketing-actions,
.marketing-hero-actions,
.marketing-cta-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.marketing-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 96px;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 56px;
}

.marketing-hero-copy,
.hero-panel-card,
.marketing-feature-card,
.marketing-step-card,
.marketing-why-panel,
.marketing-cta-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.marketing-hero-copy {
  padding: 52px 46px;
}

.marketing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-tertiary);
  margin-bottom: 16px;
}

.marketing-kicker::before {
  content: '';
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-tertiary);
}

.marketing-hero h1,
.marketing-section-heading h2,
.marketing-cta-card h2 {
  font-family: 'Syne', var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: #fff;
}

.marketing-hero h1 {
  font-size: clamp(3rem, 6vw, 5.25rem);
  margin-bottom: 20px;
  max-width: 12ch;
}

.marketing-lead {
  font-size: 1.22rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
  max-width: 58ch;
  margin-bottom: 28px;
}

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

.marketing-proof div {
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.marketing-proof strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.marketing-proof span,
.hero-panel-card li,
.marketing-feature-card p,
.marketing-step-card p,
.marketing-why-panel p,
.marketing-cta-card p {
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.7;
}

.hero-panel-card {
  height: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-panel-label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 18px;
}

.hero-panel-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-panel-list li {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-panel-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-panel-badge-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.screen {
  display: none;
  width: 100%;
  max-width: 1180px;
  animation: fadeUp 380ms cubic-bezier(.4,0,.2,1) both;
}
.screen.active { display: block; }

.marketing-section {
  margin-bottom: 56px;
}

.marketing-section-heading {
  margin-bottom: 26px;
}

.marketing-section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 15ch;
}

.marketing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.marketing-feature-card,
.marketing-step-card,
.marketing-why-panel {
  padding: 28px;
}

.marketing-feature-card h3,
.marketing-step-card h3,
.marketing-why-panel h3 {
  font-size: 1.18rem;
  margin-bottom: 12px;
}

.marketing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.marketing-step-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-weight: 700;
  color: #0d0d14;
  background: var(--brand-tertiary);
}

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

.marketing-cta-card {
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.marketing-cta-card h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin-bottom: 10px;
}

body.marketing-mode .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

body.marketing-mode .btn:hover,
body.marketing-mode .btn:focus-visible {
  transform: translateY(-1px);
}

body.marketing-mode .btn.btn-primary {
  color: #0d0d14;
  background: var(--brand-tertiary);
  box-shadow: 0 16px 36px rgba(70, 250, 10, 0.18);
}

body.marketing-mode .btn.btn-secondary,
body.marketing-mode .btn.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

body.marketing-mode .btn.btn-secondary:hover,
body.marketing-mode .btn.btn-ghost:hover,
body.marketing-mode .btn.btn-secondary:focus-visible,
body.marketing-mode .btn.btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

/* Desktop-first wide canvas for task execution screens */
.screen.task-screen-wide {
  max-width: 98%;
  width: 98%;
}
.screen.task-screen-wide .card {
  padding: 36px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-md);
}

/* ─── Step indicator ─────────────────────────────────────────────────────────── */
.step-indicator {
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-indicator::before {
  content: '';
  display: inline-block;
  width: 24px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */
.screen-title {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 12px;
}
.task-followup-screen { width:min(880px, calc(100vw - 32px)); max-width:none; }
.task-followup-screen .card { padding:32px; }
.task-followup-screen .screen-title { font-size:1.9rem; margin-bottom:8px; }
.task-followup-screen .screen-subtitle { margin-bottom:24px; }
.screen-subtitle {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 36px;
}
.screen-subtitle p + p { margin-top: .75em; }

/* ─── Form elements ──────────────────────────────────────────────────────────── */
.question-block {
  margin-bottom: 32px;
}
.question-label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.45;
}
.response-requirement {
  display: inline-block;
  margin-left: 4px;
  color: var(--ink-muted, #687080);
  font-size: .82em;
  font-weight: 500;
}
.response-requirement.is-required {
  color: #b42318;
}

/* Single / Multiple Choice */
.choice-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  font-size: .9375rem;
  color: var(--ink-soft);
  user-select: none;
}
.choice-item:hover { border-color: var(--accent); background: var(--accent-light); }
.choice-item input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.choice-item.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--ink);
  font-weight: 500;
}

/* Agree / Disagree */
.agree-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.agree-option {
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-size: .9375rem;
}
.agree-option:hover { border-color: var(--accent); background: var(--accent-light); }
.agree-option.selected.agree { border-color: var(--success); background: var(--success-light); color: var(--success); }
.agree-option.selected.disagree { border-color: var(--accent); background: var(--accent-light); color: var(--accent-hover); }

/* Linear Scale */
.scale-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scale-track {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.scale-btn {
  flex: 1;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all var(--transition);
  font-family: var(--font-body);
}
.scale-btn:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.scale-btn.selected { border-color: var(--accent); background: var(--accent); color: #fff; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: .8125rem;
  color: var(--ink-muted);
}

/* Text area */
.text-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.text-input::placeholder { color: var(--ink-muted); }

/* ─── Figma Embed ────────────────────────────────────────────────────────────── */
.embed-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin-bottom: 24px;
  background: var(--canvas);
}
.embed-container iframe {
  display: block;
  width: 100%;
  height: clamp(420px, 72vh, 920px);
  border: none;
  overflow: hidden;
}

.prototype-launcher { margin-bottom: 24px; }
.prototype-tile {
  width: 100%;
  border: 1.5px dashed rgba(var(--brand-rgb),.32);
  border-radius: var(--radius-md);
  background:
    radial-gradient(1200px 300px at 10% 10%, var(--accent-light) 0%, #fff 60%);
  padding: 26px;
  text-align: left;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: grid;
  gap: 10px;
}
.prototype-tile-kicker {
  display: inline-block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  font-weight: 700;
}
.prototype-tile strong {
  font-size: 1.1rem;
  color: var(--ink);
}
.prototype-tile span:last-child {
  color: var(--ink-soft);
  font-size: .92rem;
}
.prototype-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.prototype-tile-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.prototype-preview {
  position: relative;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4ff;
  height: 190px;
}
.prototype-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}
.prototype-preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--ink-muted);
  background: rgba(255,255,255,.8);
}
.prototype-preview-loader.hidden { display: none; }
.prototype-status {
  display: inline-block;
  font-size: .8rem;
  color: var(--warn);
  font-weight: 600;
}
.prototype-status.is-complete {
  color: var(--success);
}

.prototype-overlay {
  position: relative;
  inset: auto;
  background: var(--canvas);
  z-index: 1;
  display: none;
  padding: 0;
  width: 100%;
  height: 100dvh;
}
.prototype-overlay.open {
  display: flex;
}
.prototype-overlay-panel {
  width: 100%;
  height: 100dvh;
  background: linear-gradient(180deg, var(--canvas) 0%, #fff 100%);
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.screen.prototype-screen-active {
  width: 100%;
  max-width: 100%;
}

.screen.prototype-screen-active .prototype-screen-card {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.screen.prototype-screen-active .prototype-screen-card > :not(.prototype-overlay):not(.prototype-launcher.hidden) {
  display: none !important;
}
.prototype-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.94);
  color: var(--ink);
}
.prototype-ribbon {
  position: absolute;
  top: 8px;
  left: 10%;
  width: 80%;
  z-index: 5;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(35, 40, 90, .12);
  cursor: grab;
  user-select: none;
}
.prototype-ribbon.is-dragging {
  cursor: grabbing;
}
.prototype-ribbon-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-back-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px;
}
.btn-back-inline svg {
  width: 14px;
  height: 14px;
}
.drag-handle {
  color: var(--ink-muted);
  letter-spacing: 1px;
  font-size: 1rem;
  line-height: 1;
}
.prototype-ribbon-title {
  white-space: nowrap;
  margin-right: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 26vw;
}
.overlay-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.viewer-mode-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.viewer-mode-controls .btn {
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.viewer-mode-controls .btn svg {
  width: 13px;
  height: 13px;
}
.viewer-mode-controls .btn.is-active {
  background: var(--accent-light);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
  font-weight: 700;
}
.btn-sm {
  padding: 8px 13px;
  font-size: .82rem;
}
.prototype-overlay-header .btn.btn-ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
}
.prototype-overlay-header .btn.btn-ghost:hover {
  background: var(--accent-light);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.prototype-overlay-header .btn.btn-primary {
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), .2);
}
.prototype-overlay-header .btn-overlay-back {
  background: var(--accent);
  color: var(--brand-on-primary);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, white);
}
.prototype-overlay-header .btn-overlay-back:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.prototype-embed {
  flex: 1;
  margin: 0;
  border-radius: 0;
  border: none;
  background: #eef2ff;
  display: grid;
  place-items: center;
  padding: 5dvh 5vw;
}
.prototype-embed iframe {
  width: 90vw;
  height: 90dvh;
  min-height: 420px;
  max-width: none;
  max-height: none;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: #fff;
}

.task-drawer {
  position: absolute;
  top: 96px;
  left: calc(100% - min(360px, 36vw) - 24px);
  z-index: 3;
  width: min(360px, 36vw);
  max-height: calc(100dvh - 108px);
  overflow: auto;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(0, 0) scale(1);
  transition: opacity var(--transition), visibility var(--transition), box-shadow var(--transition), transform 240ms ease;
}
.task-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  box-shadow: 0 14px 30px rgba(35, 40, 90, .14);
}
.task-drawer.closing-to-toggle {
  opacity: 0;
  transform: translate(var(--drawer-close-x, 0), var(--drawer-close-y, 0)) scale(0.22);
  pointer-events: none;
}
.task-drawer.is-dragging {
  cursor: grabbing;
}
.task-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  cursor: grab;
}
.task-drawer-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.task-drag-handle {
  margin-top: -1px;
}
.task-drawer h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}
.task-drawer p {
  margin: 0 0 10px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.task-drawer ul {
  margin: 0 0 12px 18px;
  color: var(--ink-muted);
  display: grid;
  gap: 6px;
}
.unable-comment-wrap {
  margin-top: 10px;
  display: none;
  gap: 8px;
}
.unable-comment-wrap.open {
  display: grid;
}
.unable-comment-wrap label {
  font-size: .84rem;
  color: var(--ink-muted);
}
.unable-comment-wrap textarea {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-body);
}
.embed-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  gap: 14px;
  font-size: .9rem;
  color: var(--ink-muted);
  transition: opacity var(--transition);
}
.embed-loader.hidden { opacity: 0; pointer-events: none; }
.embed-fallback {
  margin-top: 10px;
  font-size: .86rem;
  color: var(--ink-muted);
}
.embed-fallback a {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Spinner ────────────────────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Loading Screen ─────────────────────────────────────────────────────────── */
.loader-wrap {
  margin-top: 30vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--ink-muted);
  font-size: .9375rem;
}

/* ─── Timer Badge ────────────────────────────────────────────────────────────── */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  margin-bottom: 16px;
}
.timer-dot {
  width: 6px; height: 6px;
  background: var(--timer-dot);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ─── Task instructions ──────────────────────────────────────────────────────── */
.task-instruction-box {
  background: var(--accent-light);
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--ink);
}
.task-instruction-box strong {
  display: block;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.task-instructions-float {
  position:fixed;
  z-index:1050;
  top:150px;
  right:24px;
  width:min(340px, calc(100vw - 24px));
  max-height:min(42vh, 360px);
  overflow:auto;
  border:1px solid rgba(157,123,27,.28);
  border-radius:12px;
  background:rgba(255,248,211,.96);
  color:var(--ink);
  box-shadow:0 12px 34px rgba(30,28,20,.2);
  backdrop-filter:blur(12px);
}
.task-instructions-float-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:11px 14px;
  border-bottom:1px solid rgba(157,123,27,.2);
  color:#4d421f;
  font-size:17px;
  cursor:grab;
  touch-action:none;
  user-select:none;
}
.task-instructions-float-head:active { cursor:grabbing; }
.task-instructions-grip { font-size:1rem; line-height:1; opacity:.65; cursor:grab; }
.task-instructions-hide { flex:0 0 auto; border:1px solid rgba(77,66,31,.22); border-radius:7px; background:rgba(255,255,255,.45); color:#4d421f; padding:5px 9px; font:600 .75rem/1.2 var(--font-body); cursor:pointer; }
.task-instructions-hide:hover { background:rgba(255,255,255,.8); }
.task-instructions-float[hidden],
.task-instructions-dock[hidden] { display:none !important; }
.task-instructions-dock { position:fixed; z-index:1050; top:150px; right:24px; padding:10px 14px; border:1px solid rgba(157,123,27,.32); border-radius:999px; background:rgba(255,248,211,.97); color:#4d421f; box-shadow:0 8px 24px rgba(30,28,20,.18); font:600 .82rem/1.2 var(--font-body); cursor:pointer; backdrop-filter:blur(10px); }
.task-instructions-dock:hover { background:#fff3bf; }
.task-instructions-float p { padding:13px 14px 15px; font-size:17px; line-height:1.5; white-space:pre-wrap; }

.task-media-wrap {
  margin: 0 0 18px;
}
.study-stimulus-image {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.task-context-stimulus .study-stimulus-image { max-height:none; overflow:visible; }
.task-context-stimulus .study-stimulus-image img,
.task-media-wrap .study-stimulus-image img { cursor:zoom-in; }
.task-context-stimulus .study-stimulus-image img:focus-visible,
.task-media-wrap .study-stimulus-image img:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.study-stimulus-image img {
  display: block;
  width: 100%;
  height: auto;
}
.first-click-canvas {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: crosshair;
  background: #f8fafc;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.first-click-canvas:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.first-click-canvas img {
  display: block;
  width: 100%;
  height: auto;
}
.first-click-image-error {
  padding: 24px;
  color: var(--error, #b42318);
  font-weight: 600;
  line-height: 1.5;
}
.first-click-prototype-wrap {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}
.first-click-prototype {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  background: #fff;
}
.first-click-prototype-wrap > .small { padding: 8px 12px; }
.first-click-dot {
  position: absolute;
  z-index: 3;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.first-click-dot-pulse {
  position:absolute;inset:0;border:2px solid rgba(0,230,118,.9);border-radius:50%;background:rgba(0,230,118,.24);animation:first-click-pulse 1.35s ease-out infinite;
}
.first-click-dot-core {
  position:absolute;left:50%;top:50%;width:15px;height:15px;transform:translate(-50%,-50%);border:3px solid #fff;border-radius:50%;background:#00d968;box-shadow:0 0 0 2px #08783c,0 0 14px rgba(0,230,118,.95);
}
.first-click-dot-pointer {
  position:absolute;left:50%;top:50%;width:22px;height:27px;overflow:visible;filter:drop-shadow(0 1px 2px rgba(0,0,0,.8));
}
.first-click-dot-pointer path {
  fill:#f7fff9;stroke:#075f31;stroke-width:1.6;stroke-linejoin:round;
}
@keyframes first-click-pulse {
  0% { opacity:.9;transform:scale(.45); }
  75%,100% { opacity:0;transform:scale(1.35); }
}
.five-second-stage {
  border: 1px dashed var(--border);
  border-radius: 12px;
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #f8fafc;
}
.five-second-image {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  border-radius: 8px;
}
.preference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.preference-choice {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    background var(--transition);
}
.preference-choice:hover:not(.selected) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: translateY(-2px);
}
.preference-choice.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.preference-choice img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #f1f5f9;
}
.card-sort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.card-sort-column {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.card-sort-unassigned {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-top: 10px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.card-sort-column.drag-over,
.card-sort-unassigned.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
}
.card-sort-column h4,
.card-sort-unassigned h4 {
  margin: 0 0 8px;
  font-size: .88rem;
}
.card-sort-cards {
  display: grid;
  gap: 8px;
}
.card-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  font-size: .85rem;
}
.draggable-card {
  cursor: grab;
  transition: opacity var(--transition), transform var(--transition);
}
.draggable-card:hover {
  transform: translateY(-1px);
}
.draggable-card.dragging {
  opacity: 0.6;
}
.card-chip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.card-sort-add {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tree-path-list {
  display: grid;
  gap: 8px;
}
.tree-path-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.tree-path-btn:hover:not(.selected) {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}
.tree-path-node {
  display: inline-block;
  line-height: 1.4;
}
.tree-path-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.live-site-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .first-click-dot {
    animation: none;
  }
  .first-click-dot-pulse { animation: none; }
  .preference-choice,
  .tree-path-btn,
  .card-sort-column,
  .card-sort-unassigned,
  .draggable-card {
    transition: none;
  }
  .preference-choice:hover:not(.selected),
  .draggable-card:hover {
    transform: none;
  }
}

/* ─── Welcome / Thank you ────────────────────────────────────────────────────── */
.hero-icon {
  width: 64px; height: 64px;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  font-size: 28px;
}

.divider {
  width: 40px; height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 24px 0;
}

/* ─── Disqualified ───────────────────────────────────────────────────────────── */
.disqualified-icon {
  width: 64px; height: 64px;
  background: var(--warn-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  font-size: 28px;
}

/* ─── Error toast ────────────────────────────────────────────────────────────── */
#error-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform 350ms cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}
#error-toast.visible { transform: translateX(-50%) translateY(0); }
#error-toast .retry-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-body);
}

/* ─── Action footer ──────────────────────────────────────────────────────────── */
.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.task-secondary-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.task-footer-vertical {
  position: fixed;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 104px;
  box-sizing: border-box;
  margin: 0;
  padding: 38px clamp(16px, 4vw, 48px) max(16px, env(safe-area-inset-bottom));
  border: 1px solid rgba(122, 132, 151, .34);
  border-bottom: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(229,232,239,.94) 0%, rgba(229,232,239,.98) 28%, #e5e8ef 100%);
  box-shadow: 0 -8px 28px rgba(31, 41, 61, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}
.screen.has-floating-task-action .card {
  padding-top: 48px;
  padding-bottom: 148px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.task-footer-actions {
  display: contents;
}
.task-footer-actions > #btn-task-next {
  min-width: 230px;
  margin-left: auto;
}
.task-footer-vertical .task-secondary-actions {
  position: absolute;
  left: 50%;
  bottom: 76px;
  justify-content: center;
  max-width: min(80vw, 620px);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.task-footer-vertical #btn-step-back,
.task-footer-vertical #btn-task-next { position:relative; z-index:1; pointer-events:auto; }
.task-reference-trigger { display:inline-flex; align-items:center; gap:7px; padding:8px 11px; border:1px solid rgba(255,255,255,.9); border-radius:9px; background:rgba(16,24,40,.82); color:#fff; box-shadow:0 4px 16px rgba(20,24,40,.22); font-family:inherit; font-size:.75rem; font-weight:600; line-height:1.2; cursor:pointer; }
.task-reference-trigger.is-preview-trigger { position:absolute; z-index:4; top:12px; right:12px; }
.task-reference-trigger .task-reference-expand-icon { display:block; width:17px; height:17px; flex:0 0 auto; }
.task-reference-trigger:hover { background:rgba(16,24,40,.96); }
.task-reference-trigger:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.task-context-stimulus .study-stimulus-image,
.task-context-stimulus .question-stimulus-frame,
.task-media-wrap .study-stimulus-image,
.task-media-wrap .question-stimulus-frame,
.task-media-wrap .first-click-prototype-wrap,
.task-media-wrap .first-click-canvas { position:relative; }
.task-reference-inline { margin-top:12px; }
.participant-back-button { display:inline-flex; align-items:center; gap:8px; }
.participant-back-button svg { width:17px; height:17px; }
.question-block { scroll-margin-top:28px; }
.question-block.has-error { border-left:3px solid var(--error, #b42318); padding-left:12px; }
.question-block .field-error { color:var(--error, #b42318); }
.question-validation-summary { margin:18px 0; padding:14px 16px; border:1px solid #e4a6a6; border-left:4px solid #b42318; border-radius:10px; background:#fff6f5; color:#7a1c1c; line-height:1.45; font-weight:600; }
.task-gate-note {
  font-size: .82rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.consent-box {
  margin-top: 20px;
  background: var(--accent-light);
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.consent-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}
.consent-check input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.consent-subtle {
  margin-top: 10px;
  font-size: .86rem;
  color: #4b5563;
  line-height: 1.5;
}
.welcome-rich-text p + p { margin-top: .85em; }
.welcome-rich-text ul { margin: .65em 0 .85em 1.35em; padding-left: .5em; }
.welcome-rich-text li + li { margin-top: .25em; }

.participant-intro-box {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  border-radius: var(--radius-md);
  background: #fff;
}

.participant-intro-title {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
  color: var(--ink);
}

.participant-intro-text,
.participant-intro-note {
  margin: 8px 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

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

.participant-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.participant-field span {
  font-size: .92rem;
}

.participant-field .text-input {
  min-height: 48px;
  height: 48px;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .participant-intro-grid {
    grid-template-columns: 1fr;
  }
}

.review-details {
  margin-top: 18px;
}
.review-summary {
  margin-top: 10px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--accent) 6%, #fff);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.review-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
}
.review-label {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .9rem;
}
.review-value {
  color: var(--ink);
  text-align: right;
  font-size: .9rem;
  max-width: 60%;
}

.preview-banner {
  margin: -8px auto 16px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, var(--border));
  background: var(--warn-light);
  color: var(--warn);
  font-size: .84rem;
  font-weight: 700;
  text-transform: none;
  text-align: center;
}

.choice-item:focus-visible,
.agree-option:focus-visible,
.scale-btn:focus-visible,
.text-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light), 0 0 0 5px var(--accent);
}

.section-sep { margin: 32px 0; border: none; border-top: 1px solid var(--border); }

/* ─── Validation error ───────────────────────────────────────────────────────── */
.field-error {
  display: block;
  margin-top: 8px;
  font-size: .8125rem;
  color: var(--accent);
  font-weight: 500;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 28px 22px; }
  .screen-title { font-size: 1.625rem; }
  .task-followup-screen { width:100%; }
  .task-followup-screen .card { padding:24px 18px; }
  .task-followup-screen .screen-title { font-size:1.55rem; }
  .agree-wrap { grid-template-columns: 1fr; }
  .scale-btn { height: 42px; font-size: .8125rem; }
  #app { padding: 32px 12px 64px; }
  .action-footer { flex-direction: column; gap: 12px; align-items: stretch; }
  .action-footer .btn { justify-content: center; }
  .task-secondary-actions { order: 2; flex-direction: column; align-items: stretch; }
  .screen.task-screen-wide .card { padding: 24px 18px; }
  .screen.task-screen-wide { width: 100%; max-width: 100%; }
  .embed-container iframe { min-height: 360px; height: 60vh; }
  .prototype-overlay-header { padding: 10px; }
  .prototype-overlay-header strong { font-size: .92rem; }
  .overlay-actions { width: 100%; }
  .prototype-ribbon { left: 10px; width: calc(100% - 20px); top: 8px; }
  .prototype-embed { padding: 5dvh 5vw; }
  .prototype-embed iframe { width: 90vw; height: 90dvh; }
  .task-drawer {
    width: calc(100% - 20px);
    max-height: 48vh;
    top: auto;
    bottom: 10px;
    left: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .task-footer-vertical { top:auto; bottom:0; width:100%; min-height:104px; padding:48px 14px max(14px, env(safe-area-inset-bottom)); }
  .screen.has-floating-task-action .card { padding:24px 18px 140px; }
  .task-footer-actions > #btn-task-next { min-width:0; flex:1; }
  .task-footer-vertical .task-secondary-actions { bottom:66px; max-width:86vw; font-size:.75rem; }
  .prototype-tile-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 1024px) {
  .screen.task-screen-wide {
    max-width: 98%;
    width: 98%;
  }
  .embed-container iframe {
    min-height: 520px;
    height: min(70vh, 760px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARTICIPANT UI ENHANCEMENTS
   Layered on top of existing rules — ambient, glass, motion, refinement
═══════════════════════════════════════════════════════════════════════════ */

/* ── Ambient mesh background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 8%,  rgba(var(--brand-rgb),.08) 0%, transparent 65%),
    radial-gradient(ellipse 55% 75% at 88% 92%, rgba(var(--brand-rgb),.07) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 55% 38%, rgba(var(--brand-rgb),.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: ambientDrift 20s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  0%   { opacity: 1;   transform: scale(1)    translateY(0); }
  100% { opacity: .82; transform: scale(1.05) translateY(-14px); }
}

/* Dot-grid texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(var(--brand-rgb),.055) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

#app { position: relative; z-index: 1; }

/* ── Progress bar — glowing leading dot ── */
#progress-bar-container {
  background: transparent;
}
#progress-bar {
  background: linear-gradient(90deg,
    var(--brand-primary)    0%,
    var(--brand-secondary)  45%,
    var(--brand-tertiary-2) 100%);
  box-shadow: 0 0 10px rgba(var(--brand-rgb),.45);
  position: relative;
}
#progress-bar::after {
  content: '';
  position: absolute;
  right: -1px; top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-tertiary-2);
  transform: translateY(-50%);
  box-shadow: 0 0 10px 2px rgba(var(--brand-rgb),.7);
  opacity: 0;
  transition: opacity 400ms;
}
#progress-bar-container.visible #progress-bar::after { opacity: 1; }

/* ── Screen animation — spring slide ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px) scale(.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Loading screen ── */
.loader-wrap {
  padding-top: 28vh;
  gap: 22px;
}
.brand-logo-inline {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(var(--brand-rgb),.22),
    0 2px 8px  rgba(var(--brand-rgb),.12),
    0 0 0 1px  rgba(var(--brand-rgb),.08);
  animation: logoIn 600ms cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(.75) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
  border-color: rgba(var(--brand-rgb),.15);
  border-top-color: var(--brand-primary);
}
.loader-wrap p {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: fadeIn 400ms 500ms both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Card — frosted glass surface ── */
.card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.9);
  border-bottom-color: rgba(225,228,240,.6);
  border-right-color: rgba(225,228,240,.5);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.95) inset,
    0 2px 4px  rgba(17,19,58,.03),
    0 8px 32px rgba(17,19,58,.08),
    0 24px 64px rgba(17,19,58,.06);
}

/* ── Step indicator — pill badge ── */
.step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand-primary);
  background: rgba(var(--brand-rgb),.08);
  border: 1px solid rgba(var(--brand-rgb),.12);
  padding: 5px 12px 5px 9px;
  border-radius: 100px;
  margin-bottom: 22px;
}
.step-indicator::before {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 6px rgba(var(--brand-rgb),.5);
}

/* ── Screen title ── */
.screen-title {
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  letter-spacing: -.02em;
  line-height: 1.15;
}

/* ── Primary button — gradient + gloss ── */
.btn-primary {
  background: linear-gradient(140deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,.15) inset,
    0 4px 16px rgba(var(--brand-rgb),.32),
    0 1px 4px  rgba(var(--brand-rgb),.2);
  letter-spacing: .015em;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.13) 0%, transparent 55%);
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.15) inset,
    0 8px 28px rgba(var(--brand-rgb),.38),
    0 2px 8px  rgba(var(--brand-rgb),.22);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255,255,255,.1) inset,
    0 2px 8px rgba(var(--brand-rgb),.2);
}

/* ── Ghost button — frosted ── */
.btn-ghost {
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  border-color: rgba(225,228,240,.9);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.95);
  border-color: rgba(var(--brand-rgb),.22);
}

/* ── Choice items — elevated hover/selected ── */
.choice-item {
  border-radius: var(--radius-md);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.choice-item:hover {
  border-color: rgba(var(--brand-rgb),.4);
  background: rgba(var(--brand-rgb),.04);
  box-shadow: 0 4px 16px rgba(var(--brand-rgb),.1);
  transform: translateY(-1px);
}
.choice-item.selected {
  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb),.12),
    0 4px 14px rgba(var(--brand-rgb),.1);
  transform: translateY(-1px);
}

/* ── Scale buttons ── */
.scale-btn {
  border-radius: 10px;
}
.scale-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb),.1);
}
.scale-btn.selected {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  box-shadow: 0 4px 14px rgba(var(--brand-rgb),.3);
}

/* ── Preference cards ── */
.preference-choice {
  border-radius: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.preference-choice:hover:not(.selected) {
  box-shadow: 0 6px 22px rgba(var(--brand-rgb),.12);
  transform: translateY(-3px);
}
.preference-choice.selected {
  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb),.12),
    0 6px 18px rgba(var(--brand-rgb),.12);
}

/* ── Text input ── */
.text-input {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: rgba(245,246,251,.7);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.text-input:focus {
  background: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.1);
}

/* ── Task instruction box ── */
.task-instruction-box {
  border-radius: 14px;
  border-color: rgba(var(--brand-rgb),.15);
}

/* ── Timer badge ── */
.timer-badge {
  background: linear-gradient(135deg, #12143A, #2d2926);
  box-shadow: 0 2px 10px rgba(17,19,58,.25);
}
.timer-dot {
  width: 7px; height: 7px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,59,48,.5); }
  50%       { opacity: .5; box-shadow: 0 0 0 5px rgba(255,59,48,0); }
}

/* ── Error toast ── */
#error-toast {
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(17,19,58,.2), 0 4px 16px rgba(17,19,58,.1);
}

/* ── Action footer divider ── */
.action-footer {
  border-top-color: rgba(225,228,240,.6);
}

/* ── Consent box ── */
.consent-box {
  border-radius: 14px;
}

/* ── Hero icon — gradient ── */
.hero-icon {
  background: linear-gradient(135deg, rgba(var(--brand-rgb),.1), rgba(var(--brand-rgb),.08));
  border: 1px solid rgba(var(--brand-rgb),.1);
  border-radius: var(--radius-lg);
}

/* ── Disqualified icon ── */
.disqualified-icon {
  background: var(--warn-light);
  border: 1px solid rgba(212,128,42,.15);
}

/* ── Preview banner ── */
.preview-banner {
  backdrop-filter: blur(8px);
}

/* ── Tree test buttons ── */
.tree-path-btn {
  border-radius: 12px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.tree-path-btn:hover:not(.selected) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--brand-rgb),.09);
}

/* ── Prototype overlay ── */
.prototype-overlay-header {
  backdrop-filter: blur(12px);
}

/* ── Mobile adjustments ── */
@media (max-width: 640px) {
  .card { border-radius: 18px; }
  .screen-title { font-size: 1.5rem; }
}

@media (max-width: 1080px) {
  .marketing-header,
  .marketing-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .marketing-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .marketing-nav {
    justify-self: start;
    flex-wrap: wrap;
  }

  .marketing-hero,
  .marketing-feature-grid,
  .marketing-steps,
  .marketing-why-grid,
  .marketing-cta-card {
    grid-template-columns: 1fr;
  }

  .marketing-hero-copy,
  .hero-panel-card,
  .marketing-feature-card,
  .marketing-step-card,
  .marketing-why-panel,
  .marketing-cta-card {
    padding: 24px;
  }

  .marketing-proof {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .marketing-header {
    padding-top: 18px;
  }

  .marketing-actions,
  .marketing-hero-actions,
  .marketing-cta-actions {
    width: 100%;
  }

  body.marketing-mode .btn {
    width: 100%;
  }

  .marketing-brand {
    align-items: flex-start;
  }

  .marketing-brand-lockup {
    width: 182px;
  }

  .marketing-hero h1 {
    font-size: 2.8rem;
  }
}

/* Force-hide the participant app shell whenever the marketing landing is active. */
body.marketing-mode #app,
body.marketing-mode #app.hidden,
body.marketing-mode #progress-bar-container,
body.marketing-mode #progress-bar-container.hidden,
body.marketing-mode #loading-screen,
body.marketing-mode .loader-wrap {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.participant-mode #marketing-landing,
body.participant-mode #marketing-landing.hidden {
  display: none !important;
}

/* Question attachments and optional-response cues */
.question-attachment-image { display:block; max-width:100%; max-height:420px; height:auto; object-fit:contain; margin:12px 0 16px; border:1px solid var(--border, #e5e7eb); border-radius:12px; background:#fff; }
.optional-label { font-size:.82em; font-weight:400; color:var(--ink-muted, #687080); }

.question-section-heading { margin:24px 0 10px; padding-top:16px; border-top:1px solid var(--border, #e5e7eb); font-size:1.05rem; }
.question-block:first-child .question-section-heading { margin-top:0; padding-top:0; border-top:0; }


/* Optional webpage/Figma stimuli at task and question level */
.question-stimulus-frame { position:relative; width:100%; margin:12px 0 16px; border:1px solid var(--border); border-radius:12px; overflow:hidden; background:#fff; }
.screen.has-floating-task-action .question-stimulus-frame { border:0; border-radius:0; overflow:visible; background:transparent; }
.question-stimulus-frame iframe { display:block; width:100%; min-height:480px; border:0; background:#fff; }
.stimulus-frame-loading .stimulus-loading { position:absolute; z-index:2; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; background:linear-gradient(145deg,#fff 0%,#f5f7fc 100%); color:#30394e; text-align:center; pointer-events:none; }
.stimulus-loading[hidden] { display:none !important; }
.stimulus-loading strong { font-size:1rem; font-weight:700; }
.stimulus-loading-detail { max-width:32rem; color:#697386; font-size:.875rem; }
.stimulus-loading-track { position:relative; display:block; width:min(240px,60vw); height:6px; overflow:hidden; border-radius:99px; background:#dfe4f2; }
.stimulus-loading-track::after { content:""; position:absolute; inset:0 auto 0 0; width:38%; border-radius:inherit; background:linear-gradient(90deg,var(--brand-primary),var(--brand-secondary)); animation:stimulus-load-progress 1.3s ease-in-out infinite; }
@keyframes stimulus-load-progress { 0% { transform:translateX(-110%); } 100% { transform:translateX(280%); } }
.question-stimulus-frame > .small { padding:8px 12px; margin:0; }
.screen.task-screen-wide .task-context-stimulus .question-stimulus-frame iframe,
.screen.task-screen-wide .task-media-wrap > .question-stimulus-frame iframe { height:min(88vh, 1500px); min-height:min(88vh, 680px); }
.screen.task-screen-wide .first-click-prototype-wrap { min-height:0; }
.screen.task-screen-wide .first-click-prototype { height:min(88vh, 1500px); min-height:min(88vh, 680px); }
.task-stimulus-modal { position:fixed; z-index:1200; inset:0; display:none; align-items:stretch; justify-content:stretch; padding:0; }
.task-stimulus-modal.open { display:flex; }
.task-stimulus-modal-backdrop { position:absolute; inset:0; background:rgba(8,12,22,.62); backdrop-filter:blur(3px); }
.task-stimulus-modal .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-stimulus-modal-panel { position:relative; z-index:1; display:flex; flex:1 1 auto; width:100vw; height:100dvh; overflow:hidden; background:transparent; }
.task-stimulus-modal-context { position:absolute; z-index:5; top:max(20px, env(safe-area-inset-top)); left:max(20px, env(safe-area-inset-left)); max-width:calc(100vw - 104px); margin:0; padding:11px 16px; border:1px solid rgba(255,255,255,.35); border-radius:12px; background:rgba(18,24,38,.72); color:#fff; font-size:14px; font-weight:650; line-height:1.35; backdrop-filter:blur(12px); }
.task-stimulus-modal-close { position:absolute; z-index:5; top:max(16px, env(safe-area-inset-top)); right:max(16px, env(safe-area-inset-right)); display:grid; width:48px; height:48px; place-items:center; border:1px solid rgba(255,255,255,.45); border-radius:50%; background:rgba(18,24,38,.54); color:#fff; cursor:pointer; backdrop-filter:blur(12px); }
.task-stimulus-modal-close svg { width:22px; height:22px; }
.task-stimulus-modal-content { position:absolute; inset:0; display:flex; overflow:hidden; align-items:center; justify-content:center; background:transparent; touch-action:none; }
.task-stimulus-zoom-surface { display:flex; width:100vw; height:100dvh; flex:0 0 auto; align-items:center; justify-content:center; transform-origin:center; will-change:transform; cursor:grab; }
.task-stimulus-zoom-surface.is-panning { cursor:grabbing; }
.task-stimulus-zoom-surface iframe { width:100%; height:100%; border:0; background:#fff; pointer-events:auto; }
.task-stimulus-zoom-surface img { display:block; width:100%; height:100%; object-fit:contain; user-select:none; -webkit-user-drag:none; }
.task-stimulus-zoom-controls { position:absolute; z-index:4; left:50%; bottom:max(20px, env(safe-area-inset-bottom)); display:flex; align-items:center; gap:8px; transform:translateX(-50%); padding:8px 10px; border:1px solid rgba(255,255,255,.25); border-radius:14px; background:rgba(18,24,38,.68); color:#fff; box-shadow:0 8px 28px rgba(0,0,0,.24); backdrop-filter:blur(14px); }
.task-stimulus-zoom-controls button { min-width:38px; height:36px; border:0; border-radius:8px; background:rgba(255,255,255,.12); color:#fff; font-family:inherit; font-size:1rem; font-weight:600; line-height:1; cursor:pointer; }
.task-stimulus-zoom-controls [data-zoom="reset"] { padding:0 11px; font-size:.78rem; }
.task-stimulus-zoom-controls [data-zoom-label] { min-width:48px; text-align:center; font-size:.75rem; font-variant-numeric:tabular-nums; }
.task-stimulus-pan-hint { margin-left:5px; color:rgba(255,255,255,.78); font-size:.72rem; white-space:nowrap; }
@media (max-width:640px) {
  .task-reference-trigger.is-preview-trigger { top:8px; right:8px; }
  .task-stimulus-pan-hint { display:none; }
  .screen.task-screen-wide .task-context-stimulus .question-stimulus-frame iframe,
  .screen.task-screen-wide .task-media-wrap > .question-stimulus-frame iframe { height:78vh; min-height:480px; }
  .screen.task-screen-wide .first-click-prototype { height:78vh; min-height:480px; }
  .task-instructions-float { top:100px; right:12px; width:min(300px, calc(100vw - 24px)); max-height:36vh; }
}
.task-image-preview img { display:block; max-width:100%; max-height:240px; object-fit:contain; margin-top:8px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.task-image-preview .hint { display:block; margin-top:8px; color:var(--ink-muted); }
.five-second-image { display:block; width:100%; max-height:70vh; border:0; object-fit:contain; background:#fff; }

/* Give consent content more usable width and reduce unnecessary framing. */
.consent-box { margin-top:12px; padding:12px 14px; }
.screen-consent .screen-card, .consent-screen .screen-card { width:min(100% - 24px, 1180px); max-width:1180px; }
.screen-consent .screen-content, .consent-screen .screen-content { padding:clamp(12px,2vw,24px); }

/* Compact consent layout: reduce card gutters so the consent statement has room. */
.screen:has(.consent-box) > .card { width:min(100% - 24px, 1180px); max-width:1180px; padding:clamp(18px, 3vw, 30px); }
.screen:has(.consent-box) .consent-box { margin:10px 0 0; padding:12px 14px; }
.screen:has(.consent-box) .consent-check { gap:9px; }
.task-instructions-rich p { margin:0 0 8px; }
.task-instructions-rich ul { margin:6px 0 8px; padding-left:22px; }
.task-instructions-rich li { margin:3px 0; }

/* ─── Research method components (v2) ─────────────────────────────────────── */
.cs-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; }

/* Tree test: one level at a time */
.tree-nav { border:1px solid var(--border); border-radius:12px; background:#fff; padding:14px; display:grid; gap:12px; }
.tree-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; font-size:.86rem; color:var(--ink-muted); }
.tree-crumb { background:none; border:0; padding:4px 6px; border-radius:6px; color:var(--accent); font:inherit; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.tree-crumb[aria-current="location"] { color:var(--ink); text-decoration:none; font-weight:600; cursor:default; }
.tree-back { justify-self:start; }
.tree-level { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.tree-node { width:100%; min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid var(--border); border-radius:10px; background:#fff; padding:10px 14px; font:inherit; color:var(--ink); text-align:left; cursor:pointer; transition:border-color var(--transition), background var(--transition); }
.tree-node:hover { border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); background:color-mix(in srgb, var(--accent) 5%, #fff); }
.tree-node-chev { font-size:1.3rem; color:var(--ink-muted); }
.tree-node-pick { font-size:.8rem; color:var(--accent); font-weight:600; white-space:nowrap; }
.tree-empty { color:var(--ink-muted); font-size:.9rem; padding:6px 2px; }
.tree-actions { display:flex; flex-wrap:wrap; gap:8px; }
.tree-skip { color:var(--ink-muted); }
.tree-result { display:grid; gap:8px; padding:12px; border-radius:10px; background:var(--accent-light); }
.tree-result-path { font-weight:600; }
.tree-result .btn { justify-self:start; }

/* Card sort v2 */
.card-sort-v2 { display:grid; gap:10px; }
.cs-progress { margin:0; font-size:.88rem; color:var(--ink-muted); }
.cs-add { display:grid; gap:6px; }
.cs-add label { font-weight:600; font-size:.88rem; }
.cs-add > div { display:flex; gap:8px; flex-wrap:wrap; }
.cs-add input { flex:1 1 200px; min-height:42px; }
.cs-message { margin:0; color:var(--error); font-size:.88rem; }
.cs-board { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; align-items:start; }
.cs-col { border:1px solid var(--border); border-radius:10px; background:#fff; padding:10px; min-height:96px; transition:border-color var(--transition), background var(--transition); }
.cs-unsorted { background:#f8fafc; border-style:dashed; }
.cs-col.drag-over { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 8%, #fff); }
.cs-col h4 { margin:0 0 8px; font-size:.9rem; display:flex; align-items:center; gap:6px; }
.cs-col-h { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
.cs-col-tools { display:flex; gap:4px; }
.cs-tool { border:0; background:none; color:var(--accent); font-size:.78rem; padding:2px 4px; cursor:pointer; text-decoration:underline; }
.cs-count { font-size:.75rem; font-weight:600; color:var(--ink-muted); background:#eef1f6; border-radius:99px; padding:1px 7px; }
.cs-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.cs-card { display:grid; gap:6px; border:1px solid var(--border); border-radius:8px; background:#fff; padding:8px 10px; cursor:grab; }
.cs-card.dragging { opacity:.55; }
.cs-card-label { font-size:.9rem; font-weight:500; }
.cs-card select { min-height:36px; font-size:.84rem; }
.cs-empty, .cs-empty-board { color:var(--ink-muted); font-size:.84rem; padding:6px 2px; }
.cs-hint { margin:0; }

/* Preference */
.preference-choice-label { font-weight:600; }
.preference-choice-desc { font-size:.85rem; color:var(--ink-muted); }
.preference-choice:focus-visible, .tree-node:focus-visible, .tree-crumb:focus-visible, .cs-card select:focus-visible, .cs-tool:focus-visible { outline:3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset:2px; }
.preference-zoom-row { display:flex; flex-wrap:wrap; gap:6px; }
.preference-reason { display:grid; gap:6px; margin-top:12px; }
.preference-reason label { font-weight:600; }

/* 5-second: the stimulus stays invisible until it has loaded, so loading never eats into the exposure */
.five-second-stage { position:relative; }
.five-second-frame:not(.is-shown) { position:absolute; inset:0; opacity:0; pointer-events:none; }
.five-second-frame.is-shown { width:100%; height:60vh; }
.five-second-loading { display:grid; justify-items:center; gap:10px; color:var(--ink-muted); text-align:center; }
.five-second-intro { display:grid; justify-items:center; gap:12px; text-align:center; max-width:46ch; }

/* First click: locked once recorded */
.first-click-canvas.is-locked { cursor:default; }

/* Instruction acknowledgement & tracking notices */
.instruction-ack { display:flex; gap:10px; align-items:flex-start; margin:14px 0 4px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#fff; cursor:pointer; }
.instruction-ack input { width:20px; height:20px; margin-top:1px; accent-color:var(--accent); }
.tracking-notice { margin:8px 0; padding:10px 12px; border-radius:10px; background:var(--warn-light, #fff7e6); color:var(--ink); font-size:.88rem; }
.tracking-status { color:var(--ink-muted); }
.followup-context-chip { display:inline-block; margin:0 0 6px; padding:3px 10px; border-radius:99px; background:var(--accent-light); color:var(--ink); font-size:.8rem; font-weight:600; }

@media (max-width: 640px) {
  .cs-board { grid-template-columns:1fr; }
  .tree-node { min-height:52px; }
}
@media (prefers-reduced-motion: reduce) {
  .tree-node, .cs-col { transition:none; }
}

/* Phone task footer: Back and Continue share one row; the gate note sits above them (was overlapping Back). */
@media (max-width: 640px) {
  .task-footer-vertical.action-footer { flex-direction: row; align-items: center; gap: 10px; padding-top: 44px; }
  .task-footer-vertical .task-secondary-actions { top: 10px; bottom: auto; width: 86vw; }
  .task-footer-vertical #btn-step-back { flex: 0 0 auto; }
}

/* ══ Participant navigation & context aids (2026-11) ═════════════════════════ */

/* Step chip doubles as a progress menu */
button.step-jump-trigger { font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; transition: background 140ms ease, border-color 140ms ease; }
button.step-jump-trigger:hover { background: rgba(var(--brand-rgb),.14); border-color: rgba(var(--brand-rgb),.28); }
button.step-jump-trigger:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 2px; }
.step-jump-caret { width: 14px; height: 14px; margin-left: 2px; }
.step-jump-trigger[aria-expanded="true"] .step-jump-caret { transform: rotate(180deg); }
.step-jump-menu { position: fixed; z-index: 1300; width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; padding: 0 0 8px; border: 1px solid rgba(23,32,51,.1); border-radius: 16px; background: #fff; color: var(--ink, #1d2040); box-shadow: 0 24px 60px rgba(17,19,58,.22); animation: fadeUp 160ms ease both; }
.step-jump-head { position: sticky; top: 0; z-index: 1; padding: 16px 16px 12px; background: #fff; border-bottom: 1px solid #eef0f6; }
.step-jump-head strong { display: block; font-size: .95rem; }
.step-jump-head > span { display: block; margin-top: 2px; color: #5c6283; font-size: .82rem; font-weight: 600; }
.step-jump-head p { margin: 8px 0 0; color: #6a7090; font-size: .78rem; line-height: 1.45; }
.step-jump-meter { height: 6px; margin-top: 10px; border-radius: 99px; background: #eceef6; overflow: hidden; }
.step-jump-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-primary, #3a3e98), var(--accent, #5b4ee6)); }
.step-jump-list { list-style: none; margin: 0; padding: 6px 8px 0; }
.step-jump-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: .86rem; text-align: left; cursor: pointer; }
.step-jump-item:hover:not([disabled]) { background: #f3f2ff; }
.step-jump-item:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: -2px; }
.step-jump-num { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e7f6ee; color: #137a45; font-size: .72rem; font-weight: 700; }
.step-jump-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-jump-status { flex: 0 0 auto; color: #137a45; font-size: .72rem; font-weight: 600; }
.step-jump-item.is-current { background: #f1f0ff; cursor: default; }
.step-jump-item.is-current .step-jump-num { background: var(--brand-primary, #3a3e98); color: #fff; }
.step-jump-item.is-current .step-jump-status { color: var(--brand-primary, #3a3e98); }
.step-jump-item.is-resume .step-jump-num { background: #fff3dc; color: #a25f00; }
.step-jump-item.is-resume .step-jump-status { color: #a25f00; }
.step-jump-item.is-locked { cursor: not-allowed; color: #9aa0b8; }
.step-jump-item.is-locked .step-jump-num { background: #f0f1f6; color: #9aa0b8; }
.step-jump-item.is-locked .step-jump-status { color: #9aa0b8; }

/* Task screens: Back / Continue live in a compact floating dock, not a full-width bar */
.task-footer-vertical { left: auto; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: auto; min-height: 0; padding: 8px; gap: 8px; border: 1px solid rgba(23,32,51,.1); border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 12px 36px rgba(17,19,58,.2); transition: padding 160ms ease, box-shadow 160ms ease; }
.task-footer-actions > #btn-task-next { min-width: 0; margin-left: 0; }
.task-footer-vertical #btn-step-back { min-height: 44px; padding: 8px 14px; border-radius: 999px; }
.task-footer-vertical #btn-task-next { min-height: 44px; padding: 10px 20px; border-radius: 999px; }
.task-footer-vertical .task-secondary-actions { left: auto; right: 6px; bottom: calc(100% + 8px); transform: none; max-width: min(320px, 80vw); text-align: right; }
.task-footer-vertical .task-gate-note { display: inline-block; padding: 6px 10px; border-radius: 8px; background: rgba(29,32,64,.88); color: #fff; font-size: .78rem; box-shadow: 0 6px 18px rgba(17,19,58,.2); }
.screen.has-floating-task-action .card { padding-bottom: 104px; }
/* While scrolled into the mockup, the dock shrinks to two round buttons; it expands on hover or focus. */
@media (max-width: 640px) {
  .task-footer-vertical { top: auto; left: auto; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; min-height: 0; padding: 6px; }
  .screen.has-floating-task-action .card { padding: 24px 18px 96px; }
  .task-footer-vertical .task-secondary-actions { bottom: calc(100% + 8px); }
}

/* The full-screen control on a visible mockup: present, but quiet */
.task-reference-trigger.is-preview-trigger { top: 10px; right: 10px; padding: 6px 10px; border: 1px solid rgba(23,32,51,.14); background: rgba(255,255,255,.82); color: #2a2f4f; box-shadow: 0 2px 8px rgba(17,19,58,.1); opacity: .78; backdrop-filter: blur(8px); transition: opacity 140ms ease, background 140ms ease; }
.task-reference-trigger.is-preview-trigger:hover,
.task-reference-trigger.is-preview-trigger:focus-visible { opacity: 1; background: #fff; }
.task-reference-trigger.is-preview-trigger .task-reference-expand-icon { width: 15px; height: 15px; }

/* Question screens: floating "View mockup" card, always in reach */
.mockup-fab { position: fixed; z-index: 1040; right: max(16px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 148px; padding: 8px; border: 1px solid rgba(91,78,230,.28); border-radius: 16px; background: #fff; color: #1d2040; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 16px 40px rgba(17,19,58,.2); transition: transform 160ms ease, box-shadow 160ms ease; }
.mockup-fab:hover { transform: translateY(calc(-50% - 2px)); box-shadow: 0 20px 48px rgba(17,19,58,.26); }
.mockup-fab:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 3px; }
.mockup-fab-thumb { position: relative; display: block; height: 92px; overflow: hidden; border-radius: 10px; background: linear-gradient(145deg, var(--accent-light), #fff); }
.mockup-fab-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.mockup-fab-art { display: grid; place-items: center; width: 100%; height: 100%; color: #5b4ee6; }
.mockup-fab-art svg { width: 76%; height: auto; }
.mockup-fab-zoom { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-primary, #3a3e98); color: #fff; box-shadow: 0 4px 10px rgba(17,19,58,.25); }
.mockup-fab-zoom svg { width: 15px; height: 15px; }
.mockup-fab-text strong { display: block; font-size: .86rem; color: var(--brand-primary, #3a3e98); }
.mockup-fab-text small { display: block; margin-top: 1px; color: #6a7090; font-size: .72rem; line-height: 1.3; }
.mockup-fab.is-attention { animation: mockupFabNudge 1.6s ease-in-out 3; }
.mockup-fab.is-attention::after { content: ""; position: absolute; inset: -4px; border-radius: 19px; border: 2px solid rgba(91,78,230,.55); animation: mockupFabRing 1.6s ease-out 3; pointer-events: none; }
@keyframes mockupFabNudge { 0%, 100% { transform: translateY(-50%); } 50% { transform: translate(-6px, -50%); } }
@keyframes mockupFabRing { 0% { opacity: .9; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .mockup-fab.is-attention, .mockup-fab.is-attention::after { animation: none; } }
.screen.has-mockup-fab .card { padding-right: max(48px, 190px); }
@media (max-width: 1100px) {
  .screen.has-mockup-fab .card { padding-right: 24px; padding-bottom: 120px; }
  .mockup-fab { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; flex-direction: row; align-items: center; width: auto; max-width: calc(100vw - 32px); padding: 6px 14px 6px 6px; border-radius: 999px; }
  .mockup-fab:hover { transform: translateY(-2px); }
  .mockup-fab-thumb { width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%; }
  .mockup-fab-zoom { display: none; }
  .mockup-fab.is-attention::after { border-radius: 999px; }
  @keyframes mockupFabNudge { 0%, 100% { transform: none; } 50% { transform: translateY(-5px); } }
}

/* Instructions card: resizable from the bottom-right corner */
.task-instructions-float { resize: both; min-width: 240px; min-height: 120px; max-width: calc(100vw - 24px); max-height: 85vh; }

/* Per-task intro (storytelling) screen */
.task-intro-kicker { margin: 0 0 6px; color: var(--accent, #5b4ee6); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.task-intro-layout { display: grid; gap: 22px; margin-top: 18px; }
.task-intro-card.is-side .task-intro-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .task-intro-card.is-side .task-intro-layout { grid-template-columns: 1fr; } }
.task-intro-figure { margin: 0; }
.task-intro-image-btn { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; overflow: hidden; background: #fff; cursor: zoom-in; }
.task-intro-image-btn img { display: block; width: 100%; max-height: 460px; object-fit: contain; background: #f7f8fc; }
.task-intro-zoom { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border-radius: 8px; background: rgba(29,32,64,.78); color: #fff; font-size: .74rem; opacity: 0; transition: opacity 140ms ease; }
.task-intro-image-btn:hover .task-intro-zoom, .task-intro-image-btn:focus-visible .task-intro-zoom { opacity: 1; }
.task-intro-figure figcaption { margin-top: 8px; color: #6a7090; font-size: .82rem; }
.task-intro-story { font-size: 1.02rem; line-height: 1.7; color: var(--ink, #1d2040); }
.task-intro-story p { margin: 0 0 14px; }
.task-intro-story ul { margin: 0 0 14px 1.2em; }
.task-intro-lightbox { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 24px; background: rgba(8,12,22,.82); }
.task-intro-lightbox img { max-width: 100%; max-height: calc(100dvh - 48px); border-radius: 10px; background: #fff; }
.task-intro-lightbox-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(18,24,38,.6); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* Help button + coach tour */
.participant-help-btn { position: fixed; z-index: 1100; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 9px; border: 1px solid rgba(23,32,51,.12); border-radius: 999px; background: rgba(255,255,255,.94); color: var(--brand-primary, #3a3e98); font: 600 .82rem/1 var(--font-body, inherit); cursor: pointer; box-shadow: 0 6px 18px rgba(17,19,58,.12); backdrop-filter: blur(8px); }
.participant-help-btn svg { width: 18px; height: 18px; }
.participant-help-btn:hover { background: #fff; box-shadow: 0 8px 22px rgba(17,19,58,.18); }
.participant-help-btn:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 2px; }
.participant-help-btn[hidden] { display: none; }
.coach-spot { position: fixed; z-index: 1500; border-radius: 14px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent, #5b4ee6), 0 0 0 9999px rgba(10,12,30,.55); pointer-events: none; transition: all 220ms ease; }
.coach-spot[hidden] { display: block !important; left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(10,12,30,.55); }
.coach-card { position: fixed; z-index: 1501; left: 0; right: 0; margin: 0 auto; bottom: max(24px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 24px)); padding: 18px 20px 16px; border-radius: 18px; background: #fff; color: var(--ink, #1d2040); box-shadow: 0 28px 70px rgba(10,12,30,.35); animation: fadeUp 200ms ease both; }
.coach-card.is-top { top: max(24px, env(safe-area-inset-top)); bottom: auto; }
.coach-top { display: flex; align-items: center; justify-content: space-between; }
.coach-count { color: #6a7090; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.coach-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f2f8; color: #3b4160; font-size: 22px; line-height: 1; cursor: pointer; }
.coach-art { display: grid; place-items: center; height: 84px; margin: 10px 0 12px; border-radius: 12px; background: #f6f6fd; }
.coach-art svg { width: 120px; height: 75px; }
.coach-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.coach-card p { margin: 0; color: #4a5070; font-size: .92rem; line-height: 1.55; }
.coach-card .coach-here { margin-top: 8px; color: var(--accent, #5b4ee6); font-size: .8rem; font-weight: 600; }
.coach-here[hidden] { display: none; }
.coach-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.coach-dots { display: flex; gap: 5px; }
.coach-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d9dbea; }
.coach-dots span.is-on { width: 18px; border-radius: 4px; background: var(--accent, #5b4ee6); }
.coach-btns { display: flex; gap: 8px; }
.coach-btns .btn { min-height: 40px; padding: 8px 16px; }
@media (prefers-reduced-motion: reduce) { .coach-spot { transition: none; } }
.stimulus-caption-row { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.stimulus-caption-row .screen-subtitle { margin: 0; }
.stimulus-caption-row .task-reference-trigger.is-preview-trigger { position: static; flex: 0 0 auto; opacity: 1; }
/* Larger, branded floating mockup card */
.mockup-fab { width: 184px; }
.mockup-fab-thumb { height: 116px; }
.mockup-fab-text { padding: 8px 10px; border-radius: 10px; background: var(--brand-primary, #3a3e98); }
.mockup-fab-text strong { color: #fff; font-size: .9rem; }
.mockup-fab-text small { color: rgba(255,255,255,.82); }
.screen.has-mockup-fab .card { padding-right: max(48px, 220px); }
@media (max-width: 1100px) {
  .mockup-fab { width: auto; }
  .mockup-fab-thumb { height: 52px; }
  .mockup-fab-text { background: transparent; padding: 0; }
  .mockup-fab-text strong { color: var(--brand-primary, #3a3e98); }
  .mockup-fab-text small { color: #6a7090; }
  .screen.has-mockup-fab .card { padding-right: 24px; }
}
/* Dock alignment: .action-footer adds top padding/margin/border; reset them so both buttons sit centred in the pill. */
.task-footer-vertical.action-footer { margin: 0; padding: 7px; align-items: center; gap: 8px; border: 1px solid rgba(23,32,51,.1); }
.task-footer-vertical.action-footer #btn-step-back,
.task-footer-vertical.action-footer #btn-task-next { height: 46px; min-height: 46px; margin: 0; padding-top: 0; padding-bottom: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: .95rem; }
.task-footer-vertical.action-footer #btn-step-back { padding-left: 16px; padding-right: 18px; }
.task-footer-vertical.action-footer #btn-task-next { padding-left: 22px; padding-right: 20px; }
@media (max-width: 640px) {
  .task-footer-vertical.action-footer { padding: 6px; flex-direction: row; }
  .task-footer-vertical.action-footer #btn-task-next { font-size: .9rem; padding-left: 16px; padding-right: 14px; }
}
/* Mockup card placed beside the questions by JS, draggable */
.mockup-fab.is-placed { transform: none; animation-name: mockupFabNudgePlaced; }
.mockup-fab.is-placed:hover { transform: translateY(-2px); }
.mockup-fab.is-dragging { cursor: grabbing; transition: none; transform: none; box-shadow: 0 24px 56px rgba(17,19,58,.3); }
@keyframes mockupFabNudgePlaced { 0%, 100% { transform: none; } 50% { transform: translateX(-6px); } }
.mockup-fab { touch-action: none; user-select: none; }
.mockup-fab-grip { display: block; margin: -2px 0 -2px; color: #9aa0b8; font-size: .66rem; letter-spacing: .04em; text-align: center; cursor: grab; }
.mockup-fab:hover .mockup-fab-grip { color: #5b4ee6; }
.screen.has-mockup-fab .card { padding-right: 48px; }
@media (max-width: 1100px) { .mockup-fab-grip { display: none; } }
/* Mockup card: separate drag handle and open button */
.mockup-fab { cursor: default; gap: 6px; }
.mockup-fab-handle { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--accent-light); color: var(--brand-primary, #3a3e98); font-size: .74rem; font-weight: 700; letter-spacing: .02em; cursor: grab; touch-action: none; user-select: none; }
.mockup-fab-handle svg { width: 14px; height: 14px; fill: currentColor; }
.mockup-fab-handle:hover { background: #e1e4f8; }
.mockup-fab-handle:active, .mockup-fab.is-dragging .mockup-fab-handle { cursor: grabbing; background: #d6daf5; }
.mockup-fab-handle:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 2px; }
.mockup-fab-open { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mockup-fab-open:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 3px; border-radius: 12px; }
.mockup-fab-open:hover .mockup-fab-text { filter: brightness(1.12); }
.mockup-fab-grip { display: none; }
@media (max-width: 1100px) {
  .mockup-fab { flex-direction: row; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; }
  .mockup-fab-handle { align-self: stretch; padding: 0 6px; border-radius: 999px 0 0 999px; }
  .mockup-fab-handle span { display: none; }
  .mockup-fab-open { flex-direction: row; align-items: center; gap: 10px; }
}
/* Completion gate (instruction screens) */
.instruction-gate { margin: 14px 0 4px; }
.instruction-gate .instruction-gate-q { margin: 0 0 10px; }
.instruction-gate .instruction-ack { margin: 0; }
.instruction-ack span { line-height: 1.5; }
.instruction-ack:has(input:checked) { border-color: var(--accent, var(--brand-primary)); background: var(--accent-light); }
.instruction-gate .instruction-gate-q { padding: 14px 16px; border: 1px solid var(--border, #E3E6ED); border-left: 3px solid var(--accent, var(--brand-primary)); border-radius: 10px; background: #fff; color: var(--ink, #172033); font-size: .95rem; line-height: 1.6; }
.instruction-gate .instruction-gate-q p { margin: 0 0 6px; }
.instruction-gate .instruction-gate-q p:last-child { margin-bottom: 0; }
.instruction-gate .instruction-gate-q ul { margin: 4px 0 0; padding-left: 1.25em; }
.instruction-gate .instruction-gate-q li { margin: 2px 0; }
.instruction-gate .instruction-gate-q strong { font-weight: 700; }
/* Countdown/elapsed timer: a clock, not a red dot (red dot is reserved for recording) */
.timer-badge .timer-clock { width: 14px; height: 14px; flex: 0 0 auto; color: currentColor; opacity: .9; }
.timer-badge .timer-dot { display: none; }

/* ── Prototype workspace: one set of controls only ──
   While the full-screen activity is open, the task page's own instructions card, Back/Continue bar
   and mockup card sit underneath it. The workspace has its own Back and "What to do" panel. */
body.viewer-screen-active .task-instructions-float,
body.viewer-screen-active .task-instructions-dock,
body.viewer-screen-active .task-footer-vertical,
body.viewer-screen-active .mockup-fab { display: none !important; }
.prototype-ribbon .prototype-ribbon-title { color: #fff; font-weight: 600; }
.prototype-ribbon .drag-handle { color: rgba(255,255,255,.55); }

/* ── Figma view switch: Fit / Fill width / 100% ── */
.figma-view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin: 0 0 8px; border: 1px solid var(--border); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(17,19,58,.06); }
.figma-view-switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; transition: background-color 140ms cubic-bezier(.2,.7,.2,1), color 140ms cubic-bezier(.2,.7,.2,1); }
.figma-view-switch button svg { width: 14px; height: 14px; flex: none; }
.figma-view-switch button:hover { color: var(--ink); background: var(--canvas); }
.figma-view-switch button[aria-pressed="true"] { background: var(--brand-primary); color: #fff; }
.figma-view-switch button:focus-visible { outline: 2px solid var(--brand-secondary); outline-offset: 2px; }
.figma-view-switch.is-dark { margin: 0; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); box-shadow: none; }
.figma-view-switch.is-dark button { color: rgba(255,255,255,.82); }
.figma-view-switch.is-dark button:hover { color: #fff; background: rgba(255,255,255,.12); }
.figma-view-switch.is-dark button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.figma-view-switch.is-modal { position: absolute; z-index: 3; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; }
.first-click-prototype-wrap + .figma-view-switch, .stimulus-caption-row + .figma-view-switch { margin-top: 4px; }
@media (max-width: 640px) { .figma-view-switch button { padding: 0 9px; } .figma-view-switch.is-dark span { display: none; } }
@media (prefers-reduced-motion: reduce) { .figma-view-switch button { transition: none; } }

/* ── End of the Figma prototype ── */
.figma-end-prompt { position: fixed; z-index: 2147483000; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(17,19,58,.18); color: var(--ink); animation: figma-end-in 200ms cubic-bezier(.2,.7,.2,1); }
.figma-end-prompt strong { display: block; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.3; }
.figma-end-prompt p { margin: 6px 0 0; color: var(--ink-soft); }
.figma-end-prompt .figma-end-count { font-weight: 600; color: var(--brand-primary); font-variant-numeric: tabular-nums; }
.figma-end-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.figma-end-actions .btn { min-height: 44px; }
@keyframes figma-end-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .figma-end-prompt { animation: none; } }


/* ── Continue dock: always fully visible (label kept while scrolling); the arrow gently nudges right ── */
.task-footer-vertical #btn-task-next:not(:disabled) .btn-icon { animation: continue-nudge 2.6s cubic-bezier(.34,1.3,.64,1) 1.2s infinite; }
.task-footer-vertical #btn-task-next:not(:disabled):hover .btn-icon,
.task-footer-vertical #btn-task-next:not(:disabled):focus-visible .btn-icon { animation: none; transform: translateX(3px); transition: transform 140ms cubic-bezier(.2,.7,.2,1); }
@keyframes continue-nudge {
  0%, 62%, 100% { transform: translateX(0); }
  70% { transform: translateX(6px); }
  78% { transform: translateX(1px); }
  86% { transform: translateX(4px); }
  94% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .task-footer-vertical #btn-task-next .btn-icon { animation: none !important; } }


/* Instructions card grows with its content, up to the space above the Continue dock (then it scrolls). */
.task-instructions-float { height: auto; max-height: calc(100dvh - 150px - 128px); }
@media (max-width: 900px) { .task-instructions-float { max-height: calc(100dvh - 100px - 150px); } }

/* Why the welcome button is disabled: shown next to it until consent is ticked */
.consent-hint { margin: 0; font-size: .92rem; color: var(--ink-soft, #4a5568); flex: 1 1 auto; }
.consent-hint[hidden] { display: none; }


/* Welcome/consent: the primary action stays bottom right whether or not the hint is showing */
.action-footer > #btn-welcome-start { margin-left: auto; }

/* Consent: the hint sits directly above the primary button, right aligned */
.consent-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.consent-hint { text-align: right; flex: none; }

/* Context pop-up before a task: page-level dialog with header, scrolling body and footer */
.task-intro-modal-root { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(17,24,39,.6); animation: ui-fade .2s ease-out; }
.task-intro-modal { width: min(640px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 20px; box-shadow: 0 30px 90px rgba(17,24,39,.35); color: var(--ink, #1d2040); }
.task-intro-modal-head { padding: 22px 28px 18px; border-bottom: 1px solid var(--border, #e5e7eb); }
.task-intro-modal-head .step-indicator, .task-intro-modal-head .step-badge { margin-bottom: 12px; }
.task-intro-modal-title { margin: 6px 0 0; font-family: inherit; font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: var(--ink, #1d2040); }
.task-intro-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 28px; }
.task-intro-modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 28px; border-top: 1px solid var(--border, #e5e7eb); background: #fafbfd; }
.task-intro-modal .task-intro-images { margin-top: 0; }
.task-intro-modal .task-intro-story { margin-top: 18px; }
@media (max-width: 560px) {
  .task-intro-modal-root { padding: 0; }
  .task-intro-modal { max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .task-intro-modal-head, .task-intro-modal-body, .task-intro-modal-foot { padding-left: 18px; padding-right: 18px; }
  .task-intro-modal-foot .btn { flex: 1 1 auto; }
}

/* Instruction text size (A− / A+): top right, beside Help, same look and size */
:root { --instr-scale: 1; }
.task-instructions-rich, .task-instructions-dock, .task-instructions-float, .task-instruction-box,
.welcome-rich-text, .task-intro-story, .instruction-ack, .screen-subtitle, .closed-text {
  zoom: var(--instr-scale, 1);
}
.text-size-ctl { position: fixed; z-index: 1100; top: max(14px, env(safe-area-inset-top)); right: max(118px, calc(env(safe-area-inset-right) + 118px)); display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px; border: 1px solid rgba(23,32,51,.12); border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 6px 18px rgba(17,19,58,.12); backdrop-filter: blur(8px); }
.text-size-ctl button { height: 26px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--brand-primary, #3a3e98); font: 600 .82rem/1 var(--font-body, inherit); cursor: pointer; }
.text-size-ctl button:hover:not(:disabled) { background: #eef0f8; }
.text-size-ctl button:disabled { opacity: .35; cursor: default; }
.text-size-ctl button:focus-visible { outline: 3px solid var(--accent, #5b4ee6); outline-offset: 2px; }

/* Default size of the task instructions text (A− / A+ scales from this) */
.task-drawer-body, .task-instructions-rich { font-size: 17px; }

/* Open in Figma fallback after a long load: hidden until the one-minute mark. */
.stimulus-loading-open[hidden], .stimulus-loading-retry[hidden] { display: none !important; }
.stimulus-loading-open { margin-top: 4px; }
