/* AI Ops lesson page: the page's parts, one section each, phone rules beside the part they change.
   The page base, focus ring and top bar come from ../base.css, linked before this file.
   Colour, type, radius and easing come from ../tokens.css; this file states only layout measures. */

/* ---------- Layout shell ---------- */

:root {
  --sidebar-w: 260px;
  --rail-w: 220px;
  --column: 680px;
  --gutter: 32px;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  max-width: 1440px;
  margin: 0 auto;
}
.content {
  min-width: 0;
  padding: 40px var(--gutter) 96px;
}
.article { max-width: var(--column); margin: 0 auto; }

/* Under 1100 the rail folds into the page; under 860 the sidebar becomes a drawer */
@media (max-width: 1099px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}
@media (max-width: 859px) {
  :root { --gutter: 20px; }
  .shell { display: block; }
  .content { padding: 28px var(--gutter) 96px; }
}

/* ---------- Top bar: the lesson's menu button (the bar itself is in ../base.css) ---------- */

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-btn { display: none; }

@media (max-width: 859px) {
  .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    border-radius: var(--aiops-radius-control);
    color: var(--aiops-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-btn .x { display: none; }
  .nav-toggle:checked ~ .topbar .menu-btn .bars { display: none; }
  .nav-toggle:checked ~ .topbar .menu-btn .x { display: block; }
  .nav-toggle:focus-visible ~ .topbar .menu-btn { outline: 2px solid var(--aiops-text); outline-offset: 2px; }
}

/* ---------- Sidebar: course, progress, lessons ---------- */

.sidebar {
  position: sticky;
  top: var(--bar-h);
  height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 16px 48px 20px;
  border-right: 1px solid var(--aiops-border);
  scrollbar-width: thin;
  scrollbar-color: var(--aiops-border-strong) transparent;
}
.course-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--aiops-border);
}
.course-head .logo-tile {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--aiops-border);
}
.course-head .logo-tile svg { width: 18px; height: 18px; }
.course-head strong {
  display: block;
  color: var(--aiops-text);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}
.course-head small {
  display: block;
  color: var(--aiops-text-muted);
  font-size: 13px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.course-progress {
  flex-basis: 100%; height: 3px; margin-top: 4px; border-radius: 3px;
  background: var(--aiops-hover); overflow: hidden;
}
.course-progress i { display: block; height: 100%; width: 34.6%; border-radius: 3px; background: var(--aiops-accent); }
.mobile-shelves { display: none; }

.group-label {
  margin: 20px 0 6px;
  padding: 0 8px;
  color: var(--aiops-text);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
}
.group-label span { color: var(--aiops-text-muted); font-weight: 500; margin-right: 4px; font-variant-numeric: tabular-nums; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--aiops-radius-control);
  color: var(--aiops-text-muted);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}
.lessons a:hover { color: var(--aiops-text); }
.lessons a:not([aria-current="page"]):hover { background: var(--aiops-subtle); }
.lessons .n {
  flex: none;
  width: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--aiops-text-faint);
}
.lessons .t { flex: 1; text-wrap: pretty; }
.lessons .done { margin-top: 2px; color: var(--aiops-ok); width: 14px; height: 14px; }
.lessons a[aria-current="page"] {
  background: var(--aiops-accent-tint);
  color: var(--aiops-accent-ink);
  font-weight: 500;
}
.lessons a[aria-current="page"] .n { color: var(--aiops-accent-ink); }

.scrim { display: none; }

