/* ============================================================
   services.bubbledevelopment.cz — shared styles
   Pulled from BD WEB Design/colors_and_type.css (design tokens
   + form system). Trimmed to what services pages actually use.
   ============================================================ */

:root {
  --bd-purple:        #804895;
  --bd-purple-deep:   #240342;
  --bd-purple-active: #4a348b;
  --bd-blue:          #17a8e3;
  --bd-orange:        #e06d46;

  --bd-lilac-50:      #f9f8ff;
  --bd-lilac-100:     #f0ebff;
  --bd-lilac-150:     #efebfa;
  --bd-lilac-200:     #eeecf7;
  --bd-lilac-300:     #e5e3f0;
  --bd-lilac-400:     #e7e5f2;

  --bd-white:         #ffffff;
  --bd-gray-100:      #eeeeee;

  --bd-fg-1:          var(--bd-purple-deep);
  --bd-fg-2:          #5b4d6b;
  --bd-fg-3:          #8a7e98;

  --bd-shadow-card:   0 4px 48px rgba(72, 11, 255, 0.08);
  --bd-shadow-button: 0 2px 20px rgba(36, 3, 66, 0.2);

  --bd-radius-pill:   100px;
  --bd-radius-card:   20px;
  --bd-radius-input:  10px;
  --bd-radius-large:  30px;

  --bd-font-sans:     "Inter", system-ui, -apple-system, "Segoe UI",
                      "Helvetica Neue", Arial, sans-serif;

  --bd-fs-h1:         44px;
  --bd-fs-h2:         28px;
  --bd-fs-body:       17px;
  --bd-fs-body-s:     15px;
  --bd-fs-button:     13px;

  --bd-ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --bd-dur-fast:      0.15s;
  --bd-dur-base:      0.3s;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--bd-font-sans);
  font-size: var(--bd-fs-body);
  line-height: 1.6;
  color: var(--bd-fg-1);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(128, 72, 149, 0.08), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(23, 168, 227, 0.07), transparent 60%),
    var(--bd-lilac-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--bd-purple-deep);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 { font-size: var(--bd-fs-h1); font-weight: 800; line-height: 1.1; }
h2 { font-size: var(--bd-fs-h2); }

p { margin: 0 0 16px; }

a { color: var(--bd-purple); text-decoration: underline; }
a:hover { color: var(--bd-purple-deep); }

strong { color: var(--bd-purple-deep); font-weight: 700; }

:focus-visible {
  outline: 2px solid var(--bd-purple);
  outline-offset: 2px;
}

/* ----- Layout ----- */
.bd-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.bd-card {
  background: var(--bd-white);
  border-radius: var(--bd-radius-large);
  box-shadow: var(--bd-shadow-card);
  padding: 48px;
}

.bd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  text-decoration: none;
}
.bd-header__logo {
  height: 36px;
  width: auto;
}

.bd-intro {
  color: var(--bd-fg-2);
  font-size: var(--bd-fs-body);
  margin-bottom: 8px;
}

.bd-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bd-lilac-100);
  color: var(--bd-purple);
  padding: 8px 14px;
  border-radius: var(--bd-radius-pill);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
.bd-context__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bd-purple);
}
.bd-context.is-hidden { display: none; }

/* ----- Form ----- */
.bd-form {
  display: grid;
  gap: 28px;
  margin-top: 8px;
}

.bd-section {
  display: grid;
  gap: 24px;
  padding-top: 8px;
  border-top: 1px solid var(--bd-lilac-200);
  padding-top: 28px;
}
.bd-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.bd-section__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-purple);
  margin: 0 0 4px;
}

.bd-field {
  display: grid;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.bd-field > legend {
  padding: 0;
}

.bd-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--bd-purple-deep);
  line-height: 1.4;
}
.bd-label__req {
  color: var(--bd-orange);
  font-weight: 700;
  margin-left: 2px;
}

.bd-help {
  font-size: 13px;
  color: var(--bd-fg-3);
  line-height: 1.5;
  margin-top: -4px;
}

.bd-error {
  font-size: 13px;
  color: var(--bd-orange);
  font-weight: 600;
  display: none;
}
.bd-field.is-invalid .bd-error { display: block; }

/* ----- Rating scale ----- */
.bd-rating {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bd-rating__option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 12px;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--bd-dur-fast) var(--bd-ease),
              background var(--bd-dur-fast) var(--bd-ease),
              transform var(--bd-dur-fast) var(--bd-ease);
  user-select: none;
}
.bd-rating__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bd-rating__num {
  font-size: 22px;
  font-weight: 800;
  color: var(--bd-purple-deep);
  line-height: 1;
}
.bd-rating__lbl {
  font-size: 11px;
  color: var(--bd-fg-3);
  font-weight: 500;
  line-height: 1.25;
  min-height: 1.5em;
}
.bd-rating__option:hover {
  border-color: var(--bd-purple);
  transform: translateY(-1px);
}
.bd-rating__option:has(input:checked) {
  background: var(--bd-purple);
  border-color: var(--bd-purple);
}
.bd-rating__option:has(input:checked) .bd-rating__num,
.bd-rating__option:has(input:checked) .bd-rating__lbl {
  color: var(--bd-white);
}
.bd-field.is-invalid .bd-rating__option {
  border-color: var(--bd-orange);
}

