/**
 * Ferretly Help Center — Stonly KB CSS pack
 * Domain: help.ferretly.com
 *
 * INSTALL
 * 1. Stonly → Knowledge base settings → Advanced / Custom CSS & HTML
 *    (see: https://stonly.com/kb/guide/en/customize-a-knowledge-base-with-css-and-html-qUlvzbsgQw/Steps/27522)
 * 2. Paste this entire file into Custom CSS.
 * 3. Preview on a private/internal guide first, then publish KB theme if required.
 * 4. Prefer stable selectors: .ston-*, .step-content-wrap, aside.tip / aside.warning
 *    Do NOT depend on hashed classes like ContentText__StyledUnsafeHtml-sc-xxxxx
 *
 * CONTENT CONVENTIONS (so styles apply)
 * - Tips:     <aside class="tip">...</aside>
 * - Warnings: <aside class="warning">...</aside>
 * - Notes:    <aside class="note">...</aside>   (custom; styled below)
 * - UI labels in prose: <strong class="ui">Run Check</strong>
 * - "Ready when" boxes: <div class="kb-ready">...</div>
 * - Related link row:   <p class="kb-related"><a href="...">Title</a> ...</p>
 * - Figure caption:     <p class="kb-caption"><span class="kb-tag">Figure</span> ...</p>
 * - Checklist:          <ul class="kb-checklist"><li>...</li></ul>
 *
 * SCOPE
 * Styles the public knowledge base reader. In-app tooltips/widgets use a different
 * surface and are only lightly affected (if at all).
 */

/* =============================================================================
   1. Design tokens
   ============================================================================= */

:root {
  /* Brand (aligned with ferretly.com / help chrome) */
  --f-brand: #4457ff;
  --f-brand-dark: #3346e0;
  --f-brand-soft: #eff4fe;
  --f-brand-mid: #c5cdff;

  /* Ink */
  --f-ink-900: #1c1a24;
  --f-ink-800: #26282e;
  --f-ink-700: #3d3f47;
  --f-ink-600: #5d6169;
  --f-ink-500: #8b8e95;
  --f-ink-300: #d3d5da;
  --f-ink-200: #e3e5e9;
  --f-ink-100: #f0f1f3;
  --f-ink-50: #f8f8f9;
  --f-white: #ffffff;

  /* Semantic */
  --f-tip-border: #4457ff;
  --f-tip-bg: rgba(68, 87, 255, 0.08);
  --f-warn-border: #e07a2f;
  --f-warn-bg: rgba(224, 122, 47, 0.1);
  --f-danger-border: #e04b4b;
  --f-danger-bg: rgba(224, 75, 75, 0.08);
  --f-note-border: #7c5cbf;
  --f-note-bg: rgba(124, 92, 191, 0.08);
  --f-ok-border: #1f9d6a;
  --f-ok-bg: rgba(31, 157, 106, 0.1);

  /* Type */
  --f-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  --f-text-size: 16.5px;
  --f-text-lh: 1.65;
  --f-measure: 42rem;

  /* Chrome */
  --f-radius: 10px;
  --f-radius-sm: 6px;
  --f-shadow: 0 1px 2px rgba(28, 26, 36, 0.06), 0 8px 24px rgba(28, 26, 36, 0.04);
}

/* =============================================================================
   2. Base page / KB shell (light touch)
   ============================================================================= */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soften full-page background slightly without fighting layout */
.kb-guide,
[class*="kb-guide"] {
  /* keep default structure; brand accent only where safe */
}

/* =============================================================================
   3. Guide header & breadcrumbs
   ============================================================================= */

.ston-kb-guide-header,
.ston-content-summary-header {
  letter-spacing: -0.02em;
}

.ston-breadcrumbs,
.ston-breadcrumb-list,
.ston-breadcrumb-link {
  font-size: 13px;
}

.ston-breadcrumb-link {
  color: var(--f-ink-600);
  text-decoration: none;
}

.ston-breadcrumb-link:hover {
  color: var(--f-brand);
}

/* =============================================================================
   4. Step body — primary reading surface
   ============================================================================= */

.step-content-wrap .ston-content-text,
.step-content-wrap .content-text,
.ston-content-text,
.content-text {
  font-family: var(--f-font);
  font-size: var(--f-text-size);
  line-height: var(--f-text-lh);
  color: var(--f-ink-700);
  letter-spacing: 0.01em;
  max-width: var(--f-measure);
}

