/* guide library (gen/build_library.py). Loaded before /assets/site.css, so every rule is scoped to
   .lib (body class) to win on specificity. Code colours: pygments 'default' darkened to >= 4.6:1 on --panel. */

.lib .provenance { font-family: var(--mono); font-size: var(--fs-0); color: var(--muted); margin: 0.75rem 0 0; }
.lib .pagehead .note { margin-top: 1.25rem; }
.lib .pagehead h1 { max-width: 30ch; overflow-wrap: anywhere; }
.lib .pagehead h1 .owner { color: var(--muted); font-weight: 400; }
.lib .guide-links { font-size: var(--fs-1); color: var(--muted); margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.lib .guide-links a { font-weight: 500; }

/* inline code: 0.2em side padding, no gap before trailing punctuation (fix-library-r2); pre code untouched */
.lib :not(pre) > code { padding: 0.05em 0.2em; }

/* sticky TOC that scrolls on its own when a guide has many sections */
.lib .docside .toc { max-height: calc(100vh - 3rem); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 1rem; }

/* rendered guide body */
.lib .guide-body { padding-top: 2.5rem; min-width: 0; }
.lib .guide-body > * { max-width: var(--measure); }
.lib .guide-body > pre.hl, .lib .guide-body > .table-wrap, .lib .guide-body > blockquote.alert { max-width: none; }
.lib .guide-body h2 { font-size: var(--fs-4); margin: 3rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--rule); max-width: none; }
.lib .guide-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.lib .guide-body h3 { font-size: var(--fs-3); margin: 2.25rem 0 0.75rem; }
.lib .guide-body h4, .lib .guide-body h5, .lib .guide-body h6 { font-size: var(--fs-2); margin: 1.75rem 0 0.5rem; }
.lib .guide-body h2, .lib .guide-body h3, .lib .guide-body h4 { scroll-margin-top: 1rem; overflow-wrap: anywhere; }
.lib .guide-body li > p { margin-bottom: 0.35em; }
.lib .guide-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; max-width: none; }
.lib .guide-body hr + h2 { border-top: 0; margin-top: 0; padding-top: 0.5rem; }
.lib .guide-body kbd { font-family: var(--mono); font-size: 0.85em; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 2px; padding: 0 0.3em; background: var(--white); white-space: nowrap; }
.lib .guide-body .tab-label { font-family: var(--mono); font-size: var(--fs-0); color: var(--muted); margin: 1rem 0 0.35rem; }
.lib .guide-body pre.hl {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 2px; padding: 0.85rem 1rem;
  overflow-x: auto; font-size: 0.875rem; line-height: 1.5; margin: 0 0 1.25rem; tab-size: 4;
}
.lib .guide-body pre.hl code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; color: var(--ink); }
.lib .guide-body pre.hl:focus-visible, .lib .guide-body .table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib .guide-body .table-wrap { margin: 0 0 1.5rem; }
.lib .guide-body table { font-size: var(--fs-1); }
.lib .guide-body th { font-weight: 500; color: var(--muted); font-size: var(--fs-0); border-top: 2px solid var(--ink); }
.lib .guide-body td code, .lib .guide-body th code { overflow-wrap: anywhere; }
.lib .guide-body tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
.lib .guide-body .al-center { text-align: center; }
.lib .guide-body .al-right { text-align: right; }
.lib .guide-body .al-left { text-align: left; }
.lib .guide-body blockquote { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-left: 3px solid var(--rule-strong); background: var(--panel); font-size: var(--fs-1); }
.lib .guide-body blockquote > :last-child { margin-bottom: 0; }
.lib .guide-body blockquote pre.hl { background: var(--white); }
.lib .guide-body .alert-title { font-family: var(--mono); font-size: var(--fs-0); letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.35rem; color: var(--ink); }
.lib .guide-body .alert--note, .lib .guide-body .alert--tip, .lib .guide-body .alert--important { border-left-color: var(--accent); background: var(--accent-tint); }
.lib .guide-body .alert--note .alert-title, .lib .guide-body .alert--tip .alert-title, .lib .guide-body .alert--important .alert-title { color: var(--accent-ink); }
.lib .guide-body .alert--warning { border-left-color: var(--warn-line); background: var(--warn-tint); }
.lib .guide-body .alert--warning .alert-title { color: var(--warn-ink); }
.lib .guide-body .alert--caution { border-left-color: var(--fail-ink); background: var(--fail-tint); }
.lib .guide-body .alert--caution .alert-title { color: var(--fail-ink); }
.lib .guide-foot { margin-top: 3rem; border-top: 2px solid var(--ink); padding-top: 1rem; max-width: var(--measure); }
.lib .guide-foot p { font-size: var(--fs-1); color: var(--muted); }

/* repository page */
.lib .repo-guides li span a { font-weight: 400; }
.lib .facts-inline { font-size: var(--fs-1); color: var(--muted); }

