/* Respondent runtime */
.t-shell { min-height: 100vh; display: flex; flex-direction: column; }

.t-top { padding: 18px 26px 0; height: 40px; }
.t-progress { font-size: 13px; color: var(--dim); }

.t-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 22px 30px; }

.t-card { width: 100%; max-width: 640px; }
.t-card.enter { animation: card-in 240ms cubic-bezier(.2,.8,.3,1); }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.t-qhead { margin-bottom: 22px; }
.t-qnum { font-size: 13px; color: var(--cobalt); display: block; margin-bottom: 8px; }
.t-qarrow { color: var(--faint); }
.t-question { font-size: 27px; line-height: 1.25; font-weight: 600; }
.t-req { color: var(--bad); }
.t-desc { color: var(--dim); margin-top: 10px; font-size: 16px; }

.t-error { margin-top: 14px; color: var(--bad); background: var(--bad-wash); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; animation: card-in 160ms ease-out; }

.t-actions { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.t-big { font-size: 16px; padding: 11px 26px; border-radius: 9px; }

.t-nav { padding: 0 26px 14px; display: flex; }
.t-nav .spacer { flex: 1; }

.t-foot { padding: 12px 26px 18px; display: flex; justify-content: center; }
.t-foot .brand { font-size: 14px; opacity: .55; }
.t-foot .brand:hover { opacity: 1; }

/* choices */
.t-opts { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.t-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 9px;
  background: var(--surface);
  font-size: 16px; text-align: left; cursor: pointer;
  transition: border-color var(--speed), transform 80ms;
}
.t-opt:hover { border-color: var(--faint); }
.t-opt:active { transform: scale(.99); }
.t-opt.on { border-color: var(--ink); font-weight: 500; }
.t-optkey {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 5px;
  font-size: 12px; color: var(--dim); background: var(--surface);
}
.t-opt.on .t-optkey { background: var(--ink); border-color: var(--ink); color: var(--marker); }
.t-optlabel { flex: 1; }
.t-optcheck { width: 18px; color: var(--good); font-weight: 700; }

/* dropdown */
.t-select { max-width: 380px; font-size: 16px; padding: 11px 12px; }

/* stars */
.t-stars { display: flex; align-items: center; gap: 6px; }
.t-star {
  font-size: 38px; line-height: 1; border: none; background: none;
  color: var(--line-strong); cursor: pointer; padding: 2px;
  transition: color 100ms, transform 100ms;
}
.t-star:hover { transform: scale(1.12); }
.t-star.on { color: var(--warn); }
.t-starval { margin-left: 10px; font-size: 14px; }

/* scale */
.t-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.t-cell {
  min-width: 44px; padding: 10px 8px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 15px;
  transition: border-color var(--speed);
}
.t-cell:hover { border-color: var(--faint); }
.t-cell.on { border-color: var(--ink); font-weight: 600; }
.t-celllabel { font-size: 11px; color: var(--dim); max-width: 76px; text-align: center; line-height: 1.25; }
.t-nps .t-cell { min-width: 42px; }
.t-scale-ends { display: flex; justify-content: space-between; max-width: 560px; margin-top: 8px; }

/* text inputs */
.t-textinput {
  width: 100%; max-width: 480px;
  border: none; border-bottom: 2px solid var(--line-strong);
  background: transparent; font-size: 22px; padding: 8px 2px;
  border-radius: 0;
  transition: border-color var(--speed);
}
.t-textinput:focus { outline: none; border-bottom-color: var(--cobalt); }
.t-textinput::placeholder { color: var(--faint); }
.t-textarea { min-height: 90px; resize: vertical; font-size: 18px; line-height: 1.5; }

/* ranking */
.t-rank { max-width: 460px; }
.t-rankitem {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
  border: 1.5px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); cursor: grab; font-size: 16px;
}
.t-rankitem.dragging { opacity: .4; }
.t-rankitem.drag-over { border-color: var(--cobalt); }
.t-rankitem .spacer { flex: 1; }
.t-rankpos {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--marker-wash); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