/* Headings inside step content */
.step-content-wrap .ston-content-text h1,
.step-content-wrap .ston-content-text h2,
.step-content-wrap .ston-content-text h3,
.step-content-wrap .ston-content-text h4,
.step-content-wrap .ston-content-text h5,
.ston-content-text h1,
.ston-content-text h2,
.ston-content-text h3,
.ston-content-text h4,
.ston-content-text h5 {
  color: var(--f-ink-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-weight: 650;
}

.step-content-wrap .ston-content-text h3,
.ston-content-text h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-size: 1.35em;
}

.step-content-wrap .ston-content-text h4,
.ston-content-text h4 {
  margin-top: 1.25em;
  margin-bottom: 0.4em;
  font-size: 1.15em;
}

.step-content-wrap .ston-content-text h5,
.ston-content-text h5 {
  margin-top: 1em;
  margin-bottom: 0.35em;
  font-size: 1.05em;
  font-weight: 700;
}

/* Paragraphs & lists */
.step-content-wrap .ston-content-text p,
.ston-content-text p {
  margin-top: 0;
  margin-bottom: 0.85em;
}

.step-content-wrap .ston-content-text ul,
.step-content-wrap .ston-content-text ol,
.ston-content-text ul,
.ston-content-text ol {
  margin: 0.4em 0 1em;
  padding-left: 1.35em;
}

.step-content-wrap .ston-content-text li,
.ston-content-text li {
  margin: 0.35em 0;
  padding-left: 0.15em;
}

.step-content-wrap .ston-content-text li::marker,
.ston-content-text li::marker {
  color: var(--f-brand);
}

/* Links */
.step-content-wrap .ston-content-text a,
.ston-content-text a {
  color: var(--f-brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--f-brand) 45%, transparent);
}

.step-content-wrap .ston-content-text a:hover,
.ston-content-text a:hover {
  color: var(--f-brand-dark);
  text-decoration-color: var(--f-brand-dark);
}

/* Bold / emphasis */
.step-content-wrap .ston-content-text strong,
.step-content-wrap .ston-content-text b,
.ston-content-text strong,
.ston-content-text b {
  color: var(--f-ink-900);
  font-weight: 700;
}

/* Inline code */
.step-content-wrap .ston-content-text code:not([data-type="code-block"]),
.ston-content-text code:not([data-type="code-block"]) {
  font-family: var(--f-mono);
  font-size: 0.9em;
  color: var(--f-ink-800);
  background: var(--f-ink-50);
  border: 1px solid var(--f-ink-200);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Horizontal rules */
.step-content-wrap .ston-content-text hr,
.ston-content-text hr,
.ston-horizontal-rule {
  border: 0;
  border-top: 1px solid var(--f-ink-200);
  margin: 1.5em 0;
}

/* Images in content */
.step-content-wrap .ston-content-text img,
.ston-content-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--f-radius);
  border: 1px solid var(--f-ink-200);
  box-shadow: var(--f-shadow);
  margin: 0.75em 0 0.35em;
}

/* =============================================================================
   5. Callouts — tip / warning / note / danger
   Stonly ships tip + warning; note/danger are conventions for authors.
   ============================================================================= */

.step-content-wrap .ston-content-text aside.tip,
.step-content-wrap .ston-content-text aside.warning,
.step-content-wrap .ston-content-text aside.note,
.step-content-wrap .ston-content-text aside.danger,
.ston-content-text aside.tip,
.ston-content-text aside.warning,
.ston-content-text aside.note,
.ston-content-text aside.danger,
.content-text aside.tip,
.content-text aside.warning,
.content-text aside.note,
.content-text aside.danger {
  position: relative;
  border-radius: var(--f-radius) !important;
  padding: 12px 16px 12px 18px !important;
  margin: 1em 0 !important;
  min-height: 0 !important;
  border-left-width: 4px !important;
  border-left-style: solid !important;
  box-shadow: none;
  overflow: hidden;
}

.step-content-wrap .ston-content-text aside.tip,
.ston-content-text aside.tip,
.content-text aside.tip {
  background: var(--f-tip-bg) !important;
  border-left-color: var(--f-tip-border) !important;
  color: var(--f-ink-800) !important;
}

.step-content-wrap .ston-content-text aside.warning,
.ston-content-text aside.warning,
.content-text aside.warning {
  background: var(--f-warn-bg) !important;
  border-left-color: var(--f-warn-border) !important;
  color: var(--f-ink-800) !important;
}

.step-content-wrap .ston-content-text aside.note,
.ston-content-text aside.note,
.content-text aside.note {
  background: var(--f-note-bg) !important;
  border-left-color: var(--f-note-border) !important;
  color: var(--f-ink-800) !important;
}