/* ----- Textarea ----- */
.bd-textarea {
  width: 100%;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 14px 18px;
  font-family: inherit;
  font-size: 15px;
  color: var(--bd-purple-deep);
  line-height: 1.55;
  min-height: 110px;
  resize: vertical;
  transition: border-color var(--bd-dur-base) var(--bd-ease),
              box-shadow var(--bd-dur-base) var(--bd-ease);
  outline: none;
}
.bd-textarea::placeholder { color: var(--bd-fg-3); }
.bd-textarea:hover { border-color: var(--bd-lilac-400); }
.bd-textarea:focus {
  border-color: var(--bd-purple);
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.12);
}

/* ----- Checkbox ----- */
.bd-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--bd-fg-2);
  line-height: 1.5;
  user-select: none;
}
.bd-check input { position: absolute; opacity: 0; pointer-events: none; }
.bd-check__box {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              border-color var(--bd-dur-fast) var(--bd-ease),
              box-shadow var(--bd-dur-fast) var(--bd-ease);
}
.bd-check input:checked + .bd-check__box {
  background: var(--bd-purple);
  border-color: var(--bd-purple);
}
.bd-check input:checked + .bd-check__box::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.bd-check:hover .bd-check__box { border-color: var(--bd-purple); }
.bd-check input:focus-visible + .bd-check__box {
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.18);
}

.bd-consent {
  background: var(--bd-lilac-50);
  border-radius: var(--bd-radius-input);
  padding: 16px 18px;
  display: none;
}
.bd-consent.is-visible { display: block; }

/* ----- Buttons ----- */
.bd-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.bd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: var(--bd-radius-pill);
  font-family: inherit;
  font-size: var(--bd-fs-button);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--bd-dur-base) var(--bd-ease),
              box-shadow var(--bd-dur-base) var(--bd-ease),
              transform var(--bd-dur-fast) var(--bd-ease);
}
.bd-btn--primary {
  background: var(--bd-purple);
  color: var(--bd-white);
}
.bd-btn--primary:hover:not(:disabled) {
  background: var(--bd-purple-active);
  box-shadow: var(--bd-shadow-button);
}
.bd-btn--primary:active:not(:disabled) {
  transform: translateY(1px);
}
.bd-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bd-btn__spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bd-spin 0.8s linear infinite;
  display: none;
}
.bd-btn.is-loading .bd-btn__spinner { display: inline-block; }
@keyframes bd-spin { to { transform: rotate(360deg); } }

/* ----- Submit error banner ----- */
.bd-banner {
  display: none;
  padding: 14px 18px;
  background: rgba(224, 109, 70, 0.1);
  border: 1px solid rgba(224, 109, 70, 0.3);
  border-radius: var(--bd-radius-input);
  color: var(--bd-orange);
  font-size: 14px;
  font-weight: 600;
}
.bd-banner.is-visible { display: block; }

/* ----- Footer ----- */
.bd-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--bd-fg-3);
}

/* ----- Thanks page ----- */
.bd-thanks {
  text-align: center;
  padding: 24px 8px 8px;
}
.bd-thanks__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bd-lilac-100);
  color: var(--bd-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.bd-thanks__icon svg { width: 32px; height: 32px; }
.bd-thanks p {
  color: var(--bd-fg-2);
  font-size: var(--bd-fs-body);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Text input ----- */
.bd-input {
  width: 100%;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--bd-purple-deep);
  transition: border-color var(--bd-dur-fast) var(--bd-ease),
              box-shadow var(--bd-dur-fast) var(--bd-ease);
}
.bd-input::placeholder { color: var(--bd-fg-3); }
.bd-input:hover { border-color: var(--bd-lilac-400); }
.bd-input:focus {
  outline: none;
  border-color: var(--bd-purple);
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.12);
}
.bd-input--invalid {
  border-color: var(--bd-orange);
}

/* ----- Password input + reveal toggle ----- */
.bd-input-group { position: relative; }
.bd-input-group .bd-input { padding-right: 44px; }
.bd-input-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--bd-fg-3);
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              color var(--bd-dur-fast) var(--bd-ease);
}
.bd-input-toggle:hover { background: var(--bd-lilac-100); color: var(--bd-purple); }
.bd-input-toggle svg { width: 18px; height: 18px; }

/* ----- Service item card (transferAccesses) ----- */
.bd-service {
  position: relative;
  background: var(--bd-lilac-50);
  border: 1px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 20px 22px 22px;
  margin-bottom: 16px;
}
.bd-service__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bd-service__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--bd-purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}
.bd-service__row { margin-bottom: 12px; }
.bd-service__row:last-child { margin-bottom: 0; }
.bd-service__row .bd-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bd-fg-2);
}

