/* ============================================================================
   Guide — task-oriented reading.  (brief §17)
   ============================================================================

   §17 asks the guide to be optimised for task-oriented reading: clear steps,
   compact examples, links into the product.  What was here was the third
   thing and not the first two.  Eight steps, each drawn as a 2rem-padded card
   with a 16px radius, a shadow, a 4px gradient rail that wiped in on hover
   and a `translateY(-4px)` lift; each carrying a 48px gradient-filled number
   tile and a filled accent button.  At 1440 the eight cards ran to 4,148px of
   page for about 1,100 words -- roughly four screens of chrome around one
   screen of instructions.

   The rebuild is the same eight steps as *steps*: a number, a heading, a
   paragraph, one link out, separated by hairlines.

   2026-09-18.  Two things changed with the visual system.

   One, the page is a document.  `.am-doc` / `.am-doc__layout` / `.am-toc`
   (static/css/dev-portal.css, linked before this sheet) supply the frame the
   other three documentation routes use: a page head, a sticky contents column
   and one reading column.  The contents column is the eight step anchors,
   which is what the old `.progress-indicator` strip was trying to be; every
   rule in this sheet that drew that strip -- the wrapping flex row, the
   20px circles, the nowrap labels and the three separate narrow-screen
   negotiations with page-unification.css over its five-column phone grid --
   is gone with it, along with the `.glossary-header` / `.glossary-toggle` /
   `.glossary-content` / `.glossary-grid` rules that dressed a div with
   `role="button"` as a disclosure.  The glossary is a real `<details>` and a
   real table now, and both come from the shared layer.

   Two, the steps are one column.  This sheet has asked for that since the
   §17 rewrite -- `.quick-start-steps { display: flex; flex-direction:
   column }` -- and never got it: workspaces.css, the last stylesheet in the
   document, carries `html body.page-guide .main-content .quick-start-steps
   { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) }` at
   (0,3,2), and this sheet's (0,2,1) rule loses on both counts.  So the eight
   steps were two-up bordered cards on every desktop render.  The rules below
   carry `html body.page-guide .main-content .guide-container` and, where the
   losing declaration is also `!important` somewhere, `!important` with it.

   Cascade: linked from {% block extra_css %}, before bundle-shell.css, so the
   rules that answer brand.css / app-shell.css / page-unification.css /
   workspaces.css carry !important and say which rule they are answering.

   On the !important in this file: measured by disabling this sheet and
   diffing computed styles, roughly a third of them change nothing today --
   they declare a value the cascade already produces. They are kept as guards,
   not removed as dead code: every one answers a rule in brand.css,
   app-shell.css, page-unification.css or workspaces.css, all four of which
   are edited by other workstreams, and a redundant `box-shadow: none` becomes
   load-bearing the day a shadow is added to a shared selector list. Do not
   read an !important here as proof that something is currently fighting back.
   ============================================================================ */

/* --- The column ---------------------------------------------------------- */

/* `.am-doc` owns the measure and the block rhythm, and `.container`
   (shell-2026.css) owns the page gutter, so this element sets neither. Its
   measure is the family's one measure -- 1180px, declared on `.am-doc` in
   am-system.css. Until 2026-09-18 brand.css overrode it here with
   `.page-guide .guide-container { max-width: 1220px !important }`, which made
   this the only documentation route 40px wider than the others; that name is
   out of the brand.css list now rather than answered from this file. */
.guide-container {
    width: 100%;
    margin-inline: auto;
}

/* The two entries under the eight steps: the foot of the document, separated
   from the sequence by a hairline rather than numbered into it. */
body.page-guide .guide-toc__rest {
    margin-block-start: var(--c-space-3);
    padding-block-start: var(--c-space-3);
    border-block-start: 1px solid var(--c-line);
}

/* --- Steps --------------------------------------------------------------- */

body.page-guide .quick-start-section {
    margin-block-end: var(--c-space-6);
}

/* One column.  See the header: workspaces.css puts this in two, from a
   selector this sheet cannot outrank without the `.main-content
   .guide-container` prefix. */
html body.page-guide .main-content .guide-container .quick-start-steps {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    margin: 0;
}

/* A step is a numbered passage, not a card.  app-shell.css and workspaces.css
   both card this class; the container in the selector keeps this winning over
   both. */