@media (max-width: 859px) {
  .sidebar {
    position: fixed;
    z-index: 35;
    top: var(--bar-h);
    left: 0;
    bottom: 0;
    height: auto;
    width: min(320px, 86vw);
    background: var(--aiops-sidebar);
    border-right: 1px solid var(--aiops-border);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 220ms var(--aiops-ease), visibility 0s linear 220ms;
  }
  .scrim {
    display: block;
    position: fixed;
    z-index: 34;
    inset: var(--bar-h) 0 0 0;
    background: var(--aiops-scrim);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms var(--aiops-ease), visibility 0s linear 200ms;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
  .nav-toggle:checked ~ .shell .scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
  body:has(.nav-toggle:checked) { overflow: hidden; }

  .mobile-shelves {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
  }
  .mobile-shelves a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--aiops-border);
    border-radius: 999px;
    color: var(--aiops-text-muted);
    font-size: 14px;
    text-decoration: none;
  }
  .mobile-shelves a[aria-current="page"] { color: var(--aiops-text); background: var(--aiops-hover); border-color: var(--aiops-hover); font-weight: 500; }
  .lessons a { min-height: 40px; padding: 10px 8px; }
}

/* ---------- Article header: breadcrumb, title, lead, facts ---------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--aiops-text-muted);
}
.prose .crumbs a { color: var(--aiops-text-muted); text-decoration: none; transition: color 150ms ease, border-color 150ms ease; }
.prose .crumbs a:hover { color: var(--aiops-text); }
.crumbs .sep { color: var(--aiops-mark); }

h1 {
  margin: 0;
  color: var(--aiops-text);
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.9px;
  text-wrap: balance;
}
.prose .lead {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 28px;
  color: var(--aiops-text-body);
  text-wrap: pretty;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 20px 0 28px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--aiops-border);
  list-style: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--aiops-text-muted);
}
.prose .meta { padding-left: 0; margin: 20px 0 28px; }
.prose .meta li { margin: 0; padding: 0; }
.meta li { display: flex; align-items: flex-start; gap: 6px; }
.meta svg { margin-top: 2px; }
.meta b { color: var(--aiops-text); font-weight: 500; }
.meta .wide { flex-basis: 100%; }
/* Cost as three stars: filled in text colour, empty as an outline in the mark grey */
.meta .cost { align-items: center; }
.meta .stars { display: inline-flex; gap: 1px; margin-left: 6px; vertical-align: -3px; }
/* The stars open the glossary card with the level's meaning; no dot, no underline */
.meta .term.is-cost { display: inline-flex; align-items: center; cursor: help; text-decoration: none; }
.meta .term.is-cost::after { display: none; }
.meta .star { color: var(--aiops-mark); }
.meta .star.on { color: var(--aiops-text); fill: currentColor; }
/* Each fact's icon carries one colour; the words stay neutral */
.meta .c-accent { color: var(--aiops-accent); }
.meta .c-amber { color: var(--aiops-amber); }
.meta .c-ok { color: var(--aiops-ok); }
.meta .c-lane { color: var(--aiops-lane-foundation); }
/* The lane named first in "Adds to your Business OS" picks the hue (Foundation when none is given) */
.meta .c-lane.lane-attract { color: var(--aiops-lane-attract); }
.meta .c-lane.lane-convert { color: var(--aiops-lane-convert); }
.meta .c-lane.lane-deliver { color: var(--aiops-lane-deliver); }
.meta .c-lane.lane-run { color: var(--aiops-lane-run); }
.meta .c-lane.lane-build { color: var(--aiops-lane-build); }

