/*
 * Grovedock docs, on mdBook. The app's own tokens (console/src/styles.css, plans/design-system.md):
 * Bark and Night grounds, Fishlake for links and actions, Gold only for landing, Lichen for
 * agents; Schibsted Grotesk for everything, IBM Plex Mono only for code.
 * Layout: a slim bar; the contents on the left; a 72ch article; "On this page" on the right.
 * The one bold element: a page that is a sequence of numbered steps sits on the trunk, its last
 * step (the landing) tipped in gold.
 */

:root {
  --content-max-width: 72ch;
  --sidebar-target-width: 272px;
  --menu-bar-height: 60px;
  --page-padding: 32px;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono-font: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --code-font-size: 0.875em;
  --tip: #f0b429;
}

/* ---- colour: light (mdBook "light", "rust"), dark (mdBook "navy", "coal", "ayu") ---- */
.light,
.rust {
  --color-scheme: light;
  --bg: #f4f5f2;
  --fg: #13202b;
  --ink-2: #4a5865;
  --ink-3: #5c6873;
  --line: #e2e6df;
  --raised: #ffffff;
  --primary: #16324f;
  --primary-ink: #f4f5f2;
  --links: #1d4f80;
  --sidebar-bg: #f4f5f2;
  --sidebar-fg: #4a5865;
  --sidebar-non-existant: #8a949c;
  --sidebar-active: #13202b;
  --sidebar-spacer: #e2e6df;
  --sidebar-header-border-color: #e2e6df;
  --scrollbar: #cfd6cc;
  --icons: #4a5865;
  --icons-hover: #13202b;
  --inline-code-color: #13202b;
  --theme-popup-bg: #ffffff;
  --theme-popup-border: #e2e6df;
  --theme-hover: #eef1ec;
  --quote-bg: #eef1ec;
  --quote-border: #cfd6cc;
  --table-border-color: #e2e6df;
  --table-header-bg: #eef1ec;
  --table-alternate-bg: #f8f9f6;
  --searchbar-border-color: #cfd6cc;
  --searchbar-bg: #ffffff;
  --searchbar-fg: #13202b;
  --searchbar-shadow-color: rgb(19 32 43 / 0.08);
  --searchresults-header-fg: #5c6873;
  --searchresults-border-color: #e2e6df;
  --searchresults-li-bg: #eef1ec;
  --search-mark-bg: rgb(240 180 41 / 0.35);
  --overlay-bg: rgb(19 32 43 / 0.35);
}
.navy,
.coal,
.ayu {
  --color-scheme: dark;
  --bg: #0b141e;
  --fg: #e6ecf2;
  --ink-2: #a0b0c1;
  --ink-3: #8796a5;
  --line: #1c2a39;
  --raised: #101b27;
  --primary: #8cb8e6;
  --primary-ink: #0b141e;
  --links: #8cb8e6;
  --sidebar-bg: #0b141e;
  --sidebar-fg: #a0b0c1;
  --sidebar-non-existant: #5f6e7d;
  --sidebar-active: #e6ecf2;
  --sidebar-spacer: #1c2a39;
  --sidebar-header-border-color: #1c2a39;
  --scrollbar: #29394b;
  --icons: #a0b0c1;
  --icons-hover: #e6ecf2;
  --inline-code-color: #e6ecf2;
  --theme-popup-bg: #101b27;
  --theme-popup-border: #29394b;
  --theme-hover: #142231;
  --quote-bg: #101b27;
  --quote-border: #29394b;
  --table-border-color: #1c2a39;
  --table-header-bg: #101b27;
  --table-alternate-bg: #0d1721;
  --searchbar-border-color: #29394b;
  --searchbar-bg: #101b27;
  --searchbar-fg: #e6ecf2;
  --searchbar-shadow-color: rgb(0 0 0 / 0.3);
  --searchresults-header-fg: #8796a5;
  --searchresults-border-color: #1c2a39;
  --searchresults-li-bg: #142231;
  --search-mark-bg: rgb(240 180 41 / 0.3);
  --overlay-bg: rgb(0 0 0 / 0.5);
}