html body.page-guide .main-content .guide-container .quick-start-step {
    position: relative;
    margin: 0 !important;
    padding: var(--c-space-6) 0 !important;
    background: none !important;
    border: 0 !important;
    border-block-end: 1px solid var(--c-line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none;
    overflow: visible;
}

html body.page-guide .main-content .guide-container .quick-start-step:last-child {
    border-block-end: 0 !important;
}

/* The 4px gradient rail that scaled in on hover. */
body.page-guide .quick-start-step::before {
    content: none !important;
}

html body.page-guide .main-content .guide-container .quick-start-step:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--c-line) !important;
}

body.page-guide .step-header-quick {
    display: flex;
    align-items: baseline;
    gap: var(--c-space-3);
    margin-block-end: var(--c-space-3);
    min-width: 0;
}

/* The step number: an index in the mono face, aligned with the heading's
   baseline.  It was a 48px gradient tile with its own shadow — the loudest
   object in each of eight cards, carrying one digit. */
/* brand.css paints `.progress-circle, .step-number-quick, .toc-number` with
   `background-color: var(--c-evidence) !important; background-image:
   var(--brand-gradient) !important; color: var(--c-canvas) !important;
   border: 0 !important` -- a filled brand tile for every number on the page,
   in the accent colour, which in this system means "verified".  It is also
   what made the eight step numbers *invisible*: canvas ink on the canvas. */
body.page-guide .step-number-quick {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 0;
    background: none !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: var(--c-mono);
    font-size: var(--c-t-body);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    /* --c-text-secondary, not --c-text-faint.

       Measured on this page's light ground: --c-text 13.78,
       --c-text-secondary 6.96, --c-text-faint 4.36, --c-text-muted 4.15.
       Both metadata tokens are under the 4.5 floor in the light theme, and
       the ordinal is the one piece of the step's own heading line -- it reads
       with the title, not under it.  The faint token stays where it belongs,
       on the contents column's own counters, which sit on the surface the
       shared layer already measured. */
    color: var(--c-text-secondary) !important;
}

body.page-guide .step-number-quick i,
body.page-guide .step-number-quick svg {
    width: 16px;
    height: 16px;
    align-self: center;
}

/* workspaces.css sets this to 1.1rem, which is smaller than the contents
   entry that points at it. */
html body.page-guide .main-content .guide-container .step-title-quick {
    min-width: 0;
    margin: 0;
    font-size: var(--c-t-h2);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

[dir="rtl"] html body.page-guide .main-content .guide-container .step-title-quick {
    letter-spacing: 0;
}

html body.page-guide .main-content .guide-container .step-description {
    max-width: 70ch;
    margin: 0;
    font-size: var(--c-t-body);
    line-height: 1.7;
    color: var(--c-text-secondary);
}

/* --- What the step gets you ---------------------------------------------- */

/* A task instruction that does not say what happens is half an instruction:
   the reader cannot tell whether they did it. So each step carries the result
   as well as the action, on its own line, in the muted register -- the same
   weight as a caption, above the 0.75rem floor. The label is a word, not a
   colour, so it survives a monochrome print and a screen reader. */
body.page-guide .step-outcome {
    display: flex;
    align-items: baseline;
    gap: var(--c-space-2);
    max-width: 70ch;
    margin: var(--c-space-3) 0 0;
    font-size: var(--c-t-meta);
    line-height: 1.6;
    color: var(--c-text-muted);
}

body.page-guide .step-outcome__label {
    flex-shrink: 0;
    color: var(--c-text-muted);
    font-size: var(--c-t-label);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

[dir="rtl"] body.page-guide .step-outcome__label { letter-spacing: 0; }

/* --- The link out of each step ------------------------------------------- */

/* One per step, and it is the point of the step: §17 asks for links into the
   product.  The geometry and the register of `.am-btn--secondary`, written
   out here rather than composed, because the class is `.step-action` and two
   stylesheets paint that name with `!important`: brand.css fills it with
   `var(--c-evidence)` and the brand gradient, and page-unification.css
   repaints it `#245b83` in the light theme from
   `html[data-theme="light"] body[class^="page-"] .main-content :is(…)` --
   (0,5,2) important, because one of its `:is()` arguments is
   `.filter-chip.active`.  So the button was a cyan pill in dark and a navy
   one in light: one component in two categories, depending on a preference,
   and in the colour this system reserves for verification. */
body.page-guide .step-action {
    display: inline-flex;
    align-items: center;
    gap: var(--c-space-2);
    min-height: 40px;
    margin-block-start: var(--c-space-4);
    padding: 0 var(--c-space-4);
    background: var(--c-inset) !important;
    background-color: var(--c-inset) !important;
    border: 1px solid var(--c-line) !important;
    border-radius: var(--c-r-pill) !important;
    box-shadow: none !important;
    color: var(--c-text) !important;
    font-family: inherit;
    font-size: var(--c-t-meta);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 140ms var(--c-ease), color 140ms var(--c-ease);
}

/* Hover moves the border, not the label.

   Recolouring the text to `--c-evidence` on hover measured 4.48:1 in light
   against 13.76:1 at rest -- a hover state that made the label *less* legible
   than not hovering, which is backwards. The border carries the state; the
   text stays at full contrast. */
body.page-guide .step-action:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--c-line-strong) !important;
}

