:root {
  --sb-green: #1f6b3a;
  --sb-green-dark: #174e2c;
  --sb-green-soft: #eaf4ed;
  --sb-ink: #263238;
  --sb-muted: #66736b;
  --sb-border: #d9e3dc;
  --sb-canvas: #f6f8f6;
  --sb-white: #ffffff;
  --sb-focus: #f4b400;
  --sb-shadow: 0 8px 24px rgba(23, 78, 44, 0.08);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #1f6b3a;
  --md-primary-fg-color--light: #3f8a59;
  --md-primary-fg-color--dark: #174e2c;
  --md-accent-fg-color: #1f6b3a;
  --md-default-bg-color: #f6f8f6;
}

.md-grid { max-width: 1440px; }
.md-content__inner { max-width: 980px; margin-inline: auto; }
.md-typeset h1 { color: var(--sb-green-dark); font-weight: 750; }
.md-typeset h2 { color: var(--sb-green-dark); font-weight: 700; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--sb-ink);
  background: var(--sb-canvas);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
}

a { color: var(--sb-green); }
a:hover { color: var(--sb-green-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--sb-focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.9rem;
  color: var(--sb-white);
  background: #000;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  color: var(--sb-white);
  background: var(--sb-green-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,.16);
}

.brand {
  display: flex;
  min-width: 270px;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--sb-white);
  text-decoration: none;
}
.brand strong { font-size: 1.16rem; letter-spacing: -0.02em; }
.brand span { color: #cfe6d6; font-size: 0.9rem; }

.menu-button {
  display: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 6px;
  color: var(--sb-white);
  background: transparent;
}

.site-search { position: relative; width: min(520px, 46vw); margin-left: auto; }
.site-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.site-search input {
  width: 100%;
  padding: 0.68rem 0.8rem;
  border: 0;
  border-radius: 7px;
  font: inherit;
}
.search-results {
  position: absolute;
  right: 0;
  left: 0;
  display: none;
  max-height: 420px;
  overflow: auto;
  margin-top: 0.45rem;
  border: 1px solid var(--sb-border);
  border-radius: 8px;
  color: var(--sb-ink);
  background: var(--sb-white);
  box-shadow: var(--sb-shadow);
}
.search-results.open { display: block; }
.search-results a { display: block; padding: .7rem .8rem; border-bottom: 1px solid var(--sb-border); text-decoration: none; }
.search-results a:last-child { border-bottom: 0; }
.search-results strong, .search-results span { display: block; }
.search-results span { margin-top: .15rem; color: var(--sb-muted); font-size: .88rem; }
.search-empty { padding: .8rem; color: var(--sb-muted); }

.site-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.site-nav {
  position: sticky;
  top: 68px;
  align-self: start;
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 1.2rem 1rem 2rem;
  border-right: 1px solid var(--sb-border);
  background: var(--sb-white);
}
.site-nav h2 { margin: 0 0 .75rem; color: var(--sb-muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.site-nav ul { margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; margin: .18rem 0; padding: .62rem .72rem; border-radius: 7px; color: var(--sb-ink); text-decoration: none; }
.site-nav a:hover { background: var(--sb-green-soft); }
.site-nav a.active { color: var(--sb-green-dark); background: var(--sb-green-soft); font-weight: 700; box-shadow: inset 4px 0 0 var(--sb-green); }

.content-wrap { min-width: 0; padding: 2rem clamp(1rem, 4vw, 4rem) 4rem; }
.doc-content {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.6rem);
  border: 1px solid var(--sb-border);
  border-radius: 14px;
  background: var(--sb-white);
  box-shadow: var(--sb-shadow);
}

h1, h2, h3 { color: var(--sb-green-dark); line-height: 1.2; letter-spacing: -0.025em; }
h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin-top: 2.5rem; padding-top: .35rem; border-top: 1px solid var(--sb-border); font-size: 1.55rem; }
h3 { margin-top: 1.7rem; font-size: 1.2rem; }
h1 + p { color: #3f4f47; font-size: 1.12rem; }

.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 1.5rem 0 2rem; }
.task-card {
  display: flex;
  flex-direction: column;
  min-height: 116px;
  justify-content: center;
  padding: 1.15rem;
  border: 1px solid var(--sb-border);
  border-radius: 10px;
  color: var(--sb-ink);
  background: linear-gradient(145deg, var(--sb-white), var(--sb-green-soft));
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--sb-shadow); }
.task-card strong { color: var(--sb-green-dark); font-size: 1.08rem; }
.task-card span { margin-top: .25rem; color: var(--sb-muted); }

