/* docs.shiftpilot.com. A reading surface in ShiftPilot's own colours: the
   midnight ramp (hue 268) and one cyan-blue accent, in the dark the apps ship
   in and in a light paper for bright rooms. Layout after Mintlify, Hashnode
   and GitBook docs (section list, page, "On this page"). */

@font-face {
  font-family: "Diatype";
  src: url("/fonts/ABCDiatype-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Diatype";
  src: url("/fonts/ABCDiatype-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Diatype";
  src: url("/fonts/ABCDiatype-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: oklch(0.145 0.011 268);
  --bg-raised: oklch(0.175 0.012 269);
  --surface: oklch(0.2 0.013 270);
  --surface-2: oklch(0.24 0.014 270);
  --line: oklch(0.87 0.06 262 / 0.11);
  --line-2: oklch(0.87 0.06 262 / 0.2);
  --fg: oklch(0.955 0.005 260);
  --fg-2: oklch(0.82 0.014 265);
  --fg-3: oklch(0.68 0.016 265);
  --accent: oklch(0.79 0.12 222);
  --accent-strong: oklch(0.86 0.1 218);
  --accent-soft: oklch(0.76 0.13 222 / 0.13);
  --accent-ink: oklch(0.16 0.03 250);
  --good: oklch(0.8 0.15 155);
  --good-soft: oklch(0.8 0.15 155 / 0.13);
  --warn: oklch(0.84 0.14 82);
  --warn-soft: oklch(0.84 0.14 82 / 0.13);
  --code-bg: oklch(0.22 0.014 270);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 18px 48px -12px oklch(0 0 0 / 0.6);
  --header: 3.75rem;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.993 0.002 268);
  --bg-raised: oklch(0.98 0.004 268);
  --surface: oklch(0.966 0.006 268);
  --surface-2: oklch(0.94 0.008 268);
  --line: oklch(0.3 0.04 268 / 0.11);
  --line-2: oklch(0.3 0.04 268 / 0.22);
  --fg: oklch(0.21 0.02 268);
  --fg-2: oklch(0.37 0.022 268);
  --fg-3: oklch(0.48 0.022 268);
  --accent: oklch(0.49 0.16 246);
  --accent-strong: oklch(0.41 0.16 250);
  --accent-soft: oklch(0.55 0.16 240 / 0.1);
  --accent-ink: oklch(0.99 0.005 250);
  --good: oklch(0.44 0.12 155);
  --good-soft: oklch(0.6 0.15 155 / 0.12);
  --warn: oklch(0.46 0.11 70);
  --warn-soft: oklch(0.75 0.15 80 / 0.16);
  --code-bg: oklch(0.955 0.007 268);
  --shadow: 0 1px 2px oklch(0.3 0.04 268 / 0.08), 0 18px 48px -12px oklch(0.3 0.04 268 / 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header) + 1.5rem);
  scrollbar-color: var(--line-2) transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Diatype", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-2);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--fg);
  background: oklch(0.76 0.13 222 / 0.32);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in oklch, var(--accent) 45%, transparent);
}
a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.875rem;
  color: var(--accent-ink);
  text-decoration: none;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  height: var(--header);
  padding: 0 1.25rem;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px);
}

.brand {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  min-width: 15rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--fg);
}
.mark {
  width: 1.375rem;
  height: 1.375rem;
  fill: currentColor;
}
.brand-docs {
  padding-left: 0.6rem;
  margin-left: 0.05rem;
  font-weight: 400;
  color: var(--fg-3);
  border-left: 1px solid var(--line-2);
}

.search-open {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  width: min(26rem, 100%);
  height: 2.375rem;
  padding: 0 0.75rem;
  margin-right: auto;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg-3);
  text-align: left;
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.search-open:hover {
  color: var(--fg-2);
  background: var(--surface);
  border-color: color-mix(in oklch, var(--accent) 55%, var(--line-2));
}
.search-open span {
  flex: 1;
}

kbd {
  padding: 0.1rem 0.4rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--fg-2);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}

.top-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}
.top-links a {
  color: var(--fg-2);
  text-decoration: none;
}
.top-links a:hover {
  color: var(--fg);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  color: var(--fg-2);
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.icon-btn:hover {
  color: var(--fg);
  background: var(--surface);
}
.theme-toggle .sun,
:root[data-theme="light"] .theme-toggle .moon {
  display: none;
}
:root[data-theme="light"] .theme-toggle .sun {
  display: block;
}
.nav-toggle {
  display: none;
}

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr) 15rem;
  max-width: 94rem;
  margin: 0 auto;
}

