.guides-site svg:not(.apple-glyph):not(.menu-toggle svg) {
  flex-shrink: 0;
}

.guides-site a:focus-visible {
  outline: 2px solid var(--guide-accent);
  outline-offset: 5px;
  border-radius: 3px;
}

.guides-site .brand-wordmark:focus-visible {
  outline-offset: -3px;
}

.docs-sidebar summary:focus-visible {
  outline: 2px solid var(--guide-accent);
  outline-offset: -2px;
  border-radius: 3px;
}

html[data-site-theme="ink"] .guides-site {
  --guide-accent: var(--clay);
}

.guides-site {
  --guide-accent: var(--clay-dark);
}

.guides-site .header-nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--guide-accent);
  text-underline-offset: 8px;
}

.features-main {
  padding: 96px 0 0;
}

.features-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  padding-bottom: 64px;
}

.features-intro h1 {
  font-size: clamp(2.8rem, 5.2vw, 5.4rem);
  font-weight: 650;
  letter-spacing: -0.038em;
  line-height: 1.04;
}

.features-intro h1 span {
  color: var(--guide-accent);
}

.features-lead {
  max-width: 43ch;
  margin-top: 24px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.6;
}

.features-actions {
  display: grid;
  justify-items: start;
  gap: 18px;
  padding-bottom: 5px;
}

.features-actions svg,
.features-docs-link svg,
.features-end svg,
.feature-guide svg,
.docs-sidebar summary svg,
.guide-start svg,
.docs-task-group svg,
.guide-pagination svg {
  width: 20px;
  height: 20px;
}

.features-docs-link,
.features-end a,
.feature-guide,
.guide-start {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--guide-accent);
  font-weight: 550;
  min-height: 44px;
}

.features-docs-link:hover,
.features-end a:hover,
.feature-guide:hover,
.guide-start:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: 36px 40px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}

.feature-card--lead {
  background: var(--paper-2);
  padding-top: 40px;
}

.feature-glyph {
  width: 30px;
  height: 30px;
  margin-bottom: 28px;
  color: var(--guide-accent);
}

.feature-card--lead .feature-glyph {
  width: 44px;
  height: 44px;
}

.feature-card h2 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.feature-card--lead h2 {
  font-size: 2rem;
}

.feature-card h2 a:hover {
  color: var(--guide-accent);
}

.feature-card p {
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.65;
  margin-block: 16px 24px;
}

.feature-guide {
  margin-top: auto;
  font-size: 0.95rem;
}

.features-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 64px;
  padding-bottom: 72px;
}

.features-end h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 550;
  letter-spacing: -0.025em;
}

.docs-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: start;
  gap: clamp(48px, 6vw, 96px);
  padding-top: 64px;
  padding-bottom: 96px;
}

.docs-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100dvh - 124px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.docs-sidebar summary {
  display: none;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 8px;
}

.docs-sidebar nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
}

.docs-sidebar nav a:focus-visible {
  outline-offset: -2px;
}

.docs-topic-group + .docs-topic-group {
  margin-top: 16px;
}

.docs-group-title {
  padding: 4px 12px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}

.docs-sidebar nav .docs-overview {
  color: var(--fg);
  font-weight: 600;
  padding-bottom: 16px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.docs-sidebar nav a:hover {
  color: var(--fg);
  background: var(--paper-2);
}

.docs-sidebar nav a[aria-current="page"] {
  background: var(--paper-2);
  color: var(--guide-accent);
  font-weight: 600;
}

.docs-article {
  min-width: 0;
  width: 100%;
  max-width: 46ch;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.docs-article:focus {
  outline: none;
}

.docs-article strong {
  font-weight: 600;
}

.docs-article kbd,
.docs-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

/* Keycaps read in the body face, as macOS menus print them; code stays mono. */
.docs-article kbd {
  font-family: inherit;
  font-size: 0.88em;
  font-weight: 500;
  display: inline-block;
  padding: 0 0.3em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper-2);
  line-height: 1.5;
}

/* A combo: one unbroken group of key caps joined by plus signs. */
.docs-article kbd.keys {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  white-space: nowrap;
}

.docs-article kbd[data-key]::before {
  margin-right: 0.25em;
}

.docs-article kbd[data-key="option"]::before { content: "\2325" / ""; }
.docs-article kbd[data-key="shift"]::before { content: "\21E7" / ""; }
.docs-article kbd[data-key="command"]::before { content: "\2318" / ""; }
.docs-article kbd[data-key="control"]::before { content: "\2303" / ""; }

.docs-article code {
  padding: 0.1em 0.25em;
  border-radius: 3px;
  background: var(--paper-2);
}

.guide-path {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.guide-path a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.guide-path a:hover {
  color: var(--guide-accent);
}

.docs-article h1 {
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}

.guide-lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.6;
}

.on-this-page {
  margin-top: 36px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}

.on-this-page-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.on-this-page ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 8px;
  list-style: none;
}

