:root{
  /* #23807E, not the brand's #30ABA9: white button text on #30ABA9 is
     2.8:1, under WCAG AA's 4.5:1. #23807E gives 4.7:1 and its hover 5.9:1.
     Branding (Premium) still overrides both. */
  --stedica-primary:#23807E;
  --stedica-primary-dark:#1D6F6D;
  --stedica-primary-soft:#E8F7F7;
  --stedica-bg:#F8FAFC;
  --stedica-card:#FFFFFF;
  --stedica-border:#E2E8F0;
  --stedica-text:#0F172A;
  --stedica-muted:#64748B;
  --stedica-success:#22C55E;
  --stedica-warning:#F59E0B;
  --stedica-danger:#EF4444;
  --stedica-shadow:0 10px 30px rgba(15,23,42,.08);
  /* 6px on every box, field, button and section border. This token already
     existed at 14px and drives ~45 rules across the stylesheets — changing it
     here is the whole radius change. Progress meters and avatars are NOT
     driven by it and keep their pill (999px) / circle (50%) radii, because a
     progress bar squared off at 6px reads as broken rather than restyled. */
  --stedica-radius:6px;

  /* Offline sync actions. Brand red rather than the survey's teal primary:
     these act on data sitting unsynced on the device and should read as
     "attend to this", not as a neutral secondary action. Matches the #ED2939
     in the plugin icon, darkened just enough (5.28.1) for white text to pass
     WCAG AA: #ED2939 gave 4.22:1, #DB2531 gives 4.86:1. */
  --stedica-offline-btn-bg:#DB2531;
  --stedica-offline-btn-fg:#FFFFFF;
  --stedica-offline-btn-bg-hover:#E5E7EB;
  --stedica-offline-btn-fg-hover:#000000;
}

/* The survey's own box, never the page. These used to sit on html and body,
   which gave every page a survey was placed on the plugin's font and
   background — the theme's header, menu and footer included. */
.stedica-survey-wrapper,
.stedica-survey-container{
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--stedica-text);
}

/* The background follows the survey (and its dark mode), so its light-on-dark
   text never lands on a light theme page. flow-root keeps the container's
   margins inside the coloured box. */
.stedica-survey-wrapper{
  display:flow-root;
  background:var(--stedica-bg);
  border-radius:var(--stedica-radius, 6px);
}

/* dark mode */
@media (prefers-color-scheme: dark){
  :root{
    --stedica-bg:#0F172A;
    --stedica-card:#111827;
    --stedica-border:#243041;
    --stedica-text:#E5EEF7;
    --stedica-muted:#94A3B8;
    --stedica-primary-soft:#113837;
    --stedica-shadow:0 10px 30px rgba(0,0,0,.35);
  }
}

.stedica-survey-container{
  max-width:820px;
  margin:28px auto 42px;
  padding:0 14px;
}

.stedica-survey-header{
  margin-bottom:18px;
}

/* The survey title.
   `.stedica-survey-heading` is the SERVER-RENDERED <h2> and is now the only
   title — it had no rule of its own, so it inherited whatever the theme gave
   an <h2> and looked like a stray heading above the card rather than part of
   it. `.stedica-survey-title` was the JS-rendered duplicate; the selector is
   kept so an older cached script does not lose its styling mid-upgrade. */
.stedica-survey-heading,
.stedica-survey-title{
  /* font-family is set explicitly, not inherited. A theme that styles `h2`
     with its own family wins over the family inherited from body, so without
     this the survey title renders in the theme's heading font while the card
     directly beneath it renders in the plugin's — the title reads as part of
     the page rather than part of the survey. */
  font-family:inherit;
  font-size:28px;
  font-weight:800;
  line-height:1.15;
  color:var(--stedica-text);
}

/* The server-rendered heading sits OUTSIDE the card, so it needs room beneath
   it. The old JS title sat inside the header immediately above its subtitle,
   where 6px was right. */
.stedica-survey-heading{
  margin:0 0 14px;
}

.stedica-survey-title{
  margin:0 0 6px;
}

.stedica-survey-subtitle{
  color:var(--stedica-muted);
  font-size:14px;
}

.stedica-survey-progress{
  margin-top:16px;
}

.stedica-progress-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  color:var(--stedica-muted);
  margin-bottom:8px;
}

.stedica-progress-meta strong{
  color:var(--stedica-text);
}

.stedica-progress{
  height:10px;
  border-radius:999px;
  background:rgba(148,163,184,.18);
  overflow:hidden;
}

.stedica-progress-bar{
  height:100%;
  width:0;
  background:linear-gradient(90deg,var(--stedica-primary),var(--stedica-primary-dark));
  border-radius:999px;
  transition:width .45s cubic-bezier(.2,.8,.2,1);
}

/* scorecard */
.stedica-scorecard{
  background:var(--stedica-card);
  border:1px solid var(--stedica-border);
  border-radius:var(--stedica-radius, 6px);
  padding:18px;
  box-shadow:var(--stedica-shadow);
  margin-bottom:18px;
}

