/* Obsero ingestion docs. Google-style devsite layout. No build step, no framework. */

:root {
  color-scheme: light;

  --blue:        #1a73e8;
  --blue-press:  #174ea6;
  --blue-bg:     #e8f0fe;

  --page:        #ffffff;
  --surface:     #ffffff;
  --surface-alt: #f8f9fa;
  --code-bg:     #f1f3f4;
  --divider:     #dadce0;
  --divider-sub: #e8eaed;

  --heading:     #202124;
  --body:        #3c4043;
  --secondary:   #5f6368;

  --note-bg:     #e8f0fe;  --note-bd:     #1a73e8;
  --caution-bg:  #fef7e0;  --caution-bd:  #f9ab00;
  --warning-bg:  #fce8e6;  --warning-bd:  #d93025;
  --success-bg:  #e6f4ea;  --success-bd:  #1e8e3e;

  --tok-comment: #5f6368;
  --tok-string:  #0b8043;

  --nav-w:  264px;
  --toc-w:  232px;
  --bar-h:  64px;

  --sans: "Google Sans", "Product Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Roboto Mono", "Google Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --blue:        #8ab4f8;
    --blue-press:  #aecbfa;
    --blue-bg:     #283142;

    --page:        #202124;
    --surface:     #202124;
    --surface-alt: #292a2d;
    --code-bg:     #35363a;
    --divider:     #3c4043;
    --divider-sub: #35363a;

    --heading:     #e8eaed;
    --body:        #bdc1c6;
    --secondary:   #9aa0a6;

    --note-bg:     #1f2a3d;  --note-bd:     #8ab4f8;
    --caution-bg:  #332d1d;  --caution-bd:  #fdd663;
    --warning-bg:  #33231f;  --warning-bd:  #f28b82;
    --success-bg:  #1e2b22;  --success-bd:  #81c995;

    --tok-comment: #9aa0a6;
    --tok-string:  #81c995;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.00625em;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 8px;
  background: var(--page);
  border-bottom: 1px solid var(--divider);
}

.iconbtn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--secondary);
  cursor: pointer;
}
.iconbtn:hover { background: var(--surface-alt); color: var(--heading); }
.iconbtn svg { width: 20px; height: 20px; display: block; }

#nav-toggle { display: none; }
@media (max-width: 1023px) { #nav-toggle { display: grid; } }

.product {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-family: var(--sans);
  padding-left: 8px;
  white-space: nowrap;
}
.product b { font-weight: 500; font-size: 20px; color: var(--heading); letter-spacing: 0; }
.product span { font-size: 14px; color: var(--secondary); }
@media (max-width: 599px) { .product span { display: none; } }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-link {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.topbar-link:hover { background: var(--surface-alt); color: var(--heading); }
@media (max-width: 599px) { .topbar-link { display: none; } }

/* ---------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- left nav */

.sidenav {
  position: sticky;
  top: var(--bar-h);
  height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--divider);
  padding: 16px 0 48px;
  background: var(--page);
}
@media (max-width: 1023px) {
  .sidenav {
    position: fixed;
    top: var(--bar-h);
    left: 0;
    width: var(--nav-w);
    max-width: 86vw;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .18s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 8px 10px 1px rgba(60, 64, 67, .15);
  }
  body.nav-open .sidenav { transform: translateX(0); }
  .scrim {
    position: fixed;
    inset: var(--bar-h) 0 0;
    background: rgba(32, 33, 36, .5);
    z-index: 29;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
}

.navsearch { padding: 0 16px 12px; }
.navsearch input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: var(--surface-alt) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 11px 50% / 18px;
  color: var(--body);
  font: 400 14px/40px var(--text);
  outline: none;
}
.navsearch input:focus { border-color: var(--blue); background-color: var(--page); }
.navsearch input::placeholder { color: var(--secondary); }

.navgroup {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--secondary);
  padding: 20px 24px 6px;
}
.navgroup:first-of-type { padding-top: 4px; }

.sidenav ul { list-style: none; margin: 0; padding: 0; }

