/*
 * The help site's look: the admin app's tokens (apps/admin-web/src/design/tokens.css), its
 * typeface (Inter) and both themes, chosen by the reader's system. Plain CSS, no build step.
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  color-scheme: light;
  --background: #ffffff;
  --background-subtle: #f8f7f4;
  --surface: #ffffff;
  --surface-hover: #f5f4f0;
  --border: #e4e1da;
  --border-strong: #d2cec5;
  --text: #1a1917;
  --text-muted: #5f5b54;
  --text-subtle: #6e6a62;
  --accent: #1f63e0;
  --accent-hover: #1a52bd;
  --accent-subtle: #eef3fe;
  --focus-ring: #286ef1;
  --info: #1f63e0;
  --info-subtle: #eef3fe;
  --success: #127036;
  --success-subtle: #e7f6ee;
  --warning: #8a5300;
  --warning-subtle: #fff4db;
  --shadow-float: 0 12px 32px rgb(26 25 23 / 0.14), 0 2px 6px rgb(26 25 23 / 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #1d1c1a;
    --background-subtle: #171614;
    --surface: #22211e;
    --surface-hover: #2a2825;
    --border: #302e2a;
    --border-strong: #3d3a35;
    --text: #f3f1ed;
    --text-muted: #b0aaa1;
    --text-subtle: #9a948b;
    --accent: #6b9bff;
    --accent-hover: #8db2ff;
    --accent-subtle: #1e2a44;
    --focus-ring: #8db2ff;
    --info: #8db2ff;
    --info-subtle: #1e2a44;
    --success: #7ee2a0;
    --success-subtle: #12291b;
    --warning: #facc5b;
    --warning-subtle: #2b2210;
    --shadow-float: 0 12px 32px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.4);
  }
}

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

html {
  font-family:
    'Inter Variable',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus {
  top: 8px;
}

/* Top bar: the site's name, search and a way back to the app. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.app-link {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.875rem;
}
.search {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.search input {
  width: 100%;
  padding: 7px 36px 7px 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--background-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}
.search:focus-within .shortcut {
  display: none;
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  max-height: 70vh;
  overflow-y: auto;
}
.search-results a,
.search-page-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}
.search-results [aria-selected='true'] a,
.search-results a:hover,
.search-page-results a:hover {
  background: var(--accent-subtle);
}
.result-title {
  display: block;
  font-weight: 600;
}
.result-meta,
.result-empty {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.result-empty {
  padding: 8px 10px;
}
.search-page-results {
  list-style: none;
  padding: 0;
}

/* The page: navigation, the article, and "On this page". */
.frame {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 200px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar > ul > li {
  margin-bottom: 20px;
}
.nav-section {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.sidebar a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}
.sidebar a:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.sidebar a[aria-current='page'] {
  background: var(--accent-subtle);
  color: var(--text);
  font-weight: 550;
}

main {
  min-width: 0;
  max-width: 720px;
}
h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h2 {
  margin: 40px 0 12px;
  font-size: 1.375rem;
  line-height: 1.3;
}
h3 {
  margin: 28px 0 8px;
  font-size: 1.125rem;
}
/* A heading reached by its link lands below the sticky top bar, not under it. */
h2[id],
h3[id] {
  scroll-margin-top: 80px;
}
h2 .anchor,
h3 .anchor {
  color: inherit;
  text-decoration: none;
}
.lead {
  margin: 0 0 8px;
  font-size: 1.125rem;
  color: var(--text-muted);
}
.updated,
.breadcrumb {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: var(--text-subtle);
}
.breadcrumb {
  margin-bottom: 8px;
}
code,
kbd {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 1px 5px;
  background: var(--background-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
}
ol,
ul {
  padding-left: 1.4em;
}
li {
  margin: 4px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--text-muted);
}
.callout {
  margin: 20px 0;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--info);
  background: var(--info-subtle);
}
.callout p {
  margin: 0;
}
.callout-tip {
  border-left-color: var(--success);
  background: var(--success-subtle);
}
.callout-warning {
  border-left-color: var(--warning);
  background: var(--warning-subtle);
}
.callout-label {
  margin-right: 4px;
}

.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 0.875rem;
}
.toc-title {
  margin: 0 0 8px;
  font-weight: 600;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc a {
  color: var(--text-muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent);
}

/* The home page's sections. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.card h2 {
  margin: 0 0 4px;
  font-size: 1.125rem;
}
.card > p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card li span {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-subtle);
}

@media (max-width: 1080px) {
  .frame {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 760px) {
  .frame {
    display: block;
    padding-top: 20px;
  }
  .sidebar {
    display: none;
  }
  .shortcut,
  .app-link {
    display: none;
  }
  h1 {
    font-size: 1.625rem;
  }
}