/* ----- Secondary / outline button ----- */
.bd-btn--secondary {
  background: var(--bd-white);
  color: var(--bd-purple);
  border: 1.5px solid var(--bd-lilac-300);
}
.bd-btn--secondary:hover:not(:disabled) {
  background: var(--bd-lilac-50);
  border-color: var(--bd-purple);
}

/* ----- Ghost / danger remove button ----- */
.bd-btn-remove {
  background: transparent;
  color: var(--bd-orange);
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--bd-radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--bd-dur-fast) var(--bd-ease);
}
.bd-btn-remove:hover { background: rgba(224, 109, 70, 0.1); }
.bd-btn-remove svg { width: 14px; height: 14px; }

/* ----- Form footer (stacked buttons) ----- */
.bd-form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ----- Banner success / info (post-submit) ----- */
.bd-banner--success {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #2e7d32;
  padding: 14px 18px;
  border-radius: var(--bd-radius-input);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
}
.bd-banner--error {
  background: rgba(224, 109, 70, 0.08);
  border: 1px solid rgba(224, 109, 70, 0.3);
  color: #b34322;
  padding: 14px 18px;
  border-radius: var(--bd-radius-input);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
}

/* ----- Select dropdown ----- */
.bd-select {
  width: 100%;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 12px 44px 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--bd-purple-deep);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23804895' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  transition: border-color var(--bd-dur-fast) var(--bd-ease),
              box-shadow var(--bd-dur-fast) var(--bd-ease);
}
.bd-select:hover { border-color: var(--bd-lilac-400); }
.bd-select:focus {
  outline: none;
  border-color: var(--bd-purple);
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.12);
}
.bd-select:disabled {
  background-color: var(--bd-lilac-100);
  color: var(--bd-fg-3);
  cursor: not-allowed;
}

/* ----- File upload ----- */
.bd-file {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bd-file input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.bd-file__btn {
  background: var(--bd-white);
  color: var(--bd-purple);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              border-color var(--bd-dur-fast) var(--bd-ease);
}
.bd-file__btn:hover {
  background: var(--bd-lilac-50);
  border-color: var(--bd-purple);
}
.bd-file__btn svg { width: 14px; height: 14px; }
.bd-file__name {
  font-size: 14px;
  color: var(--bd-fg-2);
  word-break: break-all;
}
.bd-file__name:empty::before {
  content: "Žádný soubor není vybrán";
  color: var(--bd-fg-3);
  font-style: italic;
}
.bd-file__name { flex: 1 1 100%; min-width: 0; }

/* --- Per-file list (one row per uploaded file with × remove) --- */
.bd-file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bd-file-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bd-lilac-50);
  border: 1px solid var(--bd-lilac-200);
  border-radius: 8px;
  font-size: 13px;
}
.bd-file-list__name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--bd-fg-1);
  word-break: break-all;
}
.bd-file-list__size {
  flex: 0 0 auto;
  color: var(--bd-fg-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bd-file-list__remove {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--bd-fg-3);
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bd-file-list__remove:hover {
  background: rgba(224, 109, 70, 0.1);
  border-color: rgba(224, 109, 70, 0.4);
  color: var(--bd-orange);
}
.bd-file-list__total {
  font-size: 12px;
  color: var(--bd-fg-3);
  margin-top: 2px;
}
[data-files-summary][data-bd-warn] .bd-file-list__total {
  color: var(--bd-orange);
  font-weight: 600;
}
.bd-file__remove {
  background: transparent;
  border: none;
  color: var(--bd-orange);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--bd-radius-pill);
}
.bd-file__remove:hover { background: rgba(224, 109, 70, 0.1); }

/* ----- TinyMCE container blends with BD inputs ----- */
.bd-field .tox-tinymce {
  border-radius: var(--bd-radius-input) !important;
  border: 1.5px solid var(--bd-lilac-300) !important;
}
.bd-field .tox-tinymce:focus-within {
  border-color: var(--bd-purple) !important;
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.12);
}

/* ----- Embed mode (iframe in logBook) — keep just the card -----
   Aktivuje se přes <html class="bd-embed"> (JS detekuje iframe / ?embed=1).
   Inline detektor v <head> nastaví třídu na documentElement ještě před
   tím, než parser projde <body>, takže CSS sedí od první malby.
*/
html.bd-embed,
html.bd-embed body {
  background: transparent;
}
html.bd-embed .bd-page {
  padding: 0;
  max-width: none;
  min-height: auto;
}
html.bd-embed .bd-header,
html.bd-embed .bd-footer {
  display: none !important;
}
html.bd-embed .bd-card {
  box-shadow: none;
  border-radius: 0;
  padding: 32px 36px;
}