.sidebar,
.toc {
  position: sticky;
  top: var(--header);
  align-self: start;
  max-height: calc(100dvh - var(--header));
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.sidebar {
  padding: 1.75rem 1rem 3rem 1.25rem;
  border-right: 1px solid var(--line);
}
.nav-group + .nav-group {
  margin-top: 1.6rem;
}
.nav-group h2 {
  margin: 0 0 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-3);
}
.nav-group ul,
.toc ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.nav-group a {
  display: block;
  padding: 0.3rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--fg-2);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.15s, color 0.15s;
}
.nav-group a:hover {
  color: var(--fg);
  background: var(--surface);
}
.nav-group a[aria-current="page"] {
  font-weight: 500;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

main {
  min-width: 0;
  padding: 2.5rem 3.5rem 4rem;
  outline: none;
}
article {
  max-width: 44rem;
  margin: 0 auto;
}

/* ---------- On this page ---------- */

.toc {
  padding: 2.75rem 1.25rem 3rem 0.5rem;
  font-size: 0.875rem;
}
.toc h2 {
  margin: 0 0 0.6rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-3);
}
.toc-list {
  position: relative;
  border-left: 1px solid var(--line);
}
.toc-marker {
  position: absolute;
  top: 0;
  left: -1px;
  width: 1px;
  height: 1.5rem;
  background: var(--accent);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.toc a {
  display: block;
  padding: 0.22rem 0 0.22rem 0.9rem;
  line-height: 1.45;
  color: var(--fg-3);
  text-decoration: none;
  transition: color 0.15s;
}
.toc .l3 a {
  padding-left: 1.75rem;
}
.toc a:hover,
.toc a.on {
  color: var(--fg);
}

/* ---------- The page ---------- */

.crumbs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: 0.875rem;
  color: var(--fg-3);
}
.crumbs a {
  color: var(--fg-3);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--fg);
}
.crumbs .icon {
  width: 0.875rem;
  height: 0.875rem;
}

h1,
h2,
h3 {
  color: var(--fg);
  text-wrap: balance;
}
h1 {
  margin: 0;
  font-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.lead {
  margin: 0.9rem 0 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg-2);
  text-wrap: pretty;
}
article h2 {
  position: relative;
  padding-top: 2rem;
  margin: 2.75rem 0 0;
  font-size: 1.4375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  border-top: 1px solid var(--line);
}
article h3 {
  position: relative;
  margin: 2rem 0 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
}
article p,
article ul,
article ol {
  margin: 0.9rem 0 0;
  text-wrap: pretty;
}
article strong {
  font-weight: 500;
  color: var(--fg);
}
article ul {
  padding-left: 1.15rem;
}
article li + li {
  margin-top: 0.35rem;
}
article li::marker {
  color: var(--fg-3);
}

.anchor {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.35rem;
  color: var(--fg-3);
  vertical-align: middle;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.anchor .icon {
  width: 0.95rem;
  height: 0.95rem;
}
h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}
.anchor:hover {
  color: var(--accent);
}

/* Numbered steps: the number sits in the margin of the step it belongs to. */
ol.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}
ol.steps > li {
  position: relative;
  padding-left: 2.6rem;
  counter-increment: step;
}
ol.steps > li + li {
  margin-top: 0.85rem;
}
ol.steps > li::before {
  position: absolute;
  top: 0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  content: counter(step);
  background: var(--accent-soft);
  border-radius: 999px;
}

code {
  padding: 0.12em 0.36em;
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--fg);
  overflow-wrap: anywhere;
  background: var(--code-bg);
  border-radius: 6px;
}
pre {
  padding: 0.9rem 1.1rem;
  margin: 1.1rem 0 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}
pre code {
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
  background: none;
}

.callout {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0 0;
  background: var(--accent-soft);
  border-radius: 12px;
}
.callout .icon {
  margin-top: 0.3rem;
  color: var(--accent);
}
.callout p {
  margin: 0;
  color: var(--fg);
}
.callout p + p {
  margin-top: 0.5rem;
}
.callout.tip {
  background: var(--good-soft);
}
.callout.tip .icon {
  color: var(--good);
}
.callout.important {
  background: var(--warn-soft);
}
.callout.important .icon {
  color: var(--warn);
}

.table {
  margin: 1.2rem 0 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
table {
  width: 100%;
  font-size: 0.9375rem;
  line-height: 1.55;
  border-collapse: collapse;
}
th,
td {
  padding: 0.65rem 1rem 0.65rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-3);
  white-space: nowrap;
  border-bottom-color: var(--line-2);
}
td:first-child {
  font-weight: 500;
  color: var(--fg);
}
th:last-child,
td:last-child {
  padding-right: 0;
}