/* library landing: search results + owner index */
.lib .lib-search .filterbar { margin-top: 1.25rem; }
.lib .lib-search .repos[hidden] { display: none; }
.lib .lib-search .count { margin-top: 0.25rem; }
.lib .repos { max-width: none; }
.lib .repo p { margin: 0; }
.lib .lib-private { max-width: 34rem; margin: 2rem 0 0; display: grid; }
.lib .lib-private .tile { min-height: 0; }
.lib .letters { display: flex; flex-wrap: wrap; gap: 0.125rem; max-width: none; font-family: var(--mono); font-size: var(--fs-1); margin: 0 0 1.5rem; padding: 0; list-style: none; }
.lib .letters li { margin: 0; }
/* fix-library-r3: 27 x 24 px + 26 x 2 px gap = ~706 px, one row when the column is >= 706 px (1024 px viewport up; 2 rows at 900); centre spacing 26 px (>= 24 px target size) */
.lib .letters a { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; min-height: 1.5rem; padding: 0.15rem 0.1rem; box-sizing: border-box; }
.lib .owner-index { columns: 3 16rem; column-gap: 2.5rem; font-size: var(--fs-1); }
.lib .owner-group { break-inside: avoid; margin: 0 0 1.25rem; }
.lib .owner-group h3 { font-family: var(--mono); font-size: var(--fs-1); color: var(--faint); border-bottom: 1px solid var(--rule); padding-bottom: 0.25rem; margin-bottom: 0.4rem; }
.lib .owner-group ul { list-style: none; margin: 0; padding: 0; }
.lib .owner-group li { margin: 0 0 0.3rem; line-height: 1.35; overflow-wrap: anywhere; }
.lib .owner-group .o { color: var(--muted); font-family: var(--mono); font-size: var(--fs-0); }
.lib .owner-group .o::after { content: " /"; color: var(--rule-strong); }

@media (max-width: 720px) {
  .lib .guide-body { padding-top: 1.5rem; }
  .lib .guide-body h2 { margin-top: 2.25rem; padding-top: 1.5rem; }
  .lib .guide-body pre.hl { font-size: 0.8125rem; padding: 0.7rem 0.75rem; }
  /* fix-library-r3: wrap code on phones (as print does) so nothing is cut off at the right edge */
  .lib .guide-body pre.hl, .lib .guide-body pre.hl code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .lib .docside .toc { max-height: none; }
}

@media print {
  .lib .guide-body a[href^="http"]::after { content: none; }
  .lib .guide-body pre.hl { white-space: pre-wrap; overflow: visible; break-inside: auto; }
  .lib .guide-body pre.hl code { white-space: pre-wrap; }
  .lib .lib-search, .lib .letters { display: none !important; }
}