@media (max-width: 1099px) {
  .meta { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 859px) {
  h1 { font-size: 30px; line-height: 36px; letter-spacing: -0.7px; }
  .prose .lead { font-size: 17px; line-height: 27px; }
}

/* ---------- Prose: headings, paragraphs, lists, links, inline code ---------- */

h2 {
  margin: 56px 0 16px;
  color: var(--aiops-text);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.5px;
  text-wrap: balance;
  scroll-margin-top: calc(var(--bar-h) + 24px);
}
.prose p { margin: 0 0 20px; text-wrap: pretty; }
.prose strong { color: var(--aiops-text); font-weight: 600; }
.prose a {
  color: var(--aiops-text);
  text-decoration: underline;
  text-decoration-color: var(--aiops-accent-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease, text-decoration-thickness 150ms ease;
}
.prose a:hover { color: var(--aiops-accent-ink); text-decoration-color: var(--aiops-accent); text-decoration-thickness: 2px; }
.prose ul { margin: 0 0 20px; padding-left: 22px; }
.prose li { margin: 0 0 8px; padding-left: 4px; }
.prose li::marker { color: var(--aiops-mark); }

code {
  font-family: var(--aiops-font-mono);
  font-size: 0.86em;
  color: var(--aiops-text);
  background: var(--aiops-code);
  border: 1px solid var(--aiops-border);
  border-radius: 6px;
  padding: 1px 5px;
  white-space: nowrap;
}

@media (max-width: 859px) {
  h2 { font-size: 22px; line-height: 30px; margin-top: 48px; }
  /* A long path or command may break rather than push the page sideways */
  code { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- Glossary term and card ---------- */

.term {
  position: relative;
  color: inherit;
  cursor: help;
  border-radius: 4px;
  text-decoration: underline dotted transparent 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 150ms var(--aiops-ease);
}
.term code { text-decoration: inherit; text-underline-offset: 4px; }
.term:hover, .term:focus, .term.is-open { text-decoration-color: var(--aiops-accent); }

/* At rest a term has no underline: a small accent dot after the word marks it. */
.term::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--aiops-accent);
  vertical-align: 0.62em;
  opacity: 0.8;
  transition: opacity 150ms var(--aiops-ease), scale 150ms var(--aiops-ease);
}
.term:hover::after, .term:focus::after, .term.is-open::after { opacity: 1; scale: 1.25; }

.gloss {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: 320px;
  padding: 12px 14px;
  background: var(--aiops-surface);
  border-radius: var(--aiops-radius-control);
  box-shadow: var(--aiops-shadow);
  color: var(--aiops-text-body);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  text-wrap: pretty;
  cursor: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 160ms var(--aiops-ease), transform 160ms var(--aiops-ease), visibility 0s linear 160ms;
}
.gloss::after { /* hover bridge */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 12px;
}
.gloss .gl {
  display: block;
  margin-bottom: 2px;
  color: var(--aiops-accent-ink);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.gloss b { display: block; color: var(--aiops-text); font-weight: 600; margin-bottom: 2px; }
.term:hover .gloss,
.term:focus .gloss,
.term.is-open .gloss {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

/* Phone: the card is pinned to the viewport, clear of the corner switcher */
@media (max-width: 859px) {
  .term { position: static; }
  .gloss {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 76px;
    width: auto;
    max-width: none;
    transform: translateY(6px);
    font-size: 15px;
    line-height: 23px;
    padding: 14px 16px;
  }
  .term:hover .gloss,
  .term:focus .gloss,
  .term.is-open .gloss { transform: none; }
  .gloss::after { display: none; }
}

/* ---------- Callout: the Skip note ---------- */

.callout {
  display: flex;
  gap: 12px;
  margin: 28px 0 8px;
  padding: 14px 16px;
  background: var(--aiops-accent-tint);
  border: 1px solid var(--aiops-accent-line);
  border-radius: var(--aiops-radius);
  font-size: 15px;
  line-height: 24px;
}
.callout > svg { margin-top: 4px; color: var(--aiops-accent); }
.callout p { margin: 0; }
/* A longer note: the bold lead and one sentence, then a short list, then at most one closing line. */
.callout-body { min-width: 0; }
.callout .callout-body > * + * { margin-top: 10px; }
.callout-body ul, .callout-body ol { margin-bottom: 0; padding-left: 20px; }
.callout-body li { margin: 0; padding-left: 2px; }
.callout-body li + li { margin-top: 6px; }
.callout-body li::marker { color: var(--aiops-accent); }

/* ---------- Flow: "How it works" as its steps, each with an icon ---------- */

.prose ol.flow {
  list-style: none;
  margin: 20px 0 24px;
  padding: 0;
}
.prose .flow-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0 0 8px;
}
.prose .flow-step:last-child { padding-bottom: 0; }
/* The rail: a hairline from each tile down to the next */
.flow-step::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: var(--aiops-border-strong);
}
.flow-step:last-child::after { display: none; }
.flow-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--aiops-border);
  border-radius: 8px;
  background: var(--aiops-surface);
  color: var(--aiops-text-muted);
}
.flow-text {
  padding-top: 3px;
  font-size: 15px;
  line-height: 22px;
  color: var(--aiops-text);
  text-wrap: pretty;
}
/* A step the member does or decides: the one place the flow uses the accent */
.flow-step.is-you .flow-icon {
  border-color: var(--aiops-accent-line);
  background: var(--aiops-accent-tint);
  color: var(--aiops-accent);
}
.flow-step.is-you .flow-text { font-weight: 500; }