.status {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 999px;
}
.status.live {
  color: var(--good);
  background: var(--good-soft);
}
.status.review,
.status.planned {
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.status.proposed {
  color: var(--warn);
  background: var(--warn-soft);
}

/* Pictures. A product screen sits on its own dark stage in both themes, the
   way it looks in the app. No line around a picture's frame: most pictures
   already draw their own window edge, at their own corner, and a second line
   a few pixels outside it read as a mistake. */
.shot {
  padding: 0;
  margin: 1.5rem 0 0;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: oklch(0.125 0.01 268);
  border-radius: 14px;
}
.shot.phone img {
  width: min(17rem, 100%);
  border-radius: 22px;
}
.shot.narrow img {
  width: min(26rem, 100%);
}
.shot.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 17rem));
  gap: 1rem;
}
.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-3);
}
li > .shot {
  margin: 0.8rem 0 0.4rem;
}

/* ---------- Page foot ---------- */

.page-foot {
  max-width: 44rem;
  margin: 3.5rem auto 0;
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pager a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  transition: border-color 0.2s, background-color 0.2s;
}
.pager a:hover {
  background: var(--bg-raised);
  border-color: color-mix(in oklch, var(--accent) 60%, var(--line-2));
}
.pager .next {
  justify-content: flex-end;
  text-align: right;
}
.pager small {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--fg-3);
}
.pager .icon {
  color: var(--fg-3);
  transition: transform 0.25s var(--ease), color 0.2s;
}
.pager .prev:hover .icon {
  color: var(--accent);
  transform: translateX(-3px);
}
.pager .next:hover .icon {
  color: var(--accent);
  transform: translateX(3px);
}
.foot-note {
  padding-top: 1.25rem;
  margin: 2rem 0 0;
  font-size: 0.875rem;
  color: var(--fg-3);
  border-top: 1px solid var(--line);
}
.foot-note a {
  color: var(--fg-2);
}

/* ---------- Home ---------- */

/* The front door (2026-11-27): a picture of the product, two large buttons,
   then a way in by who you are, by device and by topic. Layout after
   Snowflake's, Mintlify's and GitBook's docs homes and Navan's help centre;
   picture cards after Cohere and Samara. The home page has no "On this page"
   column, so it takes that width; its grids answer to the width they have
   (container queries), not to the window. */

.shell.wide {
  grid-template-columns: 17rem minmax(0, 1fr);
}
.home {
  max-width: 68rem;
  container: home / inline-size;
}
.home-foot {
  max-width: 68rem;
}

