/* Shared parts (#components, js/pages/kit.js). */
.kit { gap: var(--s6) !important; }
.kit-part { display: flex; flex-direction: column; gap: var(--s3); }
.kit-part > h2 { margin: 0; font-size: var(--fs-xl); font-weight: 600; }
.kit-part > .help { margin: 0; max-width: 72ch; }
.kit-thumbs { grid-template-columns: repeat(2, 96px); }
.kit-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.kit-swatch { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-s); color: var(--dim); }
.kit-swatch i { display: block; height: 48px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: var(--s1); }
.kit-swatch b { color: var(--text); font-weight: 500; }
.kit-temper { height: 24px; border-radius: var(--radius); background: var(--temper); }
.kit-type { display: flex; flex-direction: column; gap: var(--s2); }
.kit-type .k28 { font-size: var(--fs-2xl); font-weight: 700; } .kit-type .k20 { font-size: var(--fs-xl); font-weight: 600; } .kit-type .k16 { font-size: var(--fs-l); font-weight: 600; }

/* The Documents page (js/pages/docs.js) and Markdown (js/components/markdown.js). */
article.doc { max-width: 72ch; line-height: 1.65; font-size: 15px; min-width: 0; }
.doc-title { margin: 0 0 var(--s3); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.01em; }
.docs-group { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s3); }
/* A guide: the side list of guides (this one highlighted) on the left, the guide, its sections ("On this page") on the right. */
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-areas: "nav doc"; gap: var(--s6); align-items: start; padding-top: var(--s2); }
.doc-layout.has-toc { grid-template-columns: 230px minmax(0, 1fr) 210px; grid-template-areas: "nav doc toc"; }
.doc-layout > article.doc { grid-area: doc; }
.doc-nav-wrap { grid-area: nav; }
.doc-toc-wrap { grid-area: toc; }
.doc-nav-wrap, .doc-toc-wrap { position: sticky; top: calc(var(--header-h) + var(--s4)); max-height: calc(100vh - var(--header-h) - var(--s6)); overflow-y: auto; }
.doc-nav-wrap > summary, .doc-toc-wrap > summary { display: none; }
.doc-nav { display: flex; flex-direction: column; gap: var(--s4); font-size: var(--fs-s); }
.doc-nav b, .doc-toc b { display: block; color: var(--dim); font-weight: 500; margin-bottom: var(--s1); }
.doc-nav ul, .doc-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-nav a { display: block; padding: 4px var(--s2); border-radius: var(--radius); color: #c9cfd2; text-decoration: none; }
.doc-nav a:hover { background: var(--raised); color: var(--text); }
.doc-nav a.on { background: var(--sel); color: var(--text); font-weight: 500; }
.doc-toc { font-size: var(--fs-s); }
.doc-toc ul { border-left: 1px solid var(--line); }
.doc-toc a { display: block; padding: 3px var(--s3); margin-left: -1px; border-left: 2px solid transparent; color: var(--dim); text-decoration: none; }
.doc-toc a:hover { color: var(--text); }
.doc-toc a.on { color: var(--text); border-left-color: var(--link); }
.doc h3 { scroll-margin-top: calc(var(--header-h) + var(--s4)); }
/* Narrower: "On this page" folds above the guide. */
@media (max-width: 1100px) {
    .doc-layout.has-toc { grid-template-columns: 230px minmax(0, 1fr); grid-template-areas: "nav toc" "nav doc"; row-gap: var(--s4); }
    .doc-layout.has-toc .doc-nav-wrap { grid-row: 1 / span 2; }
    .doc-toc-wrap { position: static; max-height: none; border: 1px solid var(--line-soft); border-radius: var(--radius-l); padding: var(--s3); }
    .doc-toc-wrap > summary { display: list-item; cursor: pointer; color: var(--text); font-weight: 500; }
    .doc-toc-wrap[open] > summary { margin-bottom: var(--s3); }
    .doc-toc b { display: none; }
}
@media (max-width: 860px) {
    .doc-layout, .doc-layout.has-toc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "toc" "doc"; gap: var(--s4); }
    .doc-layout.has-toc .doc-nav-wrap { grid-row: auto; }
    .doc-nav-wrap { position: static; max-height: none; border: 1px solid var(--line-soft); border-radius: var(--radius-l); padding: var(--s3); }
    .doc-nav-wrap > summary { display: list-item; cursor: pointer; color: var(--text); font-weight: 500; }
    .doc-nav-wrap[open] > summary { margin-bottom: var(--s3); }
}
#docs-page .crow .sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.md h2 { font-size: var(--fs-xl); margin: var(--s5) 0 var(--s2); }
.md h3 { font-size: var(--fs-l); margin: var(--s5) 0 var(--s2); }
.md h4, .md h5 { font-size: var(--fs-m); margin: var(--s4) 0 var(--s1); }
.md > h3:first-child { margin-top: 0; }
.md p { margin: var(--s2) 0; }
.md ul, .md ol { margin: var(--s2) 0; padding-left: var(--s5); }
.md li { margin: var(--s1) 0; }
.md li > p { margin: var(--s1) 0; }
.md a { color: var(--link); }
.md code { background: var(--raised); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; }
.md pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3);
    overflow-x: auto; margin: var(--s2) 0; }