html {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--bg);
  font-size: 16px;
}
code {
  font-family: var(--mono-font);
}
:focus-visible {
  outline: 2px solid var(--links);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- the bar ---- */
#mdbook-menu-bar.menu-bar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  margin: 0 !important;
  height: var(--menu-bar-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.gd-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px 16px;
  height: 100%;
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
/* The brand once, on the contents' own column: the sidebar's edge runs up through the bar. */
.gd-brandcell {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  height: 100%;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: 16px;
}
html.sidebar-visible .gd-brandcell {
  box-sizing: border-box;
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
}
.gd-mid {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding-inline: 12px;
}
.page {
  margin-top: 0 !important;
  padding-top: var(--menu-bar-height);
}
#mdbook-sidebar.sidebar {
  top: var(--menu-bar-height);
}
#mdbook-menu-bar-hover-placeholder {
  display: none;
}
.gd-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--fg) !important;
  text-decoration: none !important;
}
.gd-mark {
  width: 24px;
  height: 24px;
}
.gd-word {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.gd-section {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--ink-2) !important;
  font-weight: 560;
  text-decoration: none !important;
}
.gd-section:hover {
  color: var(--fg) !important;
}
.gd-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 100%);
  height: 36px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink-3);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.gd-search:hover {
  border-color: var(--ink-3);
}
.gd-search-label {
  flex: 1;
  text-align: left;
}
.gd-kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: 500 12px var(--sans);
  color: var(--ink-3);
}
.gd-links {
  display: flex;
  gap: 2px;
}
.gd-links a {
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--ink-2) !important;
  font-size: 14px;
  font-weight: 520;
  text-decoration: none !important;
}
.gd-links a:hover {
  background: var(--theme-hover);
  color: var(--fg) !important;
}
.gd-theme {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 9px;
  color: var(--icons);
}
.gd-theme:hover {
  background: var(--theme-hover);
}
.gd-cta {
  display: inline-flex;
  flex: none;
  white-space: nowrap;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-ink) !important;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none !important;
}
.gd-cta:hover {
  filter: brightness(1.08);
}
.gd-only-narrow {
  display: none !important;
}
#mdbook-menu-bar .theme-popup {
  top: calc(var(--menu-bar-height) - 6px);
  left: auto;
  right: 112px;
  z-index: 1100;
  min-width: 170px;
  padding: 4px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgb(19 32 43 / 0.25);
}
#mdbook-menu-bar .theme-popup .theme {
  position: relative;
  width: 100%;
  padding: 8px 16px 8px 30px;
  font: inherit;
  font-size: 14px;
  text-align: left;
}
#mdbook-menu-bar .theme-popup .theme:hover {
  background: var(--theme-hover);
}
#mdbook-menu-bar .theme-popup .theme-selected::before {
  position: absolute;
  left: 11px;
  margin: 0;
}

/* ---- the contents ---- */
.sidebar {
  border-right: 1px solid var(--line);
  font-size: 14.4px;
}
.sidebar .sidebar-scrollbox {
  padding: 20px 14px 40px 20px;
}
.chapter li.part-title {
  margin: 22px 0 6px;
  padding: 0 10px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 650;
}
.chapter li.chapter-item {
  margin-block: 1px;
  line-height: 1.35;
}
.chapter li .chapter-link-wrapper {
  display: flex;
  align-items: center;
}
.chapter li .chapter-link-wrapper > a {
  flex: 1;
}
.chapter li a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--sidebar-fg);
  text-decoration: none;
}
.chapter li a:hover {
  background: var(--theme-hover);
  color: var(--fg);
}
.chapter li a.active {
  background: var(--raised);
  color: var(--fg);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--primary), 0 0 0 1px var(--line);
}
.sidebar-resize-handle .sidebar-resize-indicator {
  display: none;
}

