/* Oligoscan Processor plugin (theme-aware colors only) */
body.pagelayer-body .oligoscan-processor-wrap {
  --osp-bg: var(--color-page-background);
  --osp-card: var(--bf-wpdt-surface-bg);
  --osp-border: var(--bf-wpdt-border);
  --osp-text: var(--color-page-text);
  --osp-muted: rgba(74, 97, 120, 0.78);
  --osp-primary: var(--color-brand-500);
  --osp-primary-2: #7198bf;
  --osp-success: #33c38e;
  --osp-error: #ff6767;
  --osp-shadow: var(--shadow-shadow-lg);
  --osp-spinner-track: rgba(10, 13, 18, 0.18);
}

html[data-theme="dark"] body.pagelayer-body .oligoscan-processor-wrap {
  --osp-muted: rgba(198, 211, 230, 0.75);
  --osp-primary-2: #84b9e3;
  --osp-spinner-track: rgba(255, 255, 255, 0.25);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] body.pagelayer-body .oligoscan-processor-wrap {
    --osp-muted: rgba(198, 211, 230, 0.75);
    --osp-primary-2: #84b9e3;
    --osp-spinner-track: rgba(255, 255, 255, 0.25);
  }
}

/* Override the plugin's remaining hard-coded colors so light theme remains readable. */
body.pagelayer-body .oligoscan-processor-wrap .osp-btn {
  background: var(--osp-card) !important;
  color: var(--osp-text) !important;
  border-color: var(--osp-border) !important;
}

body.pagelayer-body .oligoscan-processor-wrap .osp-btn:hover {
  background: var(--osp-primary) !important;
  border-color: var(--osp-primary) !important;
  color: var(--color-base-white) !important;
}

body.pagelayer-body .oligoscan-processor-wrap .osp-btn--primary {
  color: var(--color-base-black) !important;
}

body.pagelayer-body .oligoscan-processor-wrap .osp-spinner {
  border-color: var(--osp-spinner-track) !important;
  border-top-color: var(--osp-primary) !important;
}

/* Oligoscan Processor options panel background (theme-aware) */
body.pagelayer-body .osp-options {
  background: var(--color-page-background) !important;
}