.stedica-scorecard-title{
  font-size:18px;
  font-weight:800;
  margin-bottom:6px;
}

.stedica-score-overall{
  font-size:46px;
  font-weight:900;
  line-height:1;
  margin-bottom:6px;
}

.stedica-score-overall-label{
  font-size:13px;
  color:var(--stedica-muted);
  margin-bottom:16px;
}

.stedica-score-overall.is-good{ color:var(--stedica-success); }
.stedica-score-overall.is-warn{ color:var(--stedica-warning); }
.stedica-score-overall.is-bad{ color:var(--stedica-danger); }

.stedica-kpi-gauge-row{
  padding:10px 0;
  border-top:1px solid rgba(148,163,184,.14);
}

.stedica-kpi-gauge-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:7px;
}

.stedica-kpi-gauge-label{
  font-size:14px;
  font-weight:700;
}

.stedica-kpi-gauge-value{
  font-size:13px;
  font-weight:800;
  color:var(--stedica-text);
}

.stedica-kpi-gauge{
  height:12px;
  background:rgba(148,163,184,.18);
  border-radius:999px;
  overflow:hidden;
}

.stedica-kpi-gauge-fill{
  height:100%;
  width:0;
  border-radius:999px;
  transition:width .45s cubic-bezier(.2,.8,.2,1);
  background:var(--stedica-primary);
}

.stedica-kpi-gauge.is-good .stedica-kpi-gauge-fill{ background:var(--stedica-success); }
.stedica-kpi-gauge.is-warn .stedica-kpi-gauge-fill{ background:var(--stedica-warning); }
.stedica-kpi-gauge.is-bad .stedica-kpi-gauge-fill{ background:var(--stedica-danger); }

/* sections */
.stedica-section-card{
  background:var(--stedica-card);
  border:1px solid var(--stedica-border);
  border-radius:var(--stedica-radius, 6px);
  padding:18px;
  box-shadow:var(--stedica-shadow);
  margin-bottom:18px;
}

.stedica-section-title{
  font-size:18px;
  font-weight:800;
  margin:0 0 12px;
}

/* questions */
.stedica-question-card{
  border:1px solid rgba(148,163,184,.16);
  border-radius:var(--stedica-radius, 6px);
  padding:16px;
  background:rgba(255,255,255,.55);
  margin-bottom:14px;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (prefers-color-scheme: dark){
  .stedica-question-card{
    background:rgba(255,255,255,.02);
  }
}

.stedica-question-card:hover{
  border-color:rgba(48,171,169,.45);
  box-shadow:0 8px 24px rgba(48,171,169,.08);
}

.stedica-question-title{
  display:block;
  font-size:15px;
  font-weight:800;
  margin-bottom:6px;
}

.stedica-question-desc{
  font-size:13px;
  color:var(--stedica-muted);
  margin-bottom:12px;
}

/* 5.31.1: the rating scale in words, above the input. */
.stedica-rating-hint{
  font-size:13px;
  color:var(--stedica-muted);
  margin:0 0 6px;
}

.stedica-input,
.stedica-select,
.stedica-input-file{
  width:100%;
  min-height:46px;
  padding:11px 12px;
  border:1px solid var(--stedica-border);
  border-radius:var(--stedica-radius, 6px);
  background:var(--stedica-card);
  color:var(--stedica-text);
  box-sizing:border-box;
  font-size:15px;
}

.stedica-input:focus,
.stedica-select:focus,
.stedica-input-file:focus{
  outline:none;
  border-color:var(--stedica-primary);
  box-shadow:0 0 0 4px rgba(48,171,169,.15);
}

.stedica-choice-group{
  display:flex;
  flex-direction:column;
  gap:10px;
  /* A <fieldset> brings a 2px groove border, padding and min-content width
     from the browser; the group is a layout box, not a visible frame. */
  border:0;
  padding:0;
  margin:0;
  min-inline-size:0;
}

.stedica-choice{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--stedica-border);
  border-radius:var(--stedica-radius, 6px);
  background:var(--stedica-card);
  cursor:pointer;
  transition:all .18s ease;
}

/* 5.29.0: multi-select. The hint sits inside the group, above the boxes.
   At the answer limit the unticked boxes are disabled; disabled controls are
   exempt from the contrast minimum, and the hint already says why. */
.stedica-choice-hint{
  margin:0;
  font-size:.92em;
}
.stedica-choice:has(input:disabled){
  cursor:not-allowed;
  opacity:.6;
}
.stedica-choice:has(input:disabled):hover{
  border-color:var(--stedica-border);
  background:var(--stedica-card);
}

.stedica-choice:hover{
  border-color:var(--stedica-primary);
  background:var(--stedica-primary-soft);
}

