/* Public survey page, laid out like the rbot showform: one question per page,
   icon-prefixed inputs, a centred Next button; a Section is one card with its questions. */
:root {
  --sf-accent: #03a9f4;
  --sf-accent-dark: #0288d1;
  --sf-text: #2b2b2b;
  --sf-muted: #6b7280;
  --sf-border: #c8c8c8;
  --sf-icon-bg: #f3f3f3;
  --sf-radius: 5px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--sf-text);
}

* {
  box-sizing: border-box;
}

.sf-page {
  position: relative;
  min-height: 100vh;
  padding: 72px 6% 48px;
  color: var(--sf-text);
}

.sf-restart {
  position: absolute;
  top: 26px;
  right: 5%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
}

.sf-restart:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sf-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1380px;
  margin: 0 auto;
}

.sf-html {
  overflow-wrap: anywhere;
}

.sf-html img,
.sf-html iframe {
  max-width: 100%;
}

/* Header / Footer Label formats from the Survey form layout editor. */
.sf-html blockquote {
  margin: 0.3rem 0;
  padding-left: 0.8rem;
  border-left: 4px solid #cbd5e1;
}

.sf-html pre {
  margin: 0.3rem 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: #1e293b;
  color: #f8fafc;
  white-space: pre-wrap;
}

.sf-html a {
  color: #2563eb;
  text-decoration: underline;
}

/* Page transitions (Survey layout → Page transition). */
.sf-stage {
  animation: sf-fade 0.35s ease both;
}

.sf-stage.is-left_to_right {
  animation-name: sf-from-left;
}

.sf-stage.is-right_to_left {
  animation-name: sf-from-right;
}

.sf-stage.is-top_to_bottom {
  animation-name: sf-from-top;
}

.sf-stage.is-bottom_to_top {
  animation-name: sf-from-bottom;
}

/* Drawn again on the same page (an answer picked): no transition, so the page does not flash. */
.sf-stage.is-still {
  animation: none;
}

@keyframes sf-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sf-from-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-top {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-bottom {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.sf-stage.is-still {
  animation: none;
}

/* ---- Single question page ---- */
.sf-single {
  padding-top: 18vh;
}

/* No template: a question page (outside a section) sits in the middle of the window, top to bottom,
   like the live survey form. The header stays at the top and the footer at the bottom; a long question
   still grows and scrolls as before. Templates and section pages keep their own layout. */
.sf-page:not(.sf-tpl) {
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

.sf-page:not(.sf-tpl) > .sf-shell {
  flex: 1 0 auto;
  width: 100%;
}

.sf-page:not(.sf-tpl) > .sf-shell > .sf-stage:has(> .sf-single) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
}

.sf-page:not(.sf-tpl) .sf-stage > .sf-single {
  padding-top: 0;
}

.sf-single .sf-label {
  font-size: 32px;
  font-weight: 500;
}

.sf-single .sf-question > :not(.sf-label):not(.sf-error) {
  max-width: 500px;
}

.sf-single .sf-question.is-message .sf-label,
.sf-single .sf-question.is-links .sf-label {
  max-width: 900px;
}

/* ---- Question block ---- */
.sf-question {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sf-label {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  white-space: pre-line;
}

.sf-required {
  margin-left: 8px;
  color: #ef4444;
}

.sf-error {
  min-height: 0;
  margin: -6px 0 0;
  color: #dc2626;
  font-size: 14px;
}

.sf-error:empty {
  display: none;
}

.sf-hint {
  margin: 0;
  color: var(--sf-muted);
  font-size: 14px;
}

.sf-loader {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fff;
}

.sf-loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid #e8eef5;
  border-top-color: var(--sf-accent);
  border-radius: 50%;
  animation: sf-loader-spin 0.7s linear infinite;
}

.sf-loader-text {
  color: #64748b;
  font-family: Poppins, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

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

.sf-notice {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: #fff;
  text-align: center;
}

.sf-notice-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.sf-notice h1 {
  margin: 0;
  max-width: 420px;
  font-family: Poppins, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
}

.sf-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Icon box + input, joined like a Bootstrap input group. */
.sf-input-group {
  display: flex;
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  overflow: hidden;
}

.sf-input-group:focus-within {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.15);
}

.sf-input-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 62px;
  border-right: 1px solid var(--sf-border);
  background: var(--sf-icon-bg);
  color: #6b6b6b;
}

.sf-input,
.sf-select,
.sf-area {
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--sf-text);
  font: inherit;
  font-size: 17px;
  outline: none;
}

