/* ============================================================
   BeeCore Examples — /developers/examples
   Sidebar geometry = Production Documentation baseline
   (see EXAMPLES_DOCUMENTATION_BASELINE.md — measured 2026-10-04).
   All classes prefixed ex- ; no global selectors touched.
   Main content fills the full width right of the sidebar
   (no max-width lock on container; prose capped at 900px only).
   ============================================================ */
:root {
  --ex-sidebar-width: 250px;
  --ex-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ex-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --ex-text: #181818;
  --ex-muted: #667085;
  --ex-border: #e5e7eb;
  --ex-code-bg: #f8f9fa;
  --ex-accent: #f5b800;
  --ex-accent-dark: #b27600;
  --ex-active-bg: #fff7dc;
  --ex-pale: #fffbef;
  --ex-dark: #0f172a;
  --ex-dark-border: #1e293b;
  --ex-dark-text: #e2e8f0;
  --ex-dark-dim: #94a3b8;
}

/* ---------- Page shell (grid identical to .dp-page[data-public-docs]) ---------- */
#examples-root.ex-page {
  display: grid;
  grid-template-columns: var(--ex-sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-top: 1px solid #eaeaea;
  min-height: calc(100vh - 76px);
  font-family: var(--ex-font);
  color: var(--ex-text);
  box-sizing: border-box;
}
#examples-root.ex-page *,
#examples-root.ex-page *::before,
#examples-root.ex-page *::after { box-sizing: border-box; }

/* ---------- Sidebar (geometry = Documentation .dp-toc baseline) ---------- */
.ex-toc {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: auto;
  align-self: stretch;
  position: static;
  display: block;
  overflow: visible;
  background: #fff;
  padding: 24px 18px 40px 26px;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 0;   /* Production /docs measured 2026-10-04: .dp-toc has NO right border */
  border-radius: 0;
}
.ex-label {
  color: #737373;
  font-size: 11px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: .08em;
  margin: 0 10px 8px;
  padding: 0;
}
.ex-group { display: block; margin: 0 0 24px; }
.ex-row {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  color: #252525;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  text-decoration: none;
  border: 0;
  border-left: 0 solid transparent;
  border-radius: 5px;
  padding: 9px 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.ex-row:hover { color: #252525; background: #fafafa; }
.ex-row.ex-active,
.ex-row.ex-active:hover {
  background: var(--ex-active-bg);
  border-left: 3px solid var(--ex-accent);
}
.ex-row:focus-visible { outline: 2px solid var(--ex-accent); outline-offset: -2px; }
.ex-num {
  flex: none;
  width: 24px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  color: var(--ex-muted);
  letter-spacing: .02em;
}
.ex-row.ex-active .ex-num { color: var(--ex-accent-dark); }
.ex-divider {
  border: 0;
  border-top: 1px solid var(--ex-border);
  margin: 0 10px 20px;
}

/* ---------- Main column: FULL WIDTH (no max-width lock) ---------- */
.ex-main {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}
.ex-content {
  width: 100%;
  max-width: none;
  padding: 0 30px 60px;
  min-width: 0;
  border-left: 1px solid var(--ex-border); /* full-height divider between sidebar and main, per effect */
}
.ex-section { margin: 0 0 27px; scroll-margin-top: 89px; }
.ex-section h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: normal;
  margin: 0 0 4px;
  color: var(--ex-text);
  letter-spacing: normal;
}
.ex-p { max-width: 900px; font-size: 14px; line-height: 1.6; color: #3a3a3a; margin: 0 0 14px; }
.ex-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ex-accent-dark);
  margin: 0 0 12px;
}
.ex-sec-head { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.ex-sec-num {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #a07708;
  background: #fdf3cf;
  border: 1px solid #f1e2a8;
  border-radius: 8px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.ex-link-btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ex-accent-dark);
  text-decoration: none;
}
.ex-link-btn:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.ex-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 36px;
  align-items: start;
  margin: 30px 0 26px;
}
.ex-hero h1 {
  font-size: 40px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  color: var(--ex-text);
}
.ex-hero-desc { font-size: 15.5px; line-height: 1.6; color: #3a3a3a; margin: 0 0 18px; max-width: 520px; }
.ex-badges { display: flex; gap: 10px; margin: 0 0 20px; }
.ex-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #4a4a4a;
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  padding: 5px 12px;
  background: #fff;
}
.ex-badge i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ex-accent);
  display: inline-block;
}
.ex-hero-actions { display: flex; gap: 12px; }
.ex-btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 7px;
  padding: 10px 18px;
  transition: background .12s ease, border-color .12s ease;
}
.ex-btn-primary { background: var(--ex-accent); color: #181818; border: 1px solid var(--ex-accent); }
.ex-btn-primary:hover { background: #ffca2e; }
.ex-btn-secondary { background: #fff; color: var(--ex-text); border: 1px solid var(--ex-border); }
.ex-btn-secondary:hover { border-color: #d2c58a; }

/* ---------- Code panel (shared hero + sections) — LIGHT theme per effect ---------- */
.ex-panel {
  border: 1px solid var(--ex-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.ex-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #eeeef0;
}
.ex-panel-tabs {
  display: inline-flex;
  gap: 2px;
  margin-right: auto;
  background: #f4f4f2;
  border-radius: 8px;
  padding: 3px;
}
.ex-tab {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #667085;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 11px;
  cursor: pointer;
}
.ex-tab:hover { color: #181818; }
.ex-tab.ex-tab-active {
  color: #181818;
  background: #fff;
  border-color: #e2e2df;
}
.ex-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #667085;
  background: #fff;
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}
.ex-copy:hover { color: #181818; border-color: #c9cdd4; }
.ex-copy svg { width: 13px; height: 13px; flex: none; }
.ex-copy.ex-copied { color: #181818; background: var(--ex-accent); border-color: var(--ex-accent); }
.ex-code-wrap { display: none; }
.ex-code-wrap.ex-code-active { display: block; }
.ex-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--ex-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #24292f;
  background: #fff;
}
.ex-pre code { font-family: inherit; }
.ex-tok-s { color: #0a306d; }
.ex-tok-c { color: #6e7781; font-style: italic; }
.ex-tok-k { color: #953800; }
.ex-panel-divider { border: 0; border-top: 1px solid #eeeef0; margin: 0; }
.ex-panel-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
}
.ex-panel-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
  color: #181818;
  margin: 0;
}
.ex-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 14px;
}
.ex-endpoint-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ex-dark-dim);
  flex: none;
}
.ex-endpoint-url {
  font-family: var(--ex-mono);
  font-size: 12px;
  color: var(--ex-dark-text);
  margin-right: auto;
  overflow-wrap: anywhere;
}

/* light variant (info panels inside sections) */
.ex-light-code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--ex-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #25303e;
  background: var(--ex-code-bg);
  border: 1px solid var(--ex-border);
  border-radius: 0 0 8px 8px;
  border-top: 0;
}
.ex-light-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ex-muted);
  background: #f1f3f5;
  border: 1px solid var(--ex-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 8px 14px;
}

/* ---------- Popular Examples ---------- */
.ex-pop {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 6px;
}
.ex-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  background: #fff;
  padding: 14px 15px;
  text-decoration: none;
  transition: border-color .12s ease;
}
.ex-card:hover { border-color: #d2c58a; }
.ex-card-title { font-size: 14px; font-weight: 600; color: var(--ex-text); margin: 0 0 4px; }
.ex-card-desc { font-size: 12.5px; line-height: 1.5; color: var(--ex-muted); margin: 0 0 12px; }
.ex-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; }
.ex-tag {
  font-family: var(--ex-mono);
  font-size: 10.5px;
  color: #4a4a4a;
  background: #f5f6f7;
  border: 1px solid var(--ex-border);
  border-radius: 4px;
  padding: 2px 7px;
}
.ex-card-arrow { font-size: 12.5px; font-weight: 600; color: var(--ex-text); margin-top: auto; }

/* ---------- Section split (info left / code right) ---------- */
.ex-split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 28px;
  align-items: start;
  margin: 8px 0 10px;
}
.ex-info {
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  background: #fff;
  padding: 4px 16px;
  margin: 0 0 14px;
}
.ex-info-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 11px 0;
}
.ex-info-row + .ex-info-row { border-top: 1px solid #f0f0f0; }
.ex-info-key {
  flex: none;
  width: 128px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--ex-muted);
}
.ex-info-val { font-size: 13px; color: var(--ex-text); overflow-wrap: anywhere; }
.ex-info-val code {
  font-family: var(--ex-mono);
  font-size: 12px;
  background: var(--ex-code-bg);
  border: 1px solid var(--ex-border);
  border-radius: 4px;
  padding: 1px 6px;
}
.ex-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ex-accent-dark);
  background: var(--ex-pale);
  border: 1px solid #f3e6bb;
  border-radius: 999px;
  padding: 1px 9px;
}
.ex-soon {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #98a2b3;
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------- BYOK provider chips ---------- */
.ex-prov-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.ex-prov-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ex-text);
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
}
.ex-prov-chip img { width: 18px; height: 18px; border-radius: 4px; }
.ex-prov-note { font-size: 12px; color: var(--ex-muted); margin: 4px 0 0; }