.step-content-wrap .ston-content-text aside.danger,
.ston-content-text aside.danger,
.content-text aside.danger {
  background: var(--f-danger-bg) !important;
  border-left-color: var(--f-danger-border) !important;
  color: var(--f-ink-800) !important;
}

.step-content-wrap .ston-content-text aside p,
.ston-content-text aside p,
.content-text aside p {
  margin: 0 !important;
  font-size: 0.96em;
  line-height: 1.55;
}

.step-content-wrap .ston-content-text aside p + p,
.ston-content-text aside p + p {
  margin-top: 0.5em !important;
}

/* Optional label line authors can use: <p><strong>Tip:</strong> ...</p> */
.step-content-wrap .ston-content-text aside > p:first-child > strong:first-child,
.ston-content-text aside > p:first-child > strong:first-child {
  display: inline;
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.35em;
  vertical-align: 0.05em;
}

.step-content-wrap .ston-content-text aside.tip > p:first-child > strong:first-child,
.ston-content-text aside.tip > p:first-child > strong:first-child {
  color: var(--f-brand-dark);
}

.step-content-wrap .ston-content-text aside.warning > p:first-child > strong:first-child,
.ston-content-text aside.warning > p:first-child > strong:first-child {
  color: #b35f14;
}

/* Soften Stonly's default thick icon rail if present */
.step-content-wrap .ston-content-text aside.tip:before,
.step-content-wrap .ston-content-text aside.warning:before {
  /* keep product icons if Stonly injects them; don't force remove */
  opacity: 0.95;
}

/* =============================================================================
   6. Tables (statuses, troubleshooting, matrices)
   ============================================================================= */

.step-content-wrap .ston-content-text table,
.ston-content-text table,
.content-text table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.45;
  margin: 0.75em 0 1.25em;
  border: 1px solid var(--f-ink-200);
  border-radius: var(--f-radius);
  overflow: hidden;
  background: var(--f-white);
}

.step-content-wrap .ston-content-text thead,
.ston-content-text thead {
  background: var(--f-ink-50);
}

.step-content-wrap .ston-content-text th,
.ston-content-text th {
  text-align: left;
  font-size: 0.78em;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--f-ink-600);
  padding: 10px 12px;
  border-bottom: 1px solid var(--f-ink-200);
  background: var(--f-ink-50);
}

.step-content-wrap .ston-content-text td,
.ston-content-text td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--f-ink-200);
  border-right: 1px solid var(--f-ink-100);
  color: var(--f-ink-700);
  vertical-align: top;
}

.step-content-wrap .ston-content-text tr:last-child td,
.ston-content-text tr:last-child td {
  border-bottom: 0;
}

.step-content-wrap .ston-content-text tbody tr:nth-child(even),
.ston-content-text tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--f-brand-soft) 35%, var(--f-white));
}

.step-content-wrap .ston-content-text tbody tr:hover,
.ston-content-text tbody tr:hover {
  background: var(--f-brand-soft);
}

/* =============================================================================
   7. Author helper classes (add in step HTML when needed)
   ============================================================================= */

/* UI control labels in prose: click <strong class="ui">Run Check</strong> */
.step-content-wrap .ston-content-text strong.ui,
.ston-content-text strong.ui,
.step-content-wrap .ston-content-text .ui,
.ston-content-text .ui {
  display: inline-block;
  font-weight: 700;
  color: var(--f-ink-900);
  background: var(--f-ink-100);
  border: 1px solid var(--f-ink-200);
  border-radius: var(--f-radius-sm);
  padding: 0.05em 0.4em;
  font-size: 0.94em;
  line-height: 1.4;
  white-space: nowrap;
}

/* Success / "you're ready when" */
.step-content-wrap .ston-content-text .kb-ready,
.ston-content-text .kb-ready {
  margin: 1em 0;
  padding: 12px 14px;
  border-radius: var(--f-radius);
  background: var(--f-ok-bg);
  border: 1px solid color-mix(in srgb, var(--f-ok-border) 35%, transparent);
  color: var(--f-ink-800);
  font-size: 0.96em;
  line-height: 1.5;
}

.step-content-wrap .ston-content-text .kb-ready strong,
.ston-content-text .kb-ready strong {
  color: #0f6b47;
}

/* Related article chips */
.step-content-wrap .ston-content-text .kb-related,
.ston-content-text .kb-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.75em 0 1em;
  padding: 0;
}