/* ---------- Diagram: "How it works" as boxes joined by arrows ---------- */

.prose ol.diagram {
  container-type: inline-size;
  list-style: none;
  margin: 20px 0 24px;
  padding: 0;
}
.prose .diagram li { margin: 0; padding: 0; }
.prose .diagram ul { list-style: none; margin: 0; padding: 0; }
.dg-step { position: relative; }
.prose .dg-step + .dg-step { padding-top: 30px; }
/* The arrow into each step: a hairline and a small head, centred */
.dg-step + .dg-step::before,
.dg-answers::after,
.dg-answer::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--aiops-border-strong);
}
.dg-step + .dg-step::before { top: 2px; height: 22px; }
.dg-step + .dg-step::after {
  content: "";
  position: absolute;
  top: 22px;
  left: calc(50% - 4px);
  border: 4.5px solid transparent;
  border-top: 5px solid var(--aiops-border-strong);
  border-bottom: 0;
}
.dg-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  background: var(--aiops-surface);
}
.dg-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--aiops-hover);
  color: var(--aiops-text-muted);
}
.dg-body { flex: 1; min-width: 0; }
.prose .dg-name { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--aiops-text); }
.dg-n { margin-right: 2px; font-weight: 500; color: var(--aiops-text-muted); font-variant-numeric: tabular-nums; }
.prose .dg-line { margin: 2px 0 0; font-size: 14px; line-height: 21px; color: var(--aiops-text-body); text-wrap: pretty; }
.prose .dg-question { margin: 6px 0 0; font-size: 14px; line-height: 21px; font-weight: 500; color: var(--aiops-text); }
/* A decision: dashed outline, the fork icon; its answers fan out below */
.dg-step.is-decision > .dg-box { border-style: dashed; border-color: var(--aiops-border-strong); }
/* The member's own step: the one place the diagram uses the accent */
.dg-step.is-you > .dg-box { border-color: var(--aiops-accent-line); background: var(--aiops-accent-tint); }
.dg-step.is-you .dg-icon { background: var(--aiops-surface); color: var(--aiops-accent); }
/* Lanes: work done side by side, inside the step's box */
.prose ul.dg-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
/* li.dg-* outranks the list reset above (.prose .diagram li) */
.prose .diagram li.dg-lane,
.prose .diagram li.dg-answer {
  font-size: 13px;
  line-height: 19px;
  color: var(--aiops-text-body);
  text-wrap: pretty;
}
.prose .diagram li.dg-lane { padding: 8px 10px; border-radius: 8px; background: var(--aiops-hover); }
.dg-label { display: block; margin-bottom: 2px; font-weight: 600; color: var(--aiops-text); }
/* Answers: a stem from the decision, a bar, then one box per answer */
.prose ul.dg-answers {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding-top: 26px;
}
.dg-answers::after { top: 0; height: 12px; }
.dg-answers::before {
  content: "";
  position: absolute;
  top: 12px;
  /* from the first answer's centre to the last's: columns are (100% - gaps) / n wide */
  left: calc((100% - (var(--n, 2) - 1) * 12px) / (2 * var(--n, 2)));
  right: calc((100% - (var(--n, 2) - 1) * 12px) / (2 * var(--n, 2)));
  height: 1px;
  background: var(--aiops-border-strong);
}
/* An answer: a lighter step box, the same border, radius and inset */
.prose .diagram li.dg-answer {
  position: relative;
  padding: 10px 14px 12px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  background: var(--aiops-surface);
}
.dg-answer::before { top: -14px; height: 14px; }
.dg-answer .i { width: 14px; height: 14px; margin: 0 4px -2px 0; color: var(--aiops-accent); }
/* Narrow: answers stack under the decision instead of fanning out */
@container (max-width: 480px) {
  .prose ul.dg-answers { grid-auto-flow: row; gap: 6px; margin-left: 28px; padding-top: 6px; }
  .dg-answers::before, .dg-answers::after, .dg-answer:last-child::before { display: none; }
  /* The rail runs on past every answer but the last, so the elbows join into one line */
  .dg-answer::before { left: -15px; top: 0; height: auto; bottom: -8px; }
  /* Each answer hangs off the decision by a short elbow */
  .dg-answer::after {
    content: "";
    position: absolute;
    left: -15px;
    top: -8px;
    width: 14px;
    height: 24px;
    border-left: 1px solid var(--aiops-border-strong);
    border-bottom: 1px solid var(--aiops-border-strong);
    border-bottom-left-radius: 6px;
  }
}

