/* Plain HTML, circa 2005. System fonts and native controls are intentional. */
* { box-sizing: border-box; }
html { background: #d4d0c8; color: #000; }
body { max-width: 800px; margin: 20px auto; border: 1px solid #808080; background: #fff; font: 16px/1.4 "Times New Roman", Times, serif; }
a { color: #0000ee; text-decoration: underline; }
a:visited { color: #551a8b; }
header { padding: 10px 16px; border-bottom: 1px solid #808080; background: #eee; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.brand { font-weight: bold; font-size: 20px; }
nav { display: flex; flex-wrap: wrap; gap: 16px; }
.version { margin-left: auto; font-size: 13px; }
main { padding: 0 20px; }
.intro { margin: 24px 0; }
h1 { margin: 0 0 12px; color: #000080; font-size: 28px; }
p { margin: 10px 0; }
h2 { margin: 0; font-size: 19px; }
h3 { margin: 0 0 10px; font-size: 16px; }
.connection { margin: 0; padding: 10px 14px; min-width: 0; border: 2px groove #ddd; }
legend { padding: 0 5px; font-weight: bold; }
.connection > div { max-width: 440px; }
.connection button { margin-top: 10px; }
.connection p { font-size: 14px; margin-bottom: 0; }
label { display: block; font-weight: bold; margin: 10px 0 4px; }
input, select, textarea, button { font: 13px/1.4 Tahoma, Arial, sans-serif; color: #000; }
input:not([type=range]):not([type=checkbox]), select, textarea { width: 100%; min-width: 0; padding: 4px; background: #fff; border: 2px inset #ddd; border-radius: 0; }
textarea { resize: vertical; }
textarea::placeholder, input::placeholder { color: #666; opacity: 1; }
button { padding: 4px 12px; border: 2px outset #ddd; border-radius: 0; background: #e8e8e8; cursor: pointer; }
button:hover { background: #dcdcdc; }
button:active { border-style: inset; }
button:disabled { color: #595959; cursor: wait; }
:focus-visible { outline: 2px solid #000080; outline-offset: 2px; }
small { display: block; margin-top: 5px; color: #444; font: 12px/1.45 Tahoma, Arial, sans-serif; }
input[type=range] { width: 100%; }
output { float: right; font-weight: normal; }
#workspace, #explorer { margin-top: 28px; }
#examples { margin: 28px 0; }
#examples h3 { margin: 16px 0 8px; }
#examples blockquote, #examples .example-rewrite { margin: 0; padding: 0; border: 0; background: transparent; }
#examples blockquote p { margin: 0; }
#examples blockquote p, #examples .example-rewrite { white-space: pre-line; }
.example-copy { position: relative; display: grid; align-items: center; min-height: 220px; padding: 28px; border-radius: 20px; background: #f1eee6; font-size: 22px; line-height: 1.5; cursor: pointer; }
.example-copy > :not(svg) { grid-area: 1 / 1; }
#examples .example-original { opacity: 1; visibility: visible; }
#examples .example-rewrite { opacity: 0; visibility: hidden; }
#examples article[data-stage=rewrite] .example-copy { background: #edf5ed; }
#examples article[data-stage=rewrite] .example-original { opacity: 0; visibility: hidden; }
#examples article[data-stage=rewrite] .example-rewrite { opacity: 1; visibility: visible; }
@property --ink-progress { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
#examples mark { --ink-progress: 0%; --ink-wash: #f1eee655; color: inherit; background-color: transparent; background-image: linear-gradient(to right, transparent var(--ink-progress), #f1eee6 var(--ink-progress)), linear-gradient(var(--ink-wash), var(--ink-wash)), url('/highlighter-paper.png'); background-repeat: no-repeat; background-size: 100% 100%, 100% 100%, 100% 115%; background-position: left top, left top, left 68%; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
#examples mark.heavy { --ink-wash: #f1eee618; }
#examples mark:nth-of-type(3n) { background-position: left top, left top, left 88%; }
#examples article[data-stage=issues] mark { --ink-progress: 100%; }
.example-progress { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.example-progress rect { fill: none; stroke: #9d8357; stroke-width: 1; stroke-dasharray: 100; stroke-dashoffset: 100; }
[data-stage=rewrite] .example-progress rect { stroke: #588c67; }
.example-footer { position: relative; min-height: 44px; margin-top: 8px; }
#examples .example-source { position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; max-width: calc(100% - 56px); min-height: 44px; margin: 0; color: inherit; font-size: 13px; text-decoration: none; }
.example-source img { flex: none; width: 22px; height: 22px; opacity: .65; }
.example-source span { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: max-width 350ms ease-in-out, opacity 220ms ease-in-out, margin 350ms ease-in-out; }
.example-source:is(:hover, :focus-visible) span { max-width: 650px; opacity: 1; margin-left: 12px; }
#examples .example-details { margin: 0; }
#examples .example-details summary { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; padding: 0; list-style: none; cursor: pointer; color: inherit; text-decoration: none; }
.example-details summary::-webkit-details-marker { display: none; }
.example-details[open] summary svg { transform: rotate(90deg); }
.example-detail-body { padding: 8px 0 20px; }
.example-detail-body p, .example-detail-body li { font-size: 14px; }
.example-detail-body ul { padding-left: 20px; }
.example-copy:focus-visible, .example-source:focus-visible, .example-details summary:focus-visible { outline: 2px solid #448367; outline-offset: 4px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 5px 8px; background: #000080; color: #fff; margin-bottom: 12px; }
.section-heading span, .section-heading a { font-size: 13px; }
.section-heading a, .section-heading a:visited { color: #fff; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; }
.source, .settings, .explorer-grid > div { min-width: 0; }
.source { display: flex; flex-direction: column; }
.pane-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pane-label label, .pane-label h3 { margin: 0; }
.source textarea { flex: 1; min-height: 300px; font: 15px/1.5 "Times New Roman", Times, serif; }
.source-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 12px; }
.settings { background: #eee; border: 1px solid #aaa; padding: 10px; font-size: 14px; }
.row { display: flex; gap: 10px; }
.row > div { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 5px; font-weight: normal; }
details { margin-top: 12px; }
summary { color: #0000ee; text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions span { width: 100%; font-size: 13px; }
#status { min-height: 22px; }
#status.error { color: #a00000; font-weight: bold; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #aaa; margin: 16px 0; }
.metric { padding: 8px; }
.metric + .metric { border-left: 1px solid #aaa; }
.metric span { font-size: 14px; }
.metric strong { display: block; font-size: 23px; }
.finding { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid #aaa; overflow-wrap: anywhere; }
.finding p { margin: 0; }
#findings h3 { margin-top: 16px; }
pre, .code, #constraints { font: 12px/1.5 "Courier New", Courier, monospace; }
pre { padding: 10px; background: #f3f3f3; border: 1px solid #aaa; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 500px; overflow: auto; }
#output-text { font: 16px/1.5 "Times New Roman", Times, serif; background: #fff; max-height: none; }
.explorer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
#request-body { margin-bottom: 8px; }
#endpoint-description { font-size: 14px; }
#explorer-result { margin-top: 0; min-height: 260px; }
.notes { border-top: 1px solid #808080; margin: 28px 0 20px; padding-top: 14px; font-size: 14px; }
.notes h3 { margin: 14px 0 4px; }
.notes p { margin: 0; }
footer { border-top: 1px solid #808080; padding: 12px; text-align: center; font-size: 13px; }
footer .brand { font-size: 16px; }
footer p { margin: 4px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  body { margin: 8px; }
  main { padding: 0 12px; }
  header { padding: 10px 12px; }
  nav { order: 3; width: 100%; }
  .workbench, .explorer-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid #aaa; }
  .finding { grid-template-columns: 1fr; gap: 4px; }
  button, select { min-height: 36px; }
  input:not([type=range]):not([type=checkbox]), select, textarea, .source textarea { font-size: 16px; }
}

/* The public guide shares the workbench's plain HTML appearance. */
.guide section { margin: 24px 0; }
.guide blockquote { margin: 10px 0 16px; padding: 4px 12px; border-left: 3px solid #aaa; background: #f3f3f3; }
.guide table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.guide caption { text-align: left; margin-bottom: 6px; font-weight: bold; }
.guide th, .guide td { padding: 8px; border: 1px solid #aaa; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.guide thead { background: #eee; }
.guide th[scope=row] { width: 30%; }
.guide code { font: 13px/1.5 "Courier New", Courier, monospace; }

.account fieldset { border: 2px groove #ddd; padding: 12px; }
.account form { max-width: 520px; }
.account form button { margin-top: 12px; }
.account .error { color: #a00000; font-weight: bold; }
#new-secrets { border: 2px solid #000080; padding: 12px; }
#new-secrets input { font-family: "Courier New", Courier, monospace; }

/* Native horizontal scrolling works with touch, trackpads and without JavaScript. */
#example-track { position: relative; --example-width: min(520px, calc(100% - 48px)); display: flex; align-items: flex-start; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 4px 0 16px; }
#example-track:focus-visible { outline: 2px solid #000080; outline-offset: 4px; }
#examples #example-track article { flex: 0 0 var(--example-width); min-width: 0; margin: 0; padding: 0; border: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.example-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.example-controls button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; }
.example-controls button:disabled { cursor: default; opacity: .4; }
/* Leave room to align the final card at the start, so it also gets its turn. */
#example-track::after { content: ''; flex: 0 0 max(0px, calc(100% - var(--example-width) - 20px)); }
@media (max-width: 640px) { #example-track { --example-width: 100%; gap: 16px; } #example-track::after { display: none; } }

/* Shared words travel between measured inline positions without changing text layout. */
#examples .example-word-layer { grid-area: auto; position: absolute; inset: 0; pointer-events: none; max-width: none; }
.example-word-layer span { position: absolute; white-space: pre; }
#examples article.word-motion .example-original, #examples article.word-motion .example-rewrite { opacity: 0; visibility: hidden; transition: none; }

.example-word-layer .example-erasing { background: url('/highlighter-paper.png') left 68% / 100% 115% no-repeat; mask-image: linear-gradient(90deg, transparent 48%, #000 51%); mask-size: 300% 100%; mask-repeat: no-repeat; }