.sidenav a.navitem {
  display: block;
  padding: 8px 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
  text-decoration: none;
  border-radius: 0 100px 100px 0;
  margin-right: 12px;
}
.sidenav a.navitem:hover { background: var(--surface-alt); }
.sidenav a.navitem.current {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 500;
}

.subnav { margin: 2px 0 4px; }
.subnav a {
  display: block;
  padding: 5px 24px 5px 40px;
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  text-decoration: none;
  border-left: 1px solid var(--divider);
  margin-left: 28px;
}
.subnav a:hover { color: var(--blue); border-left-color: var(--blue); }

.navresults { padding: 0 12px; }
.navresults .hit {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--body);
  font-size: 14px;
}
.navresults .hit:hover { background: var(--surface-alt); }
.navresults .hit small { display: block; color: var(--secondary); font-size: 12px; }
.navresults .empty { padding: 12px; color: var(--secondary); font-size: 13px; }

/* ---------------------------------------------------------------- content */

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 0 56px;
  max-width: 1240px;
  padding: 0 48px 96px;
}
@media (max-width: 1279px) {
  .content { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 599px) {
  .content { padding: 0 16px 64px; }
}

article { min-width: 0; max-width: 840px; padding-top: 24px; }

.breadcrumb {
  font-size: 13px;
  color: var(--secondary);
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: .6; }

/* ---------------------------------------------------------------- type */

h1 {
  font-family: var(--sans);
  font-size: 36px;
  line-height: 44px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--heading);
  margin: 4px 0 16px;
}
h2 {
  font-family: var(--sans);
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
  color: var(--heading);
  margin: 48px 0 12px;
  scroll-margin-top: calc(var(--bar-h) + 16px);
}
h3 {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
  color: var(--heading);
  margin: 32px 0 8px;
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

.lede { font-size: 18px; line-height: 28px; color: var(--secondary); margin: 0 0 20px; }

p { margin: 0 0 16px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:active { color: var(--blue-press); }

ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 0 0 8px; }
li > ul, li > ol { margin-top: 8px; }

strong { font-weight: 500; color: var(--heading); }
em { font-style: italic; }

hr { border: 0; border-top: 1px solid var(--divider); margin: 40px 0; }

/* headed anchors, devsite style */
h2, h3 { position: relative; }
.anchor {
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--secondary);
  font-size: 18px;
  text-decoration: none;
  padding: 0 4px;
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
@media (max-width: 1023px) { .anchor { display: none; } }

/* ---------------------------------------------------------------- code */

code {
  font-family: var(--mono);
  font-size: 85%;
  background: var(--code-bg);
  color: var(--heading);
  padding: .15em .4em;
  border-radius: 4px;
  overflow-wrap: break-word;
}

.code-block { position: relative; margin: 0 0 20px; }

pre {
  background: var(--code-bg);
  color: var(--heading);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; white-space: pre; }
pre .c { color: var(--tok-comment); }
pre .s { color: var(--tok-string); }

.copybtn {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--secondary);
  font: 500 12px/1 var(--sans);
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
.code-block:hover .copybtn, .copybtn:focus { opacity: 1; }
.copybtn:hover { background: var(--page); border-color: var(--divider); color: var(--blue); }
.copybtn.done { color: var(--success-bd); opacity: 1; }

figure.snippet { margin: 0 0 20px; }
figure.snippet figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--secondary);
  padding: 0 0 8px 2px;
}
figure.snippet .code-block { margin: 0; }

.flow {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
  background: var(--surface-alt);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
  white-space: pre;
  color: var(--body);
}

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 22px; min-width: 460px; }
caption { text-align: left; color: var(--secondary); font-size: 13px; padding-bottom: 8px; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--divider-sub); }
th {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--heading);
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
tbody tr:hover { background: var(--surface-alt); }
td code { font-size: 13px; }

/* ---------------------------------------------------------------- asides */

