/* All features: a reference page, a table of contents beside the groups (features.html and its translations only).
   Builds on styles.css: colors, type, pills, tables. */
.ref-hero { padding-block: 48px 28px; }
.ref-hero .wrap { grid-template-columns: minmax(0, 1fr); }
.ref-hero h1 { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.8rem); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: baseline; gap: 8px; }

/* The table of contents: on top on narrow screens, a sticky column beside the groups on wide ones */
.ref { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 48px; padding-bottom: 72px; }
.ref > * { min-width: 0; }
.toc { font-size: var(--step--1); padding-top: 8px; }
.toc-title { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; }
.toc li { break-inside: avoid; }
.toc a { display: block; padding: 3px 10px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); line-height: 1.4; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }
.toc ol ol { margin: 0 0 4px; }
.toc ol ol a { padding-left: 22px; font-size: 0.8rem; }
@media (max-width: 959px) {
  .toc { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .toc > ol { columns: 2 13rem; column-gap: 24px; }
  .toc ol ol { display: none; }
}
@media (min-width: 960px) {
  .ref { grid-template-columns: 14rem minmax(0, 1fr); align-items: start; }
  .toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + 24px); max-height: calc(100vh - var(--top-h) - 48px); overflow: auto; padding-top: 32px; }
}

/* Groups: the heading lands 32px under the sticky header */
.group { padding-top: 32px; min-width: 0; }
.group + .group { margin-top: 40px; border-top: 1px solid var(--line); }
.group h2 { font-size: var(--step-2); }
.group-lede { color: var(--muted); max-width: 66ch; margin-top: 10px; }
.group .note { margin-top: 12px; }

/* A feature: its name and keys, then a sentence or two and where it stands */
.feats { margin-top: 18px; border-top: 1px solid var(--line); }
.feat { display: grid; gap: 4px 28px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .feat { grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr); } }
.feat h3 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.feat-keys { margin-top: 6px; font-size: 0.9rem; color: var(--muted); line-height: 1.9; }
.feat-text { display: grid; gap: 8px; align-content: start; }
.feat-text p { max-width: 70ch; }
.feat-text ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; max-width: 70ch; }
.feat-status { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88rem; color: var(--muted); }
.feat-status > span { display: inline; }
.feat-status .pill { margin-right: 4px; }
.where { display: inline-block; font-family: var(--f-mono); font-size: 0.72rem; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; vertical-align: 0.1em; }

/* Keys */
.keytable { min-width: 620px; font-size: 0.93rem; }
.keytable th, .keytable td { padding: 10px 16px; }
.keytable td:first-child { white-space: nowrap; }
.keytable td:last-child code { font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.group .compare-wrap { margin-top: 18px; }

/* Options and command line: name and what it does */
.optlist { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 6px 20px; margin: 0; font-size: 0.92rem; }
.optlist dt code { overflow-wrap: anywhere; }
.optlist dd { margin: 0; color: var(--muted); }
@media (max-width: 559px) { .optlist { grid-template-columns: minmax(0, 1fr); } .optlist dd { margin-bottom: 8px; } }
pre.cmd { margin: 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 0.85rem; }

/* Buttons under a group */
.ref .btns { margin-top: 18px; }