/* ----- Radio / checkbox cards (vertical option lists) -----
   Used by invoicingQuestionnaire for multi-option Q's.
*/
.bd-options {
  display: grid;
  gap: 8px;
}
.bd-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bd-purple-deep);
  transition: border-color var(--bd-dur-fast) var(--bd-ease),
              background var(--bd-dur-fast) var(--bd-ease);
}
.bd-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bd-option__mark {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  background: var(--bd-white);
  border: 1.5px solid var(--bd-lilac-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              border-color var(--bd-dur-fast) var(--bd-ease);
}
.bd-option--radio .bd-option__mark { border-radius: 50%; }
.bd-option--check .bd-option__mark { border-radius: 6px; }
.bd-option:hover { border-color: var(--bd-purple); }
.bd-option:has(input:checked) {
  border-color: var(--bd-purple);
  background: var(--bd-lilac-50);
}
.bd-option--radio:has(input:checked) .bd-option__mark::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bd-purple);
}
.bd-option--check:has(input:checked) .bd-option__mark {
  background: var(--bd-purple);
  border-color: var(--bd-purple);
}
.bd-option--check:has(input:checked) .bd-option__mark::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.bd-option input:focus-visible + .bd-option__mark {
  box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.18);
}
.bd-field.is-invalid .bd-option {
  border-color: var(--bd-orange);
}

/* ----- Yes / No quick pair (horizontal) ----- */
.bd-yesno {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.bd-yesno--three {
  grid-template-columns: repeat(3, 1fr);
}
.bd-yesno .bd-option {
  justify-content: center;
  text-align: center;
  font-weight: 600;
}
.bd-yesno .bd-option__mark { display: none; }
.bd-yesno .bd-option:has(input:checked) {
  background: var(--bd-purple);
  border-color: var(--bd-purple);
  color: var(--bd-white);
}

/* ----- Matrix grid (one radio group per row, columns are options) ----- */
.bd-matrix {
  border: 1px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  overflow: hidden;
}
.bd-matrix__scroll {
  overflow-x: auto;
}
.bd-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}
.bd-matrix th,
.bd-matrix td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--bd-lilac-200);
  text-align: center;
  vertical-align: middle;
}
.bd-matrix thead th {
  background: var(--bd-lilac-50);
  color: var(--bd-fg-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bd-matrix tbody tr:last-child th,
.bd-matrix tbody tr:last-child td {
  border-bottom: none;
}
.bd-matrix th[scope="row"] {
  text-align: left;
  color: var(--bd-purple-deep);
  font-weight: 600;
  width: 28%;
  background: var(--bd-white);
}
.bd-matrix tbody tr:hover th[scope="row"],
.bd-matrix tbody tr:hover td {
  background: var(--bd-lilac-50);
}
.bd-matrix__cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border: 1.5px solid var(--bd-lilac-300);
  border-radius: 50%;
  cursor: pointer;
  background: var(--bd-white);
  transition: border-color var(--bd-dur-fast) var(--bd-ease),
              background var(--bd-dur-fast) var(--bd-ease);
}
.bd-matrix__cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bd-matrix__cell:hover { border-color: var(--bd-purple); }
.bd-matrix__cell:has(input:checked) {
  border-color: var(--bd-purple);
  background: var(--bd-purple);
  box-shadow: inset 0 0 0 3px var(--bd-white);
}
.bd-field.is-invalid .bd-matrix {
  border-color: var(--bd-orange);
}

/* ----- Page / section dividers (multi-page questionnaire layout) ----- */
.bd-page-section {
  display: grid;
  gap: 28px;
}
.bd-page-section__heading {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bd-purple);
  margin: 0;
  padding: 6px 14px;
  background: var(--bd-lilac-100);
  border-radius: var(--bd-radius-pill);
  display: inline-block;
  align-self: start;
}
.bd-block {
  display: grid;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--bd-lilac-200);
}
.bd-block:first-of-type {
  border-top: none;
  padding-top: 0;
}
.bd-block__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-purple);
  margin: 0 0 -4px;
}
.bd-block__intro {
  font-size: 14px;
  color: var(--bd-fg-2);
  margin: -8px 0 0;
  padding: 12px 16px;
  background: var(--bd-lilac-50);
  border-left: 3px solid var(--bd-lilac-300);
  border-radius: 6px;
}

/* ----- Sublabel under a question label ----- */
.bd-sublabel {
  font-size: 13px;
  color: var(--bd-fg-3);
  line-height: 1.5;
  margin: -6px 0 0;
  font-style: italic;
}

/* ----- Info / heading block (Q62 etc.) ----- */
.bd-info {
  padding: 18px 20px;
  background: var(--bd-lilac-50);
  border-left: 3px solid var(--bd-purple);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--bd-fg-2);
}
.bd-info strong { color: var(--bd-purple-deep); }
.bd-info > :first-child { margin-top: 0; }
.bd-info > :last-child { margin-bottom: 0; }

