:root {
  color-scheme: light;
  --ink: #17191d;
  --ink-soft: #30343a;
  --muted: #68707b;
  --paper: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --line: #dfe2e7;
  --line-strong: #c8cdd4;
  --coral: #ee6356;
  --coral-dark: #d94e43;
  --coral-soft: #fff0ee;
  --teal: #178f81;
  --teal-soft: #e6f6f3;
  --yellow: #d99d20;
  --yellow-soft: #fff6d9;
  --blue: #4169c1;
  --blue-soft: #edf2ff;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(23, 25, 29, 0.16);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 750;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 16px;
  font-weight: 760;
}

.brand__mark {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-size: 15px;
}

.brand--small {
  font-size: 14px;
}

.brand--small .brand__mark {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  font-size: 13px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--yellow-soft);
  font-size: 13px;
  font-weight: 750;
}

.usage-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.demo-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 22px;
  padding: 8px 12px;
  border: 1px solid #efd992;
  border-radius: 6px;
  color: #72520e;
  background: var(--yellow-soft);
  font-size: 13px;
  font-weight: 650;
}

.demo-note svg {
  width: 16px;
  height: 16px;
}

.workspace-head,
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workspace-head {
  margin-bottom: 26px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 750;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:focus-visible,
.icon-button:focus-visible,
.tab:focus-visible,
.option-button:focus-visible,
.template-card:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(65, 105, 193, 0.25);
  outline-offset: 2px;
}

.button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.button--primary {
  color: #fff;
  background: var(--coral);
}

