/* The Brindlemark sandbox documentation (/work/banking-api), on top of work.css: the article with the set's own
   navigation beside it on a wide screen, the notice that says what the sample is, the two diagrams and the pager.
   Same paper, ink and rules as the rest of the site; no colour of its own. */

.bk .w-head{max-width:60rem}
.bk-notice{max-width:46rem;margin:0 0 var(--s2);padding:var(--s3) var(--s4);border-left:3px solid var(--ink);background:var(--paper);font-size:var(--fs-small);line-height:1.55;color:var(--ink2)}
.bk-notice b{color:var(--ink);font-weight:600}

.bk-grid{display:grid;gap:var(--s6);align-items:start}
.bk-article{min-width:0}
.bk-article>h2:first-child{margin-top:var(--s5)}
@media (min-width:1100px){
 .bk-grid{grid-template-columns:minmax(0,var(--w-col)) 15.5rem;gap:var(--s7)}
 .bk-nav{position:sticky;top:96px;order:2}
}

/* The set's navigation: the eight pages, each with its Diátaxis type. The open page is marked in ink. */
.bk-nav{font-size:var(--fs-small)}
.bk-nav-h{margin:0 0 var(--s2);font-weight:600;color:var(--ink)}
.bk-nav ol{list-style:none;margin:0;padding:0;border-left:1px solid var(--rule2)}
.bk-nav a{display:block;padding:7px 0 7px var(--s4);margin-left:-1px;border-left:3px solid transparent;color:var(--ink2);text-decoration:none;line-height:1.35}
.bk-nav a span{display:block}
.bk-nav a small{display:block;margin-top:2px;font-size:.78rem;color:var(--mute)}
.bk-nav a:hover span{text-decoration:underline;text-underline-offset:.18em}
.bk-nav a[aria-current="page"]{border-left-color:var(--ink);color:var(--ink);font-weight:600}
.bk-nav a[aria-current="page"] small{font-weight:400}
@media (max-width:1099px){
 .bk-nav{order:-1;padding:var(--s3) var(--s4);border:1px solid var(--rule);border-radius:var(--r2);background:var(--paper)}
 .bk-nav ol{display:grid;grid-template-columns:repeat(auto-fill,minmax(13rem,1fr));gap:0 var(--s4);border-left:0}
 .bk-nav a{padding:6px 0 6px var(--s3);min-height:44px;box-sizing:border-box;border-left:2px solid var(--rule)}
 .bk-nav a[aria-current="page"]{border-left:3px solid var(--ink)}
}

/* An identifier in a table breaks only where it has a natural joint: lib/banking.mjs puts one after . / and _ in
   identifiers of 24 characters or more. */
.bk-article :is(td,th) code{overflow-wrap:normal;word-break:normal}
/* The site's tables keep a first column on one line, for short labels; here a first column can hold a sentence. */
.bk-article tbody td:first-child{white-space:normal}
.bk-article td:first-child code{white-space:nowrap}

/* The diagrams: SVG with words in the site's type, ink lines, the sandbox's lane on the desk grey. */
.bk-fig{margin:var(--s5) 0 var(--s6)}
.bk-fig svg{display:block;width:100%;height:auto;font-family:var(--sans)}
.bk-fig figcaption{margin-top:var(--s3);font-size:var(--fs-meta);line-height:1.5;color:var(--ink2)}
.bk-flow .bk-narrow{display:none;max-width:420px}
@media (max-width:640px){.bk-flow .bk-wide{display:none}.bk-flow .bk-narrow{display:block}}
.bk-lifefig svg{max-width:460px}
.bk-n rect{fill:var(--paper);stroke:var(--ink);stroke-width:1.5}
.bk-n.bk-you rect{fill:var(--paper);stroke:var(--ink2);stroke-dasharray:5 4}
.bk-final .bk-inner{fill:none;stroke:var(--ink);stroke-width:1}
.bk-sandbox{fill:var(--desk);stroke:var(--rule2);stroke-width:1}
.bk-t{font-size:15px;font-weight:600;fill:var(--ink)}
.bk-mono{font-family:var(--mono);font-size:14px;letter-spacing:.02em}
.bk-s{font-size:12.5px;fill:var(--ink2)}
.bk-lane{font-size:12px;font-weight:600;fill:var(--mute);letter-spacing:.04em;text-transform:uppercase}
.bk-op{font-family:var(--mono);font-size:12px;fill:var(--ink)}
.bk-e{fill:none;stroke:var(--ink);stroke-width:1.5}
.bk-dash{stroke-dasharray:5 4}
.bk-head{fill:var(--ink)}

/* Previous and next, at the foot of the article. */
.bk-pager{display:flex;justify-content:space-between;gap:var(--s3);flex-wrap:wrap;margin-top:var(--s7);padding-top:var(--s5);border-top:1px solid var(--rule)}
.bk-pager .btn{flex-direction:column;align-items:flex-start;gap:2px;height:auto;min-height:44px;padding:8px 16px;text-align:left;white-space:normal}
.bk-pager .btn span{font-size:.75rem;font-weight:500;color:var(--mute)}
.bk-pager .bk-next{margin-left:auto;align-items:flex-end;text-align:right}
@media print{.bk-nav,.bk-pager{display:none}}

/* On a phone, a table becomes one block per row: the first cell is the row's name, and each other cell shows its
   column's name above it (data-label, written by lib/banking.mjs). The column names stay in the table for screen
   readers, which also keep the table's roles; the generated label has an empty alternative so it isn't read twice. */
@media (max-width:599px){
 .bk-article .tbl{overflow:visible}
 .bk-table,.bk-table tbody,.bk-table tr,.bk-table td{display:block;width:auto}
 .bk-table{background:none}
 .bk-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .bk-table tr{padding:var(--s3) 0;border-bottom:1px solid var(--rule)}
 .bk-table tbody tr:first-child{border-top:2px solid var(--ink)}
 .bk-article .bk-table :is(td,th){border:0;padding:2px 0}
 .bk-article .bk-table td:first-child{font-weight:600;padding-bottom:4px}
 .bk-table td+td::before{content:attr(data-label);content:attr(data-label) / "";display:block;margin-top:6px;font-size:.75rem;font-weight:600;letter-spacing:.02em;color:var(--mute)}
 .bk-article .bk-table td code{overflow-wrap:anywhere}
 .bk-nav ol{grid-template-columns:1fr 1fr;gap:0 var(--s3)}
 .bk-nav a small{display:none}
}