/* ----- Conditional visibility ----- */
.bd-field.is-hidden,
.bd-block.is-hidden,
.bd-page-section.is-hidden,
.bd-other-wrap.is-hidden {
  display: none !important;
}

/* ----- Simple wizard step (used by documentTemplateQuestionnaire) ----- */
.bd-step { display: grid; gap: 28px; }
.bd-step:not(.is-active) { display: none !important; }
.bd-step__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--bd-purple-deep);
  margin: 0 0 4px;
}
.bd-step__intro {
  color: var(--bd-fg-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 8px;
}

/* ===========================================================
   WIZARD — public surface only.
   The form is rendered into pages: one block visible at a
   time, navigation buttons at the bottom. Admin uses the
   scroll-everything layout above (no .bd-iq-wizard on body).
   =========================================================== */
.bd-iq-wizard .bd-page-section__heading,
.bd-iq-admin .bd-page-section__heading {
  /* Page-level headings duplicate block titles in both surfaces:
     wizard already has the block title as the step header, and admin
     renders the block titles as cards — the page-section pills above
     them just doubled the same text. */
  display: none !important;
}
/* Hide form title + intro from step 2 onwards — they're a one-time
   greeting, no need to repeat on every step. */
.bd-iq-wizard-after-first .bd-card > h1,
.bd-iq-wizard-after-first .bd-card > .bd-intro {
  display: none;
}
.bd-iq-wizard .bd-block {
  border-top: none !important;
  padding-top: 0 !important;
}
.bd-iq-wizard .bd-block.is-step-inactive {
  display: none !important;
}

/* In wizard, the block "head" is a non-clickable title at the top of
   the step. No chevron, no collapse toggle behavior. The body is
   always visible (no data-collapsed shrink). */
.bd-iq-wizard .bd-block__head {
  cursor: default;
  background: transparent;
  border: 0;
  padding: 4px 0 8px;
  pointer-events: none;
}
.bd-iq-wizard .bd-block__head:hover {
  background: transparent;
  border: 0;
}
.bd-iq-wizard .bd-block__chev { display: none; }
.bd-iq-wizard .bd-block__title {
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--bd-purple-deep);
  font-weight: 800;
}
.bd-iq-wizard .bd-block__body {
  display: grid !important;
  gap: 36px;
  padding-top: 8px;
}
.bd-iq-wizard .bd-block[data-collapsed] > .bd-block__body {
  display: grid !important;
}

/* Spacing: bigger gap between question (legend) and answer (options).
   Soft horizontal rule between consecutive questions inside a block
   gives a calm visual rhythm without heavy borders. */
.bd-iq-wizard .bd-field {
  gap: 18px;
  padding: 4px 0;
}
.bd-iq-wizard .bd-field + .bd-field {
  border-top: 1px solid var(--bd-lilac-200);
  padding-top: 28px;
}
.bd-iq-wizard .bd-label {
  font-size: 17px;
  line-height: 1.45;
}
.bd-iq-wizard .bd-help,
.bd-iq-wizard .bd-sublabel {
  margin-top: -8px;
}

/* Wizard nav bar — sticks to the bottom of the card. */
.bd-wizard-nav {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--bd-lilac-200);
  display: grid;
  gap: 16px;
}
.bd-wizard-progress {
  display: grid;
  gap: 6px;
}
.bd-wizard-progress__text {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-fg-3);
}
.bd-wizard-progress__bar {
  width: 100%;
  height: 4px;
  background: var(--bd-lilac-200);
  border-radius: 4px;
  overflow: hidden;
}
.bd-wizard-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bd-purple), var(--bd-blue));
  transition: width var(--bd-dur-base) var(--bd-ease);
  width: 0%;
}
.bd-wizard-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.bd-wizard-buttons .bd-btn:disabled {
  opacity: 0.35;
}
@media (max-width: 600px) {
  .bd-wizard-buttons { flex-direction: column; }
  .bd-wizard-buttons .bd-btn { width: 100%; }
  .bd-iq-wizard .bd-block__body { gap: 28px; }
  .bd-iq-wizard .bd-field + .bd-field { padding-top: 22px; }
}

/* ----- Collapsible blocks (public only) -----
   Public page collapses every block but the first; clicking the head
   (or finishing all required fields in the current block) expands the
   next one. Admin keeps everything expanded — no .bd-block__head node
   is rendered there.
*/
.bd-block__head {
  appearance: none;
  background: var(--bd-white);
  border: 1px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  margin: 0;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              border-color var(--bd-dur-fast) var(--bd-ease);
}
.bd-block__head:hover {
  background: var(--bd-lilac-50);
  border-color: var(--bd-purple);
}
.bd-block__head .bd-block__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-purple);
}
.bd-block__chev {
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--bd-purple);
  border-bottom: 2px solid var(--bd-purple);
  transform: rotate(45deg);
  transition: transform var(--bd-dur-fast) var(--bd-ease);
  flex: 0 0 auto;
  margin-left: 12px;
}
[data-collapsed] .bd-block__chev {
  transform: rotate(-45deg);
}
.bd-block__body {
  display: grid;
  gap: 24px;
  padding-top: 24px;
}
[data-collapsed] > .bd-block__body {
  display: none;
}
[data-collapsible] {
  display: grid;
  gap: 0;
  border-top: none !important;
  padding-top: 0 !important;
}
[data-collapsible]:not(:first-child) {
  margin-top: 12px;
}