/* matrix */
.t-matrix { overflow-x: auto; }
.t-matrix table { border-collapse: collapse; }
.t-matrix th { padding: 6px 10px; color: var(--dim); font-weight: 500; text-align: center; max-width: 90px; }
.t-matrix td { padding: 8px 10px; text-align: center; }
.t-mxrow { text-align: left !important; font-size: 15px; min-width: 160px; }
.t-mxdot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer;
  transition: all var(--speed);
}
.t-mxdot:hover { border-color: var(--faint); }
.t-mxdot.on { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--marker); }

/* experiment */
.t-alts { display: flex; gap: 14px; flex-wrap: wrap; }
.t-alt {
  flex: 1; min-width: 200px; max-width: 300px;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); cursor: pointer; text-align: left;
  padding: 14px 16px;
  transition: border-color var(--speed), transform 80ms, box-shadow var(--speed);
}
.t-alt:hover { border-color: var(--faint); box-shadow: var(--shadow); }
.t-alt:active { transform: scale(.99); }
.t-alt.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.t-alt.on .t-althead { background: var(--marker); margin: -14px -16px 8px; padding: 10px 16px; border-radius: 10px 10px 0 0; }
.t-althead { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.t-altattr { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* image */
.t-img { border-radius: 10px; max-height: 340px; margin: 6px 0; }

/* quiz score */
.t-score { margin-top: 20px; }
.t-scorenum { font-size: 44px; font-weight: 600; }
.t-scorebar { height: 10px; border-radius: 5px; background: var(--line); margin: 10px 0; overflow: hidden; max-width: 320px; }
.t-scorefill { height: 100%; background: var(--marker); border-right: 2px solid var(--ink); transition: width 600ms cubic-bezier(.2,.8,.3,1); }
.t-reviews { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.t-review { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; align-items: flex-start; }
.t-review.good { background: var(--good-wash); } .t-review.good > span:first-child { color: var(--good); }
.t-review.bad { background: var(--bad-wash); } .t-review.bad > span:first-child { color: var(--bad); }
.t-review > span:nth-child(2) { flex: 1; }

/* poll results */
.t-poll { max-width: 460px; }
.t-pollrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.t-polllabel { width: 130px; font-size: 14px; }
.t-pollbar { flex: 1; height: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.t-pollfill { height: 100%; background: var(--line-strong); transition: width 500ms cubic-bezier(.2,.8,.3,1); }
.t-pollfill.top { background: var(--marker); border-right: 2px solid var(--ink); }

/* static card */
.t-static { max-width: 460px; margin: 12vh auto 0; padding: 34px; text-align: center; }

/* ============ page mode ============ */
.t-page { max-width: 720px; margin: 0 auto; padding: 40px 22px; display: block; }
.t-pagehead { margin-bottom: 24px; }
.t-psec { padding: 22px 24px; margin-bottom: 16px; transition: opacity 300ms; }
.t-psec.off { display: none; }
.t-pquestion { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.t-phead { margin-bottom: 14px; }
.t-perr { color: var(--bad); font-size: 13px; margin-top: 8px; }
.t-perr:empty { display: none; }
.t-pagesubmit { padding: 10px 0 30px; }
.t-ptask { border-top: 1px solid var(--line); }
.t-ptask:first-of-type { border-top: none; }
.t-page .t-question { font-size: 24px; }

@media (max-width: 600px) {
  .t-question { font-size: 22px; }
  .t-alts { flex-direction: column; }
  .t-alt { max-width: none; }
  /* matrix collapses: each row stacks, labels move under the dots */
  .t-matrix thead { display: none; }
  .t-matrix tr { display: block; margin-bottom: 14px; }
  .t-matrix td { display: inline-block; vertical-align: top; }
  .t-matrix .t-mxrow { display: block; font-weight: 500; padding-bottom: 2px; }
  .t-mxdot { width: 30px; height: 30px; position: relative; margin-bottom: 16px; }
  .t-mxdot::after {
    content: attr(data-cl);
    position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
    font-size: 9px; color: var(--dim); white-space: nowrap; max-width: 56px;
    overflow: hidden; text-overflow: ellipsis;
  }
}
