/* === Service detail page — documentation layout === */

.doc-layout {
  display: grid;
  grid-template-columns: 280px 1fr 240px;
  min-height: 100vh;
  background: #fff;
}
@media (max-width: 1280px) {
  .doc-layout { grid-template-columns: 260px 1fr; }
  .doc-toc { display: none; }
}

/* Right-side TOC */
.doc-toc {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 80px 28px 40px 0;
  overflow-y: auto;
}
.doc-toc__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.doc-toc__label::before {
  content: "";
  width: 14px; height: 1px;
  background: var(--green);
}
.doc-toc__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  position: relative;
}
.doc-toc__list::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.doc-toc__list a {
  position: relative;
  display: block;
  padding: 7px 0 7px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  transition: color .2s var(--ease), padding .25s var(--ease);
}
.doc-toc__list a::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 1px; height: 0;
  background: var(--green);
  transition: height .3s var(--ease);
}
.doc-toc__list a:hover { color: var(--ink); padding-left: 20px; }
.doc-toc__list a.is-active {
  color: var(--green-dark);
  font-weight: 600;
}
.doc-toc__list a.is-active::before { top: 0; height: 100%; width: 2px; }
.doc-toc__list .nested {
  padding-left: 14px;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* Mobile TOC accordion (shown <1280) */
.doc-toc-mobile {
  display: none;
  margin: 0 0 32px;
  background: #FBFBF9;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
@media (max-width: 1280px) {
  .doc-toc-mobile { display: block; }
}
.doc-toc-mobile__summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.doc-toc-mobile__summary::-webkit-details-marker { display: none; }
.doc-toc-mobile__summary svg {
  transition: transform .3s var(--ease);
  color: var(--green-dark);
}
.doc-toc-mobile[open] .doc-toc-mobile__summary svg { transform: rotate(180deg); }
.doc-toc-mobile__list {
  list-style: none;
  margin: 0; padding: 8px 18px 18px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border-soft);
}
.doc-toc-mobile__list a {
  display: block;
  padding: 8px 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border-soft);
}
.doc-toc-mobile__list li:last-child a { border-bottom: 0; }
.doc-toc-mobile__list .nested { padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.doc-toc-mobile__list a:hover { color: var(--green-dark); }
.doc-toc-mobile__list a.is-active { color: var(--green-dark); font-weight: 600; }

/* Sidebar */
.doc-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 28px 24px 28px 32px;
  display: flex; flex-direction: column;
  background: #FBFBF9;
  overflow-y: auto;
}
.doc-sidebar__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
  letter-spacing: .02em;
  color: var(--green-dark);
  margin-bottom: 24px;
}
.doc-sidebar__logo img { height: 22px; width: auto; display: block; }
.doc-sidebar__back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  align-self: flex-start;
  margin-bottom: 32px;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .35s var(--ease);
}
.doc-sidebar__back:hover {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: rgba(47,158,68,.25);
  transform: translateX(-2px);
}
.doc-sidebar__back svg { transition: transform .35s var(--ease); }
.doc-sidebar__back:hover svg { transform: translateX(-3px); }

.doc-nav {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.doc-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
  transition: background .25s var(--ease), color .25s var(--ease), padding .35s var(--ease);
  position: relative;
}
.doc-nav a svg {
  flex: 0 0 18px; width: 18px; height: 18px;
  color: var(--muted-2);
  transition: color .25s var(--ease);
}
.doc-nav a:hover {
  background: rgba(47,158,68,.06);
  color: var(--ink);
}
.doc-nav a:hover svg { color: var(--green-dark); }
.doc-nav a.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
}
.doc-nav a.is-active svg { color: var(--green-dark); }
.doc-nav a.is-active::before {
  content: "";
  position: absolute;
  left: -32px; top: 50%;
  width: 3px; height: 18px;
  background: var(--green);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
}

.doc-sidebar__foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--muted);
}
.doc-sidebar__foot a { color: var(--green-dark); font-weight: 500; }