.doc-screenshot {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: contain;
  margin: 1.35rem auto .45rem;
  border: 1px solid #cbd6cf;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(38,50,56,.08);
}
.doc-screenshot.narrow { max-height: 190px; }
.doc-screenshot + em { display: block; color: var(--sb-muted); text-align: center; font-size: .91rem; }

table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1rem 0 1.5rem; }
th, td { padding: .7rem .8rem; border: 1px solid var(--sb-border); text-align: left; vertical-align: top; }
th { color: var(--sb-white); background: var(--sb-green); }
tr:nth-child(even) td { background: #f8faf8; }

.admonition { margin: 1.4rem 0; padding: 1rem 1.05rem; border-left: 5px solid var(--sb-green); border-radius: 8px; background: var(--sb-green-soft); }
.admonition.warning { border-left-color: #a85d00; background: #fff6e6; }
.admonition-title { margin: 0 0 .25rem; font-weight: 800; }
.admonition p:last-child { margin-bottom: 0; }

code { padding: .08rem .3rem; border-radius: 4px; background: #edf1ee; }
pre { overflow-x: auto; padding: 1rem; border-radius: 8px; color: #f7fff8; background: #173c27; }
pre code { padding: 0; background: transparent; }

.page-footer { max-width: 980px; margin: 1.2rem auto 0; color: var(--sb-muted); font-size: .86rem; text-align: center; }

/* Keep topic navigation visible on landscape tablets. At this width the
   primary topic list is more useful than the current-page table of contents. */
@media screen and (min-width: 60em) and (max-width: 76.234375em) {
  [dir="ltr"] .md-sidebar--primary,
  [dir="rtl"] .md-sidebar--primary {
    right: auto;
    left: auto;
  }

  .md-sidebar--primary {
    position: sticky;
    z-index: 1;
    top: 2.4rem;
    display: block;
    width: 12.1rem;
    height: 0;
    background: transparent;
    transform: none;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    touch-action: pan-y;
  }

  .md-sidebar--secondary {
    display: none !important;
  }

  .md-header__button[for="__drawer"] {
    display: none;
  }

  [dir="ltr"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-left: 1.2rem;
  }

  [dir="rtl"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-right: 1.2rem;
  }
}

/* Give the collapsed navigation control a visible name on phones and
   portrait tablets. Material already supplies the accessible control name. */
@media screen and (max-width: 59.984375em) {
  .md-header__button[for="__drawer"] {
    display: inline-flex;
    width: auto;
    align-items: center;
    gap: .25rem;
  }

  .md-header__button[for="__drawer"]::after {
    content: "Topics";
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .01em;
  }
}

@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; }
  .brand { min-width: 0; flex: 1; }
  .brand span { display: none; }
  .menu-button { display: inline-block; order: -1; }
  .site-search { width: 100%; order: 3; }
  .site-shell { display: block; }
  .site-nav { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(88vw, 320px); height: 100vh; padding-top: 5rem; transform: translateX(-105%); box-shadow: var(--sb-shadow); transition: transform .18s ease; }
  .site-nav.open { transform: translateX(0); }
  .content-wrap { padding: 1rem .7rem 3rem; }
  .doc-content { border-radius: 10px; }
  .task-grid { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-nav, .page-footer { display: none; }
  .site-shell { display: block; }
  .content-wrap, .doc-content { max-width: none; padding: 0; border: 0; box-shadow: none; }
  a { color: inherit; }
}