.button--primary:hover {
  background: var(--coral-dark);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button--secondary:hover {
  border-color: var(--ink-soft);
}

.button--dark {
  color: #fff;
  background: var(--ink);
}

.button--small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.button--block {
  width: 100%;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button--danger:hover {
  color: var(--danger);
  background: #fff1f0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.metric-card,
.metric-skeleton {
  min-width: 0;
  min-height: 105px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card__icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: var(--teal);
  background: var(--teal-soft);
}

.metric-card:nth-child(2) .metric-card__icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-card:nth-child(3) .metric-card__icon {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.metric-card:nth-child(4) .metric-card__icon {
  color: #8c6108;
  background: var(--yellow-soft);
}

.metric-card__icon svg {
  width: 15px;
  height: 15px;
}

.metric-card strong {
  overflow: hidden;
  font-size: 25px;
  line-height: 1;
  text-overflow: ellipsis;
}

.metric-skeleton {
  position: relative;
  overflow: hidden;
}

.metric-skeleton::after {
  position: absolute;
  inset: 0;
  background: #eceef1;
  content: "";
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  to { opacity: 0.45; }
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 45px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
}

.tab svg {
  width: 16px;
  height: 16px;
}

.tab.is-active {
  color: var(--ink);
}

.tab.is-active::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  background: var(--coral);
  content: "";
}

.tab__count {
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 8px;
  background: #e9ebef;
  font-size: 10px;
}

.tab-panel {
  min-height: 260px;
}

.section-line {
  min-height: 38px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.quiz-list,
.lead-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quiz-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.7fr) minmax(100px, 0.55fr) minmax(105px, 0.5fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quiz-row:last-child,
.lead-row:last-child {
  border-bottom: 0;
}

.quiz-row__main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.quiz-row__mark {
  width: 8px;
  height: 45px;
  flex: 0 0 8px;
  border-radius: 4px;
  background: var(--coral);
}

.quiz-row__mark--course-fit { background: var(--teal); }
.quiz-row__mark--client-brief { background: var(--yellow); }

.quiz-row__copy {
  min-width: 0;
}

.quiz-row__copy strong,
.quiz-row__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-row__copy strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.quiz-row__copy span,
.quiz-stat span {
  color: var(--muted);
  font-size: 12px;
}

.quiz-stat {
  min-width: 0;
}

.quiz-stat strong,
.quiz-stat span {
  display: block;
}

.quiz-stat strong {
  margin-bottom: 2px;
  font-size: 16px;
}

.quiz-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 680;
}

.status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status--paused {
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 280px;
  padding: 36px 20px;
  place-items: center;
  text-align: center;
}

.empty-state__inner {
  max-width: 360px;
}

.empty-state__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid #efd992;
  border-radius: 8px;
  color: #8c6108;
  background: var(--yellow-soft);
}

.empty-state__icon svg {
  width: 21px;
  height: 21px;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.empty-state p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.loading-row,
.quiz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

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

.lead-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(150px, 1fr) 120px;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.lead-row strong,
.lead-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-row__person {
  min-width: 0;
}

.lead-row__person strong {
  margin-bottom: 3px;
}

.lead-row__person span,
.lead-row__date,
.lead-row__quiz {
  color: var(--muted);
}

.outcome-label {
  display: inline-block;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  color: #126c62;
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 650;
}

.funnel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.funnel-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

.funnel-row__label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.funnel-row__track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #eceef1;
}

.funnel-row__fill {
  display: block;
  width: var(--value);
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.funnel-row:nth-child(2) .funnel-row__fill { background: var(--blue); }
.funnel-row:nth-child(3) .funnel-row__fill { background: var(--coral); }

.funnel-row strong {
  text-align: right;
}

.modal {
  width: calc(100% - 32px);
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(23, 25, 29, 0.55);
  backdrop-filter: blur(2px);
}

.modal--wide {
  max-width: 760px;
}

.modal--compact {
  max-width: 430px;
  padding: 22px;
}

.modal__header,
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal--wide .modal__header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal__footer {
  position: sticky;
  z-index: 2;
  bottom: 0;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.form-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.field-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 15px;
}

.field-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.step-number {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

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

.template-card {
  position: relative;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
  background: var(--surface);
  cursor: pointer;
}

.template-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.template-card.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.template-card__mark {
  display: block;
  width: 28px;
  height: 5px;
  margin-bottom: 13px;
  border-radius: 3px;
  background: var(--coral);
}

.template-card[data-accent="teal"] .template-card__mark { background: var(--teal); }
.template-card[data-accent="yellow"] .template-card__mark { background: var(--yellow); }

.template-card strong,
.template-card small {
  display: block;
}

.template-card strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.template-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.template-card__category {
  margin-bottom: 8px;
  color: var(--blue) !important;
  font-weight: 680;
}

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

.field--full {
  grid-column: 1 / -1;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 670;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.field input {
  height: 42px;
  padding: 0 11px;
}

.field textarea {
  min-height: 84px;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  outline: 0;
}

.feature-list {
  display: grid;
  gap: 13px;
  margin: 23px 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
}

.legal-note {
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.legal-note a,
.document-shell p a {
  color: var(--blue);
  text-decoration: underline;
}

.detail-body {
  padding: 20px 22px 24px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.detail-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-stat strong,
.detail-stat span {
  display: block;
}

.detail-stat strong {
  font-size: 20px;
}

.detail-stat span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.share-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.share-field input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
}

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

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100% - 40px));
  padding: 11px 14px;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 30px rgba(23, 25, 29, 0.2);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

/* Respondent flow */
.quiz-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--surface);
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(720px, calc(100% - 40px));
  min-height: 63px;
  margin: 0 auto;
}

.step-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.progress-track {
  height: 4px;
  background: #eceef1;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width 220ms ease;
}

.quiz-shell {
  display: flex;
  width: min(720px, calc(100% - 40px));
  min-height: 560px;
  flex: 1;
  margin: 0 auto;
  padding: 58px 0 52px;
  flex-direction: column;
  justify-content: center;
}

.quiz-screen {
  width: 100%;
  animation: screen-in 180ms ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-screen__kicker {
  margin-bottom: 13px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.quiz-screen h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: 38px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.quiz-screen__description {
  max-width: 570px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.quiz-meta {
  display: flex;
  gap: 18px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.quiz-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quiz-meta svg {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

.question-number {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.question-title {
  max-width: 680px;
  margin-bottom: 24px;
  font-size: 28px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

.option-button {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 61px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  text-align: left;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.option-button:hover,
.option-button.is-selected {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.option-button__key {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 750;
}

.option-button svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: 22px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.back-button svg {
  width: 16px;
  height: 16px;
}

.lead-form {
  display: grid;
  max-width: 520px;
  gap: 14px;
}

.consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.consent input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--coral);
}

.consent a {
  color: var(--blue);
  text-decoration: underline;
}

.result-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.result-mark svg {
  width: 24px;
  height: 24px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.result-referral {
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.result-referral a {
  color: var(--blue);
  font-weight: 680;
}

.quiz-error {
  max-width: 520px;
  padding: 18px;
  border: 1px solid #f3bbb6;
  border-radius: 8px;
  background: var(--coral-soft);
}

.quiz-error h2 {
  margin-bottom: 6px;
}

.quiz-error p {
  color: var(--muted);
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(720px, calc(100% - 40px));
  min-height: 54px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.quiz-footer a:hover {
  color: var(--ink);
}

/* Legal documents */
.document-page {
  background: var(--surface);
}

.document-shell {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 80px;
}

.document-shell .brand {
  margin-bottom: 50px;
}

.document-shell h1 {
  margin-bottom: 26px;
}

.document-shell h2 {
  margin: 30px 0 9px;
}

.document-shell p {
  color: var(--ink-soft);
  line-height: 1.7;
}

@media (max-width: 760px) {
  h1 { font-size: 27px; }

  .topbar__inner,
  .app-shell,
  .quiz-topbar,
  .quiz-shell,
  .quiz-footer {
    width: calc(100% - 28px);
  }

  .app-shell {
    padding-top: 24px;
  }

  .usage-label {
    display: none;
  }

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

  .quiz-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .quiz-row__main {
    grid-column: 1;
  }

  .quiz-row > .quiz-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
  }

  .quiz-row__actions {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .lead-row {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 8px 14px;
  }

  .lead-row__quiz {
    display: none !important;
  }

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

  .template-card {
    min-height: 112px;
  }

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

  .field--full {
    grid-column: auto;
  }

  .quiz-shell {
    min-height: 510px;
    padding: 40px 0;
  }

  .quiz-screen h1 {
    font-size: 31px;
  }

  .question-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  body { font-size: 14px; }

  .topbar {
    height: 58px;
  }

  .topbar__actions {
    gap: 6px;
  }

  .avatar {
    display: none;
  }

  .workspace-head {
    align-items: flex-end;
  }

  .workspace-head .button span {
    display: none;
  }

  .workspace-head .button {
    width: 42px;
    padding: 0;
  }

  .metric-card,
  .metric-skeleton {
    min-height: 94px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .tabs {
    gap: 0;
  }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 0 7px;
  }

  .tab svg {
    display: none;
  }

  .quiz-row {
    padding: 13px;
  }

  .quiz-row__actions .icon-button:nth-child(2) {
    display: none;
  }

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

  .lead-row__date {
    font-size: 11px;
  }

  .outcome-label {
    width: fit-content;
  }

  .funnel {
    padding: 14px;
  }

  .funnel-row {
    grid-template-columns: 92px minmax(0, 1fr) 48px;
    gap: 9px;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal--wide .modal__header,
  .form-section,
  .modal__footer,
  .detail-body {
    padding-right: 15px;
    padding-left: 15px;
  }

  .modal__footer .button {
    flex: 1;
    min-width: 0;
  }

  .modal__footer .button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .detail-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .share-field {
    align-items: stretch;
    flex-direction: column;
  }

  .share-field .button {
    width: 100%;
  }

  .quiz-topbar {
    min-height: 57px;
  }

  .quiz-shell {
    min-height: 470px;
    padding: 34px 0;
  }

  .quiz-screen h1 {
    font-size: 28px;
  }

  .quiz-screen__description {
    font-size: 15px;
  }

  .question-title {
    font-size: 22px;
  }

  .option-button {
    min-height: 58px;
    padding: 9px 11px;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-footer {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

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