.doc-main a {
  color: #6cb4ff;
  text-decoration: underline;
  text-decoration-color: rgba(108, 180, 255, 0.4);
  text-underline-offset: 2px;
}

.doc-main a:hover {
  color: #8fc6ff;
  text-decoration-color: #8fc6ff;
}

/* Doc shell: wide two-column content (label + body per section) under the fixed site navbar */
.doc-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 101px;
  min-height: 100vh;
  position: relative;
}

.doc-main {
  padding: 48px clamp(1.5rem, 4vw, 3.5rem) 120px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Horizontal in-page anchor pills, replaces the old sidebar TOC.
   Sticky under the fixed site navbar so it stays reachable on long pages. */
.doc-pillnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 40px;
  padding: 16px 0 24px;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 101px;
  z-index: 500;
  background: rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.doc-pillnav a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  color: #999;
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.doc-pillnav a:hover {
  color: #fff;
  border-color: #333;
}

.doc-pillnav a.active {
  background: #111;
  color: #fff;
  border-color: #333;
}

.doc-crosslink {
  display: inline-block;
  margin-bottom: 20px;
  color: #999;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.doc-crosslink:hover {
  color: #fff;
}

.doc-header {
  margin-bottom: 32px;
}

.doc-header h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 12px;
}

.doc-header p {
  color: #999;
  font-size: 16px;
  max-width: 640px;
  margin: 0;
}

/* Each doc section spreads a short label column and a wider content column
   across the full page width instead of stacking everything in one narrow column. */
section.doc-section {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: 52px 0;
  border-top: 1px solid #1a1a1a;
  scroll-margin-top: 181px;
}

section.doc-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.doc-section-label {
  position: sticky;
  top: 185px;
  align-self: start;
}

.doc-section-body {
  min-width: 0;
}

section.doc-section .kicker {
  display: block;
  color: #777;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

section.doc-section h1[id] {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
  scroll-margin-top: 181px;
}

section.doc-section .lede {
  color: #999;
  font-size: 15px;
  margin: 0;
}

.doc-section-body > *:first-child {
  margin-top: 0;
}

@media (max-width: 960px) {
  section.doc-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .doc-section-label {
    position: static;
  }
}

section.doc-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 30px 0 10px;
  letter-spacing: 0;
  text-align: left;
}

section.doc-section h3 {
  font-size: 14.5px;
  font-weight: 700;
  margin: 22px 0 8px;
  color: #fff;
}

section.doc-section p {
  margin: 0 0 14px;
  color: #ccc;
  font-size: 15px;
}

section.doc-section ul.plain {
  margin: 0 0 20px;
  padding-left: 20px;
}

section.doc-section ul.plain li {
  margin-bottom: 8px;
  color: #ccc;
  font-size: 15px;
}

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  color: #fff;
}

pre {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 20px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #eee;
  line-height: 1.7;
}

table.opts {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 22px;
  font-size: 14px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
}

table.opts th, table.opts td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: top;
}

table.opts tr:last-child td {
  border-bottom: none;
}

table.opts th {
  color: #777;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid #262626;
}

table.opts td.field-name {
  font-weight: 650;
  white-space: nowrap;
  color: #fff;
}

table.opts td.field-desc {
  color: #999;
}

.callout {
  display: flex;
  gap: 10px;
  border: 1px solid #1a1a1a;
  border-left: 3px solid #666;
  background: #0a0a0a;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 8px 0 24px;
  font-size: 14px;
  color: #999;
}

.callout b { color: #fff; }
.callout-icon { flex-shrink: 0; font-weight: 800; color: #999; }
.callout.warn { border-left-color: #ffa726; }
.callout.warn .callout-icon { color: #ffa726; }
.callout.danger { border-left-color: #ff5c70; }
.callout.danger .callout-icon { color: #ff5c70; }

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}

.doc-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.doc-card:hover {
  border-color: #333;
  transform: translateY(-2px);
}

.doc-card h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 8px;
}

.doc-card p {
  color: #999;
  font-size: 13.5px;
  margin: 0;
}

ol.steps { margin: 0 0 20px; padding-left: 22px; }
ol.steps li { margin-bottom: 8px; color: #ccc; font-size: 15px; }

.badge-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #111;
  border: 1px solid #1a1a1a;
  color: #999;
  margin-left: 8px;
}

.field-shot {
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  background: #0a0a0a;
  padding: 18px 20px;
  margin: 8px 0 20px;
}

.tab-pair {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 4px;
}

.tab-pair span {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #1a1a1a;
  font-size: 12.5px;
  color: #999;
}

.tab-pair span.active {
  border-color: #333;
  background: #111;
  color: #fff;
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed #333;
  border-radius: 8px;
  background: #0a0a0a;
  padding: 36px 20px;
  margin: 8px 0 22px;
  color: #808080;
  text-align: center;
}

.screenshot-placeholder .ph-icon { font-size: 22px; opacity: 0.7; }
.screenshot-placeholder .ph-label { font-size: 13px; font-weight: 650; color: #999; }
.screenshot-placeholder .ph-hint { font-size: 12px; max-width: 460px; }

/* Screenshot frame — holds the real image + caption, replaces the dashed placeholder once a shot exists */
.screenshot-frame {
  margin: 8px 0 22px;
}

.screenshot-frame img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  border: 1.5px solid #3a3a3a;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.screenshot-frame img:hover { opacity: 0.9; }

.screenshot-frame .ph-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #808080;
  max-width: 620px;
}

/* Lightbox — click a screenshot to blow it up over a blurred backdrop; click outside it to dismiss */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
  background: rgba(5, 5, 5, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Short/wide screenshots: center them vertically like before. Tall ones fall back
   to align-items: flex-start (below) so they render at full readable width and
   scroll instead of being squashed to fit the viewport height. */
.lightbox-overlay {
  align-items: safe center;
}

.lightbox-overlay img {
  width: min(1100px, 100%);
  max-width: min(1100px, 100%);
  height: auto;
  margin: auto 0;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.lightbox-overlay.active img {
  transform: scale(1);
}

@media (max-width: 860px) {
  .doc-shell { padding-top: 70px; }
  .doc-main { padding: 32px 20px 100px; }
  table.opts td.field-name { white-space: normal; }

  /* Wrapped pills would stack into several rows and eat too much sticky
     screen space on a phone — scroll horizontally as a single strip instead. */
  .doc-pillnav {
    top: 70px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .doc-pillnav::-webkit-scrollbar { display: none; }

  .doc-pillnav a {
    flex: 0 0 auto;
  }
}