.stedica-choice input{
  /* transform:scale() and accent-color are gone: both apply to the NATIVE
     control, and these are drawn from scratch below. Sizing is on the
     input rule itself now. */
}
/* ── Question fields, checkboxes and radios ───────────────────────────────
   Everything a respondent types into or ticks, at the same 6px radius as the
   rest of the UI.

   Checkboxes and radios need appearance:none to accept a radius at all — a
   native control ignores border-radius in every current browser — which means
   once we take the native rendering away we owe the user the checked state,
   the focus ring and the disabled state back. That is what the rules below do.

   The radio is deliberately NOT round any more. That is the trade this radius
   asks for: a 6px radio reads as a rounded square, and the only thing left
   distinguishing it from a checkbox is that its checked mark is a dot rather
   than a tick. The dot is kept for exactly that reason — do not "simplify" it
   to a tick. */

.stedica-survey-wrapper input[type="text"],
.stedica-survey-wrapper input[type="email"],
.stedica-survey-wrapper input[type="url"],
.stedica-survey-wrapper input[type="tel"],
.stedica-survey-wrapper input[type="number"],
.stedica-survey-wrapper input[type="password"],
.stedica-survey-wrapper input[type="search"],
.stedica-survey-wrapper input[type="date"],
.stedica-survey-wrapper input[type="datetime-local"],
.stedica-survey-wrapper input[type="time"],
.stedica-survey-wrapper input[type="file"],
.stedica-survey-wrapper textarea,
.stedica-survey-wrapper select{
  border-radius:var(--stedica-radius, 6px);
}

.stedica-survey-wrapper input[type="checkbox"],
.stedica-survey-wrapper input[type="radio"]{
  -webkit-appearance:none;
  appearance:none;
  width:20px;
  height:20px;
  margin:0;
  flex:0 0 auto;
  border:1px solid var(--stedica-border);
  border-radius:var(--stedica-radius, 6px);
  background:var(--stedica-card);
  display:inline-grid;
  place-content:center;
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
}

.stedica-survey-wrapper input[type="checkbox"]:hover:not(:disabled),
.stedica-survey-wrapper input[type="radio"]:hover:not(:disabled){
  border-color:var(--stedica-primary);
}

.stedica-survey-wrapper input[type="checkbox"]:checked,
.stedica-survey-wrapper input[type="radio"]:checked{
  background:var(--stedica-primary);
  border-color:var(--stedica-primary);
}

/* Tick, drawn with a rotated box-edge so it needs no font or image. */
.stedica-survey-wrapper input[type="checkbox"]::after{
  content:"";
  width:5px;
  height:10px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:translateY(-1px) rotate(45deg);
  opacity:0;
}

.stedica-survey-wrapper input[type="checkbox"]:checked::after{
  opacity:1;
}

/* Dot — the only remaining visual difference from a checkbox now that both
   are 6px squares. */
.stedica-survey-wrapper input[type="radio"]::after{
  content:"";
  width:8px;
  height:8px;
  border-radius:2px;
  background:#fff;
  opacity:0;
}

.stedica-survey-wrapper input[type="radio"]:checked::after{
  opacity:1;
}

.stedica-survey-wrapper input[type="checkbox"]:focus-visible,
.stedica-survey-wrapper input[type="radio"]:focus-visible{
  outline:2px solid var(--stedica-primary);
  outline-offset:2px;
}

.stedica-survey-wrapper input[type="checkbox"]:disabled,
.stedica-survey-wrapper input[type="radio"]:disabled{
  background:#F1F5F9;
  border-color:#E2E8F0;
  cursor:not-allowed;
}

/* Disabled AND checked is its own state, and the easy version of this rule
   gets it wrong: leave the mark white on the pale disabled background and a
   ticked-but-locked box renders as an empty one. The control is still
   communicating an answer the respondent cannot change — a pre-filled or
   read-only response — so the mark has to stay legible. Muted slate rather
   than the live teal, so it reads as "set, but not yours to change". */
.stedica-survey-wrapper input[type="checkbox"]:disabled:checked,
.stedica-survey-wrapper input[type="radio"]:disabled:checked{
  background:#CBD5E1;
  border-color:#CBD5E1;
}

/* Windows High Contrast / forced-colours: appearance:none strips the control
   out of the forced palette, so the checked state must be redrawn in system
   colours or it vanishes entirely for the users who most need to see it. */
@media (forced-colors: active){
  .stedica-survey-wrapper input[type="checkbox"],
  .stedica-survey-wrapper input[type="radio"]{
    border-color:ButtonBorder;
    background:ButtonFace;
  }
  .stedica-survey-wrapper input[type="checkbox"]:checked,
  .stedica-survey-wrapper input[type="radio"]:checked{
    background:Highlight;
    border-color:Highlight;
  }
  .stedica-survey-wrapper input[type="checkbox"]::after{ border-color:ButtonText; }
  .stedica-survey-wrapper input[type="radio"]::after{ background:ButtonText; }
}