.sf-input {
  flex: 1;
}

.sf-stack > .sf-input {
  height: 54px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
}

.sf-inline-select {
  flex: none;
  max-width: 130px;
  border-right: 1px solid var(--sf-border);
  cursor: pointer;
}

/* Name prefix / phone code dropdown (survey.js inlinePicker): the value and a caret; its list opens
   under the field, lined up with it (a .sf-combo-panel, as for the List suggestions). */
.sf-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sf-picker svg {
  flex: none;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.sf-picker.is-open svg {
  transform: rotate(180deg);
}

.sf-picker:focus-visible {
  outline: 2px solid var(--tpl-accent, var(--sf-accent));
  outline-offset: 2px;
  border-radius: 6px;
}

.sf-picker-panel .sf-combo-option {
  padding: 8px 12px;
}

.sf-area {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  resize: vertical;
}

.sf-area:focus {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.15);
}

/* Choice pills (multi choice, multi select, slots, yes/no). */
.sf-choices,
.sf-yesno {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sf-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 20px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  color: var(--sf-text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sf-choice:hover:not(:disabled) {
  border-color: var(--sf-accent);
}

.sf-choice.is-selected {
  border-color: #1f91f3;
  background: #1f91f3;
  color: #fff;
}

.sf-choice-box {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

.sf-choice-box.is-on {
  border-color: #fff;
  color: #1f91f3;
}

.sf-choice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sf-choice.has-image {
  flex-direction: column;
  padding: 8px;
}

.sf-choice img {
  width: 120px;
  height: 90px;
  border-radius: 4px;
  object-fit: cover;
}

.sf-yesno-btn {
  min-width: 140px;
  justify-content: center;
}

.sf-pictures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.sf-pictures .sf-choice {
  flex-direction: column;
  padding: 10px;
}

.sf-pictures .sf-choice img {
  width: 100%;
  height: 130px;
}

.sf-pictures.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.sf-pictures.is-compact .sf-choice img {
  height: 80px;
}

/* Rating, opinion scale, range. */
.sf-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

/* A star with its label under it (Terrible … Awesome, as set in the builder). */
.sf-star {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 56px;
  padding: 0;
  border: 0;
  background: none;
  color: #d1d5db;
  cursor: pointer;
}

.sf-star-icon {
  font-size: 40px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.sf-star:hover .sf-star-icon {
  transform: scale(1.12);
}

.sf-star-label {
  max-width: 84px;
  overflow: hidden;
  color: var(--sf-muted, #6b7280);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-star.is-on {
  color: #fbbf24;
}

.sf-star.is-picked .sf-star-label {
  color: var(--sf-text, #111827);
  font-weight: 700;
}

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

.sf-scale-btn {
  height: 46px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sf-scale-btn.is-on {
  border-color: #1f91f3;
  background: #1f91f3;
  color: #fff;
}

.sf-scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--sf-muted);
  font-size: 13px;
}

/* Range (RBot look): a thin line filled up to a round thumb, the value in a tag with an arrow at the
   line's right end, "Min-0" / "Max-100" under the ends. Templates colour it with their accent. */
.sf-range {
  --sf-range-color: var(--tpl-accent, #00afff);
}

.sf-range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sf-range-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sf-range-input:focus {
  outline: none;
}

.sf-range-input::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--sf-range-color) var(--fill, 0%), color-mix(in srgb, var(--sf-range-color) 45%, #94a3b8) var(--fill, 0%));
}

.sf-range-input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -10px;
  border: 2px solid color-mix(in srgb, var(--sf-range-color) 70%, #000);
  border-radius: 50%;
  background: var(--sf-range-color);
  -webkit-appearance: none;
  appearance: none;
}

.sf-range-input::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--sf-range-color) 45%, #94a3b8);
}

.sf-range-input::-moz-range-progress {
  height: 2px;
  background: var(--sf-range-color);
}

.sf-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--sf-range-color) 70%, #000);
  border-radius: 50%;
  background: var(--sf-range-color);
}

.sf-range-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sf-range-color) 25%, transparent);
}

