/* Notebook theme. Light and dark follow the Undertide appearance
   (localStorage key undertide-appearance). The tokens below are the
   configuration: every themed notebook reads this file. */

:root {
  --fd-navy: #00204E;
  --fd-cobalt: #2340C8;
  --fd-sky: #BFE3FF;
  --fd-paper: #F2F1EC;
  --fd-ink-light: #EAF2FF;
  --fd-ink-dark: #00204E;
  --fd-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", system-ui, sans-serif;
  --fd-gutter: clamp(24px, 6vw, 48px);
  --fd-top: 24px;
  --fd-bottom: 28px;
  --field-ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
  --fd-bg: var(--fd-paper);
  --fd-fg: var(--fd-ink-dark);
  --fd-muted: #53688A;
  --fd-rule: rgba(0, 32, 78, 0.14);
  --fd-accent: var(--fd-cobalt);
  --fd-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fd-code-size: 16px;
  --fd-code-string: #3a635a;
  --fd-code-number: #80513f;
  --fd-code-comment: #53688A;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fd-bg: var(--fd-navy);
  --fd-fg: var(--fd-ink-light);
  --fd-muted: #93A7C6;
  --fd-rule: rgba(234, 242, 255, 0.18);
  --fd-accent: var(--fd-sky);
  --fd-code-string: #F2D9B8;
  --fd-code-number: #9DB6EE;
  --fd-code-comment: #93A7C6;
}

@media (min-width: 761px) {
  :root {
    --fd-gutter: clamp(48px, 5vw, 80px);
    --fd-top: 36px;
    --fd-bottom: 48px;
  }
}

@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --fd-bg: white;
    --fd-fg: #111;
    --fd-muted: #53688A;
    --fd-rule: rgba(0, 32, 78, 0.14);
    --fd-accent: var(--fd-cobalt);
    --fd-code-string: #3a635a;
    --fd-code-number: #80513f;
    --fd-code-comment: #53688A;
  }
}

:root, :root[data-theme="dark"] {
  --jp-ui-font-family: var(--fd-font);
  --jp-content-font-family: var(--fd-font);
  --jp-code-font-family: var(--fd-font);
  --jp-code-font-family-default: var(--fd-font);
  --jp-ui-font-size1: 16px;
  --jp-content-font-size1: 19px;
  --jp-content-line-height: 1.72;
  --jp-code-font-size: 15px;
  --jp-code-line-height: 1.7;
  --jp-content-heading-font-weight: 400;
  --jp-border-radius: 0;
  --jp-border-width: 1px;
  --jp-border-color0: var(--fd-rule);
  --jp-border-color1: var(--fd-rule);
  --jp-border-color2: var(--fd-rule);
  --jp-border-color3: var(--fd-rule);
  --jp-layout-color0: var(--fd-bg);
  --jp-layout-color1: var(--fd-bg);
  --jp-layout-color2: var(--fd-bg);
  --jp-layout-color3: var(--fd-rule);
  --jp-layout-color4: var(--fd-muted);
  --jp-ui-font-color0: var(--fd-fg);
  --jp-ui-font-color1: var(--fd-fg);
  --jp-ui-font-color2: var(--fd-muted);
  --jp-ui-font-color3: var(--fd-muted);
  --jp-content-font-color0: var(--fd-fg);
  --jp-content-font-color1: var(--fd-fg);
  --jp-content-font-color2: var(--fd-muted);
  --jp-content-font-color3: var(--fd-muted);
  --jp-content-link-color: var(--fd-fg);
  --jp-cell-editor-background: transparent;
  --jp-cell-editor-active-background: transparent;
  --jp-cell-editor-border-color: transparent;
  --jp-cell-editor-active-border-color: transparent;
  --jp-cell-prompt-not-active-font-color: var(--fd-muted);
  --jp-cell-inprompt-font-color: var(--fd-muted);
  --jp-cell-outprompt-font-color: var(--fd-muted);
  --jp-notebook-padding: 0;
  --jp-cell-padding: 0;
  --jp-mirror-editor-keyword-color: var(--fd-accent);
  --jp-mirror-editor-builtin-color: var(--fd-accent);
  --jp-mirror-editor-operator-color: var(--fd-fg);
  --jp-mirror-editor-punctuation-color: var(--fd-fg);
  --jp-mirror-editor-variable-color: var(--fd-fg);
  --jp-mirror-editor-variable-2-color: var(--fd-fg);
  --jp-mirror-editor-variable-3-color: var(--fd-fg);
  --jp-mirror-editor-def-color: var(--fd-fg);
  --jp-mirror-editor-property-color: var(--fd-fg);
  --jp-mirror-editor-string-color: var(--fd-code-string);
  --jp-mirror-editor-string-2-color: var(--fd-code-string);
  --jp-mirror-editor-number-color: var(--fd-code-number);
  --jp-mirror-editor-comment-color: var(--fd-code-comment);
  --jp-mirror-editor-error-color: var(--fd-accent);
  --jp-rendermime-error-background: transparent;
  --jp-vega-background: var(--fd-bg);
}