/* ===========================================================
   Admin edit affordances
   Layout principles:
   - Every editable question is a card with light dashed border
     so it's obvious what's editable vs. structural.
   - Each option is a flex row, with a right-anchored X "remove"
     button INSIDE that option (option has position:relative).
   - Each question has a tiny toolbar ABOVE the legend (not over
     the options) with the "Smazat otázku" pill button.
   - All controls are visible at rest — no hover-only — so users
     can actually find them.
   =========================================================== */

.bd-iq-admin .bd-block {
  position: relative;
}
.bd-iq-admin .bd-field {
  position: relative;
  border: 1px dashed var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 16px 18px 18px;
  background: var(--bd-white);
}
.bd-iq-admin .bd-field:hover {
  border-color: var(--bd-lilac-400);
}
.bd-iq-admin .bd-field:focus-within {
  border-color: var(--bd-purple);
}

.bd-iq-admin [data-editable="text"] {
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              outline var(--bd-dur-fast) var(--bd-ease);
  display: inline-block;
  min-width: 40px;
}
.bd-iq-admin [data-editable="text"]:hover {
  background: var(--bd-lilac-100);
}
.bd-iq-admin [data-editable="text"]:focus {
  outline: 2px solid var(--bd-purple);
  background: var(--bd-white);
}

/* Q-tools toolbar — flex row at the very top of the field, BEFORE the legend */
.bd-iq-admin .bd-q-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

/* Block-tools toolbar — same layout, above the block head */
.bd-iq-admin .bd-block-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.bd-iq-admin .bd-q-tool {
  appearance: none;
  background: var(--bd-white);
  border: 1px solid var(--bd-lilac-300);
  color: var(--bd-fg-2);
  border-radius: var(--bd-radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.bd-iq-admin .bd-q-tool:hover {
  border-color: var(--bd-purple);
  color: var(--bd-purple);
}
.bd-iq-admin .bd-q-tool--danger:hover {
  border-color: var(--bd-orange);
  color: var(--bd-orange);
  background: rgba(224, 109, 70, 0.06);
}

/* --- Bank-sourced question marker (admin only) ---------------------
   The engine emits data-shared-ref="shared.X" on the fieldset of any
   question resolved from sharedQuestions.json. In admin mode we add
   (a) a subtle tinted left border on the field, and (b) a small pill
   badge inside the legend (added by admin.js), so the editor sees at
   a glance which questions are bank-sourced and which are local. */
.bd-iq-admin .bd-field[data-shared-ref] {
  border-left: 3px solid rgba(128, 72, 149, 0.35);
  background: rgba(128, 72, 149, 0.035);
  padding-left: 14px;
  border-radius: 0 6px 6px 0;
}
.bd-iq-admin .bd-bank-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(128, 72, 149, 1);
  background: rgba(128, 72, 149, 0.1);
  border: 1px solid rgba(128, 72, 149, 0.3);
  border-radius: var(--bd-radius-pill);
  cursor: help;
  vertical-align: middle;
  user-select: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.bd-iq-admin .bd-bank-badge:hover {
  background: rgba(128, 72, 149, 0.18);
  border-color: rgba(128, 72, 149, 0.5);
}

/* Each option is a flex row with the X anchored on its OWN right side.
   Crucial: position:relative so absolute child anchors to it.
   The left padding makes room for the drag handle. */
.bd-iq-admin .bd-option {
  position: relative;
  padding-right: 44px;
  padding-left: 36px;
}

/* Drag handle on the left side of each option — only this element is
   draggable=true; the rest of the option keeps its normal click/edit
   behaviour. The two-character glyph (⋮⋮) hints at "grab to drag". */
.bd-iq-admin .bd-option-drag-handle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bd-fg-3);
  cursor: grab;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -3px;
  user-select: none;
  border-radius: 4px;
  transition: color var(--bd-dur-fast) var(--bd-ease),
              background var(--bd-dur-fast) var(--bd-ease);
}
.bd-iq-admin .bd-option-drag-handle:hover {
  color: var(--bd-purple);
  background: var(--bd-lilac-100);
}
.bd-iq-admin .bd-option-drag-handle:active { cursor: grabbing; }

/* Visual states during drag */
.bd-iq-admin .bd-option.is-dragging {
  opacity: 0.4;
}
.bd-iq-admin .bd-option.is-drop-target-before {
  box-shadow: 0 -3px 0 0 var(--bd-purple);
}
.bd-iq-admin .bd-option.is-drop-target-after {
  box-shadow: 0 3px 0 0 var(--bd-purple);
}