/* The value: a rounded tag with a small arrow pointing back at the line. */
.sf-range-tag {
  position: relative;
  flex: none;
  min-width: 26px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--sf-range-color);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
}

.sf-range-tag::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -7px;
  border-width: 5px 7px 5px 0;
  border-style: solid;
  border-color: transparent var(--sf-range-color) transparent transparent;
  transform: translateY(-50%);
}

.sf-range-ends {
  display: flex;
  justify-content: space-between;
  /* Lined up under the line, not under the tag. */
  margin: 10px 60px 0 0;
  color: var(--sf-text, #1f2937);
  font-size: 15px;
  font-weight: 600;
}

/* Agreement, file, voice, captcha, matrix, links. */
.sf-terms {
  max-height: 180px;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--sf-radius);
  background: #fafafa;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.sf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  cursor: pointer;
}

.sf-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--sf-accent);
}

.sf-check.is-correct {
  color: #15803d;
}

.sf-check.is-wrong {
  color: #dc2626;
}

.sf-file-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* File Upload: the RBot drag & drop box (dashed frame, picture, "Drag & drop or click to upload"). */
.sf-file.sf-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 150px;
  padding: 10px;
  border: 1px dashed #a6a6a6;
  border-radius: 10px;
  background: #fff;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sf-file.sf-upload.is-drag {
  border-color: var(--sf-accent);
  background: #f0f9ff;
}

.sf-upload-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  outline: none;
}

.sf-upload-empty:focus-visible {
  box-shadow: 0 0 0 2px var(--sf-accent);
}

.sf-upload-icon {
  color: #d4d4d4;
}

.sf-upload-text {
  font-size: 16px;
}

.sf-upload-hint {
  color: #94a3b8;
  font-size: 12px;
}

.sf-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 8px;
}

.sf-upload-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sf-upload-choose {
  padding: 5px 18px;
  border: 0;
  border-radius: 5px;
  background: #128ff2;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sf-upload-choose:hover {
  background: #0d7ad0;
}

.sf-upload-count {
  padding: 4px 12px;
  border: 1px solid rgba(128, 128, 128, 0.21);
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.21);
  color: #333;
  font-size: 13px;
}

.sf-upload-clear {
  padding: 0;
  border: 0;
  background: none;
  color: #128ff2;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sf-upload-clear:hover {
  text-decoration: underline;
}

.sf-upload-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.sf-upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px;
  border-radius: 6px;
}

.sf-upload-item:hover {
  background: #dbf4ff;
}

.sf-upload-thumb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
}

.sf-upload-thumb.is-doc {
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
  font: 700 9px/1 sans-serif;
  letter-spacing: 0.02em;
}

.sf-upload-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.sf-upload-name {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-upload-size {
  color: #94a3b8;
  font-size: 12px;
}

.sf-upload-remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #606887;
  cursor: pointer;
}

.sf-upload-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* File Upload auto-fetch: the PDF password box and its Read details button on one line. */
.sf-autofetch-password {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sf-autofetch-password .sf-input {
  flex: 1 1 auto;
  min-width: 0;
}

.sf-autofetch-password .sf-next {
  flex: none;
  width: auto;
}

/* Date / Appointment: the whole box opens the calendar, so it reads as clickable. */
.sf-date .sf-input-group,
.sf-date .sf-date-input {
  cursor: pointer;
}

.sf-autofetch-done {
  color: #15803d;
}

.sf-file-list,
.chat-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-file-item,
.chat-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sf-file-name,
.chat-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-file-remove,
.chat-file-remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sf-file-remove:hover,
.chat-file-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.sf-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.sf-voice-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: var(--sf-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(3, 169, 244, 0.35);
}

.sf-voice-btn.is-recording {
  background: #dc2626;
  animation: sf-pulse 1.2s ease infinite;
}

@keyframes sf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
}