/* ---- the page: article plus "On this page" ---- */
.content main {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-block: 48px 24px;
}
.content main > h1:first-of-type {
  margin: 0 0 14px;
  font-size: clamp(30px, 24px + 1.2vw, 40px);
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.content main > h1:first-of-type + p {
  margin-top: 0;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.6;
}
.content main h2 {
  margin: 2.6em 0 0.6em;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.content main h3 {
  margin: 2em 0 0.5em;
  font-size: 17px;
  font-weight: 650;
}
.content main a.header {
  color: inherit;
  text-decoration: none;
}
.content main p,
.content main li {
  line-height: 1.7;
}
.content main a:not(.header) {
  color: var(--links);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--links) 40%, transparent);
  text-underline-offset: 3px;
}
.content main a:not(.header):hover {
  text-decoration-color: currentColor;
}
.content main :not(pre) > code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  font-size: 0.85em;
}
.content main pre {
  position: relative;
  margin: 1.2em 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
}
.content main pre > code,
.content main pre > code.hljs {
  padding: 14px 16px;
  background: transparent;
  font-size: 13.6px;
  line-height: 1.6;
}
.content main pre > .buttons {
  top: 8px;
  right: 8px;
}
.content main blockquote {
  margin: 1.4em 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  background: var(--raised);
  color: var(--fg);
}
.content main table {
  border-collapse: collapse;
  font-size: 14.8px;
}
.content main table th {
  font-weight: 620;
  text-align: left;
}
.content main table td,
.content main table th {
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.content main table tbody tr:nth-child(2n) {
  background: transparent;
}
.content main hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* "On this page": the article's sections, the one being read marked. Wide screens only, where
   the article moves left to make room for it. */
.gd-toc {
  position: fixed;
  top: calc(var(--menu-bar-height) + 48px);
  right: 32px;
  width: 210px;
  max-height: calc(100vh - var(--menu-bar-height) - 96px);
  overflow: auto;
  font-size: 13px;
}
.gd-toc h2 {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 650;
}
.gd-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}
#mdbook-content .gd-toc a,
#mdbook-content .gd-toc a:link,
#mdbook-content .gd-toc a:visited {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  line-height: 1.35;
  text-decoration: none;
}
#mdbook-content .gd-toc a:hover {
  color: var(--fg);
}
#mdbook-content .gd-toc a[aria-current="true"] {
  border-left-color: var(--primary);
  color: var(--fg);
  font-weight: 560;
}
#mdbook-content .gd-toc li.gd-toc-sub a {
  padding-left: 24px;
}
@media (min-width: 1280px) {
  .gd-has-toc .content {
    padding-right: 260px;
  }
}
@media (max-width: 1279px) {
  .gd-toc {
    display: none;
  }
}

/* ---- the trunk: numbered steps on one line, the last (the landing) tipped in gold ---- */
.gd-steps h2.gd-step {
  position: relative;
  padding-left: 36px;
}
.gd-steps h2.gd-step::before,
.gd-steps h2.gd-step:target::before {
  content: "";
  margin: 0;
  margin-inline-start: 0;
  display: block;
  position: absolute;
  left: 4px;
  top: 0.32em;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid var(--fg);
  border-radius: 50%;
  background: var(--bg);
}
.gd-steps h2.gd-step.gd-step-last::before,
.gd-steps h2.gd-step.gd-step-last:target::before {
  left: 3px;
  top: 0.18em;
  width: 18px;
  height: 18px;
  border: 0;
  background: var(--tip);
  box-shadow: 0 0 14px rgb(240 180 41 / 0.5);
}
.gd-steps .gd-step-body {
  position: relative;
  padding-left: 36px;
}
.gd-steps .gd-step-body::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -2.2em;
  bottom: -3.2em;
  width: 2px;
  background: var(--line);
}
.gd-steps .gd-step-body.gd-step-last::before {
  display: none;
}

/* ---- previous / next, then the footer ---- */
.gd-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: var(--content-max-width);
  margin: 40px auto 0;
}
.gd-pager-link {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
  color: var(--fg) !important;
  text-decoration: none !important;
  transition: border-color 120ms ease;
}
.gd-pager-link:hover {
  border-color: var(--ink-3);
}
.gd-pager-link.next {
  grid-column: 2;
  text-align: right;
}
.gd-pager-dir {
  color: var(--ink-3);
  font-size: 13px;
}
.gd-pager-name {
  font-weight: 620;
}
.gd-pager .mobile-nav-chapters {
  float: none;
  width: auto;
  height: auto;
  margin: 0;
  font-size: inherit;
}
.gd-footer {
  max-width: var(--content-max-width);
  margin: 48px auto 0;
  padding: 24px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
}
.gd-footer p {
  margin: 0 0 8px;
}
.gd-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.gd-footer a {
  color: var(--ink-2);
  text-decoration: none;
}
.gd-footer a:hover {
  color: var(--fg);
}

/* ---- search: a panel over the page, like the app's ⌘K ---- */
#mdbook-search-wrapper:not(.hidden) {
  position: fixed;
  top: calc(var(--menu-bar-height) + 12px);
  left: 0;
  right: 0;
  z-index: 1000;
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - var(--menu-bar-height) - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised);
  box-shadow: 0 0 0 100vmax rgb(4 10 16 / 0.45), 0 24px 64px -12px rgb(0 0 0 / 0.5);
  overflow: hidden;
}
#mdbook-search-wrapper .searchbar-outer {
  max-width: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