/* ---------- Steps: build steps, checks, the "n of 3" count ---------- */

.steps {
  list-style: none;
  margin: 24px 0 28px;
  padding: 0;
}
.prose .step {
  position: relative;
  margin: 0;
  padding: 0 0 28px 44px;
}
.step::after {
  content: "";
  position: absolute;
  left: 11.5px;
  top: 32px;
  bottom: 4px;
  width: 1px;
  background: var(--aiops-border-strong);
}
.prose .step:last-child { padding-bottom: 4px; }
.step:last-child::after { display: none; }
.step-mark {
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--aiops-hover);
  color: var(--aiops-text);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.step-mark svg { width: 14px; height: 14px; stroke-width: 1.75; }
.step-title {
  margin: 0 0 6px;
  color: var(--aiops-text);
  font-size: 16px;
  line-height: 28px;
  font-weight: 600;
  text-wrap: balance;
}
.step p { margin: 0 0 14px; }
.step > :last-child { margin-bottom: 0; }
.step ul { margin-bottom: 14px; }
.inline-logo { display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.inline-logo svg { width: 15px; height: 15px; }

/* Checks you can tick */
.checks .step-mark { background: var(--aiops-canvas); box-shadow: inset 0 0 0 1px var(--aiops-border-strong); }
.tick { position: absolute; left: 0; top: 2px; width: 24px; height: 24px; cursor: pointer; }
.tick::before { content: ""; position: absolute; inset: -8px; }
.tick .step-mark { top: 0; color: var(--aiops-mark); transition: background-color 160ms var(--aiops-ease), color 160ms var(--aiops-ease), box-shadow 160ms var(--aiops-ease), scale 120ms var(--aiops-ease); }
.tick:hover .step-mark { box-shadow: inset 0 0 0 1px var(--aiops-text-muted); color: var(--aiops-text-muted); }
.tick:active .step-mark { scale: 0.92; }
.tick input:checked + .step-mark { background: var(--aiops-ok); box-shadow: none; color: var(--aiops-ok-text); }
.tick input:focus-visible + .step-mark { outline: 2px solid var(--aiops-accent); outline-offset: 2px; }
.prose .checks-count {
  margin: -12px 0 28px 44px;
  color: var(--aiops-text-muted);
  font-size: 13px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.prose .checks-count.is-done { color: var(--aiops-text); font-weight: 500; }

@media (max-width: 859px) {
  .prose .step { padding-left: 38px; }
}
@media (max-width: 599px) {
  .prose .checks-count { margin-left: 38px; }
}

/* ---------- Code box: head, body, copy button ---------- */

.code {
  margin: 12px 0 20px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  overflow: hidden;
  background: var(--aiops-canvas);
}
.code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px 0 14px;
  background: var(--aiops-subtle);
  border-bottom: 1px solid var(--aiops-border);
  font-size: 13px;
  line-height: 20px;
  color: var(--aiops-text-muted);
}
.code-head .label { color: var(--aiops-text); font-weight: 500; }
.code-head .hint::before { content: "·"; margin-right: 8px; color: var(--aiops-mark); }
.code-head code { background: none; border: 0; padding: 0; font-size: 12.5px; }

.copy {
  margin-left: auto;
  position: relative;
  display: none;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--aiops-text-muted);
  font: 500 13px/20px var(--aiops-font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, scale 120ms var(--aiops-ease);
}
.js .copy { display: inline-flex; }
.copy:hover { color: var(--aiops-text); background: var(--aiops-hover); }
.copy:active { scale: 0.97; }
.copy .ico { position: relative; width: 14px; height: 14px; }
.copy .ico svg { position: absolute; inset: 0; width: 14px; height: 14px; transition: opacity 180ms var(--aiops-ease), scale 180ms var(--aiops-ease), filter 180ms var(--aiops-ease); }
.copy .ico .tick { opacity: 0; scale: 0.25; filter: blur(4px); }
.copy.is-copied { color: var(--aiops-ok); }
.copy.is-copied .ico .sheet { opacity: 0; scale: 0.25; filter: blur(4px); }
.copy.is-copied .ico .tick { opacity: 1; scale: 1; filter: blur(0); }

pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--aiops-font-mono);
  font-size: 13.5px;
  line-height: 22px;
  color: var(--aiops-text);
  tab-size: 2;
  scrollbar-width: thin;
}
/* The prompt's 80-column lines fit the step without wrapping */
.step .code pre { font-size: 12.5px; padding-left: 14px; padding-right: 14px; }
/* The slot the member fills in, and the skill's description key */
pre .slot {
  padding: 2px 5px; margin: 0 -1px; border-radius: 5px;
  background: var(--aiops-accent-tint); color: var(--aiops-accent-ink);
  box-shadow: inset 0 0 0 1px var(--aiops-accent-line);
}
pre .key { color: var(--aiops-accent-ink); }
pre .dim { color: var(--aiops-text-muted); }