.aside {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-left: 4px solid var(--note-bd);
  background: var(--note-bg);
  border-radius: 0 8px 8px 0;
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 24px;
}
.aside > svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: var(--note-bd); }
.aside .body { min-width: 0; }
.aside .body > :last-child { margin-bottom: 0; }
.aside b.label { font-family: var(--sans); font-weight: 500; color: var(--heading); }
.aside p { margin: 0 0 10px; }

.aside.caution { border-left-color: var(--caution-bd); background: var(--caution-bg); }
.aside.caution > svg { fill: var(--caution-bd); }
.aside.warning { border-left-color: var(--warning-bd); background: var(--warning-bg); }
.aside.warning > svg { fill: var(--warning-bd); }
.aside.success { border-left-color: var(--success-bd); background: var(--success-bg); }
.aside.success > svg { fill: var(--success-bd); }

/* ---------------------------------------------------------------- cards */

.cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0 0 28px; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
  display: block;
  padding: 20px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
}
.card:hover {
  text-decoration: none;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 2px 6px 2px rgba(60, 64, 67, .15);
}
.card h3 { margin: 0 0 6px; font-size: 16px; line-height: 24px; color: var(--blue); font-weight: 500; }
.card p { margin: 0; font-size: 14px; line-height: 22px; color: var(--secondary); }

/* ---------------------------------------------------------------- steps */

ol.steps { list-style: none; padding: 0; margin: 0 0 28px; counter-reset: step; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 8px 44px;
  margin: 0 0 32px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font: 500 14px/28px var(--sans);
  text-align: center;
}
@media (prefers-color-scheme: dark) { ol.steps > li::before { color: #202124; } }
ol.steps > li > h3:first-child { margin: 2px 0 10px; }

/* ---------------------------------------------------------------- toc */

.toc { padding-top: 32px; }
.toc-inner {
  position: sticky;
  top: calc(var(--bar-h) + 24px);
  max-height: calc(100vh - var(--bar-h) - 48px);
  overflow-y: auto;
  padding-left: 16px;
  border-left: 1px solid var(--divider);
}
.toc h2 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 8px; }
.toc li.sub { margin-left: 12px; }
.toc a { display: block; font-size: 13px; line-height: 18px; color: var(--secondary); }
.toc a:hover { color: var(--blue); text-decoration: none; }
.toc a.active { color: var(--blue); font-weight: 500; }

/* ---------------------------------------------------------------- footers */

.helpful {
  margin: 56px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--heading);
}
.helpful .thumbs { display: flex; gap: 8px; }
.helpful .thumb {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  color: var(--secondary);
}
.helpful .thumb:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); text-decoration: none; }
.helpful .thumb svg { width: 18px; height: 18px; fill: currentColor; }

.pagefoot {
  grid-column: 1 / -1;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  color: var(--secondary);
  font-size: 13px;
  line-height: 20px;
}
.pagefoot a { color: var(--secondary); text-decoration: underline; }
.pagefoot a:hover { color: var(--blue); }

.nextprev {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0 0;
  font-family: var(--sans);
  font-size: 14px;
}
.nextprev a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.nextprev .spacer { flex: 1; }

/* ---------------------------------------------------------------- misc */

.pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--blue-bg);
  color: var(--blue);
  vertical-align: middle;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--page);
  color: var(--blue);
  padding: 12px 20px;
  z-index: 60;
  border: 1px solid var(--divider);
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* "Code on this page": the files the prose is about, on GitHub. */
.srcbox {
  margin: 40px 0 0; padding: 16px 20px;
  border: 1px solid var(--divider); border-radius: 8px; background: var(--surface-alt);
}
.srcbox .srcbox-title { margin: 0 0 8px; font-family: var(--sans); font-weight: 500; color: var(--heading); }
.srcbox ul { margin: 0; padding: 0; list-style: none; }
.srcbox li { margin: 6px 0; overflow-wrap: anywhere; }
.srcbox li span { color: var(--secondary); font-size: 14px; }
.srcbox .srcbox-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 0; font-size: 14px; }
a.src code, .srcbox li a code { color: var(--blue); }
a.src:hover code, .srcbox li a:hover code { text-decoration: underline; }
