:root {
  color-scheme: light;
  --paper: #f9f9f7;
  --ink: #171715;
  --muted: #555650;
  --line: #d4d5ce;
  --red: #b72120;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-underline-offset: .19em; text-decoration-thickness: 1px; }
a:hover, .text-link:hover { color: var(--red); }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 3px solid #a52322; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(91%, 1180px); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: -100px; left: 1rem; background: white; color: black; padding: 1rem; }
.skip:focus { top: .5rem; }
.mast { border-bottom: 1px solid var(--line); }
.mast-inner { display: flex; justify-content: space-between; align-items: center; height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 750; font-size: 1.22rem; letter-spacing: -.055em; }
.mark { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 27px; height: 27px; border-radius: 5px; background: var(--red); transform: rotate(-3deg); }
.mark i { display: block; height: 9px; width: 3px; border-radius: 1px; background: #fff; transform: skewY(-17deg); }
.mark i:nth-child(2) { height: 16px; }
.mark i:nth-child(3) { height: 11px; }
.repo-link { text-decoration: none; font-size: .92rem; font-weight: 650; padding: .65rem 0 .65rem .6rem; }
.repo-link span { font-weight: 400; margin-left: .15rem; }
.review { display: grid; column-gap: clamp(2rem, 5vw, 4.75rem); align-items: start; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); grid-template-areas: "intro code" "choice code" "error error"; padding-block: clamp(3rem, 7vw, 6rem) clamp(2.75rem, 6vw, 5rem); }
.intro { grid-area: intro; }
.kicker { margin: 0 0 1.3rem; color: var(--red); font: 650 .72rem/1.45 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.signal { display: inline-block; align-self: center; width: 1rem; height: .13rem; background: currentColor; vertical-align: middle; margin-right: .35rem; }
h1 { margin: 0; font-size: clamp(3.1rem, 5.45vw, 5.15rem); line-height: .98; letter-spacing: -.045em; font-weight: 720; }
h1 span { color: var(--red); }
.lead { color: #454640; font-size: clamp(1rem, 1.35vw, 1.17rem); max-width: 39ch; line-height: 1.65; margin: 1.45rem 0 0; }
.code-column { grid-area: code; min-width: 0; }
.code-card { overflow: hidden; border: 1px solid #bfc0b9; border-radius: .5rem; background: #fff; box-shadow: 0 3px 0 #e9e9e3; }
.code-head { color: #f7f6f1; background: #242623; display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .9rem 1.15rem; }
.code-head h2, .code-label, .code-type { margin: 0; font: 550 .75rem/1.35 var(--mono); }
.code-type { font-size: .64rem; color: #d3d4ca; letter-spacing: .08em; }
.filename { margin: 0; font: 450 .75rem/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; padding: .7rem 1.12rem; background: #f6f6f2; border-bottom: 1px solid #e5e6df; }
.sql { margin: 0; padding: .98rem 1rem 1.15rem .7rem; color: #222522; tab-size: 2; }
.sql code { display: block; font: 470 clamp(.8rem, 1vw, .9rem)/1.65 var(--mono);  }
.sql-line { display: grid; grid-template-columns: 2.1em minmax(0, 1fr); }
.line-number { color: #787b72; text-align: right; padding-right: .9em; font-size: .94em; user-select: none; }
.sql-text { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.65em; }
.keyword { color: #962a28; font-weight: 650; }
.comment { color: #58604d; font-style: italic; }
.literal { color: #554334; }
details { margin: 1rem 0 .1rem; border-left: 2px solid var(--line); }
summary { padding: .34rem .68rem; font-size: .82rem; font-weight: 550; color: #44463e; cursor: pointer; }
details[open] .filename { margin-top: .3rem; }
details .sql { background: #fff; }
.decision { grid-area: choice; padding-top: 1.65rem; }
.decision h2 { font-size: 1.02rem; margin: 0 0 .75rem; line-height: 1.4; letter-spacing: -.025em; }
.choices, .result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.choice, .ink-button { min-height: 46px; padding: .68rem 1.08rem; border: 1px solid #777970; font-size: .94rem; line-height: 1.3; font-weight: 650; border-radius: .32rem; background: #fff; color: var(--ink); }
.choice:hover:not(:disabled), .ink-button:hover { border-color: var(--ink); background: var(--ink); color: white; }
.ink-button { display: inline-flex; align-items: center; gap: .6rem; border-color: var(--ink); background: var(--ink); color: #fff; text-decoration: none; }
.ink-button:hover { background: #44463f; }
.text-link { border: none; background: none; padding: .55rem 0; color: inherit; font-weight: 570; text-decoration: underline; text-underline-offset: .2em; }
.result-actions { gap: 1.15rem; margin-top: 1.15rem; font-size: .94rem; }
.load-error { grid-area: error; margin-top: 1rem; }
.result { border-top: 2px solid var(--ink); background: #fff; padding: clamp(1.3rem,3.2vw,2.5rem); margin: 0 0 3rem; }
.result .kicker { margin: 0 0 .65rem; }
.result h2 { margin: 0; font-size: clamp(1.7rem,3.1vw,3rem); line-height: 1.08; letter-spacing: -.055em; }
.result p:not(.kicker):not(.filename) { line-height: 1.62; max-width: 70ch; }
.finding { font: .8rem/1.6 var(--mono); color: #3c3f37; border-left: 2px solid var(--red); padding-left: .7rem; }
.fix { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.6rem; scroll-margin-top: 1rem; }
.fix .code-card { max-width: 50rem; }
.try { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--line); padding: 1.5rem 0 2.25rem; }
.try h2 { font-size: 1.1rem; line-height: 1.5; margin: 0; letter-spacing: -.025em; }
.try p { margin: .15rem 0 0; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.command { color: var(--ink); display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .8rem; min-height: 43px; border: 1px solid var(--line); border-radius: .3rem; background: #fff; max-width: 100%; }
.command:hover:not(:disabled) { border-color: var(--ink); }
.command code { font: .83rem var(--mono); overflow-wrap: anywhere; }
.command span { font-size: .8rem; font-weight: 650; border-left: 1px solid var(--line); padding-left: .75rem; }
.feedback:not(:empty), .copy-manual { background: #fff; padding: .65rem .85rem; border: 1px solid var(--line); line-height: 1.4; overflow-wrap: anywhere; }
.feedback:not(:empty) { position: fixed; bottom: .95rem; left: 50%; transform: translateX(-50%); border-radius: .35rem; box-shadow: 0 2px 12px #0001; max-width: 90%; text-align: center; z-index: 1; }
.copy-manual { margin-bottom: 2rem; }
.copy-manual label { display: block; font-weight: 650; margin-bottom: .35rem; }
.copy-manual input { display: block; width: 100%; padding: .5rem; font-family: var(--mono); font-size: .87rem; }
@media (max-width: 780px) {
  .mast-inner { height: 59px; }
  .review { grid-template-columns: minmax(0,1fr); grid-template-areas: "intro" "code" "choice" "error"; padding: 2.6rem 0 2.2rem; }
  h1 { font-size: clamp(3rem, 9.8vw, 4.5rem); }
  .lead { max-width: 60ch; margin-top: 1rem; }
  .code-column { margin-top: 1.5rem; }
  .kicker { margin-bottom: .9rem; }
  .decision { padding-top: 1.35rem; }
  .result { margin-bottom: 2rem; }
}
@media (max-width: 410px) {
  .wrap { width: 92%; }
  .choice { padding-inline: .8rem; }
  .sql { padding-inline: .35rem; }
  .sql-line { grid-template-columns: 1.9em minmax(0, 1fr); }
}