body.page-guide .step-action:focus-visible {
    outline: 2px solid var(--c-evidence);
    outline-offset: 2px;
}

/* The same control, the same way, in both themes: page-unification's light
   rule is (0,5,2) important, so the answer goes to (0,6,2), scoped to this
   page's own steps, and changes nothing outside them. */
html[data-theme="light"] body.page-guide .main-content .guide-container .quick-start-step .step-action {
    background: var(--c-inset) !important;
    background-color: var(--c-inset) !important;
    border: 1px solid var(--c-line) !important;
    color: var(--c-text) !important;
    -webkit-text-fill-color: var(--c-text) !important;
}

html[data-theme="light"] body.page-guide .main-content .guide-container .quick-start-step .step-action:hover {
    border-color: var(--c-line-strong) !important;
}

/* The label inside the button, which is a separate fight and was missed once.

   page-unification.css has a companion to the fill rule above: the same
   `:is(…)` control list, `) :is(span, svg, i) { color: #ffffff !important;
   -webkit-text-fill-color: #ffffff !important }`.  It exists so a label stays
   legible on a filled brand button -- correct for a filled button, and
   catastrophic for a quiet one.  Recolouring `.step-action` without also
   recolouring its children left eight step labels as white text on a
   near-white page: measured 1.20:1, which is invisible, not merely low.

   Neither axe nor a screenshot caught it -- axe reported these nodes as
   needs-review because it could not resolve the background, and white on
   white photographs as an empty button. */
html[data-theme="light"] body.page-guide .main-content .guide-container .quick-start-step .step-action :is(span, svg, i),
html[data-theme="light"] body.page-guide .main-content .guide-container .quick-start-step .step-action:hover :is(span, svg, i) {
    color: var(--c-text) !important;
    -webkit-text-fill-color: var(--c-text) !important;
}

body.page-guide .step-action i,
body.page-guide .step-action svg {
    width: 15px;
    height: 15px;
}

/* --- Where to go deeper, and the glossary -------------------------------- */

/* The one paragraph each of those two blocks carries.  `.am-panel--quiet` and
   `.c-disclosure__body` own the surface and the measure; this is the prose. */
body.page-guide .guide-deeper__text {
    margin: 0 0 var(--c-space-4);
    max-width: 70ch;
    font-size: var(--c-t-body);
    line-height: 1.7;
    color: var(--c-text-secondary);
}

body.page-guide .guide-deeper__text a { color: var(--c-evidence); }

/* app-shell.css cards `.page-guide .glossary-section` -- a surface, a border
   and a radius around what is now a hairline disclosure. */