@media (max-width: 859px) {
  .copy { height: 36px; }
}
@media (max-width: 599px) {
  .code-head:has([data-copy^="prompt"]) .hint { display: none; }
  .step .code pre { font-size: 13px; }
}

/* ---------- Tables ---------- */

.table-box {
  margin: 8px 0 24px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 22px;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--aiops-border);
}
tbody tr:last-child td { border-bottom: 0; }
th {
  color: var(--aiops-text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  background: var(--aiops-subtle);
  white-space: nowrap;
}
td:first-child { color: var(--aiops-text); font-weight: 500; }
td { text-wrap: pretty; }
/* Header icons: a green tick for "build it now", an amber pause for "wait" */
th .th-ico { width: 14px; height: 14px; margin: -2px 6px 0 0; vertical-align: middle; }
th .th-ico.go { color: var(--aiops-ok); }
th .th-ico.wait { color: var(--aiops-amber); }
/* Which half of the file: a dot per half */
.half { display: inline-flex; align-items: center; gap: 7px; }
.half::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--aiops-mark); flex: none; }
.half.is-desc::before { background: var(--aiops-accent); }
.half.is-inst::before { background: var(--aiops-lane-foundation); }

@media (min-width: 600px) {
  td:nth-child(2) { min-width: 8.5em; }
}
/* Under 860: scroll sideways in their own box, first column stays put */
@media (max-width: 859px) {
  table { min-width: 560px; }
  th:first-child, td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 150px;
    max-width: 170px;
    background: var(--aiops-canvas);
    box-shadow: inset -1px 0 0 var(--aiops-border);
  }
  th:first-child { background: var(--aiops-subtle); }
}
/* Under 600: each row restacks as a labelled card */
@media (max-width: 599px) {
  .table-box { overflow-x: visible; }
  table { min-width: 0; display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tbody { display: block; }
  tr { display: block; padding: 12px 14px 14px; border-bottom: 1px solid var(--aiops-border); }
  tbody tr:last-child { border-bottom: 0; }
  td, th:first-child, td:first-child {
    position: static; min-width: 0; max-width: none; box-shadow: none; background: none;
  }
  /* Label column by padding, not grid, so a cell mixing text, code and terms stays one flow */
  td { display: block; position: relative; padding: 4px 0 0 116px; border: 0; }
  td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 104px; color: var(--aiops-text-muted); font-size: 12.5px; line-height: 22px; font-weight: 400; }
  td:first-child { display: block; padding: 0 0 4px; font-size: 15px; line-height: 23px; }
  td:first-child::before { content: none; }
}