.home-hero {
  display: grid;
  gap: 2.25rem;
  align-items: center;
}
.home h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  letter-spacing: -0.03em;
}
.home .lead {
  max-width: 34rem;
  font-size: 1.1875rem;
}
.search-open.hero {
  width: min(32rem, 100%);
  height: 3.5rem;
  padding: 0 1.2rem;
  margin: 1.75rem 0 0;
  font-size: 1.0625rem;
  border-radius: 16px;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
}
.btn {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover {
  color: var(--fg);
  background: var(--surface);
  border-color: color-mix(in oklch, var(--accent) 55%, var(--line-2));
}
.btn.primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.btn.primary:hover {
  color: var(--accent-ink);
  background: var(--accent-strong);
  border-color: transparent;
}
.btn .icon {
  transition: transform 0.25s var(--ease);
}
.btn.primary:hover .icon {
  transform: translateX(3px);
}
/* The hero picture is a window on the top left of the screen, large enough
   to read; the whole picture opens on a click. */
.home-art {
  aspect-ratio: 16 / 11;
  margin: 0;
  overflow: hidden;
  background: oklch(0.125 0.01 268);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.home-art img {
  width: 150%;
  max-width: none;
  border: 0;
  border-radius: 0;
}

.home h2 {
  padding-top: 0;
  margin: 3.75rem 0 0;
  font-size: 1.5rem;
  border-top: 0;
}
.roles,
.apps,
.topics,
.rows {
  padding: 0;
  list-style: none;
}
.roles > li,
.apps > li,
.topics > li,
.rows > li {
  margin: 0;
}

/* Rows: every link on the home page is a target the size of a button. */
.rows {
  display: grid;
  gap: 0.375rem;
  margin: 1rem 0 0;
}
.rows a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
  text-decoration: none;
  background: var(--surface);
  border-radius: 10px;
  transition: background-color 0.2s, color 0.2s;
}
.rows a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.rows .icon {
  color: var(--fg-3);
  transition: transform 0.25s var(--ease), color 0.2s, opacity 0.2s;
}
.rows a:hover .icon {
  color: currentColor;
  transform: translateX(3px);
}
.rows.quiet {
  gap: 0.125rem;
}
.rows.quiet a {
  min-height: 2.5rem;
  padding: 0.4rem 0.7rem;
  margin-inline: -0.7rem;
  font-weight: 400;
  color: var(--fg-2);
  background: none;
}
.rows.quiet a:hover,
.rows.quiet a:focus-visible {
  color: var(--fg);
  background: var(--surface);
}
.rows.quiet .icon {
  opacity: 0;
}
.rows.quiet a:hover .icon,
.rows.quiet a:focus-visible .icon {
  opacity: 1;
}

/* Who you are: a card with a product picture. The picture sits on the dark
   stage it has in the app, in both themes, and runs off the card's edge. */
.roles {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
}
.role {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.role-art {
  position: relative;
  height: 11rem;
  overflow: hidden;
  background: oklch(0.125 0.01 268);
  border-bottom: 1px solid var(--line);
}
.role-art::after {
  position: absolute;
  inset: auto 0 0;
  height: 2.5rem;
  pointer-events: none;
  content: "";
  background: linear-gradient(to top, oklch(0.125 0.01 268), oklch(0.125 0.01 268 / 0));
}
.role-art img {
  position: absolute;
  top: 1.5rem;
  display: block;
  max-width: none;
  height: auto;
}
.role-art.phone img {
  left: 50%;
  width: 12rem;
  border-radius: 1.75rem 1.75rem 0 0;
  transform: translateX(-50%);
}
.role-art.panel img {
  left: 50%;
  width: 15rem;
  border-radius: 14px 14px 0 0;
  transform: translateX(-50%);
}
.role-art.crop img {
  left: 1.5rem;
  width: 56rem;
  border-radius: 12px 0 0;
}
.role-art.fit img {
  left: 1.5rem;
  width: calc(100% - 3rem);
  border-radius: 12px 12px 0 0;
}
.role-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.1rem;
}
.role h3 {
  margin: 0;
  font-size: 1.1875rem;
}
.role p {
  margin: 0.3rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-3);
}
.role .rows {
  padding-top: 1rem;
  margin-top: auto;
}

/* The apps: one button for each platform. */
.apps {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}
.apps > li {
  display: grid;
}
.app {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: background-color 0.2s, border-color 0.2s;
}
.app:hover {
  color: var(--fg);
  background: var(--surface);
  border-color: color-mix(in oklch, var(--accent) 55%, var(--line-2));
}
.app .glyph {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
  fill-rule: evenodd;
}
.app-text {
  flex: 1;
  min-width: 0;
}
.app strong {
  display: block;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}
.app small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--fg-3);
}
.app .icon {
  color: var(--fg-3);
  transition: transform 0.25s var(--ease), color 0.2s;
}
.app:hover .icon {
  color: var(--accent);
  transform: translateX(3px);
}
.home .apps-more {
  margin: 0.9rem 0 0;
  font-size: 0.9375rem;
  color: var(--fg-3);
}

/* Topics: a card for each section, every page in it one row. */
.topics {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
}
.topics.more {
  margin-top: 1rem;
}
.topic {
  padding: 1.25rem 1.25rem 0.9rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.topic-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
}
.topic-mark .icon {
  width: 1.25rem;
  height: 1.25rem;
}
.topic h3 {
  margin: 0.9rem 0 0;
  font-size: 1.125rem;
}
.topic p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-3);
}
.topic .rows {
  padding-top: 0.6rem;
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.home-help {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  margin-top: 3.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.home-help h2 {
  margin: 0;
  font-size: 1.25rem;
}
.home-help p {
  margin: 0.3rem 0 0;
  font-size: 0.9375rem;
  color: var(--fg-2);
}
.home-help .home-actions {
  margin: 0;
}

@container home (max-width: 30rem) {
  .home-actions .btn {
    flex: 1 1 100%;
  }
}
@container home (min-width: 30rem) {
  .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container home (min-width: 40rem) {
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container home (min-width: 44rem) {
  .roles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container home (min-width: 56rem) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3rem;
  }
  .apps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container home (min-width: 60rem) {
  .topics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .topics.more {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Search ---------- */

dialog {
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
}
dialog::backdrop {
  background: oklch(0.1 0.02 268 / 0.62);
  backdrop-filter: blur(3px);
}
.search {
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100dvh - 6rem));
  margin: 5rem auto 0;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.search[open] {
  display: flex;
  flex-direction: column;
  animation: rise 0.28s var(--ease);
}
.search[open]::backdrop {
  animation: fade 0.2s ease-out;
}
@keyframes rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(10px) scale(0.985);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.search-box {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}
.search-box .icon {
  color: var(--fg-3);
}
.search-box input {
  flex: 1;
  min-width: 0;
  height: 3.4rem;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--fg);
  caret-color: var(--accent);
  background: none;
  border: 0;
  outline: none;
}
.search-box input::placeholder {
  color: var(--fg-3);
}
.search-box input::-webkit-search-cancel-button {
  display: none;
}
.esc {
  padding: 0.1rem 0.45rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--fg-2);
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.search-results {
  padding: 0.4rem;
  margin: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}
.search-results:empty {
  display: none;
}
.search-results a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--fg-2);
  text-decoration: none;
  border-radius: 10px;
}
.search-results [aria-selected="true"] a {
  background: var(--accent-soft);
}
.search-results .where {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg);
}
.search-results .where small {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--fg-3);
  white-space: nowrap;
}
.search-results .where .sub {
  font-weight: 400;
  color: var(--fg-2);
}
.search-results .snippet {
  display: -webkit-box;
  margin-top: 0.15rem;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-3);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