/* Main */
.doc-main {
  padding: 80px 64px 120px;
  min-width: 0;
}
.doc-main__inner { max-width: 720px; }
.doc-main h2[id], .doc-main h3[id] { scroll-margin-top: 24px; }
.doc-main h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0 0 32px;
}
.doc-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 56px;
  max-width: 720px;
}
.doc-lead em {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
}
.doc-section + .doc-section { margin-top: 56px; }
.doc-section h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 0 0 24px;
  color: var(--ink);
  max-width: 720px;
}
.doc-list {
  list-style: none;
  counter-reset: doc-item;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 18px;
}
.doc-list > li {
  counter-increment: doc-item;
  position: relative;
  padding-left: 36px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.doc-list > li::before {
  content: counter(doc-item) ".";
  position: absolute;
  left: 0; top: 0;
  font-weight: 600;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.doc-list > li strong {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px dashed transparent;
  transition: border-color .25s var(--ease);
}
.doc-list-letters {
  list-style: none;
  counter-reset: doc-letter;
  margin: 14px 0 0 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 14px;
}
.doc-list-letters > li {
  counter-increment: doc-letter;
  position: relative;
  padding-left: 32px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.doc-list-letters > li::before {
  content: counter(doc-letter, lower-alpha) ".";
  position: absolute;
  left: 0; top: 0;
  font-weight: 600;
  color: var(--green-dark);
}
.doc-list-letters > li strong {
  color: var(--ink);
  font-weight: 600;
}

/* Highlighted "callout" block */
.doc-callout {
  background: linear-gradient(135deg, #F4FAF5, #FFFFFF);
  border: 1px solid rgba(47,158,68,.25);
  border-left: 4px solid var(--green);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 32px 0;
}
.doc-callout p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.doc-callout p:last-child { margin-bottom: 0; }
.doc-callout strong { color: var(--green-dark); }
.doc-callout ul {
  list-style: none; margin: 12px 0 0; padding: 0;
}
.doc-callout ul li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.doc-callout ul li::before {
  content: "";
  position: absolute; left: 4px; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.doc-note {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 3px solid var(--muted-2);
  background: #FBFBF9;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}
.doc-note em { color: var(--ink-soft); font-style: normal; font-weight: 500; }

/* Plain bullet list (no numbers) */
.doc-bullets {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex; flex-direction: column;
  gap: 12px;
}
.doc-bullets > li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.doc-bullets > li::before {
  content: "—";
  position: absolute;
  left: 0; top: 0;
  color: var(--green);
  font-weight: 600;
}

/* Decorative top accent on h1 */
.doc-main h1::before {
  content: "";
  display: block;
  width: 56px; height: 4px;
  background: var(--green);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* CTA at the bottom */
.doc-cta {
  margin-top: 80px;
  padding: 36px 40px;
  background: linear-gradient(135deg, #F4FAF5 0%, #FFFFFF 100%);
  border: 1px solid rgba(47,158,68,.2);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.doc-cta__text {
  flex: 1;
  min-width: 240px;
}
.doc-cta__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 6px;
}
.doc-cta__desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* RED placeholder for missing PDF content */
.missing {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(220, 38, 38, .08);
  border: 1px dashed rgba(220, 38, 38, .5);
  color: #dc2626;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -.005em;
  line-height: 1.4;
}
.missing--block {
  display: block;
  padding: 14px 18px;
  margin: 8px 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}
.missing--inline { padding: 1px 6px; font-size: inherit; vertical-align: baseline; }
.missing::before { content: "⚠ "; opacity: .7; }

/* Hide global elements that don't belong */
.doc-layout ~ .footer,
.doc-layout ~ header { display: none !important; }

/* Mobile */
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
  .doc-sidebar__back { margin-bottom: 20px; }
  .doc-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav a {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
  }
  .doc-nav a svg { display: none; }
  .doc-nav a.is-active::before { display: none; }
  .doc-sidebar__foot { display: none; }
  .doc-main { padding: 40px 24px 80px; }
}
@media (max-width: 540px) {
  .doc-main h1 { font-size: 32px; }
  .doc-cta { padding: 24px; flex-direction: column; align-items: flex-start; }
}