/* ---------- Go deeper ---------- */

.badge {
  display: inline-block;
  vertical-align: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--aiops-border);
  border-radius: 999px;
  color: var(--aiops-text-muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0;
}
.deeper {
  margin: 16px 0 0;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
}
.deeper details + details { border-top: 1px solid var(--aiops-border); }
.deeper summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--aiops-text);
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  border-radius: var(--aiops-radius);
  transition: background-color 150ms ease;
}
.deeper summary::-webkit-details-marker { display: none; }
.deeper summary:hover { background: var(--aiops-subtle); }
.deeper summary svg { color: var(--aiops-text-muted); transition: transform 220ms var(--aiops-ease-move); }
.deeper details[open] > summary svg { transform: rotate(90deg); }
.deeper summary:focus-visible { outline-offset: -2px; }
.deeper .panel { padding: 2px 16px 18px 42px; }
.deeper .panel p:last-child { margin-bottom: 0; }
.deeper .table-box { margin-top: 4px; }

@media (max-width: 859px) {
  .deeper .panel { padding-left: 16px; }
  .deeper summary { min-height: 56px; }
}

/* ---------- What you added: each item is a plus ---------- */

.prose ul.added { list-style: none; padding-left: 0; }
.prose ul.added li { position: relative; padding-left: 28px; }
.prose ul.added li::before {
  content: "+"; position: absolute; left: 0; top: 5px;
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--aiops-ok-tint); color: var(--aiops-ok);
  font: 600 13px/1 var(--aiops-font-mono);
}

/* ---------- Option cards: a list of tools to choose from ---------- */