/* yes/no horizontal options skip the drag handle — too cramped */
.bd-iq-admin .bd-yesno .bd-option {
  padding-left: 16px;
}
.bd-iq-admin .bd-yesno .bd-option-drag-handle { display: none; }
.bd-iq-admin .bd-option-remove {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--bd-fg-3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  border-radius: 50%;
  padding: 0;
  z-index: 2;
}

/* "Upřesnit" toggle — marks this option as isOther.  Sits to the left
   of the × remove button. Off state: muted outline. On state: filled
   purple pill — same visual weight as a selected option mark, so the
   editor can scan which options trigger the free-text. */
.bd-iq-admin .bd-option-other-toggle {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  background: var(--bd-white);
  border: 1px solid var(--bd-lilac-300);
  border-radius: var(--bd-radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--bd-fg-3);
  cursor: pointer;
  line-height: 1.3;
  letter-spacing: 0.02em;
  z-index: 2;
  transition: background var(--bd-dur-fast) var(--bd-ease),
              color var(--bd-dur-fast) var(--bd-ease),
              border-color var(--bd-dur-fast) var(--bd-ease);
}
.bd-iq-admin .bd-option-other-toggle:hover {
  border-color: var(--bd-purple);
  color: var(--bd-purple);
}
.bd-iq-admin .bd-option-other-toggle.is-on {
  background: var(--bd-purple);
  border-color: var(--bd-purple);
  color: var(--bd-white);
}
.bd-iq-admin .bd-option-other-toggle.is-on::before {
  content: "✓ ";
  margin-right: 2px;
}
/* Make room on the option's right side for the extra control */
.bd-iq-admin .bd-option { padding-right: 130px; }
/* In yes/no horizontal layouts the toggle would crowd things — hide it
   there. Y/N options rarely have a "Jiné" semantic anyway. */
.bd-iq-admin .bd-yesno .bd-option-other-toggle { display: none; }
.bd-iq-admin .bd-yesno .bd-option { padding-right: 16px; }
.bd-iq-admin .bd-option-remove:hover {
  color: var(--bd-orange);
  background: rgba(224, 109, 70, 0.12);
  border-color: rgba(224, 109, 70, 0.3);
}

/* The yes/no horizontal layout doesn't have room for an X inside each
   cell — render the remove button stacked below instead. */
.bd-iq-admin .bd-yesno .bd-option {
  padding-right: 16px;
}
.bd-iq-admin .bd-yesno .bd-option-remove {
  position: static;
  transform: none;
  margin-left: 6px;
}

.bd-iq-admin .bd-option-add {
  appearance: none;
  background: var(--bd-lilac-50);
  border: 1.5px dashed var(--bd-lilac-300);
  border-radius: var(--bd-radius-input);
  padding: 10px 16px;
  width: 100%;
  cursor: pointer;
  color: var(--bd-fg-2);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  margin-top: 4px;
}
.bd-iq-admin .bd-option-add:hover {
  border-color: var(--bd-purple);
  color: var(--bd-purple);
  background: var(--bd-white);
}

/* Make sure the matrix table cells don't show stray X buttons (matrix
   options aren't user-editable for now — too structural). */
.bd-iq-admin .bd-matrix .bd-option-remove { display: none; }

/* ===========================================================
   Admin outline sidebar — list of pages → blocks → questions
   with click-to-jump + per-item ↑ ↓ × actions. Sticky on the
   left, scrollable independently of the main canvas.
   =========================================================== */
.bd-iq-has-outline .bd-page {
  margin-left: 420px;
  /* In admin let the canvas use whatever width remains after the
     outline. The base .bd-page caps at 720px which is too narrow for
     the Q12 matrix (8 rows × 5 columns) — overflow-x scroll kicked in,
     which was ugly. Override here. */
  max-width: none;
  padding-right: 24px;
  transition: margin-left var(--bd-dur-base) var(--bd-ease);
}
.bd-iq-has-outline.bd-iq-outline-collapsed .bd-page {
  margin-left: 60px;
}
/* Matrix uses the now-wider canvas — column widths spread evenly */
.bd-iq-admin .bd-matrix table {
  min-width: 0;
  table-layout: fixed;
}
.bd-iq-admin .bd-matrix th[scope="row"] { width: auto; min-width: 160px; }
.bd-iq-admin .bd-matrix thead th { white-space: normal; word-break: normal; }

.bd-iq-outline {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 400px;
  background: var(--bd-white);
  border-right: 1px solid var(--bd-lilac-300);
  display: flex;
  flex-direction: column;
  z-index: 90;
  font-size: 13px;
  transition: width var(--bd-dur-base) var(--bd-ease);
  overflow: hidden;
}
/* Collapsed: shrink to just the toggle column, keep header visible
   so the user can always expand back. */