html body.page-guide .main-content .guide-container .glossary-section {
    margin-block: var(--c-space-6);
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

/* app-shell.css also cards `.page-guide .glossary-term`, which is a table row
   now: a border and a radius on a `<tr>` renders as a stripe across the
   table.  `.am-table` draws the row. */
html body.page-guide .main-content .guide-container .glossary-term {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

html body.page-guide .main-content .guide-container .glossary-term > th {
    color: var(--c-text) !important;
    font-weight: 650;
    white-space: normal;
}

/* --- Narrow -------------------------------------------------------------- */

@media (max-width: 48rem) {
    html body.page-guide .main-content .guide-container .quick-start-step {
        padding-block: var(--c-space-5) !important;
    }

    html body.page-guide .main-content .guide-container .step-title-quick {
        font-size: var(--c-t-h3);
    }

    /* 44px, and the label is allowed to wrap inside the control rather than
       the control overflowing the column. */
    body.page-guide .step-action {
        min-height: 44px;
        max-width: 100%;
    }

    body.page-guide .step-action span {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

/* --- Motion -------------------------------------------------------------- */

/* Scoped to this page's own container.  It was `* { animation-duration:
   0.01ms !important }` — a page stylesheet silencing every animation in the
   document, header and footer included, from a sheet only /guide/ loads. */
@media (prefers-reduced-motion: reduce) {
    .guide-container,
    .guide-container * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   Print
   ============================================================================

   These pages are read on paper as well as on screen -- a policy someone
   files, an article someone annotates -- and nothing on the site had ever
   styled the printed form of them.  Rendered under `media: print` the dark
   theme carried straight through, and browsers do not print background
   colours unless the reader ticks "Background graphics".  The dark ground was
   therefore dropped and the light ink kept: body prose left the printer at
   rgb(182,198,218) on white, 1.74:1, and the page title at 1.14:1.  A sheet
   that reads as blank.

   Ink.  Forced dark, which takes the prose to 17.74:1 in either theme.  The
   selectors carry a `html body.page-*` prefix because the rules they answer
   are important and outweigh a bare class.

   Headings.  Reached by element rather than by class: this sheet may not
   write a `.c-*` selector -- test_canvas_design fails the build if a second
   stylesheet touches one -- and on paper every heading wants the same ink
   regardless of which layer named it.

   Chrome.  `nav.am-quick-dock` is `position: fixed` and printed *over* the
   body text near the foot of the page; the header and footer print as slabs
   of 3.04:1 links that no one can click.  All of it goes.  The contents
   column is hidden by dev-portal.css's own print block, where the rest of the
   documentation family's chrome is handled.
   ============================================================================ */

@media print {
  /* `[class^="page-"]` is carried onto the ink selectors for weight, not for
     matching.  theme-foundation.css sets the headings with
     `body[class^="page-"] .main-content :is(h1, ...) { color: var(--am-u-text)
     !important }` -- (0,2,2) and important.  A `html body.page-x :is(h1, ...)`
     rule is only (0,1,3), because `:is()` takes the weight of its most
     specific argument and every argument here is an element, so the first
     attempt at this lost and the headings measured 1.14:1 on white after it.
     Repeating the attribute lifts these to (0,2,3). */
  html body.page-guide[class^="page-"] {
    background: #fff !important;
  }

  /* Fixed and interactive chrome: useless on paper, and the dock actively
     obscures the text it lands on. */
  header.dashboard-header,
  footer.dashboard-footer,
  nav.am-quick-dock,
  .pg-modal,
  .pg-launcher,
  .share-toast,
  .cookie-consent,
  .social-banner {
    display: none !important;
  }

  html body.page-guide[class^="page-"] :is(h1, h2, h3, h4, h5, h6) {
    color: #000 !important;
  }

  html body.page-guide[class^="page-"] :is(p, li, span, strong, em, dt, dd, time, a, td, th) {
    color: var(--c-text) !important;
  }

  body.page-guide .quick-start-step {
    break-inside: avoid;
  }

  /* The tour trigger cannot be pressed on paper. */
  body.page-guide [data-action="start-product-tour"] {
    display: none !important;
  }
}


/* ---------------------------------------------------------------------------
   Forced colours (Windows High Contrast)
   ---------------------------------------------------------------------------
   The UA replaces every author colour with a system palette: `color`,
   `background-color` and `border-color` are all overridden, while `outline`,
   `text-decoration` and box geometry survive.  Any state whose only cue is a
   colour -- a border colour included -- therefore goes silent.

   Measured with forced colours active, this control's hover had no visible
   cue at all.  A `text-decoration` is the cue that survives, so it is added
   here and only here: outside forced colours the designed treatment is
   unchanged.
   --------------------------------------------------------------------------- */

@media (forced-colors: active) {
    body.page-guide .step-action:hover {
        text-decoration: underline;
        text-underline-offset: 0.18em;
    }
}
