/* FieldMate docs — scoped styles. Everything lives under .fm-doc,
   so it won't touch the rest of the site. Override the tokens to match your brand.
   .fm-doc-page is the opt-in <body> class for the standalone pages; host pages
   that embed only <main class="fm-doc"> are unaffected. */
.fm-doc-page, .fm-doc {
  --fm-ink: #1f2b2d;
  --fm-muted: #5b6a6d;
  --fm-on-muted: #fff;
  --fm-line: #d9e0e1;
  --fm-bg: #ffffff;
  --fm-bg-soft: #f3f6f6;
  --fm-zoleo: #0e6b6b;
  --fm-garmin: #34489a;
  --fm-contact: #8a5a00;
  --fm-alert: #a3362a;
  --fm-todo: #b8860b;
}
.fm-doc {
  color: var(--fm-ink);
  background: var(--fm-bg);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.6;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  box-sizing: border-box;
}
.fm-doc *, .fm-doc *::before, .fm-doc *::after { box-sizing: border-box; }
.fm-doc-page {
  margin: 0;
  background: var(--fm-bg);
  color: var(--fm-ink);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.fm-doc h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .5rem; }
.fm-doc h2 { font-size: 1.35rem; margin: 2.5rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--fm-line); }
.fm-doc h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
.fm-doc p, .fm-doc li { max-width: 40rem; }
.fm-doc .fm-lead { font-size: 1.15rem; color: var(--fm-muted); margin-bottom: 2rem; }
.fm-doc code { background: var(--fm-bg-soft); padding: .1em .35em; border-radius: 4px; font-size: .92em; word-break: break-all; }
.fm-doc a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fm-doc a:focus-visible { outline: 2px solid var(--fm-ink); outline-offset: 2px; }

/* Top navigation between pages */
.fm-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .95rem; margin-bottom: 2rem; padding-bottom: .75rem; border-bottom: 1px solid var(--fm-line); }
.fm-nav a { text-decoration: none; color: var(--fm-muted); }
.fm-nav a[aria-current="page"] { color: var(--fm-ink); font-weight: 600; }

/* Path marker: tells the reader which guide they are in */
.fm-path { display: inline-block; font-size: .9rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; color: #fff; margin-bottom: .75rem; }
.fm-path--zoleo { background: var(--fm-zoleo); }
.fm-path--garmin { background: var(--fm-garmin); }
.fm-path--contact { background: var(--fm-contact); }
.fm-path--shared { background: var(--fm-muted); color: var(--fm-on-muted); }

/* Start page: three entry points */
.fm-choose { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; }
.fm-choose a { display: block; text-decoration: none; padding: 1.1rem 1.25rem; border: 1px solid var(--fm-line); border-left-width: 6px; border-radius: 6px; }
.fm-choose a:hover { background: var(--fm-bg-soft); }
.fm-choose strong { display: block; font-size: 1.15rem; margin-bottom: .2rem; }
.fm-choose span { color: var(--fm-muted); }
.fm-choose .fm-go--zoleo { border-left-color: var(--fm-zoleo); }
.fm-choose .fm-go--garmin { border-left-color: var(--fm-garmin); }
.fm-choose .fm-go--contact { border-left-color: var(--fm-contact); }

/* Step lists: real sequences only */
.fm-steps { counter-reset: fm-step; list-style: none; padding: 0; }
.fm-steps > li { counter-increment: fm-step; position: relative; padding-left: 2.5rem; margin-bottom: 1rem; }
.fm-steps > li::before { content: counter(fm-step); position: absolute; left: 0; top: .05rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--fm-ink); color: #fff; font-size: .9rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* Checklist */
.fm-check { list-style: none; padding: 0; }
.fm-check li { padding-left: 1.75rem; position: relative; margin-bottom: .4rem; }
.fm-check li::before { content: "✓"; position: absolute; left: .2rem; color: var(--fm-zoleo); font-weight: 700; }

/* Callouts */
.fm-note, .fm-alert, .fm-todo { padding: .85rem 1rem; border-radius: 6px; margin: 1.25rem 0; }
.fm-note { background: var(--fm-bg-soft); }
.fm-alert { background: #fbeeec; border-left: 4px solid var(--fm-alert); }
.fm-todo { background: #fff6dd; border: 1px dashed var(--fm-todo); font-size: .95rem; }
.fm-todo::before { content: "TODO for editor — remove before publishing: "; font-weight: 700; }
.fm-note > :last-child, .fm-alert > :last-child, .fm-todo > :last-child { margin-bottom: 0; }

/* Tables scroll inside their own box on phones */
.fm-table { overflow-x: auto; margin: 1rem 0; }
.fm-table table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .95rem; }
.fm-table th, .fm-table td { text-align: left; vertical-align: top; padding: .55rem .75rem; border-bottom: 1px solid var(--fm-line); }
.fm-table th { background: var(--fm-bg-soft); }

/* Screenshots: images already have rounded corners and a border baked in */
.fm-shot { margin: 1.25rem 0 1.5rem; }
.fm-shot img { display: block; max-width: 100%; height: auto; }
.fm-shot--phone img { max-width: min(100%, 320px); }
.fm-shot--dialog img { max-width: min(100%, 440px); }
.fm-shot figcaption { font-size: .9rem; color: var(--fm-muted); margin-top: .4rem; }

/* Next-step link at the bottom of a page */
.fm-next { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--fm-line); }

/* Explicit portal preference overrides the OS; without JS use the OS. */
:root[data-theme="dark"] .fm-doc-page, :root[data-theme="dark"] .fm-doc {
  --fm-ink:#e6ecec; --fm-muted:#9fb0b2; --fm-on-muted:#1f2b2d;
  --fm-line:#34403f; --fm-bg:#141d1d; --fm-bg-soft:#1f2a2a;
  color-scheme:dark;
}
:root[data-theme="dark"] .fm-steps > li::before { background:#e6ecec; color:#1f2b2d; }
:root[data-theme="dark"] .fm-alert { background:#3a2220; }
:root[data-theme="dark"] .fm-todo { background:#3a3010; }
:root[data-theme="dark"] .fm-check li::before { color:#79c9bc; }
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-doc-page,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-doc {
    --fm-ink:#e6ecec; --fm-muted:#9fb0b2; --fm-on-muted:#1f2b2d;
    --fm-line:#34403f; --fm-bg:#141d1d; --fm-bg-soft:#1f2a2a;
    color-scheme:dark;
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-steps > li::before { background:#e6ecec; color:#1f2b2d; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-alert { background:#3a2220; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-todo { background:#3a3010; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .fm-check li::before { color:#79c9bc; }
}
.fm-header { max-width:44rem; margin:0 auto; padding:1rem 1.25rem 0; box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; gap:1rem; color:var(--fm-muted); }
.fm-header a { color:var(--fm-ink); font-weight:700; text-decoration:none; }
.fm-header a:focus-visible, .fm-skip:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.fm-skip { position:absolute; left:1rem; top:0; transform:translateY(-110%); background:var(--fm-bg); color:var(--fm-ink); padding:.5rem; z-index:1; }
.fm-skip:focus { transform:translateY(0); }
.fm-doc :is(h2,h3) { scroll-margin-top:1rem; }
@media(max-width:480px) { .fm-doc h1 { font-size:1.65rem; } }