.stedica-calculated-value{
  min-height:46px;
  display:flex;
  align-items:center;
  padding:0 14px;
  border-radius:var(--stedica-radius, 6px);
  background:var(--stedica-primary-soft);
  color:var(--stedica-primary-dark);
  font-weight:800;
  border:1px solid rgba(48,171,169,.22);
}

/* Dark mode: --stedica-primary-soft becomes #113837 (dark teal), which would
   produce unreadable medium-teal text on dark-teal background. Force a light
   readable color in dark mode. */
@media (prefers-color-scheme: dark){
  .stedica-calculated-value{
    color:#E5EEF7;
  }
}

.stedica-mobile-action-row{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.stedica-mobile-hint{
  font-size:12px;
  color:var(--stedica-muted);
}

/* Surveyor identity banner (logged-in WP user prefill). */
.stedica-surveyor-identity{
  margin-top:6px;
  padding:8px 12px;
  background:rgba(48,171,169,.10);
  border:1px solid rgba(48,171,169,.30);
  border-radius:var(--stedica-radius, 6px);
  font-size:13px;
  color:#0f5f5e;
}

/* Dark mode: the page background is near-black, so the 10%-teal tint reads
   as nearly-black; hardcoded #0f5f5e (very dark teal) on near-black is
   unreadable. Lift to a light readable tone in dark mode. */
@media (prefers-color-scheme: dark){
  .stedica-surveyor-identity{
    color:#A7E8E6;
  }
}

/* AI-result containers (image_recognition, image_comparison, picos_recognition). */
.stedica-ai-result{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:var(--stedica-radius, 6px);
  background:rgba(15,23,42,.03);
}
.stedica-ai-result-caption strong{
  display:block;
  margin-bottom:2px;
}
.stedica-ai-result-picos ul{
  list-style:disc;
}
.stedica-ai-result-compare{
  font-size:14px;
}

.stedica-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 16px;
  border:none;
  border-radius:var(--stedica-radius, 6px);
  font-size:15px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s ease;
}

.stedica-btn-primary{
  background:var(--stedica-primary);
  color:#fff;
}

.stedica-btn-primary:hover{
  background:var(--stedica-primary-dark);
}

.stedica-btn-touch{
  width:100%;
  min-height:52px;
}

/* mobile-first field rep optimizations */
@media (max-width: 768px){
  .stedica-survey-container{
    margin:14px auto 26px;
    padding:0 10px;
  }

  .stedica-survey-title{
    font-size:24px;
  }

  .stedica-section-card,
  .stedica-scorecard{
    border-radius:var(--stedica-radius, 6px);
    padding:14px;
  }

  .stedica-question-card{
    padding:14px;
  }

  .stedica-input,
  .stedica-select,
  .stedica-input-file{
    min-height:50px;
    font-size:16px;
  }

  .stedica-choice{
    min-height:54px;
    align-items:center;
  }

  .stedica-score-overall{
    font-size:40px;
  }
}.stedica-offline-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  margin:0 0 14px;
  border-radius:var(--stedica-radius, 6px);
  border:1px solid #d1d5db;
  background:#f8fafc;
}
.stedica-offline-banner.is-offline{
  border-color:#f59e0b;
  background:#fffbeb;
}
.stedica-offline-banner-title{
  font-weight:700;
  font-size:14px;
}
.stedica-offline-banner-meta{
  font-size:13px;
  opacity:.9;
}
.stedica-offline-actions{
  margin-left:auto;
}

/* Was an inline style="margin-top:16px" on the button itself. */
.stedica-thank-you-reset{
  margin-top:16px;
}

/* Sync, "Reset local state" and "Start new survey" share one treatment.
   ONE rule, not three copies: they are the same affordance — an action that
   discards or moves on from what is currently on the device — and three
   copies would drift the first time the palette changed.
   Both offline buttons are red rather than just Sync: a red Sync beside a
   neutral Reset would imply Reset is the safer of the two, when it is the
   destructive one. */
.stedica-offline-actions .stedica-btn,
.stedica-thank-you-reset{
  background:var(--stedica-offline-btn-bg);
  color:var(--stedica-offline-btn-fg);
  border:1px solid var(--stedica-offline-btn-bg);
}

.stedica-offline-actions .stedica-btn:hover:not(:disabled),
.stedica-offline-actions .stedica-btn:focus-visible:not(:disabled),
.stedica-thank-you-reset:hover:not(:disabled),
.stedica-thank-you-reset:focus-visible:not(:disabled){
  background:var(--stedica-offline-btn-bg-hover);
  color:var(--stedica-offline-btn-fg-hover);
  border-color:var(--stedica-offline-btn-bg-hover);
}

/* Keyboard users get the same affordance as the mouse hover, plus a ring that
   is visible against BOTH the red and the grey state. */