/* ---- pygments token colours ---- */
.hl .c { color: #366e6e; font-style: italic } /* Comment */
.hl .k { color: #008000; font-weight: bold } /* Keyword */
.hl .o { color: #666666 } /* Operator */
.hl .ch { color: #366e6e; font-style: italic } /* Comment.Hashbang */
.hl .cm { color: #366e6e; font-style: italic } /* Comment.Multiline */
.hl .cp { color: #8c5a00 } /* Comment.Preproc */
.hl .cpf { color: #366e6e; font-style: italic } /* Comment.PreprocFile */
.hl .c1 { color: #366e6e; font-style: italic } /* Comment.Single */
.hl .cs { color: #366e6e; font-style: italic } /* Comment.Special */
.hl .gd { color: #a00000 } /* Generic.Deleted */
.hl .ge { font-style: italic } /* Generic.Emph */
.hl .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.hl .gr { color: #cd0000 } /* Generic.Error */
.hl .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.hl .gi { color: #007600 } /* Generic.Inserted */
.hl .go { color: #656565 } /* Generic.Output */
.hl .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.hl .gs { font-weight: bold } /* Generic.Strong */
.hl .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.hl .gt { color: #0044dd } /* Generic.Traceback */
.hl .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.hl .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.hl .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.hl .kp { color: #008000 } /* Keyword.Pseudo */
.hl .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.hl .kt { color: #b00040 } /* Keyword.Type */
.hl .m { color: #666666 } /* Literal.Number */
.hl .s { color: #ba2121 } /* Literal.String */
.hl .na { color: #5d6c1e } /* Name.Attribute */
.hl .nb { color: #008000 } /* Name.Builtin */
.hl .nc { color: #0000ff; font-weight: bold } /* Name.Class */
.hl .no { color: #880000 } /* Name.Constant */
.hl .nd { color: #991ee5 } /* Name.Decorator */
.hl .ni { color: #656565; font-weight: bold } /* Name.Entity */
.hl .ne { color: #b63832; font-weight: bold } /* Name.Exception */
.hl .nf { color: #0000ff } /* Name.Function */
.hl .nl { color: #6a6a00 } /* Name.Label */
.hl .nn { color: #0000ff; font-weight: bold } /* Name.Namespace */
.hl .nt { color: #008000; font-weight: bold } /* Name.Tag */
.hl .nv { color: #19177c } /* Name.Variable */
.hl .ow { color: #991ee5; font-weight: bold } /* Operator.Word */
.hl .w { color: #6c6c6c } /* Text.Whitespace */
.hl .mb { color: #666666 } /* Literal.Number.Bin */
.hl .mf { color: #666666 } /* Literal.Number.Float */
.hl .mh { color: #666666 } /* Literal.Number.Hex */
.hl .mi { color: #666666 } /* Literal.Number.Integer */
.hl .mo { color: #666666 } /* Literal.Number.Oct */
.hl .sa { color: #ba2121 } /* Literal.String.Affix */
.hl .sb { color: #ba2121 } /* Literal.String.Backtick */
.hl .sc { color: #ba2121 } /* Literal.String.Char */
.hl .dl { color: #ba2121 } /* Literal.String.Delimiter */
.hl .sd { color: #ba2121; font-style: italic } /* Literal.String.Doc */
.hl .s2 { color: #ba2121 } /* Literal.String.Double */
.hl .se { color: #99531b; font-weight: bold } /* Literal.String.Escape */
.hl .sh { color: #ba2121 } /* Literal.String.Heredoc */
.hl .si { color: #93516b; font-weight: bold } /* Literal.String.Interpol */
.hl .sx { color: #008000 } /* Literal.String.Other */
.hl .sr { color: #93516b } /* Literal.String.Regex */
.hl .s1 { color: #ba2121 } /* Literal.String.Single */
.hl .ss { color: #19177c } /* Literal.String.Symbol */
.hl .bp { color: #008000 } /* Name.Builtin.Pseudo */
.hl .fm { color: #0000ff } /* Name.Function.Magic */
.hl .vc { color: #19177c } /* Name.Variable.Class */
.hl .vg { color: #19177c } /* Name.Variable.Global */
.hl .vi { color: #19177c } /* Name.Variable.Instance */
.hl .vm { color: #19177c } /* Name.Variable.Magic */
.hl .il { color: #666666 } /* Literal.Number.Integer.Long */

/* ---- v3.2 standalone demo chrome (gen/build_library.py --standalone only) ---- */
.demo-line { font-family: var(--sans); font-size: var(--fs-1); line-height: 1.5; color: var(--muted); margin-top: 0; margin-bottom: 0; padding-top: 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); }
.demo-line::before { content: "demo"; display: inline-block; margin-right: 0.6rem; padding: 0 0.4rem; border: 1px solid var(--accent); border-radius: 2px; color: var(--accent-ink); font-family: var(--mono); font-size: var(--fs-0); }
.demo-line + main > .crumbs { margin-top: 0.75rem; }
.no-js .js-only { display: none !important; }
.lib .try .text { max-width: 54rem; }
.lib .try .text > p, .lib .try-step p, .lib .try-step ul { max-width: var(--measure); }
.lib .try-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.lib .try-step { counter-increment: step; margin: 0 0 2rem; }
.lib .try-step:last-child { margin-bottom: 1.25rem; }
.lib .try-step h3 { font-size: var(--fs-3); margin: 0 0 0.75rem; }
.lib .try-step h3::before { content: counter(step); font-family: var(--mono); font-size: var(--fs-0); font-weight: 400; color: var(--accent); margin-right: 0.75rem; vertical-align: 0.25em; }
.lib .picks { list-style: none; padding: 0; margin: 0 0 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lib .picks li { margin: 0; }
.lib .pick { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.35rem 0.8rem; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--white); color: var(--ink); text-decoration: none; font-family: var(--mono); font-size: var(--fs-1); }
.lib .pick .owner { color: var(--muted); }
.lib .pick:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--ink); }
.lib .pick .tag { font-size: 0.6875rem; color: var(--warn-ink); border-color: var(--warn-line); background: var(--warn-tint); }
.lib .try-step .hint { font-size: var(--fs-1); color: var(--muted); margin: 0; }
.lib .surprise-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 0.5rem; }
.lib .surprise-msg { font-size: var(--fs-1); color: var(--muted); }
.lib .surprise-msg:empty { display: none; }
.lib .look-for { margin: 0; padding-left: 1.2rem; }
.lib .look-for li { margin-bottom: 0.45rem; }
.lib .try-not { font-size: var(--fs-1); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 0.5rem; }
.lib a.tile--locked { background: repeating-linear-gradient(135deg, #f4f5f4 0 6px, #eef0ef 6px 12px); border-style: dashed; }
.lib a.tile--locked .head, .lib a.tile--locked .lock { color: var(--muted); }
.lib a.tile--locked:hover { border-color: var(--muted); }
@media (max-width: 720px) {
  .lib .pick { font-size: var(--fs-0); padding: 0.3rem 0.65rem; }
  .lib .try-step h3 { font-size: var(--fs-2); }
}
@media print {
  .demo-line { border: 0; }
  .lib .js-only { display: none !important; }
}