.on-this-page a {
  color: var(--guide-accent);
  font-size: 0.94rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.on-this-page a:hover {
  text-decoration-color: currentColor;
}

.guide-section {
  margin-top: 44px;
}

.guide-section h2,
.docs-task-group h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  scroll-margin-top: 100px;
}

.guide-section p + p,
.guide-section ol + p {
  margin-top: 16px;
}

/* No one-word last lines. */
.docs-article p,
.docs-task p {
  text-wrap: pretty;
}

.guide-steps {
  padding-left: 26px;
}

.guide-steps li {
  padding-left: 8px;
  margin-top: 14px;
}

.guide-steps li::marker {
  color: var(--guide-accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.guide-note {
  padding: 26px 28px;
  border-radius: 12px;
  background: var(--paper-2);
}

.guide-note h2 {
  font-size: 1.2rem;
}

/* At the text measure three columns get too narrow, so each request is a row
   of two: the request and its host, then the labelled cells stacked beside it.
   The markup's explicit table roles keep the semantics once display changes. */
.request-table,
.request-table tbody,
.request-table th,
.request-table td {
  display: block;
}

.request-table {
  width: 100%;
  font-size: 0.94rem;
  line-height: 1.6;
}

.request-table caption {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  text-align: left;
  color: var(--muted);
}

.request-table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.request-table tr {
  display: grid;
  grid-template-columns: minmax(0, 13.5em) minmax(0, 1fr);
  column-gap: 28px;
  row-gap: 16px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.request-table tbody tr:first-child {
  border-top: 1px solid var(--line-strong);
}

.request-table th,
.request-table td {
  text-align: left;
}

.request-table tbody th {
  grid-row: span 2;
  font-weight: 600;
}

.request-table td {
  grid-column: 2;
}

/* Hosts stay whole; the markup offers a break after each dot only. */
.request-table code {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* A host under the row label reads like the same host in body text. */
.request-table th code {
  font-weight: 400;
}

.request-table td > span[data-claim] + span[data-claim] {
  display: block;
  margin-top: 12px;
}

.table-cell-label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.request-table + p {
  margin-top: 24px;
}

.features-plan {
  padding-block: 56px 72px;
}

.features-plan h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
  font-weight: 600;
}

.features-plan p {
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.7;
}

.features-plan a {
  margin-top: 16px;
}

.voice-examples {
  list-style: none;
}

.voice-examples li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.voice-examples li:last-child {
  border-bottom: 1px solid var(--line);
}

.voice-examples span {
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-policy {
  margin-top: 32px;
}

.guide-policy a {
  color: var(--guide-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.guide-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line-strong);
  padding-top: 24px;
  margin-top: 64px;
}

.guide-pagination a {
  color: var(--guide-accent);
  font-weight: 550;
  line-height: 1.4;
}

.guide-pagination a:last-child {
  text-align: right;
}

.guide-pagination span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 450;
  margin-bottom: 6px;
}

.guide-pagination svg {
  display: inline;
  vertical-align: middle;
  margin-left: 8px;
}

.guide-pagination a:first-child svg {
  margin: 0 8px 0 0;
}

.guide-start {
  margin-top: 24px;
}

.docs-task-list {
  margin-top: 48px;
}

.docs-task-group + .docs-task-group {
  margin-top: 40px;
}

.docs-task-group ul {
  list-style: none;
}

.docs-task {
  position: relative;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.docs-task a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-weight: 600;
  line-height: 1.4;
}

/* The whole row opens the guide; the link keeps a short accessible name. */
.docs-task a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.docs-task p {
  margin-top: 4px;
  padding-right: 44px;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.55;
}

.docs-task:hover a {
  color: var(--guide-accent);
}

.docs-task a svg {
  flex: none;
  transition: transform 160ms ease;
}

.docs-task:hover a svg {
  transform: translateX(3px);
}

/* The whole row is the target, so the focus ring wraps the whole row. */
.docs-task:has(a:focus-visible) {
  outline: 2px solid var(--guide-accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.docs-task a:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .docs-task a svg { transition: none; }
}

.docs-filter {
  display: grid;
  gap: 8px;
  margin-top: 40px;
}

.docs-filter[hidden],
.docs-task[hidden],
.docs-task-group[hidden] {
  display: none;
}

.docs-filter label {
  font-size: 0.875rem;
  font-weight: 600;
}

.docs-filter input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
}

.docs-filter input::placeholder {
  color: var(--muted);
}

/* The browser's blue clear button is off palette; Esc still clears the field. */
.docs-filter input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.docs-filter input:focus-visible {
  outline: 2px solid var(--guide-accent);
  outline-offset: 2px;
}

.docs-filter-status {
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.875rem;
}

.docs-filter + .docs-task-list {
  margin-top: 16px;
}

/* The privacy policy reads at the docs measure and size, with the same
   contents component. The measure counts the container's side padding. */
.legal-policy {
  --guide-accent: var(--clay-dark);
  max-width: calc(46ch + 2 * clamp(20px, 4vw, 48px));
  font-size: 1.0625rem;
}

html[data-site-theme="ink"] .legal-policy {
  --guide-accent: var(--clay);
}

.legal-policy p,
.legal-policy li {
  font-size: 1em;
  line-height: 1.7;
  text-wrap: pretty;
}

.legal-policy h2 {
  text-wrap: balance;
  scroll-margin-top: 100px;
}

.legal-policy #uninstalling {
  scroll-margin-top: 100px;
}

.legal-policy .on-this-page {
  margin: 0 0 8px;
}

.legal-policy .on-this-page ul {
  flex-direction: column;
  row-gap: 4px;
  padding-left: 0;
}

.legal-policy .on-this-page li {
  margin: 0;
  line-height: 1.45;
}

.legal-policy .on-this-page a {
  display: inline-block;
  padding-block: 3px;
}

@media (max-width: 900px) {
  .features-main { padding-top: 48px; }
  .features-intro { grid-template-columns: 1fr; gap: 28px; padding-bottom: 40px; }
  .features-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; }
  .feature-card { padding: 28px; }
  .docs-layout { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; padding-bottom: 64px; }
  .docs-sidebar { position: static; max-height: none; overflow: visible; border-block: 1px solid var(--line); }
  .docs-sidebar summary { display: flex; justify-content: space-between; align-items: center; min-height: 54px; cursor: pointer; font-size: 0.94rem; font-weight: 550; list-style: none; }
  .docs-sidebar summary::-webkit-details-marker { display: none; }
  .docs-sidebar summary svg { transform: rotate(90deg); }
  .docs-sidebar[open] summary svg { transform: rotate(-90deg); }
  .docs-sidebar nav { padding: 0 0 14px; }
  .docs-sidebar nav a { display: flex; align-items: center; min-height: 44px; padding-block: 10px; }
  .docs-article { justify-self: center; }
}

@media (max-width: 600px) {
  .features-intro h1 { font-size: clamp(2.65rem, 10.5vw, 3.5rem); }
  .features-lead { font-size: 1.08rem; }
  .feature-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { padding: 28px 24px 24px; }
  .feature-card--lead { min-height: 0; }
  .feature-card--lead h2 { font-size: 1.75rem; }
  .feature-glyph { margin-bottom: 24px; }
  .features-end { flex-direction: column; align-items: start; gap: 12px; padding-block: 40px; }
  .guide-path { margin-bottom: 8px; }
  .guide-lead { font-size: 1.1rem; }
  .on-this-page { margin-top: 28px; }
  .on-this-page ul { flex-direction: column; gap: 8px; }
  .on-this-page a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
  .guide-section { margin-top: 36px; }
  .guide-section h2 { font-size: 1.35rem; }
  .guide-note { padding: 22px; }
  .voice-examples li { grid-template-columns: 1fr; gap: 4px; }
  .guide-pagination { gap: 16px; margin-top: 44px; }
  .guide-pagination svg { display: none; }
  .request-table tr { grid-template-columns: minmax(0, 1fr); row-gap: 12px; padding-block: 18px; }
  .request-table tbody th { grid-row: auto; font-size: 1.1rem; }
  .request-table td { grid-column: 1; }
  .features-plan { padding-block: 40px 56px; }
}

@media (max-width: 720px) {
  .legal-policy h2,
  .legal-policy #uninstalling { scroll-margin-top: 124px; }
  .legal-policy .on-this-page ul { row-gap: 0; }
  .legal-policy .on-this-page a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
}

/* Wide screens: "On this page" moves into the empty right column and stays in
   view; the request table spans both columns as a real three-column table. */
@media (min-width: 1200px) {
  .docs-article:has(> .guide-top),
  .docs-article:has(> .on-this-page) {
    display: grid;
    grid-template-columns: minmax(0, 46ch) minmax(12rem, 1fr);
    column-gap: clamp(48px, 5vw, 80px);
    align-items: start;
    max-width: none;
  }

  .docs-article:has(> .on-this-page) > *,
  .docs-article:has(> .guide-top) > *,
  .guide-top > * {
    grid-column: 1;
  }

  /* A sticky grid item stays on screen until its grid container ends, not its
     grid area. On a page with a request table, the rail sits in .guide-top,
     which ends before the table, so the rail scrolls away before the table
     takes its column. */
  .docs-article > .guide-top {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: start;
  }

  .guide-top > .on-this-page,
  .docs-article > .on-this-page {
    grid-column: 2;
    grid-row: 1 / span 40;
    position: sticky;
    top: 100px;
    margin-top: 0;
    padding: 4px 0 4px 24px;
    border-block: 0;
    border-left: 1px solid var(--line);
  }

  .docs-article > .on-this-page ul,
  .guide-top > .on-this-page ul,
  .legal-policy > .on-this-page ul {
    flex-direction: column;
    row-gap: 10px;
  }

  /* Rail links read as navigation: muted, no underline, and the section in
     view (docs.js sets aria-current) gets the text colour and an accent bar
     over the rail's rule. */
  .guide-top > .on-this-page a,
  .docs-article > .on-this-page a {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    transition: color 160ms ease;
  }

  .guide-top > .on-this-page a::before,
  .docs-article > .on-this-page a::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -25px;
    width: 2px;
    background: var(--guide-accent);
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .guide-top > .on-this-page a:hover,
  .docs-article > .on-this-page a:hover {
    color: var(--fg);
  }

  .guide-top > .on-this-page a[aria-current="true"],
  .docs-article > .on-this-page a[aria-current="true"] {
    color: var(--fg);
  }

  .guide-top > .on-this-page a[aria-current="true"]::before,
  .docs-article > .on-this-page a[aria-current="true"]::before {
    opacity: 1;
  }

  .guide-section:has(.request-table) {
    grid-column: 1 / -1;
  }

  .request-table thead {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .request-table tr {
    grid-template-columns: minmax(0, 13em) minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
  }

  .request-table thead tr {
    padding-block: 0 10px;
  }

  .request-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }

  .request-table tbody th {
    grid-row: auto;
  }

  .request-table td {
    grid-column: auto;
  }

  .table-cell-label {
    display: none;
  }

  /* The docs landing takes the guides' width: the intro keeps the reading
     measure and the task groups read down two columns. */
  .docs-article:has(> .docs-task-list) {
    max-width: none;
  }

  .docs-article:has(> .docs-task-list) > * {
    max-width: 46ch;
  }

  .docs-article > .docs-task-list {
    max-width: none;
    columns: 2;
    column-gap: clamp(48px, 5vw, 80px);
  }

  .docs-task-group {
    break-inside: avoid;
  }

  .legal-policy {
    display: grid;
    grid-template-columns: minmax(0, 46ch) minmax(0, 15rem);
    grid-template-areas: "head toc" "body toc";
    grid-template-rows: auto 1fr;
    column-gap: 80px;
    align-items: start;
    max-width: calc(46ch + 80px + 15rem + 96px);
  }

  .legal-policy > .legal-head { grid-area: head; }
  .legal-policy > .legal-body { grid-area: body; }

  .legal-policy > .on-this-page {
    grid-area: toc;
    position: sticky;
    top: 100px;
    max-height: calc(100dvh - 124px);
    overflow-y: auto;
    margin: 6px 0 0;
    padding: 4px 0 4px 24px;
    border-block: 0;
    border-left: 1px solid var(--line);
  }

  .legal-policy > .on-this-page ul {
    row-gap: 6px;
  }
}