.stedica-offline-actions .stedica-btn:focus-visible,
.stedica-thank-you-reset:focus-visible{
  outline:2px solid var(--stedica-text);
  outline-offset:2px;
}

/* Disabled is the common case here — Sync is disabled whenever the queue is
   empty — so it must not look like a live red button. */
.stedica-offline-actions .stedica-btn:disabled,
.stedica-thank-you-reset:disabled{
  background:#F1F5F9;
  color:#94A3B8;
  border-color:#E2E8F0;
  cursor:not-allowed;
  opacity:1;
}
@media (max-width: 768px){
  .stedica-offline-banner{
    flex-direction:column;
    align-items:flex-start;
  }
  .stedica-offline-actions{
    margin-left:0;
    width:100%;
  }
  .stedica-offline-actions .stedica-btn{
    width:100%;
  }
}

/* ── Thank-you card ─────────────────────────────────────────────────────── */
.stedica-thank-you-card{
  text-align:center;
  padding:52px 32px;
  box-sizing:border-box;
}
.stedica-thank-you-icon{
  font-size:48px;
  line-height:1;
  margin-bottom:18px;
  color:var(--stedica-primary);
}
.stedica-thank-you-card .stedica-section-title{
  font-size:22px;
  margin-bottom:10px;
}
.stedica-thank-you-card .stedica-question-desc{
  color:var(--stedica-muted);
  margin-bottom:0;
  max-width:380px;
  margin-left:auto;
  margin-right:auto;
}
.stedica-thank-you-countdown{
  margin-top:22px;
  font-size:12px;
  color:var(--stedica-muted);
  opacity:.7;
  letter-spacing:.02em;
}
@media (max-width:768px){
  .stedica-thank-you-card{
    padding:40px 20px;
  }
}

/* ── Login-required gate ─────────────────────────────────────────────────── */
.stedica-login-required-card{
  text-align:center;
  padding:48px 32px;
  box-sizing:border-box;
}
.stedica-login-required-icon{
  font-size:40px;
  margin-bottom:16px;
  line-height:1;
}
/* Was an inline style attribute on the <img>. Moved here in 5.16.4: the block
   and Elementor widget now pass this markup through wp_kses(), which filters
   style attributes through safecss_filter_attr() — and object-fit is not
   dependably on that allowlist, so an inline rule could be dropped silently. */
.stedica-login-required-logo{
  display:block;
  max-width:160px;
  max-height:160px;
  margin:0 auto 12px;
  object-fit:contain;
}
.stedica-login-required-card .stedica-section-title{
  font-size:20px;
  margin-bottom:10px;
}
.stedica-login-required-card .stedica-question-desc{
  color:var(--stedica-muted);
  margin-bottom:0;
}
.stedica-login-required-card .stedica-btn{
  box-sizing:border-box;
  /* Was an inline style attribute on the <a>; see the note above. */
  margin-top:16px;
}
/* The element selector is deliberate, not redundant. This button is an <a>, and
   themes commonly underline links with a two-class selector of their own. The
   inline style this replaced outranked all of them; a plain
   .stedica-login-required-card .stedica-btn would merely tie, and lose to any
   theme stylesheet that loads after this one. */
.stedica-login-required-card a.stedica-btn{
  text-decoration:none;
}
@media (max-width:768px){
  .stedica-login-required-card{
    padding:36px 20px;
  }
}

/* Per-question AI status row (Image Recognition / Image Comparison / Product Recognition).
   Injected at runtime by setQuestionAIStatus() in stedica-survey.js. Removed by the next
   render() on success; persists with .is-error on failure so respondents see what went wrong. */
.stedica-ai-status{
  margin-top:10px;
  padding:8px 12px;
  border-radius:var(--stedica-radius, 6px);
  background:#eef2ff;
  color:#1e3a8a;
  font-size:13px;
  line-height:1.45;
}
.stedica-ai-status.is-error{
  background:#fef2f2;
  color:#991b1b;
}

/* ─────────────────────────────────────────────────────────
 * v4.8.0 — Accessibility additions
 * ─────────────────────────────────────────────────────── */

