/* /cheat-sheet/ — page styles (shared components live in /style.css) */
.cs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2rem 0 .6rem; }
.cs-btn-note { font-weight: 500; font-size: 12.5px; color: inherit; opacity: .75; }
.cs-prefix { margin-top: 1rem; }
.cs-prefix .pfx-switch { margin: 0; }
.cs-prefix-note { margin: .5rem 0 0; font-size: 13.5px; color: var(--ink-3); }

/* Top 20 grid */
.cs-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 12px; margin: 1.2rem 0 1rem; }
.cs-grp { padding: 14px 16px 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--cat); }
.cs-grp h3 { margin: 0 0 .6rem; font-size: .95rem; display: flex; align-items: center; }
.cs-grp ul { list-style: none; margin: 0; padding: 0; }
.cs-grp li { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; align-items: baseline; margin: 0; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.cs-grp li:first-child { border-top: 0; }
.cs-grp .kseq { white-space: nowrap; }
.kpair { display: flex; flex-direction: column; gap: 4px; }

/* Jump links under the filter */
.cs-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: -.2rem 0 .6rem; }
.cs-jump a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font: 600 13px var(--sans); text-decoration: none; }
.cs-jump a:hover { border-color: var(--green-line); color: var(--ink); }
.cs-jump .cat-dot { margin-right: 6px; }
.filter-count { min-width: 9ch; text-align: right; }

/* Generated key groups: the h2 names the group, so the generator's h3 is a small label */
#all-keys .keygroup > h3 { margin: .2rem 0 0; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); display: flex; align-items: center; }
#all-keys .keygroup .table-wrap { margin-top: .6rem; }
.keys-table td.k { white-space: nowrap; }
.keys-table td:nth-child(3) { max-width: 360px; }
.cs-vi th[scope="row"] { font-weight: 500; color: var(--ink); white-space: nowrap; }
.cs-cli td:first-child { white-space: nowrap; }
.cs-cli .cmdline code { white-space: nowrap; }

/* PDF block */
.cs-pdf { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; align-items: start; padding: 20px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--green) 7%, var(--panel)), var(--panel) 60%); border: 1px solid var(--green-line); }
.cs-pdf > div > p:first-child { margin-top: 0; }
.cs-pdf-art { position: relative; height: 170px; }
.cs-pdf-page { position: absolute; width: 168px; height: 119px; padding: 12px; border-radius: 6px; background: #fff; border: 1px solid #d5dae2; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .55); display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.cs-pdf-page:first-child { left: 0; top: 0; transform: rotate(-4deg); }
.cs-pdf-page:last-child { left: 34px; top: 44px; transform: rotate(3deg); }
.cs-pdf-page i { height: 7px; border-radius: 2px; background: #0b7a3b; opacity: .8; }
.cs-pdf-page i:nth-child(2) { background: #d4572a; } .cs-pdf-page i:nth-child(3) { background: #148a60; }
.cs-pdf-page b { height: 66px; border-radius: 2px; background: repeating-linear-gradient(#e5e7eb 0 2px, transparent 2px 8px); }
.cs-pdf-list { margin: .4rem 0 .8rem; }
.cs-pdf .cs-actions { margin: .8rem 0 .4rem; }

@media (max-width: 640px) {
  .cs-pdf { grid-template-columns: 1fr; }
  .cs-pdf-art { display: none; }
  .cs-grp li { grid-template-columns: 1fr; }
  .cs-actions .btn { flex: 1 1 auto; }
}

/* Print this page: tables only, compact, light */
@media print {
  @page { margin: 12mm; }
  .cs-hero .lede, .cs-actions, #keyboard, .shot, .callout, #pdf, #faq, #next-steps-heading, #next-steps-heading + .cards, .page-meta, .cs-prefix, .x-code, .code { display: none !important; }
  .cs-sec > p, .cs-grp + p { font-size: 9pt; }
  h1 { font-size: 20pt; margin: 0 0 6pt; }
  h2 { font-size: 13pt; margin: 12pt 0 4pt; }
  .cs-top { grid-template-columns: repeat(4, 1fr); gap: 6pt; }
  .cs-grp { padding: 6pt 8pt; border-top-width: 2pt; }
  .cs-grp li { grid-template-columns: 1fr; padding: 3pt 0; font-size: 8.5pt; }
  table { font-size: 9pt; }
  td, th { padding: 3pt 6pt !important; }
  .keys-table td:nth-child(3) { font-size: 8pt; }
  kbd { font-size: 8pt; }
}

/* Phones: stack the command under the action instead of a third column */
@media (max-width: 640px) {
  .cs-sec .keys-table:not(.cs-vi) thead { display: none; }
  .cs-sec .keys-table:not(.cs-vi) tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; border-top: 1px solid var(--line); }
  .cs-sec .keys-table:not(.cs-vi) tr:first-child { border-top: 0; }
  .cs-sec .keys-table:not(.cs-vi) td { border: 0; }
  .cs-sec .keys-table:not(.cs-vi) td:nth-child(3) { grid-column: 2; padding-top: 0; max-width: none; }
  .cs-sec .keys-table:not(.cs-vi) .cmd-mini { white-space: normal !important; word-break: break-word; }
  .cs-cli thead { display: none; }
  .cs-cli tr { display: block; padding: 8px 0; border-top: 1px solid var(--line); }
  .cs-cli td { display: block; border: 0; padding: 2px 12px; }
  .cs-cli .cmdline { min-width: 0; }
  .cs-cli .cmdline code { white-space: pre-wrap !important; word-break: break-word; }
}