#mdbook-search-wrapper .search-wrapper {
  margin: 0;
}
#mdbook-searchbar {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 48px 0 18px;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  outline: none;
}
#mdbook-search-wrapper .searchresults-outer {
  max-width: none;
  margin: 0;
  padding: 6px 8px 10px;
  overflow: auto;
  border: 0;
}
#mdbook-search-wrapper .searchresults-header {
  margin: 6px 10px 8px;
  padding: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
#mdbook-searchresults {
  margin: 0;
  padding: 0;
  list-style: none;
}
#mdbook-searchresults li {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
}
#mdbook-searchresults li:hover,
#mdbook-searchresults li.focus {
  background: var(--theme-hover);
}
#mdbook-searchresults li a {
  color: var(--fg);
  font-weight: 620;
  text-decoration: none;
}
#mdbook-searchresults .teaser {
  margin: 3px 0 0;
  padding: 0;
  padding-inline-start: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}
#mdbook-searchresults .teaser em {
  color: var(--fg);
  font-style: normal;
  font-weight: 600;
  background: none;
}
#mdbook-search-wrapper:not(.hidden) ~ #mdbook-content .gd-toc {
  visibility: hidden;
}

/* ---- narrow ---- */
@media (max-width: 1000px) {
  .gd-links {
    display: none;
  }
}
@media (max-width: 760px) {
  :root {
    --page-padding: 16px;
  }
  .gd-only-narrow {
    display: inline-flex !important;
  }
  .gd-section,
  .gd-search-label,
  .gd-kbd {
    display: none;
  }
  .gd-search {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .gd-bar {
    gap: 8px 12px;
  }
  .gd-pager {
    grid-template-columns: 1fr;
  }
  .gd-pager-link.next {
    grid-column: 1;
  }
  .content main {
    padding-top: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---- docs home: what it is beside the trunk, then where to go ---- */
.gd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 40px;
  margin: 8px 0 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.content main .gd-hero-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 22px + 1.1vw, 36px);
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.gd-lede {
  margin: 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.65;
}
.gd-trunk-art {
  justify-self: center;
  width: 100%;
  max-width: 260px;
  height: auto;
  overflow: visible;
}
.gd-trunk-art path {
  fill: none;
  stroke-linecap: round;
}
.gd-trunk-art .t-main {
  stroke: var(--fg);
  stroke-width: 2.5;
  opacity: 0.9;
}
.gd-trunk-art .t-branch {
  stroke: var(--line);
  stroke-width: 2;
}
.navy .gd-trunk-art .t-branch,
.coal .gd-trunk-art .t-branch,
.ayu .gd-trunk-art .t-branch {
  stroke: #29394b;
}
.light .gd-trunk-art .t-branch,
.rust .gd-trunk-art .t-branch {
  stroke: #cfd6cc;
}
.gd-trunk-art .t-person {
  fill: #6f9bc8;
}
.gd-trunk-art .t-agent {
  fill: #8fa89a;
}
.gd-trunk-art .t-node {
  fill: var(--bg);
  stroke: var(--fg);
  stroke-width: 2;
}
.gd-trunk-art .t-tip {
  fill: var(--tip);
  filter: drop-shadow(0 0 10px rgb(240 180 41 / 0.5));
}
.gd-trunk-art .t-label {
  fill: var(--ink-3);
  font: 11px var(--sans);
}
.content main ul.gd-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  margin: 16px 0 32px;
  padding: 0;
  list-style: none;
}
.content main ul.gd-paths li {
  border-top: 1px solid var(--line);
}
.content main ul.gd-paths a {
  display: grid;
  gap: 4px;
  padding: 16px 0 18px;
  color: var(--fg);
  text-decoration: none;
}
.gd-path-title {
  font-weight: 650;
  color: var(--fg);
}
.content main ul.gd-paths a:hover .gd-path-title {
  color: var(--links);
}
.gd-path-text {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
@media (max-width: 760px) {
  .gd-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .gd-trunk-art {
    order: -1;
    justify-self: start;
    max-width: 96px;
  }
  .gd-trunk-art .t-label {
    display: none;
  }
  .content main ul.gd-paths {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  /* On a phone the page follows the system theme; the bar keeps search and Start free. */
  .gd-theme {
    display: none !important;
  }
  .gd-brandcell {
    gap: 8px;
    padding-right: 0;
  }
  .gd-mid {
    justify-content: flex-end;
    padding-inline: 4px;
  }
  .gd-cta {
    padding: 0 12px;
  }
}