/* Skip link — visible only when focused */
.stedica-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.stedica-skip-link:focus {
  position: fixed;
  top: 16px;
  left: 16px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: #fff;
  border: 2px solid currentColor;
  color: var(--stedica-primary, #30ABA9);
  font-weight: 600;
  z-index: 100000;
  text-decoration: none;
  border-radius:var(--stedica-radius, 6px);
}

/* Visible focus indicators on every interactive element */
.stedica-survey-wrapper :is(input, textarea, select, button, a, [tabindex="0"]):focus-visible {
  outline: 3px solid var(--stedica-primary, #30ABA9);
  outline-offset: 2px;
  border-radius:var(--stedica-radius, 6px);
}

/* Tap targets ≥ 44×44 (Apple HIG / WCAG 2.5.5) */
@media (pointer: coarse) {
  .stedica-survey-wrapper button,
  /* .stedica-button was never a real class — nothing defined it, so the one
     button carrying it rendered with browser defaults. The class is
     .stedica-btn. */
  .stedica-survey-wrapper .stedica-btn,
  .stedica-survey-wrapper input[type="radio"] + label,
  .stedica-survey-wrapper input[type="checkbox"] + label,
  .stedica-survey-wrapper .stedica-option,
  .stedica-survey-wrapper .stedica-rating-star {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
  }
}

/* High-contrast preference */
@media (prefers-contrast: more) {
  .stedica-survey-wrapper :is(input, textarea, select) {
    border-width: 2px;
    border-color: currentColor;
  }
  .stedica-survey-wrapper .stedica-ai-status,
  .stedica-survey-wrapper [role="alert"],
  .stedica-survey-wrapper [role="status"] {
    border: 2px solid currentColor;
  }
}

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

/* Visually-hidden helper (for screen-reader-only text) */
.stedica-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;
}
/* A legend sizes itself to its text unless forced (themes often make it
   display:table, which ignores width); a hidden one must not widen the
   page (WCAG 1.4.10 reflow). */
legend.stedica-sr-only {
  display: block !important;
}
legend.stedica-sr-only,
.stedica-survey-app .stedica-sr-only {
  width: 1px !important;
  max-width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Live regions visual baseline (so they don't shift layout on append) */
[role="status"], [role="alert"] {
  display: block;
}

/* ─────────────────────────────────────────────────────────
 * v4.10.0 — Elementor widget placeholder
 * Shown inside the Elementor editor (where we deliberately do NOT render a
 * live survey, because rendering would mint a session row + cookie on every
 * editor repaint) and when no survey has been selected yet.
 * ───────────────────────────────────────────────────────── */
.stedica-elementor-placeholder{
  border: 2px dashed var(--stedica-border, #E2E8F0);
  border-radius: var(--stedica-radius, 14px);
  background: var(--stedica-card, #FFFFFF);
  color: var(--stedica-text, #0F172A);
  padding: 28px 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.stedica-elementor-placeholder strong{
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--stedica-primary-dark, #278E8C);
  margin-bottom: 6px;
}
.stedica-elementor-placeholder-detail{
  color: var(--stedica-muted, #64748B);
  font-size: 13px;
}
.stedica-elementor-placeholder code{
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius:var(--stedica-radius, 6px);
  background: rgba(48, 171, 169, 0.10);
  color: var(--stedica-primary-dark, #278E8C);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

@media (prefers-color-scheme: dark){
  .stedica-elementor-placeholder code{
    background: rgba(48, 171, 169, 0.16);
    color: #5EE5E3;
  }
}

/* v4.10.3 — a question that fails to render degrades to a visible card rather
   than blanking the whole survey. */
.stedica-question-error{
  border: 1px solid var(--stedica-danger, #EF4444);
  border-left-width: 4px;
  background: rgba(239, 68, 68, 0.06);
}
.stedica-question-error-title{
  display: block;
  color: var(--stedica-danger, #EF4444);
  margin-bottom: 4px;
}
.stedica-question-error-detail{
  font-size: 13px;
  color: var(--stedica-muted, #64748B);
  line-height: 1.5;
}

/* ── Spam honeypot ─────────────────────────────────────────────────────────
   Visually removed without display:none. Some bots specifically skip
   display:none fields on the assumption they are traps, so this keeps the
   field in the layout tree while putting it out of sight and out of the tab
   order. aria-hidden + tabindex=-1 on the markup keep it away from assistive
   technology, which matters more than the anti-bot nuance: announcing this
   field to a screen-reader user gets their real response thrown away. */
.stedica-hp-field {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* 5.48.0: the CAPTCHA widget (Turnstile shows itself only when it needs a
   click). Kept inside the form's width at 320 px. */
.stedica-captcha {
	margin: 12px 0 0;
	max-width: 100%;
	overflow-x: auto;
}
.stedica-captcha:empty {
	margin: 0;
}

/* ── Signature question ────────────────────────────────────────────────── */
.stedica-signature-canvas {
	display: block;
	width: 100%;
	max-width: 600px;
	height: 200px;
	background: #fff;
	border: 1px solid var(--stedica-border, #c3c4c7);
	border-radius: var(--stedica-radius, 6px);
	/* Without this the browser scrolls the page instead of drawing on touch. */
	touch-action: none;
	cursor: crosshair;
}

.stedica-signature-clear {
	margin-top: 8px;
	background: #DB2531; /* 4.86:1 with white; #ED2939 was 4.22:1. */
	border: 1px solid #DB2531;
	color: #FFFFFF;
	border-radius: var(--stedica-radius, 6px);
	padding: 6px 14px;
	cursor: pointer;
}

.stedica-signature-clear:hover,
.stedica-signature-clear:focus {
	background: #E5E7EB;
	border-color: #E5E7EB;
	color: #000000;
}

/* ── 5.17.0: start screen, step mode, outcome screen ─────────────────────── */
.stedica-start-card,
.stedica-outcome-card{
  padding:40px 32px;
  box-sizing:border-box;
}
.stedica-start-image,
.stedica-outcome-image{
  display:block;
  max-width:100%;
  height:auto;
  margin:0 auto 20px;
  border-radius:var(--stedica-radius, 6px);
}
.stedica-start-title,
.stedica-outcome-title{
  font-size:22px;
  margin-bottom:12px;
}
.stedica-start-body,
.stedica-outcome-body{
  color:var(--stedica-text);
  line-height:1.6;
}
.stedica-start-meta{
  margin:16px 0 20px;
  font-size:13px;
  color:var(--stedica-muted);
}
.stedica-outcome-score{
  display:inline-block;
  margin:0 0 16px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(48,171,169,.12);
  color:var(--stedica-text);
  font-weight:600;
}
.stedica-outcome-advice,
.stedica-outcome-answers{
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid var(--stedica-border);
}
.stedica-outcome-advice h3,
.stedica-outcome-answers h3{
  font-size:15px;
  margin:0 0 8px;
}
.stedica-outcome-advice ul{ margin:0; padding-left:20px; }
.stedica-outcome-advice li{ margin:4px 0; }
.stedica-outcome-answers dl{ margin:0; }
.stedica-outcome-answers dt{ font-weight:600; margin-top:8px; }
.stedica-outcome-answers dd{ margin:2px 0 0; color:var(--stedica-muted); }
.stedica-outcome-offline{
  margin-top:16px;
  font-size:13px;
  color:var(--stedica-muted);
}
.stedica-outcome-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:24px;
}
.stedica-outcome-actions a.stedica-btn{ text-decoration:none; text-align:center; }

.stedica-step-nav{
  display:flex;
  gap:10px;
}
.stedica-step-nav .stedica-btn{ flex:1 1 0; }
.stedica-step-nav .stedica-step-back{ flex:0 0 auto; width:auto; min-width:96px; }
.stedica-step-nav .stedica-step-back:disabled{ opacity:.35; cursor:default; }
.stedica-start-over{
  align-self:flex-start;
  background:none;
  border:0;
  padding:6px 0;
  min-height:44px;
  color:var(--stedica-muted);
  text-decoration:underline;
  cursor:pointer;
  font:inherit;
  font-size:13px;
}
.stedica-start-over:hover,
.stedica-start-over:focus-visible{ color:var(--stedica-text); }

.stedica-step-enter-forward{ animation:stedica-step-in-right .22s ease-out; }
.stedica-step-enter-back{ animation:stedica-step-in-left .22s ease-out; }
@keyframes stedica-step-in-right{ from{ opacity:0; transform:translateX(24px); } to{ opacity:1; transform:none; } }
@keyframes stedica-step-in-left{ from{ opacity:0; transform:translateX(-24px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){
  .stedica-step-enter-forward,
  .stedica-step-enter-back{ animation:none; }
}
@media (max-width:768px){
  .stedica-start-card,
  .stedica-outcome-card{ padding:28px 18px; }
}

/* 5.17.0: step headings and the result title receive focus, which scrolls
   them into view. Leave room for a theme's sticky header so the heading is
   not scrolled underneath it. Themes can override the variable. */
.stedica-outcome-title,
.stedica-start-card,
[id^="question-label-"]{
  scroll-margin-top: var(--stedica-scroll-offset, 110px);
}

/* 5.24.0: A/B test variants. Before the runtime picks one, only the first
   (the original survey) shows; afterwards only the visitor's variant. */
.stedica-ab > .stedica-ab-variant + .stedica-ab-variant { display: none; }
.stedica-ab.is-picked > .stedica-ab-variant { display: none; }
.stedica-ab.is-picked > .stedica-ab-variant.is-chosen { display: block; }

/* 5.28.1: matrix radios at least 24 x 24 px (WCAG 2.5.8 target size), and
   a wide matrix scrolls inside its own box on a narrow screen instead of
   pushing the page sideways (1.4.10 allows this for data tables). */
.stedica-matrix-wrap{
  overflow-x:auto;
}
.stedica-matrix-wrap input[type="radio"]{
  width:24px;
  height:24px;
  margin:0;
}

/* 5.28.1: the inline message under a required question left empty. */
.stedica-field-error{
  margin:6px 0 0;
  color:#B32D2E; /* 5.8:1 on white */
  font-weight:600;
}
.stedica-question-card.is-invalid{
  border-color:#B32D2E;
}

/* 5.28.1: typing a name instead of drawing a signature. */
.stedica-signature-typed-label{
  display:block;
  margin:12px 0 4px;
}

/* ==========================================================================
   5.44.0 Forms. A form (settings.kind = form) sits flat on the page in the
   theme's font, with fields laid out on a 12-column row so two or three can
   share a line. Look 'card' keeps the survey's own box around it.
   ========================================================================== */

.stedica-wrapper-flat{
  background:transparent;
}
.stedica-wrapper-flat,
.stedica-wrapper-flat .stedica-survey-container{
  font-family:inherit;
}
.stedica-wrapper-no-titles .stedica-survey-heading,
.stedica-form-no-titles .stedica-section-title{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Fields share rows. */
.stedica-kind-form .stedica-section-card{
  display:grid;
  grid-template-columns:repeat(12, minmax(0, 1fr));
  column-gap:16px;
  align-items:start;
}
.stedica-kind-form .stedica-section-card > *{
  grid-column:1 / -1;
}
.stedica-kind-form .stedica-section-card > .stedica-w-half{ grid-column:span 6; }
.stedica-kind-form .stedica-section-card > .stedica-w-third{ grid-column:span 4; }
.stedica-kind-form .stedica-section-card > .stedica-w-two_thirds{ grid-column:span 8; }
.stedica-kind-form .stedica-section-card > .stedica-w-quarter{ grid-column:span 3; }
@media (max-width:600px){
  .stedica-kind-form .stedica-section-card > [class*="stedica-w-"]{ grid-column:1 / -1; }
}

/* Flat look: no card per field, the title reads as a label. */
.stedica-wrapper-flat .stedica-kind-form .stedica-section-card{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
}
.stedica-kind-form .stedica-question-card{
  border:0;
  background:transparent;
  padding:0;
  margin:0 0 16px;
  box-shadow:none;
}
.stedica-kind-form .stedica-question-card:hover{
  border-color:transparent;
  box-shadow:none;
}
.stedica-kind-form .stedica-question-title{
  font-size:14px;
  font-weight:600;
  margin:0 0 6px;
}
.stedica-kind-form .stedica-question-desc{
  font-size:13px;
  margin:0 0 6px;
}
.stedica-kind-form .stedica-input,
.stedica-kind-form .stedica-select{
  min-height:44px;
  font-size:15px;
  font-family:inherit;
}
.stedica-kind-form .stedica-question-card.is-invalid .stedica-input,
.stedica-kind-form .stedica-question-card.is-invalid .stedica-select{
  border-color:var(--stedica-danger);
}
.stedica-kind-form .stedica-mobile-hint:empty{
  display:none;
}
.stedica-kind-form .stedica-btn-primary{
  width:100%;
  font-family:inherit;
}

/* Paragraph */
.stedica-textarea{
  min-height:96px;
  resize:vertical;
  line-height:1.5;
  font-family:inherit;
}

/* A label read by assistive technology only (consent, or by choice). */
.stedica-label-hidden > .stedica-question-title{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Address (5.45.0) */
.stedica-address{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 12px;
}
.stedica-address-full{
  grid-column:1 / -1;
}
.stedica-address-label{
  display:block;
  font-size:13px;
  margin:0 0 4px;
}
@media (max-width:600px){
  .stedica-address{grid-template-columns:1fr;}
}

/* Consent */
.stedica-consent{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  line-height:1.5;
  cursor:pointer;
}
.stedica-consent input{
  flex:0 0 auto;
  width:18px;
  height:18px;
  margin:1px 0 0;
  accent-color:var(--stedica-primary);
}
.stedica-consent a{
  color:var(--stedica-primary);
  text-decoration:underline;
}
.stedica-kind-form .stedica-type-consent{
  margin-bottom:10px;
}

/* Option cards: two or three boxes side by side, each a title and a line. */
.stedica-choice-group.stedica-choice-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
}
.stedica-choice-cards .stedica-choice{
  align-items:flex-start;
  padding:14px;
}
.stedica-choice-cards .stedica-choice input{
  /* The whole card is the target; the dot stays for keyboard and AT. */
  margin-top:2px;
}
.stedica-choice-cards .stedica-choice-label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-weight:600;
}
.stedica-choice-desc{
  font-weight:400;
  font-size:13px;
  color:var(--stedica-muted);
  line-height:1.4;
}
.stedica-choice-cards .stedica-choice:has(input:checked){
  border-color:var(--stedica-primary);
  box-shadow:0 0 0 1px var(--stedica-primary);
  background:var(--stedica-primary-soft);
}
.stedica-choice-cards .stedica-choice:has(input:focus-visible){
  outline:2px solid var(--stedica-primary);
  outline-offset:2px;
}

/* Content block */
.stedica-content-block{
  margin:0 0 16px;
  line-height:1.6;
  color:var(--stedica-text);
}
.stedica-content-block > :first-child{ margin-top:0; }
.stedica-content-block > :last-child{ margin-bottom:0; }
.stedica-content-block h3,
.stedica-content-block h4{
  font-family:inherit;
  margin:0 0 8px;
}
.stedica-content-block a{
  color:var(--stedica-primary);
}

.stedica-thank-you-message{
  line-height:1.6;
}