* { box-sizing: border-box; }
html { background: var(--fd-bg); color: var(--fd-fg); font-family: var(--fd-font); -webkit-text-size-adjust: 100%; }
body.jp-Notebook {
  margin: 0;
  padding: 0 var(--fd-gutter) calc(var(--fd-bottom) + 72px);
  background: var(--fd-bg);
  color: var(--fd-fg);
  font-family: var(--fd-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: visible;
}
::selection { background: var(--fd-fg); color: var(--fd-bg); }
.notebook-shell { width: 100%; }
.notebook-frame {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  column-gap: clamp(36px, 4vw, 72px);
  width: 100%;
  align-items: start;
}
.notebook-toc, .notebook-toc-compact { font-size: 14px; }
.notebook-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; padding-top: 28px; }
.notebook-toc p, .notebook-toc-compact summary { color: var(--fd-muted); margin: 0 0 8px; line-height: 1.4; }
.notebook-toc a, .notebook-toc-compact a { display: block; padding: 7px 0; color: var(--fd-muted); text-decoration: none; line-height: 1.45; }
.notebook-toc-compact { display: none; margin: 12px 0 20px; }
.notebook-toc-compact summary { cursor: pointer; min-height: 44px; line-height: 44px; margin: 0; }
.notebook-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding-top: 36px;
  padding-bottom: 8px;
  font-size: 15px;
}
.notebook-tools { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.notebook-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.notebook-bar .notebook-back { color: var(--fd-muted); font-weight: 400; text-align: right; }
.notebook-frame:not(:has(.notebook-toc)) { grid-template-columns: minmax(0, 1fr); }
.notebook-toc-compact summary { list-style: none; }
.notebook-toc-compact summary::-webkit-details-marker { display: none; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) {
  .notebook-bar a:hover, .notebook-toc a:hover, .notebook-toc-compact a:hover, .theme-toggle:hover { text-decoration: underline; }
  .notebook-toc a:hover, .notebook-toc-compact a:hover { color: var(--fd-fg); }
}
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
[hidden] { display: none !important; }

.jp-Notebook { padding: 0; overflow: visible; background: transparent; }
.jp-Collapser, .jp-collapseHeadingButton { display: none; }
.jp-Cell { margin: 0 0 8px; }
.jp-MarkdownCell { margin-bottom: 0; }
.jp-InputPrompt, .jp-OutputPrompt { display: none; }
.jp-CodeCell .jp-InputArea,
.jp-CodeCell .jp-InputArea-editor { overflow: visible; }
.jp-CodeCell .cm-editor {
  border: 1px solid var(--fd-rule);
  border-radius: 0;
  padding: 16px 18px;
  margin: 6px 0 18px;
  background: transparent;
  overflow-x: auto;
}
.jp-CodeCell .cm-editor.cm-s-jupyter .highlight,
.jp-CodeCell .cm-editor.cm-s-jupyter .highlight pre {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fd-fg);
  font-family: var(--fd-code);
  font-size: var(--fd-code-size);
  font-weight: 400;
  font-variant-ligatures: none;
  line-height: 1.5;
  white-space: pre;
  tab-size: 4;
}
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .nb, .highlight .ow {
  color: var(--fd-accent);
  font-weight: 500;
}
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss {
  color: var(--fd-code-string);
}
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .mb, .highlight .il {
  color: var(--fd-code-number);
}
.highlight .c, .highlight .c1, .highlight .ch, .highlight .cm, .highlight .cp, .highlight .cpf, .highlight .cs {
  color: var(--fd-code-comment);
  font-style: italic;
}
.jp-CodeCell .jp-OutputArea-output {
  display: block;
  border: 1px solid var(--fd-rule);
  border-radius: 0;
  padding: 16px 18px;
  margin: 0 0 28px;
  background: transparent;
  color: var(--fd-fg);
  overflow-x: auto;
}
.jp-CodeCell .jp-OutputArea-output pre {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--fd-fg);
  font-family: var(--fd-code);
  font-size: var(--fd-code-size);
  font-weight: 400;
  font-variant-ligatures: none;
  line-height: 1.5;
  white-space: pre;
  tab-size: 4;
}
.jp-RenderedHTMLCommon { padding-right: 0; color: var(--fd-fg); }
.jp-RenderedHTMLCommon h1 {
  font-size: clamp(40px, 5.8vw, 64px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 28px 0 32px;
  text-wrap: balance;
}
.jp-RenderedHTMLCommon h2 {
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.3;
  margin: 54px 0 24px;
}
.jp-RenderedHTMLCommon h3 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  margin: 38px 0 18px;
}
.jp-RenderedHTMLCommon p { margin: 0 0 26px; }
.jp-RenderedHTMLCommon ul, .jp-RenderedHTMLCommon ol { margin: 0 0 26px; padding-left: 1.4em; }
.jp-RenderedHTMLCommon li + li { margin-top: 8px; }
.jp-RenderedHTMLCommon strong { font-weight: 600; }
.jp-RenderedHTMLCommon a, .jp-RenderedHTMLCommon a:link, .jp-RenderedHTMLCommon a:visited {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
.jp-RenderedHTMLCommon .anchor-link { color: var(--fd-muted); text-decoration: none; margin-left: 0.3em; }
.jp-RenderedHTMLCommon code {
  font-family: var(--fd-font);
  font-size: 0.9em;
  font-weight: 500;
  font-variant-ligatures: none;
  color: inherit;
  background: transparent;
}
.jp-RenderedHTMLCommon pre {
  font: 400 15px/1.7 var(--fd-font);
  background: transparent;
  color: var(--fd-fg);
  padding: 18px 0;
  margin: 0;
  overflow: auto;
}
.jp-RenderedHTMLCommon table { border-collapse: collapse; font-size: 16px; margin-bottom: 28px; }
.jp-RenderedHTMLCommon th, .jp-RenderedHTMLCommon td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fd-rule);
}
.jp-RenderedHTMLCommon blockquote {
  margin: 0 0 26px;
  padding-left: 22px;
  border-left: 1px solid var(--fd-rule);
  color: var(--fd-muted);
}
@media (max-width: 860px) {
  .notebook-frame { display: block; width: 100%; }
  .notebook-toc { display: none; }
  .notebook-toc-compact { display: block; }
}
@media (max-width: 760px) {
  .jp-RenderedHTMLCommon { font-size: 18px; line-height: 1.7; }
  .jp-RenderedHTMLCommon h1 { font-size: clamp(36px, 10.7vw, 50px); }
  .jp-RenderedHTMLCommon h2 { font-size: 28px; }
  .jp-RenderedHTMLCommon h3 { font-size: 23px; }
  .notebook-bar { padding-top: 24px; }
}
.field-menu-open { overflow: hidden; }
.field-menu-trigger, .field-menu-close { position: fixed; z-index: 10; right: calc(var(--fd-gutter) - 4px + env(safe-area-inset-right)); bottom: calc(var(--fd-bottom) - 4px + env(safe-area-inset-bottom)); width: 48px; height: 48px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.field-menu-trigger { background: var(--fd-bg); }
.field-menu-trigger span, .field-menu-close span { position: absolute; display: block; width: 32px; height: 1px; background: currentColor; transform: translateY(-4px); transition: transform .36s var(--field-ease), width .36s var(--field-ease); }
.field-menu-trigger span:last-child, .field-menu-close span:last-child { width: 22px; transform: translate(5px, 4px); }
.field-menu { position: fixed; inset: 0; max-width: none; max-height: none; width: 100%; height: 100%; height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: var(--fd-fg); font-family: var(--fd-font); overflow: hidden; }
.field-menu::backdrop { background: transparent; }
.field-menu-plane { box-sizing: border-box; min-height: 100%; height: 100%; overflow-y: auto; padding: calc(var(--fd-top) + env(safe-area-inset-top)) var(--fd-gutter) calc(100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; background: var(--fd-bg); transform: translateX(100%); transition: transform .36s var(--field-ease); }
.field-menu.is-open .field-menu-plane { transform: translateX(0); }
.field-menu-name { font-size: 15px; font-weight: 500; line-height: 44px; margin: 0 0 64px; }
.field-menu-nav { display: flex; flex-direction: column; align-items: flex-start; margin-top: auto; }
.field-menu-nav a { display: block; color: inherit; font-size: clamp(44px, 8vw, 96px); font-weight: 300; line-height: 1.18; letter-spacing: -0.035em; text-decoration: none; }
.field-menu-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 36px; font-size: 15px; }
.field-menu-links a, .field-menu-links .theme-toggle { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.field-menu.is-open .field-menu-close span:first-child { transform: rotate(22deg); }
.field-menu.is-open .field-menu-close span:last-child { width: 32px; transform: rotate(-22deg); }
@media (hover: hover) {
  .field-menu-trigger:hover span:last-child { width: 32px; transform: translateY(4px); }
  .field-menu-links a:hover, .field-menu-links .theme-toggle:hover { opacity: .72; }
}
@media print {
  .notebook-bar, .notebook-toc, .notebook-toc-compact, .field-menu, .field-menu-trigger { display: none; }
  .notebook-frame { display: block; width: auto; }
  body.jp-Notebook { padding: 0; background: white; color: #111; }
}