/* Captcha (every template, and in sections): the code box, the code picture and a refresh button
   on one line, wrapping on phones. The box keeps each template input look. */
.sf-captcha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.sf-captcha > .sf-input-group {
  flex: 1 1 200px;
  width: auto;
}

.sf-captcha-code {
  flex: none;
  border-radius: 8px;
  user-select: none;
}

.sf-captcha-refresh {
  flex: none;
  border-radius: 999px;
  color: var(--tpl-muted, #6b6b6b);
}

.sf-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  background: #fff;
  color: #6b6b6b;
  cursor: pointer;
}

.sf-matrix-wrap {
  overflow-x: auto;
}

/* Ranking matrix as a table: only the grid lines, no fills, so it sits on any template.
   Text and lines take the template's text colour (light on dark templates, dark on light ones);
   the circles take its accent colour. Every cell is lined, the empty top-left corner too. */
.sf-matrix {
  --sf-matrix-line: color-mix(in srgb, currentColor 45%, transparent);
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: var(--tpl-text, var(--sf-text));
  font-size: 16px;
}

.sf-matrix th,
.sf-matrix td {
  height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--sf-matrix-line);
  background: transparent;
  color: inherit;
  text-align: center;
  vertical-align: middle;
}

/* Header row: column names, upper case. */
.sf-matrix thead th {
  min-width: 96px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Row names down the left. */
.sf-matrix th.sf-matrix-row {
  min-width: 120px;
  font-weight: 500;
  text-align: left;
}

/* Outlined circle; picked: an accent dot inside it. */
.sf-matrix input {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border: 1.5px solid var(--tpl-accent, var(--sf-accent));
  border-radius: 50%;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sf-matrix input:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 18%, transparent);
}

.sf-matrix input:checked {
  background: radial-gradient(circle, var(--tpl-accent, var(--sf-accent)) 0 44%, transparent 48%);
}

.sf-matrix input:focus-visible {
  outline: 2px solid var(--tpl-accent, var(--sf-accent));
  outline-offset: 3px;
}

.sf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  color: var(--sf-text);
  text-decoration: none;
}

.sf-link:hover {
  border-color: var(--sf-accent);
  color: var(--sf-accent-dark);
}

