/* The lab under the Prompt Writing chapter (writing.js): a note as Markdown and as it looks, side by side where
   there's room, and one of the Ontology's entries as YAML, JSON or XML. The site's colors, faces and themes. */
.wl { container-type: inline-size; margin: 6px 0 8px; }
.page .wl-sec > p, .page .wl-about p { max-width: 44em; }
.wl-about ul { margin: 0 0 14px; padding-left: 22px; max-width: 44em; }
.wl-about li { margin: 0 0 6px; }
.wl-about a { color: var(--c-fg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c-fg) 45%, transparent); text-underline-offset: 3px; }
.wl-k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); }
.wl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wl-head { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 0 6px; }
.wl-mini { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 5px; padding: 1px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.wl-mini:hover { background: var(--hover); color: var(--ink); }
.wl :focus-visible { outline: 2px solid var(--c-fg); outline-offset: 1px; }

/* The two sides of the note: each a label, a bar and the text, the rows lined up across both. */
.wl-eds { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 18px; margin: 4px 0 6px; }
.wl-pane { display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; }
.wl-pane + .wl-pane { margin-top: 18px; }
.wl-top { display: flex; justify-content: flex-end; margin: 0 0 6px; }
@container (min-width: 680px) { .wl-eds { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .wl-pane + .wl-pane { margin-top: 0; } }
.wl-pane > .wl-k { margin: 0 0 6px; }
.wl-bar { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 4px; padding: 4px 6px; border: 1px solid var(--cell); border-bottom-color: var(--line); border-radius: 8px 8px 0 0; background: var(--side); }
.wl-note { padding-left: 6px; font: 12.5px var(--mono); color: var(--faint); }
.wl-src .wl-bar { align-content: center; background: none; }  /* a caption, not a box to type in */
.wl-src .wl-note { font-family: inherit; font-size: 12.5px; line-height: 1.4; color: var(--dim); }
.wl-md, .wl-rich { width: 100%; min-height: 300px; border: 1px solid var(--cell); border-top: 0; border-radius: 0 0 8px 8px; color: var(--ink); }
.wl-md { display: block; resize: vertical; field-sizing: content; margin: 0; padding: 12px 14px; background: var(--bg); font: 13.5px/1.6 var(--mono); tab-size: 2; }
.wl-md:focus, .wl-rich:focus { outline: 2px solid var(--c-fg); outline-offset: -1px; }
.wl-rich { padding: 10px 16px; background: var(--bg); font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.wl-rich > :first-child, .wl-rich blockquote > :first-child { margin-top: 0; }
.wl-rich > :last-child, .wl-rich blockquote > :last-child { margin-bottom: 0; }
.page .wl-rich h1 { font-family: var(--title); font-size: 24px; font-weight: 600; line-height: 1.25; margin: 14px 0 6px; }
.page .wl-rich h2 { font-family: var(--title); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 14px 0 4px; }
.page .wl-rich p { margin: 0 0 8px; }
.wl-rich ul, .wl-rich ol { margin: 0 0 8px; padding-left: 24px; }
.wl-rich li { margin: 2px 0; }
.wl-rich blockquote { margin: 0 0 8px; padding: 2px 0 2px 14px; border-left: 3px solid var(--cell); color: var(--dim); }
.wl-rich code { font: 0.88em/1 var(--mono); background: var(--call); border-radius: 4px; padding: 2px 4px; }
.wl-rich a { color: var(--c-fg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c-fg) 45%, transparent); text-underline-offset: 3px; }
.wl-rich strong { font-weight: 650; }

/* Its toolbar: only what Markdown can write. Each button's tooltip gives the Markdown it writes. */
.wl-tools { display: flex; flex-wrap: wrap; gap: 2px; }
.wl-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--dim); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.wl-tool:hover { background: var(--hover); color: var(--ink); }
.wl-tool[aria-pressed="true"] { background: var(--sel); border-color: var(--line); color: var(--ink); }
.wl-tool:disabled { opacity: 0.4; cursor: default; background: none; }
.wl-tool svg { width: 17px; height: 17px; }
.wl-tool b { font-weight: 700; } .wl-tool .ser { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.wl-tool u { text-underline-offset: 2px; }
.wl-linkbar { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 2px; padding: 6px 0 2px; border-top: 1px solid var(--line); }
.wl-linkbar[hidden] { display: none; }
.wl-url { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 14px; padding: 5px 9px; border: 1px solid var(--cell); border-radius: 6px; background: var(--bg); color: var(--ink); }
.wl-linkbar .wl-mini { margin-left: 0; padding: 4px 10px; }
.wl-linkbar .wl-go { background: var(--sel); color: var(--ink); font-weight: 500; }
.wl-err { flex-basis: 100%; color: var(--e-fg); font-size: 13px; }
.wl-err:empty { display: none; }

/* The same facts, three ways: the entries beside the viewer, stacked on a phone. */
.wl-data { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 10px; }
@container (min-width: 620px) { .wl-data { grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); align-items: start; } }
.wl-picks-wrap .wl-k { display: block; min-height: 30px; line-height: 30px; margin: 0 0 6px; }
.wl-picks { border-bottom: 1px solid var(--line); }
.wl-pick { position: relative; display: block; padding: 10px 10px 11px; border-top: 1px solid var(--line); cursor: pointer; }
.wl-pick:hover { background: var(--hover); }
.wl-pick:has(input:checked) { background: var(--sel); box-shadow: inset 3px 0 var(--c-fg); }
.wl-pick:has(input:focus-visible) { outline: 2px solid var(--c-fg); outline-offset: -2px; }
.wl-pick input { position: absolute; opacity: 0; pointer-events: none; }
.wl-pick .nm { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.wl-pick .d { display: block; color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.page .wl-none { color: var(--dim); font-size: 14px; padding: 10px 0; margin: 0; }
.wl-ctl { flex-wrap: wrap; gap: 10px 14px; }
.wl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.wl-seg label { position: relative; cursor: pointer; }
.wl-seg label + label { border-left: 1px solid var(--line); }
.wl-seg input { position: absolute; opacity: 0; pointer-events: none; }
.wl-seg span { display: block; padding: 4px 12px; font-size: 13px; font-weight: 500; letter-spacing: 0.03em; color: var(--dim); }
.wl-seg label:hover span { background: var(--hover); color: var(--ink); }
.wl-seg input:checked + span { background: var(--sel); color: var(--ink); }
.wl-seg input:focus-visible + span { outline: 2px solid var(--c-fg); outline-offset: -2px; }
.wl-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.wl-switch input { position: absolute; opacity: 0; pointer-events: none; }
.wl-track { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--cell); transition: background 0.15s; }
.wl-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.wl-switch input:checked + .wl-track { background: var(--c-fg); }
.wl-switch input:checked + .wl-track::after { transform: translateX(12px); }
.wl-switch input:focus-visible + .wl-track { outline: 2px solid var(--c-fg); outline-offset: 2px; }
.wl-switch.off { opacity: 0.45; cursor: default; }
.page .wl-code { margin: 0; padding: 12px 14px; min-height: 12em; background: var(--call); border-radius: 8px; font: 13px/1.6 var(--mono); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.wl-code.min { word-break: break-all; }
.wl-key { color: var(--c-fg); } .wl-num { color: var(--w-fg); } .wl-attr { color: var(--p-fg); }
.wl-count { margin-top: 6px; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .wl-track, .wl-track::after { transition: none; } }
@media (max-width: 760px) { .wl-md, .wl-rich { min-height: 220px; } .wl-tool { min-width: 36px; height: 34px; } }