mark {
  color: var(--accent-strong);
  background: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.search-hint {
  padding: 0.9rem 1.15rem 1rem;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--fg-3);
}
.search-hint em {
  font-style: normal;
  color: var(--fg-2);
}

/* ---------- Picture viewer ---------- */

.lightbox {
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: visible;
}
.lightbox[open] {
  animation: rise 0.25s var(--ease);
}
.lightbox img {
  display: block;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.lightbox form {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
}
.lightbox .icon-btn {
  color: oklch(0.96 0.005 260);
  background: oklch(0.2 0.013 270 / 0.9);
}

.scrim {
  position: fixed;
  inset: var(--header) 0 0;
  z-index: 29;
  background: oklch(0.1 0.02 268 / 0.55);
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
  main {
    padding-inline: 2.5rem;
  }
}

@media (max-width: 860px) {
  .shell {
    display: block;
  }
  .nav-toggle {
    display: inline-grid;
    margin-left: -0.5rem;
  }
  .brand {
    min-width: 0;
    margin-right: auto;
  }
  .top .search-open {
    width: 2.375rem;
    padding: 0;
    margin: 0;
    justify-content: center;
    background: none;
    border-color: transparent;
  }
  .top .search-open span,
  .top .search-open kbd,
  .top-links {
    display: none;
  }
  .sidebar {
    position: fixed;
    inset: var(--header) auto 0 0;
    z-index: 30;
    width: min(19rem, 86vw);
    max-height: none;
    background: var(--bg);
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0.32s;
    transform: translateX(-102%);
  }
  .nav-open .sidebar {
    visibility: visible;
    transform: none;
  }
  .nav-group a {
    padding-block: 0.5rem;
  }
  main {
    padding: 1.75rem 1.25rem 3rem;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .hero kbd {
    display: none;
  }
  .shot.pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .top,
  .sidebar,
  .toc,
  .pager,
  .anchor {
    display: none;
  }
  .shell {
    display: block;
  }
}

/* ---------- Search results on a phone: the page, then the section, each on its own line ---------- */

@media (max-width: 560px) {
  .search {
    max-height: calc(100dvh - 2rem);
    margin-top: 1rem;
  }
  .search-results .where {
    display: block;
  }
  .search-results .where .sub {
    display: block;
  }
  .search-results .where small {
    display: none;
  }
}

/* Download cards (Ali 2026-11-26): pick a platform, everything else below. */
.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.875rem;
  padding: 0;
  margin: 1.75rem 0 1.5rem;
  list-style: none;
}
.platform {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.1rem;
  margin: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.platform:hover {
  background: var(--surface);
  border-color: var(--line-2);
}
.platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.platform .glyph {
  width: 1.75rem;
  height: 1.75rem;
  fill: var(--fg);
  fill-rule: evenodd;
}
.platform-kind {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.platform h3 {
  margin: 1rem 0 0;
  font-size: 1.125rem;
}
.platform h3 a {
  color: var(--fg);
  text-decoration: none;
}
.platform h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
}
.platform p {
  flex: 1;
  margin: 0.3rem 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-3);
}
.platform-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.platform-get {
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
  background: var(--accent);
  border-radius: 999px;
  transition: background 0.2s;
}
.platform-get:hover,
.platform-get:focus-visible {
  color: var(--accent-ink);
  background: var(--accent-strong);
}
.platform-more {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.875rem;
  text-decoration: none;
}
.platform-more .icon {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.25s var(--ease);
}
.platform-more:hover .icon {
  transform: translateX(2px);
}