.step-content-wrap .ston-content-text .kb-related a,
.ston-content-text .kb-related a {
  display: inline-block;
  font-size: 0.88em;
  font-weight: 650;
  text-decoration: none !important;
  color: var(--f-brand-dark) !important;
  background: var(--f-brand-soft);
  border: 1px solid var(--f-brand-mid);
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1.3;
}

.step-content-wrap .ston-content-text .kb-related a:hover,
.ston-content-text .kb-related a:hover {
  background: color-mix(in srgb, var(--f-brand) 14%, var(--f-white));
  border-color: var(--f-brand);
}

/* Figure captions under screenshots */
.step-content-wrap .ston-content-text .kb-caption,
.ston-content-text .kb-caption {
  margin: 0.25em 0 1.1em;
  font-size: 0.86em;
  line-height: 1.45;
  color: var(--f-ink-600);
}

.step-content-wrap .ston-content-text .kb-caption .kb-tag,
.ston-content-text .kb-caption .kb-tag {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--f-brand-dark);
  background: var(--f-brand-soft);
  border: 1px solid var(--f-brand-mid);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 0.45em;
  vertical-align: 0.05em;
}

/* Checklist (first-week / success lists) */
.step-content-wrap .ston-content-text ul.kb-checklist,
.ston-content-text ul.kb-checklist {
  list-style: none;
  padding-left: 0;
  margin: 0.5em 0 1em;
  border: 1px solid var(--f-ink-200);
  border-radius: var(--f-radius);
  background: var(--f-white);
  overflow: hidden;
}

.step-content-wrap .ston-content-text ul.kb-checklist > li,
.ston-content-text ul.kb-checklist > li {
  position: relative;
  margin: 0;
  padding: 10px 12px 10px 36px;
  border-bottom: 1px solid var(--f-ink-100);
  color: var(--f-ink-700);
}

.step-content-wrap .ston-content-text ul.kb-checklist > li:last-child,
.ston-content-text ul.kb-checklist > li:last-child {
  border-bottom: 0;
}

.step-content-wrap .ston-content-text ul.kb-checklist > li::before,
.ston-content-text ul.kb-checklist > li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--f-ink-300);
  background: var(--f-white);
}

/* Step intro lead */
.step-content-wrap .ston-content-text .kb-lede,
.ston-content-text .kb-lede {
  font-size: 1.05em;
  color: var(--f-ink-700);
  margin-bottom: 1em;
}

/* Status chips in tables or prose */
.step-content-wrap .ston-content-text .kb-status,
.ston-content-text .kb-status {
  display: inline-block;
  font-size: 0.8em;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--f-brand-soft);
  color: var(--f-brand-dark);
  border: 1px solid var(--f-brand-mid);
  white-space: nowrap;
}

.step-content-wrap .ston-content-text .kb-status.is-ok,
.ston-content-text .kb-status.is-ok {
  background: var(--f-ok-bg);
  color: #0f6b47;
  border-color: color-mix(in srgb, var(--f-ok-border) 40%, transparent);
}

.step-content-wrap .ston-content-text .kb-status.is-warn,
.ston-content-text .kb-status.is-warn {
  background: var(--f-warn-bg);
  color: #9a5410;
  border-color: color-mix(in srgb, var(--f-warn-border) 40%, transparent);
}