/* ---------- Final CTA ---------- */
.ex-final {
  background: var(--ex-active-bg);
  border: 1px solid #f3e6bb;
  border-radius: 10px;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 34px 0 0;
}
.ex-final h2 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--ex-text); }
.ex-final p { font-size: 14px; color: #6b5a1e; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ex-hero { grid-template-columns: minmax(0, 1fr); }
  .ex-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  .ex-pop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  #examples-root.ex-page { --ex-sidebar-width: 210px; }
  .ex-pop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  #examples-root.ex-page { display: flex; flex-direction: column; }
  .ex-toc {
    order: 0;
    border-right: 0;
    border-bottom: 1px solid var(--ex-border);
    padding: 18px 16px 18px;
  }
  .ex-main { order: 1; min-width: 0; }
  .ex-content { padding: 0 16px 60px; border-left: 0; }
  .ex-hero h1 { font-size: 30px; }
  .ex-pop { grid-template-columns: minmax(0, 1fr); }
  .ex-final { flex-direction: column; align-items: flex-start; }
}

/* Fixed desktop sidebar (identical to Documentation sticky contract:
   sticky top 65 + max-height viewport-65 + overflow-y auto). */
@media (min-width:701px){
  #examples-root.ex-page>.ex-toc{position:sticky;top:65px;left:0;width:250px;max-height:calc(100vh - 65px);align-self:start;overflow-y:auto;z-index:20}
  #examples-root.ex-page>.ex-content{grid-column:2;width:100%;max-width:none}
}