/* Oligoscan PDF Processor information panel */
.bf-osp-info {
  color-scheme: light dark;
  --bf-osp-surface: #fffdfa;
  --bf-osp-soft: #f7f9fc;
  --bf-osp-text: #233241;
  --bf-osp-muted: #5f7183;
  --bf-osp-line: #dbe4ee;
  --bf-osp-blue: #3f73a6;
  --bf-osp-blue-soft: #eaf2fb;
  --bf-osp-amber: #d79421;
  --bf-osp-shadow: 0 0 0 1px rgba(35, 50, 65, 0.07), 0 8px 24px rgba(35, 50, 65, 0.05);
  --bf-osp-icon-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-8 9-4.5-1.5-8-4-8-9V5l8-3 8 3v8Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --bf-osp-icon-report: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M8 13h2M8 17h2M14 13h2M14 17h2'/%3E%3C/svg%3E");
  --bf-osp-icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23233241' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.7 18-8-14a2 2 0 0 0-3.4 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
  --bf-osp-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
  max-width: 1120px;
  margin: 0 auto 22px;
  color: var(--bf-osp-text);
  font-family: "Inter", "Source Sans Pro", "Segoe UI", Arial, sans-serif;
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[data-theme="dark"] .bf-osp-info {
  color-scheme: dark;
  --bf-osp-surface: #182226;
  --bf-osp-soft: #20292d;
  --bf-osp-text: #edf4f2;
  --bf-osp-muted: #aebdc4;
  --bf-osp-line: #3d484d;
  --bf-osp-blue: #80b8f7;
  --bf-osp-blue-soft: #1d2c38;
  --bf-osp-amber: #e0aa47;
  --bf-osp-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .bf-osp-info,
  html:not([data-theme]) .bf-osp-info {
    color-scheme: dark;
    --bf-osp-surface: #182226;
    --bf-osp-soft: #20292d;
    --bf-osp-text: #edf4f2;
    --bf-osp-muted: #aebdc4;
    --bf-osp-line: #3d484d;
    --bf-osp-blue: #80b8f7;
    --bf-osp-blue-soft: #1d2c38;
    --bf-osp-amber: #e0aa47;
    --bf-osp-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09);
  }
}
.bf-osp-info *,
.bf-osp-info *::before,
.bf-osp-info *::after {
  box-sizing: border-box;
}
.bf-osp-info h2,
.bf-osp-info strong {
  color: var(--bf-osp-text) !important;
}
.bf-osp-info p,
.bf-osp-info li {
  color: var(--bf-osp-muted) !important;
  text-wrap: pretty;
}
.bf-osp-info a {
  color: var(--bf-osp-blue) !important;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
.bf-osp-info a:focus-visible,
.bf-osp-more summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bf-osp-blue) 38%, transparent);
  outline-offset: 3px;
}
.bf-osp-version {
  display: table;
  margin: 0 auto 24px !important;
  padding: 6px 12px;
  color: var(--bf-osp-blue) !important;
  background: var(--bf-osp-blue-soft);
  border-radius: 7px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bf-osp-blue) 20%, transparent), 0 3px 10px rgba(35, 50, 65, 0.06);
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 0;
}
.bf-osp-version span,
.bf-osp-version strong {
  color: inherit !important;
}
.bf-osp-version span {
  display: inline-block;
  margin-right: 0.22rem;
}
.bf-osp-version strong {
  font-variant-numeric: tabular-nums;
}
.bf-osp-disclaimer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bf-osp-blue) 9%, var(--bf-osp-surface)), var(--bf-osp-surface));
  border-radius: 8px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bf-osp-blue) 24%, transparent), 0 7px 20px rgba(35, 50, 65, 0.05);
}
.bf-osp-icon {
  display: block;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  background-color: var(--bf-osp-blue);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 19px 19px;
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.bf-osp-icon--shield {
  width: 42px;
  height: 42px;
  background-image: var(--bf-osp-icon-shield);
  background-size: 22px 22px;
}
.bf-osp-icon--report { background-image: var(--bf-osp-icon-report); }
.bf-osp-icon--warning {
  background-color: var(--bf-osp-amber);
  background-image: var(--bf-osp-icon-warning);
}
.bf-osp-icon--info {
  width: 28px;
  height: 28px;
  background-image: var(--bf-osp-icon-info);
  background-size: 15px 15px;
  border-radius: 50%;
}
.bf-osp-disclaimer h2,
.bf-osp-card-header h2 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}
.bf-osp-disclaimer p {
  margin: 5px 0 0 !important;
  font-size: 0.95rem;
}
.bf-osp-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.42fr);
  gap: 18px;
  align-items: stretch;
}
.bf-osp-card {
  padding: 20px;
  background: var(--bf-osp-surface);
  border-radius: 8px;
  box-shadow: var(--bf-osp-shadow);
}
.bf-osp-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}
.bf-osp-card > p {
  margin: 0 0 16px !important;
  font-size: 0.94rem;
}
.bf-osp-check-list,
.bf-osp-number-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bf-osp-check-list {
  display: grid;
  gap: 13px;
}
.bf-osp-check-list li {
  position: relative;
  margin: 0;
  padding-left: 27px;
  font-size: 0.91rem;
}
.bf-osp-check-list li::before {
  content: "";
  position: absolute;
  top: 0.17rem;
  left: 0;
  width: 17px;
  height: 17px;
  background-color: var(--bf-osp-blue);
  border-radius: 50%;
}
.bf-osp-check-list li::after {
  content: "";
  position: absolute;
  top: 0.41rem;
  left: 4px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--bf-osp-surface);
  border-left: 2px solid var(--bf-osp-surface);
  transform: rotate(-45deg);
}
.bf-osp-more {
  margin-top: 18px;
}
.bf-osp-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--bf-osp-text);
  background: var(--bf-osp-soft);
  border-radius: 7px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bf-osp-line) 90%, transparent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 750;
  list-style: none;
  transition-property: color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.bf-osp-more summary::-webkit-details-marker { display: none; }
.bf-osp-more summary span {
  margin-left: 18px;
  color: var(--bf-osp-blue);
  font-size: 1.05rem;
  transition-property: transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.bf-osp-more summary:hover,
.bf-osp-more summary:focus-visible {
  color: var(--bf-osp-blue);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bf-osp-blue) 34%, transparent);
}
.bf-osp-more[open] summary span { transform: rotate(90deg); }
.bf-osp-more div {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bf-osp-line);
}
.bf-osp-more p {
  margin: 0 !important;
  font-size: 0.9rem;
}
.bf-osp-number-list {
  counter-reset: bf-osp-notes;
  display: grid;
  gap: 10px;
}
.bf-osp-number-list li {
  counter-increment: bf-osp-notes;
  position: relative;
  display: block;
  margin: 0;
  padding-left: 34px;
  font-size: 0.88rem;
}
.bf-osp-number-list li::before {
  content: counter(bf-osp-notes);
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fff;
  background: var(--bf-osp-blue);
  border-radius: 50%;
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bf-osp-number-list em {
  color: inherit !important;
}
.bf-osp-privacy {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--bf-osp-soft);
  border-radius: 8px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bf-osp-line) 92%, transparent);
}
.bf-osp-privacy p {
  margin: 2px 0 0 !important;
  font-size: 0.84rem;
  line-height: 1.45;
}
@media (max-width: 860px) {
  .bf-osp-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .bf-osp-version { margin-bottom: 18px !important; }
  .bf-osp-disclaimer {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .bf-osp-icon--shield {
    width: 36px;
    height: 36px;
    background-size: 19px 19px;
  }
  .bf-osp-card { padding: 17px; }
  .bf-osp-card-header { align-items: flex-start; }
  .bf-osp-number-list li { padding-left: 32px; }
  .bf-osp-privacy {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 11px 12px;
  }
  .bf-osp-icon--info {
    width: 24px;
    height: 24px;
    background-size: 13px 13px;
  }
}