.step-content-wrap .ston-content-text .kb-status.is-queue,
.ston-content-text .kb-status.is-queue {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

/* =============================================================================
   8. Media / illustration pane
   ============================================================================= */

.ston-illustration-canvas img,
.ston-guide-media-canvas img,
.ston-illustration img {
  border-radius: var(--f-radius);
}

/* Prefer tighter media chrome when present */
.ston-guide-media-canvas {
  /* leave layout alone; only visual polish if needed */
}

/* =============================================================================
   9. Footer / next steps / progress bar
   Default Stonly step progress uses green #00A37A. Recolor to Ferretly blue.
   Stable hooks: .ston-progress-bar-*, .progressBar-*, [data-cy="progressBar"]
   ============================================================================= */

/* --- Option A (default): brand blue progress --- */

/* Filled portion of the bar */
.ston-progress-bar-bar,
.progressBar-bar,
[data-cy="progressBar"] .ston-progress-bar-bar,
[data-cy="progressBar"] [class*="ProgressBar__Bar"],
.ston-progress-bar [role="progressbar"] {
  background-color: var(--f-brand) !important;
  background: var(--f-brand) !important;
}

/* Track / remaining line (Stonly uses green @ 30% opacity on the line) */
.ston-progress-bar-line,
.progressBar-line,
[data-cy="progressBar"] .ston-progress-bar-line,
[data-cy="progressBar"] [class*="ProgressBar__Line"],
.ston-progress-bar-wrap .ston-progress-bar-line {
  background-color: var(--f-brand) !important;
  background: var(--f-brand) !important;
  opacity: 0.22 !important;
}

/* % tooltip chip (usually hidden until hover; still recolor) */
.ston-progress-bar-text,
.progressBar-text,
[data-cy="progressBar"] .ston-progress-bar-text,
[data-cy="progressBar"] [class*="ProgressBar__Text"] {
  background-color: var(--f-brand) !important;
  background: var(--f-brand) !important;
  color: var(--f-white) !important;
}

/* Extra-specific overrides for footer-wide bar */
.ston-steps-footer .ston-progress-bar-bar,
.ston-steps-footer-wrapper .ston-progress-bar-bar,
.ston-steps-footer .progressBar-bar,
.ston-progress-bar-wrap .ston-progress-bar-bar {
  background-color: var(--f-brand) !important;
  background: var(--f-brand) !important;
}

.ston-steps-footer .ston-progress-bar-line,
.ston-steps-footer-wrapper .ston-progress-bar-line,
.ston-steps-footer .progressBar-line {
  background-color: var(--f-brand) !important;
  opacity: 0.22 !important;
}

/* Kill any residual green if Stonly sets it via non-class styles */
.ston-progress-bar-wrap [style*="00A37A"],
.ston-progress-bar [style*="00A37A"],
.progressBar [style*="00A37A"] {
  /* inline styles may still win; class !important above covers normal case */
}

/*
  --- Option B: hide progress bar entirely ---
  To remove the bar instead of recoloring it, uncomment the rules below
  (delete the surrounding comment markers on the block).

.ston-progress-bar-wrap,
.ston-progress-bar,
[data-cy="progressBar"],
.ston-steps-footer .ston-progress-bar-wrap {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}
*/

/* Next/back button hover affordance where classes are stable */
.ston-steps-footer button,
.stepBottomButtons button {
  border-radius: 999px !important;
}

/* =============================================================================
   10. Search
   ============================================================================= */

.ston-search-input,
.ston-search-input-wrap input {
  border-radius: 999px;
}

.ston-search-button {
  border-radius: 999px;
}

/* =============================================================================
   11. Blockquotes (non-callout)
   ============================================================================= */

.step-content-wrap .ston-content-text blockquote.ston-blockquote:not(.tip):not(.warning),
.ston-content-text blockquote.ston-blockquote:not(.tip):not(.warning) {
  border-left: 4px solid var(--f-ink-300) !important;
  background: var(--f-ink-50);
  border-radius: 0 var(--f-radius) var(--f-radius) 0;
  color: var(--f-ink-700);
  padding: 12px 16px !important;
  margin: 1em 0 !important;
}

/* =============================================================================
   12. Accessibility & focus
   ============================================================================= */

.step-content-wrap .ston-content-text a:focus-visible,
.ston-content-text a:focus-visible,
.ston-breadcrumb-link:focus-visible,
.ston-search-input:focus-visible {
  outline: 2px solid var(--f-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================================
   13. Mobile
   ============================================================================= */

@media (max-width: 720px) {
  .step-content-wrap .ston-content-text,
  .ston-content-text,
  .content-text {
    font-size: 16px;
    max-width: none;
  }

  .step-content-wrap .ston-content-text table,
  .ston-content-text table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .step-content-wrap .ston-content-text .kb-related a,
  .ston-content-text .kb-related a {
    font-size: 0.85em;
  }

  .step-content-wrap .ston-content-text strong.ui,
  .ston-content-text strong.ui {
    white-space: normal;
  }
}

/* =============================================================================
   14. Print (download/PDF-ish reading)
   ============================================================================= */

@media print {
  .ston-search-bar,
  .ston-steps-footer,
  .ston-progress-bar-wrap,
  .ston-mobile-menu-toggle {
    display: none !important;
  }

  .step-content-wrap .ston-content-text,
  .ston-content-text {
    max-width: none;
    color: #000;
    font-size: 11pt;
  }

  .step-content-wrap .ston-content-text a,
  .ston-content-text a {
    color: #000;
    text-decoration: underline;
  }

  .step-content-wrap .ston-content-text aside,
  .ston-content-text aside {
    break-inside: avoid;
  }
}

/* =============================================================================
   15. Optional: hide empty KB chrome if needed (commented — enable carefully)
   ============================================================================= */

/*
.ston-content-summary:empty {
  display: none;
}
*/