.sf-link.is-selected {
  border-color: var(--sf-accent);
  background: color-mix(in srgb, var(--sf-accent) 12%, #fff);
  color: var(--sf-accent-dark);
}

.sf-link-btn {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sf-accent-dark);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* Spin wheel: RBot look - gold rim, gold pointer, blue SPIN hub (the hub spins it). */
.sf-spin {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 22px;
  width: min(100%, 420px);
  margin: 0 auto;
}

.sf-spin-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 14px;
  border-radius: 50%;
  background: linear-gradient(3.22deg, #b14d01 6.25%, #feca01 27.4%, #feca01 50.48%, #feca01 70.19%, #b14d01 97.12%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sf-spin-wheel,
.sf-spin-shade {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
}

.sf-spin-wheel {
  overflow: hidden;
  transition: transform 3s cubic-bezier(0.17, 0.67, 0.21, 1);
}

/* The darker band just inside the rim. It does not turn with the wheel. */
.sf-spin-shade {
  z-index: 1;
  background: radial-gradient(circle closest-side, transparent 93%, rgba(0, 0, 0, 0.15) 93%);
  pointer-events: none;
}

.sf-spin-divider,
.sf-spin-arm {
  position: absolute;
  top: 0;
  left: 50%;
  height: 50%;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.sf-spin-divider {
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.3);
}

.sf-spin-arm {
  width: 0;
}

/* "Spin Now (0 / 10)" under the wheel: the page's button look, sized to its text. */
.sf-spin-now {
  align-self: center;
  width: auto;
  min-width: 0;
  margin-top: 4px;
}

.sf-spin-now:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A slice's image: a round photo at 45% of the radius, between its label and the SPIN hub. */
.sf-spin-image {
  position: absolute;
  top: 55%;
  left: 0;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  object-fit: cover;
  transform: translate(-50%, -50%);
}

/* Sits at 65% of the radius and runs along its slice, as on RBot. */
.sf-spin-label {
  position: absolute;
  top: 35%;
  left: 0;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
}

.sf-spin-pointer {
  position: absolute;
  top: -3%;
  left: 50%;
  z-index: 3;
  width: 12%;
  max-width: 66px;
  transform: translateX(-50%);
  pointer-events: none;
}

.sf-spin-pointer svg {
  display: block;
  width: 100%;
  height: auto;
}

.sf-spin-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 28%;
  height: 28%;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(3.22deg, #b14d01 6.25%, #feca01 27.4%, #feca01 50.48%, #feca01 70.19%, #b14d01 97.12%);
  transform: translate(-50%, -50%);
}

.sf-spin-hub-btn {
  position: relative;
  width: 86%;
  height: 86%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4464f6, #2c3eb5);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.sf-spin-hub-btn::after {
  position: absolute;
  inset: 1%;
  border: 8px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

/* The SPIN hub is the only way to spin. */
.sf-spin-hub-btn:not(:disabled):hover {
  filter: brightness(1.12);
}

.sf-spin-hub-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.sf-spin-hub-btn:disabled {
  cursor: default;
}

@media (max-width: 480px) {
  .sf-spin-label {
    font-size: 13px;
  }

  .sf-spin-image {
    width: 32px;
    height: 32px;
  }

  .sf-spin-hub-btn {
    font-size: 16px;
  }

  .sf-spin-hub-btn::after {
    border-width: 5px;
  }
}

/* Questionnaire. Row stacks the options; grid puts them in two columns, like the reference form. */
.sf-quiz {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sf-quiz-q {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.sf-quiz-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.45em;
  align-items: start;
  margin: 0;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}

.sf-quiz-num {
  line-height: inherit;
  white-space: nowrap;
}

.sf-quiz-qtext {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sf-quiz-need {
  margin: 0;
  color: #dc2626;
  font-size: 14px;
}

/* Below the loaded questions while the next 100 load (or failed to). */
.sf-quiz-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0 4px;
  color: #64748b;
  font-size: 14px;
}

.sf-quiz-more-error {
  color: #dc2626;
}

.sf-quiz-more-retry {
  padding: 6px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  cursor: pointer;
}

.sf-quiz-more-retry:hover {
  border-color: #94a3b8;
}

.sf-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.sf-quiz-options.is-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.sf-quiz-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  cursor: pointer;
  font-size: 16px;
}

/* Option text with its optional picture below it. */
.sf-quiz-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sf-quiz-qimage,
.sf-quiz-oimage {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: #f8fafc;
  object-fit: contain;
}

.sf-quiz-qimage {
  max-height: 260px;
  margin: 10px 0 4px;
}

.sf-quiz-oimage {
  max-width: min(100%, 220px);
  max-height: 160px;
}

.sf-quiz-text {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sf-quiz-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

.sf-quiz-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid #aaa;
  border-radius: 50%;
  color: #666;
  font-size: 13px;
  font-weight: 600;
}

.sf-quiz-option.is-multi .sf-quiz-mark {
  border-radius: 4px;
}

.sf-quiz-option.is-selected .sf-quiz-mark {
  border-color: var(--tpl-accent, var(--sf-accent, #2196f3));
  background: var(--tpl-accent, var(--sf-accent, #2196f3));
  color: #fff;
}

.sf-quiz-option.is-correct .sf-quiz-mark {
  border-color: #28a745;
  background: #28a745;
  color: #fff;
}

.sf-quiz-option.is-wrong .sf-quiz-mark {
  border-color: #dc3545;
  background: #dc3545;
  color: #fff;
}

.sf-quiz-option.is-locked {
  cursor: default;
}

.sf-quiz-result {
  max-width: 440px;
  margin: 8px auto 0;
  text-align: center;
}

.sf-quiz-result-lead {
  margin: 0;
  color: #64748b;
  font-size: 15px;
}

.sf-quiz-result-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.sf-quiz-result-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
}

.sf-quiz-result-stats b {
  color: var(--sf-accent, #2563eb);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.sf-quiz-result-stats span {
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 640px) {
  .sf-quiz-options.is-grid {
    grid-template-columns: 1fr;
  }
}

.sf-shell:has(> .sf-timer),
.sf-tpl-card:has(> .sf-timer) {
  position: relative;
}

.sf-tpl-card:has(> .sf-timer) .sf-tpl-head {
  padding-right: 72px;
}

.sf-timer {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  color: #92400e;
}

.sf-timer svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sf-timer-track,
.sf-timer-fill {
  fill: none;
  stroke-width: 3.5;
}

.sf-timer-track {
  stroke: #e6e6e6;
}

.sf-timer-fill {
  stroke: var(--sf-accent, #d97706);
  stroke-linecap: round;
}

.sf-timer-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ---- Buttons ---- */
.sf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.sf-actions.is-section {
  margin-top: 0;
}

/* The same size as in the templates (templates.css): 44px tall, 15-16px text. */
.sf-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 4px;
  background: var(--sf-accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(3, 169, 244, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.sf-next:hover:not(:disabled) {
  background: var(--sf-accent-dark);
}

.sf-next:active:not(:disabled) {
  transform: translateY(1px);
}

.sf-next:disabled {
  opacity: 0.6;
  cursor: default;
}

.sf-next.sf-secondary {
  background: #fff;
  color: #4b5563;
  box-shadow: none;
  border: 1px solid var(--sf-border);
}

.sf-next.sf-secondary:hover {
  background: #f3f4f6;
}

/* ---- Section card ---- */
/* Centred with wide side margins like the rbot showform: 72% of the window (1380px on a
   1920px screen), so on laptop widths it no longer runs edge to edge. Phones use the full width. */
.sf-section {
  width: min(100%, 72vw);
  max-width: 1380px;
  margin-inline: auto;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
}

.sf-section-head {
  padding: 46px 62px 40px;
  border-bottom: 1px solid #e8e8e8;
}

.sf-section-head h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
}

.sf-section-head p {
  margin: 10px 0 0;
  color: var(--sf-muted);
  font-size: 16px;
}

/* The message formatted in the Section's editor: its own paragraphs, headings and lists. */
.sf-section-head .sf-section-content {
  margin-top: 10px;
  color: var(--sf-muted);
  font-size: 16px;
  line-height: 1.5;
}

.sf-section-head .sf-section-content p,
.sf-section-head .sf-section-content div {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.sf-section-head .sf-section-content :is(h1, h2, h3, h4, h5, h6) {
  margin: 0.4em 0 0.2em;
  line-height: 1.25;
}

/* A picture in the message keeps its shape when it is narrowed to the card. */
.sf-section-head .sf-section-content img {
  height: auto;
}

.sf-section-head .sf-section-content :is(ul, ol) {
  margin: 0.3em 0;
  padding-left: 1.4em;
}

.sf-section-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 36px 68px 30px;
}

.sf-section-body .sf-question.is-message .sf-label {
  font-size: 24px;
}

.sf-question.is-date .sf-input-group {
  max-width: 434px;
}

.sf-section-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  border-top: 1px solid #e8e8e8;
}

/* ---- Finished ---- */
.sf-page.is-done {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

.sf-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18vh 0 40px;
  text-align: center;
}

.sf-done:has(.sf-quiz-result) {
  padding-top: 32px;
}

.sf-done h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
}

.sf-done-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 34px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .sf-page {
    padding: 64px 16px 32px;
  }

  .sf-single {
    padding-top: 8vh;
  }

  .sf-single .sf-label {
    font-size: 24px;
  }

  .sf-label {
    font-size: 20px;
  }

  .sf-section {
    width: 100%;
  }

  .sf-section-head {
    padding: 26px 20px;
  }

  .sf-section-head h2 {
    font-size: 24px;
  }

  .sf-section-body {
    gap: 28px;
    padding: 24px 20px;
  }

  .sf-scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sf-input-icon {
    width: 48px;
  }
}

/* ---- Auth step (UI 28): login / register screen from auth.js ---- */
.sf-auth-step .rv-auth {
  max-width: 460px;
}

.sf-auth-step .rv-auth-title {
  font-size: 30px;
  font-weight: 500;
}

.sf-auth-step .rv-auth-label {
  font-size: 15px;
  font-weight: 500;
}

.sf-auth-step .sf-input-group {
  min-height: 50px;
}

.sf-auth-step .sf-input-icon {
  width: 54px;
}

.sf-auth-step .sf-error {
  margin: 0;
}

.sf-auth-step .sf-next {
  width: 100%;
}

/* Signed in as ... · Log out, in the corner away from the restart button. */
.sf-auth-who {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  max-width: calc(100vw - 32px);
}

@media (max-width: 600px) {
  .sf-auth-step .rv-auth-title {
    font-size: 24px;
  }

  .sf-auth-who {
    bottom: 10px;
    left: 10px;
  }
}

/* ---- List: the page's own suggestion list (in place of the browser's datalist popup) ---- */
.sf-combo {
  position: relative;
  width: 100%;
}

.sf-combo-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tpl-muted, #6b6b6b);
  cursor: pointer;
}

.sf-combo-toggle svg {
  transition: transform 0.2s ease;
}

.sf-combo.is-open .sf-combo-toggle svg {
  transform: rotate(180deg);
}

/* On <body>, outside the template card so nothing clips it; survey.js sets top / left / width
   from the field (under it, or above it near the bottom of the window). */
.sf-combo-panel {
  position: fixed;
  z-index: 1000;
  /* survey.js sets max-height: five options, then the list scrolls inside. */
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--tpl-border, var(--sf-border));
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  color: #1f2937;
  font-size: 15px;
  text-align: left;
}

/* Phone code dropdown (survey.js countryPicker), as on rivar's phone fields: a search box over a
   list of flag, country and code; the list scrolls under the search box. */
.sf-country-picker {
  max-width: none;
}

.sf-country-flag {
  display: inline-flex;
}

.sf-flag {
  display: block;
  flex: none;
  width: 18px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.sf-combo-panel.sf-country-menu {
  display: flex;
  flex-direction: column;
  width: 260px;
  padding: 0;
  overflow: hidden;
}

.sf-country-search-wrap {
  flex: none;
  padding: 8px;
  border-bottom: 1px solid #eef2f7;
}

.sf-country-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  border: 1px solid #dce4ee;
  border-radius: 6px;
  color: #1e293b;
  font: inherit;
  font-size: 14px;
}

.sf-country-search:focus {
  border-color: var(--tpl-accent, var(--sf-accent));
  outline: none;
}

.sf-country-options {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.sf-country-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.sf-country-option:hover,
.sf-country-option.is-active {
  background: #f1f5f9;
}

.sf-country-option.is-selected {
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent, #2563eb)) 12%, white);
  font-weight: 700;
}

.sf-country-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-country-dial {
  flex: none;
  color: #64748b;
  font-weight: 600;
}

.sf-country-empty {
  padding: 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.sf-combo-panel[hidden] {
  display: none;
}

.sf-combo-option {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sf-combo-option:hover,
.sf-combo-option.is-active {
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 12%, #fff);
}

.sf-combo-option.is-selected {
  color: var(--tpl-accent, var(--sf-accent-dark));
  font-weight: 600;
}

.sf-combo-empty {
  padding: 10px 12px;
  color: #6b7280;
  font-size: 14px;
}

/* ---- Date: the page's own calendar (in place of the browser's date picker) ---- */
.sf-date-input {
  cursor: pointer;
}

.sf-date-input::placeholder {
  letter-spacing: 0.02em;
}

/* On <body> like the List suggestions; survey.js places it under the field (or above it). */
.sf-cal {
  position: fixed;
  z-index: 1000;
  /* survey.js makes it as wide as the date field; never narrower than a usable calendar. */
  min-width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--tpl-border, var(--sf-border));
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  color: #1f2937;
  font-size: 14px;
}

.sf-cal[hidden] {
  display: none;
}

.sf-cal-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}

.sf-cal-title {
  flex: 1;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.sf-cal-nav {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sf-cal-nav:hover,
.sf-cal-nav:focus-visible {
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 12%, #fff);
  color: var(--tpl-accent, var(--sf-accent-dark));
  outline: none;
}

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

.sf-cal-weekday {
  padding: 4px 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.sf-cal-day {
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sf-cal-day:hover:not(:disabled),
.sf-cal-day:focus-visible {
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 12%, #fff);
  outline: none;
}

.sf-cal-day.is-outside {
  color: #94a3b8;
}

.sf-cal-day.is-today {
  border-color: var(--tpl-accent, var(--sf-accent));
  font-weight: 600;
}

.sf-cal-day.is-selected,
.sf-cal-day.is-selected:hover {
  border-color: transparent;
  background: var(--tpl-accent, var(--sf-accent));
  color: #fff;
  font-weight: 600;
}

.sf-cal-day.is-selected:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tpl-accent, var(--sf-accent));
}

.sf-cal-day:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.sf-cal-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
}

.sf-cal-link {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tpl-accent, var(--sf-accent-dark));
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sf-cal-link:hover:not(:disabled) {
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 10%, #fff);
}

.sf-cal-link:disabled {
  color: #cbd5e1;
  cursor: default;
}

/* The open list of a dropdown (name prefix, phone code...) is drawn by the browser on white; its options
   took the template's light text colour on dark templates (04, 13...) and were hard to read. */
.sf-select option {
  background-color: #fff;
  color: #1f2937;
}

/* ---- Appointment: calendar and the picked day's times in one popup (survey.js appointmentPicker) ----
   Two columns when the field is wide enough, stacked on narrow screens. Uses the Date calendar's styles. */
.sf-cal.sf-appt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  min-width: min(300px, calc(100vw - 24px));
}

.sf-appt-times {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Back from a day's times to the calendar. */
.sf-appt-back {
  align-self: flex-start;
  margin: 0 0 2px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--tpl-accent, var(--sf-accent, #03a9f4));
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sf-appt-back:hover,
.sf-appt-back:focus-visible {
  text-decoration: underline;
}

.sf-appt-times-title {
  margin: 4px 0 10px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
}

/* The times scroll on their own, about as tall as the calendar beside them. */
.sf-appt-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 266px;
  padding-right: 2px;
  overflow-y: auto;
}

/* Slim scrollbar with no up/down arrows: the calendar panel, the times list and the dropdowns (name title,
   phone country code, List suggestions). */
.sf-cal::-webkit-scrollbar,
.sf-appt-slots::-webkit-scrollbar,
.sf-combo-panel::-webkit-scrollbar,
.sf-country-options::-webkit-scrollbar {
  width: 4px;
}
.sf-cal::-webkit-scrollbar-button,
.sf-appt-slots::-webkit-scrollbar-button,
.sf-combo-panel::-webkit-scrollbar-button,
.sf-country-options::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.sf-cal::-webkit-scrollbar-track,
.sf-appt-slots::-webkit-scrollbar-track,
.sf-combo-panel::-webkit-scrollbar-track,
.sf-country-options::-webkit-scrollbar-track {
  background: transparent;
}
.sf-cal::-webkit-scrollbar-thumb,
.sf-appt-slots::-webkit-scrollbar-thumb,
.sf-combo-panel::-webkit-scrollbar-thumb,
.sf-country-options::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Firefox and other standards-based browsers. */
@supports not selector(::-webkit-scrollbar) {
  .sf-cal,
  .sf-appt-slots,
  .sf-combo-panel,
  .sf-country-options {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }
}

.sf-appt-slot {
  flex: none;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
}

.sf-appt-slot:hover,
.sf-appt-slot:focus-visible {
  border-color: var(--tpl-accent, var(--sf-accent));
  background: color-mix(in srgb, var(--tpl-accent, var(--sf-accent)) 8%, #fff);
  outline: none;
}

.sf-appt-slot.is-selected {
  border-color: transparent;
  background: var(--tpl-accent, var(--sf-accent));
  color: #fff;
  font-weight: 600;
}

.sf-appt-hint {
  margin: 0;
  padding: 10px 2px;
  color: #64748b;
  font-size: 14px;
}

/* ---- Google Map place search: the List's popup, a place name in bold with its area under it ---- */
.sf-place-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sf-place-option strong {
  font-weight: 600;
}

.sf-place-option span {
  color: #6b7280;
  font-size: 13px;
}

/* "Location search is not set up..." under the box. */
.sf-place-error {
  margin: 6px 0 0;
}