.prose ul.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin: 8px 0 24px;
  padding-left: 0;
  list-style: none;
}
.prose li.option {
  min-width: 0;
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  font-size: 14px;
  line-height: 22px;
}
.option-head { display: flex; align-items: center; gap: 12px; }
.option .logo-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--aiops-logo-tile);
  box-shadow: inset 0 0 0 1px var(--aiops-border);
}
.option .logo-tile img { display: block; width: 20px; height: 20px; object-fit: contain; }
.option .logo-tile.is-neutral { background: none; color: var(--aiops-text-muted); }
.option .logo-tile svg { width: 18px; height: 18px; }
.prose .option p { margin: 0; }
.prose .option-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  color: var(--aiops-text);
  font-size: 15px;
  line-height: 22px;
}
.option-name strong { overflow-wrap: anywhere; }
.option-name .badge {
  margin: 0;
  vertical-align: 0;
  border-color: var(--aiops-accent-line);
  background: var(--aiops-accent-tint);
  color: var(--aiops-accent-ink);
}
.prose .option-text { margin-top: 10px; }
.prose .option-text::first-letter { text-transform: uppercase; }
.option-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--aiops-border);
  font-size: 13px;
  line-height: 20px;
}
.option-facts div { display: contents; }
.option-facts dt { color: var(--aiops-text-muted); font-weight: 500; }
.option-facts dd { margin: 0; min-width: 0; }
.prose .option-note { margin-top: 8px; color: var(--aiops-text-muted); font-size: 13px; line-height: 20px; }
/* A long command wraps inside its card instead of widening the page */
.option code {
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Option group: a bold-lead paragraph and its cards, read as one category */
.prose .option-group {
  margin: 28px 0;
  padding: 20px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  background: var(--aiops-subtle);
  scroll-margin-top: calc(var(--bar-h) + 24px);
  transition: border-color 150ms var(--aiops-ease);
}
.prose .option-group:target { border-color: var(--aiops-accent-line); }
.option-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.prose .option-group-title {
  margin: 0;
  color: var(--aiops-text);
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
  text-wrap: balance;
}
.option-group-count {
  flex: none;
  color: var(--aiops-text-muted);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.prose .option-group-text { margin: 6px 0 0; color: var(--aiops-text-body); font-size: 14px; line-height: 22px; }
.prose .option-group-note { margin: 14px 0 0; font-size: 14px; line-height: 22px; color: var(--aiops-text-body); }
.prose .option-group-text strong { color: inherit; font-weight: inherit; }
.prose .option-group ul.options { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 16px 0 0; }
.prose .option-group li.option { background: var(--aiops-surface); }
@media (max-width: 559px) {
  .prose .option-group { padding: 14px 12px; }
}

/* Jump row before three or more groups */
.prose .option-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.prose .option-nav a {
  padding: 4px 12px;
  border: 1px solid var(--aiops-border-strong);
  border-radius: 999px;
  background: var(--aiops-surface);
  color: var(--aiops-text);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--aiops-ease);
}
.prose .option-nav a:hover { background: var(--aiops-hover); color: var(--aiops-text); }
.prose .option-nav a:focus-visible { outline: 2px solid var(--aiops-accent); outline-offset: 2px; }

/* ---------- Pager and foot ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--aiops-border);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius);
  text-decoration: none;
}
.prose .pager a { text-decoration: none; transition: color 150ms ease, border-color 150ms ease; }
.pager a:hover { border-color: var(--aiops-accent-line); }
.pager .dir {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--aiops-text-muted);
  font-size: 13px;
  line-height: 20px;
}
.pager a:hover .dir { color: var(--aiops-accent-ink); }
.pager .dir svg { transition: transform 150ms var(--aiops-ease-enter); }
.pager a[rel="prev"]:hover .dir svg { transform: translateX(-2px); }
.pager a[rel="next"]:hover .dir svg { transform: translateX(2px); }
.pager .ttl { color: var(--aiops-text); font-size: 15px; line-height: 22px; font-weight: 500; }
.pager .next { text-align: right; align-items: flex-end; }
.pager .next .dir { flex-direction: row-reverse; }

.prose .page-foot {
  margin: 28px 0 0;
  color: var(--aiops-text-muted);
  font-size: 13px;
  line-height: 20px;
}

@media (max-width: 859px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; align-items: flex-start; }
  .pager .next .dir { flex-direction: row; }
}

/* ---------- On this page: the rail, and the phone contents ---------- */

.rail {
  position: sticky;
  top: var(--bar-h);
  align-self: start;
  max-height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  padding: 40px 24px 40px 4px;
}
.toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0 10px;
  color: var(--aiops-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.toc { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--aiops-radius-control);
  color: var(--aiops-text-muted);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}
.toc a:hover { color: var(--aiops-text); }
.toc a.is-current { color: var(--aiops-accent-ink); background: var(--aiops-accent-tint); font-weight: 500; }

.toc-mobile { display: none; }

@media (max-width: 1099px) {
  .rail { display: none; }
  .toc-mobile {
    display: block;
    margin: -8px 0 28px;
    border: 1px solid var(--aiops-border);
    border-radius: var(--aiops-radius);
  }
  .toc-mobile summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--aiops-text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    border-radius: var(--aiops-radius);
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary .chev { margin-left: auto; color: var(--aiops-text-muted); transition: transform 200ms var(--aiops-ease); }
  .toc-mobile[open] summary .chev { transform: rotate(90deg); }
  .toc-mobile .toc { padding: 0 6px 8px; }
  .toc-mobile .toc a { min-height: 40px; display: flex; align-items: center; }
}