.bd-iq-outline.is-collapsed {
  width: 44px;
}
.bd-iq-outline.is-collapsed .bd-iq-outline__body {
  display: none;
}
.bd-iq-outline.is-collapsed .bd-iq-outline__head {
  padding: 14px 8px;
  justify-content: center;
}
.bd-iq-outline.is-collapsed .bd-iq-outline__head h3 {
  display: none;
}
.bd-iq-outline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--bd-lilac-200);
  flex: 0 0 auto;
  background: var(--bd-lilac-50);
}
.bd-iq-outline__head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bd-purple);
}
.bd-iq-outline__collapse {
  appearance: none;
  background: var(--bd-white);
  border: 1px solid var(--bd-lilac-300);
  border-radius: 50%;
  width: 26px; height: 26px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--bd-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--bd-dur-base) var(--bd-ease);
}
.bd-iq-outline.is-collapsed .bd-iq-outline__collapse {
  transform: rotate(180deg);
}
.bd-iq-outline__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 8px 24px;
}
.bd-iq-outline__page {
  margin-bottom: 16px;
}
.bd-iq-outline__page-head {
  margin: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-fg-3);
}
.bd-iq-outline__blocks,
.bd-iq-outline__questions {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bd-iq-outline__block {
  margin-bottom: 8px;
}
.bd-iq-outline__block-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bd-lilac-100);
  border-radius: 6px;
}
.bd-iq-outline__block-head:hover {
  background: var(--bd-lilac-200);
}
.bd-iq-outline__block-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bd-purple);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-iq-outline__questions {
  margin: 4px 0 0 0;
  padding-left: 6px;
  border-left: 2px solid var(--bd-lilac-200);
}
.bd-iq-outline__questions > li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}
.bd-iq-outline__questions > li:hover {
  background: var(--bd-lilac-50);
  border-radius: 6px;
}
.bd-iq-outline__q {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 6px;
  color: var(--bd-purple-deep);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.35;
}
.bd-iq-outline__qid {
  font-size: 10px;
  font-weight: 700;
  color: var(--bd-fg-3);
  flex: 0 0 auto;
  text-transform: uppercase;
}
.bd-iq-outline__qlabel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bd-iq-outline__q:hover .bd-iq-outline__qlabel {
  color: var(--bd-purple);
  text-decoration: underline;
}
.bd-iq-outline__actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  opacity: 0.45;
  transition: opacity var(--bd-dur-fast) var(--bd-ease);
}
.bd-iq-outline__block-head:hover .bd-iq-outline__actions,
.bd-iq-outline__questions > li:hover .bd-iq-outline__actions {
  opacity: 1;
}
.bd-iq-outline__actions button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 22px; height: 22px;
  border-radius: 4px;
  color: var(--bd-fg-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
}
.bd-iq-outline__actions button:hover:not(:disabled) {
  background: var(--bd-white);
  color: var(--bd-purple);
}
.bd-iq-outline__actions button.danger:hover {
  color: var(--bd-orange);
  background: rgba(224, 109, 70, 0.08);
}
.bd-iq-outline__actions button:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Brief flash to highlight the jumped-to target */
.bd-iq-flash {
  animation: bd-iq-flash 1.4s ease-out;
}
@keyframes bd-iq-flash {
  0%   { box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.5); }
  60%  { box-shadow: 0 0 0 4px rgba(128, 72, 149, 0.2); }
  100% { box-shadow: 0 0 0 4px rgba(128, 72, 149, 0); }
}

@media (max-width: 900px) {
  .bd-iq-has-outline .bd-page { margin-left: 0; padding-left: 16px; padding-right: 16px; }
  .bd-iq-outline {
    transform: translateX(-296px);
  }
  .bd-iq-outline:not(.is-collapsed) {
    transform: translateX(0);
    box-shadow: 0 4px 30px rgba(36, 3, 66, 0.15);
  }
}

/* Admin save bar — fixed bottom bar with dirty state + save button */
.bd-savebar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--bd-lilac-300);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
  z-index: 100;
  font-size: 14px;
  color: var(--bd-fg-2);
}
.bd-savebar__status { flex: 1; min-width: 0; }
.bd-savebar__status strong { color: var(--bd-purple-deep); }
.bd-savebar .bd-btn { padding: 10px 24px; }

/* ----- Responsive ----- */
@media (max-width: 600px) {
  .bd-page { padding: 24px 16px 56px; }
  .bd-card { padding: 28px 22px; border-radius: 20px; }
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  .bd-rating { gap: 6px; }
  .bd-rating__option { padding: 12px 4px 10px; }
  .bd-rating__num { font-size: 18px; }
  .bd-rating__lbl { font-size: 10px; }
  .bd-btn { width: 100%; }
  .bd-form-footer { flex-direction: column; }
  .bd-service { padding: 18px 16px 20px; }
  html.bd-embed .bd-card { padding: 24px 18px; }
  .bd-matrix table { font-size: 13px; }
  .bd-matrix th, .bd-matrix td { padding: 8px 6px; }
}