.md pre code { background: none; padding: 0; overflow-wrap: normal; white-space: pre; }
.md-table { overflow-x: auto; margin: var(--s2) 0; }
.md figure { margin: var(--s4) 0; }
.md figure img { display: block; max-width: 100%; height: auto; background: var(--img-bg);
    border: 1px solid var(--line); border-radius: var(--radius); }
.md figcaption { color: var(--dim); font-size: var(--fs-s); margin-top: var(--s2); }
.md table { border-collapse: collapse; width: 100%; font-size: var(--fs-m); }
.md th, .md td { border-bottom: 1px solid var(--line); padding: var(--s2); text-align: left; vertical-align: top; }
.md th { color: var(--dim); font-weight: 600; }
.md td:first-child { white-space: nowrap; font-weight: 600; }
.md td code { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 640px) { .md td:first-child { white-space: normal; } .md th, .md td { padding: var(--s2) 6px; } }
/* The API reference (/docs/api, js/site/docs.js stripe): each group's routes as the rows of a table,
   one bordered block, a divider between rows, alternately two shades (both apart from the page's
   background; code in the lighter one a step lighter again); a row's name and METHOD /path on one line. */
.md .api-rows { margin: var(--s2) 0 var(--s4); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.md .api-entry { padding: var(--s2) var(--s3); background: var(--panel); }
.md .api-entry + .api-entry { border-top: 1px solid var(--line); }
.md .api-entry.alt { background: var(--raised); }
.md .api-entry.alt code { background: var(--hover); }
.md .api-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s3); }
.md .api-head h4 { margin: 0; }
.md .api-head p { margin: 0; }
.md .api-entry p { margin: var(--s1) 0; }
.md .api-entry .md-table { margin: var(--s2) 0 0; }
/* A narrow screen: the table out to the screen's edges (over main's gutter, phone.css), no side borders. */
@media (max-width: 640px) {
    .md .api-rows { margin-left: calc(-1 * (var(--s3) + env(safe-area-inset-left)));
        margin-right: calc(-1 * (var(--s3) + env(safe-area-inset-right))); border-left: 0; border-right: 0; border-radius: 0; }
    .md .api-entry { padding-left: calc(var(--s3) + env(safe-area-inset-left)); padding-right: calc(var(--s3) + env(safe-area-inset-right)); }
}

/* A template guide's card (js/site/templates.js): what its link fills in and where, then Use this template. */
.tpl-fill { margin: var(--s3) 0 var(--s4); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); font-size: var(--fs-s); line-height: 1.5; }
.tpl-fill-head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); }
.tpl-fill-head span, .tpl-fill-foot span { color: var(--dim); }
.tpl-fill dl { display: grid; grid-template-columns: minmax(9rem, 30%) minmax(0, 1fr); gap: 0; margin: 0; }
.tpl-fill dt, .tpl-fill dd { margin: 0; padding: 6px var(--s3); border-top: 1px solid var(--line-soft); }
.tpl-fill dt:first-of-type, .tpl-fill dt:first-of-type + dd { border-top: 0; }
.tpl-fill dt { color: var(--text); font-weight: 500; }
.tpl-fill dt .where { display: block; color: var(--dim); font-weight: 400; font-size: var(--fs-xs); }
.tpl-fill dd { color: #c9cfd2; overflow-wrap: anywhere; }
.tpl-fill dd.you { color: var(--warn-text); }
.tpl-fill dd.long { cursor: pointer; }
.tpl-fill dd.long:not(.open) :is(.tpl-fill-prompt, .tpl-fill-clamp) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-fill-prompt { display: block; margin-top: 2px; color: var(--dim); }
.tpl-fill-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; padding: var(--s2) var(--s3); border-top: 1px solid var(--line-soft); }
.tpl-fill-foot a.button { text-decoration: none; }
@media (max-width: 560px) {
    .tpl-fill dl { grid-template-columns: minmax(0, 1fr); }
    .tpl-fill dd { border-top: 0; padding-top: 0; }
}
