.dd-labs-page {
  line-height: 1.6;
}

.dd-labs-page .dd-logo {
  width: auto;
  max-width: min(100%, 280px);
}

.dd-labs-page .dd-nav {
  align-items: center;
  flex-wrap: wrap;
}

.dd-labs-page .dd-nav a {
  text-underline-offset: 4px;
}

.dd-labs-page .dd-nav a[aria-current="page"] {
  color: var(--dd-purple);
  text-decoration: underline;
  text-decoration-color: var(--dd-blue);
  text-decoration-thickness: 2px;
}

.dd-labs-page :focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--dd-blue);
}

.dd-lab-directory-hero .education-notice,
.dd-notebook-hero .education-notice {
  max-width: 780px;
  margin-top: 24px;
  padding: 14px 17px;
  color: #f9fafb;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
}

.directory-shell {
  width: min(1180px, calc(100% - 80px));
  margin: 0 auto;
  padding: 46px 0 84px;
}

.eyebrow,
.mini-label {
  margin: 0 0 8px;
  color: var(--dd-purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-heading,
.cell-title-row,
.control-row,
.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  color: var(--dd-dark);
  font-size: 28px;
}

.catalog-count,
.difficulty {
  color: var(--dd-muted);
  font-weight: 700;
}

.lab-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.lab-card {
  min-width: 0;
  min-height: 420px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.lab-card h3 {
  margin: 22px 0 8px;
  color: var(--dd-dark);
  font-size: 24px;
  line-height: 1.2;
}

.lab-card > p {
  color: var(--dd-muted);
}

.lab-card p,
.dd-lab-cell p,
.dd-lab-cell li,
.dd-lab-cell a {
  overflow-wrap: anywhere;
}

.verification-badge {
  width: max-content;
  padding: 6px 10px;
  display: inline-flex;
  color: #62480d;
  background: #fff3c4;
  border: 1px solid #e8c76b;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.card-facts,
.overview-facts,
.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.card-facts div,
.overview-facts div,
.detail-list div {
  min-width: 0;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid var(--dd-border);
  border-radius: 10px;
}

.dd-labs-page dt {
  color: var(--dd-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dd-labs-page dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.chip-row,
.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 5px 9px;
  background: #f9fafb;
  border: 1px solid var(--dd-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-line {
  color: var(--dd-purple);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.completion-button,
.local-choice button {
  min-height: 42px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  margin-top: auto;
  background: linear-gradient(135deg, var(--dd-blue), var(--dd-purple));
}

.primary-button:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.secondary-button {
  color: #ffffff;
  background: #6b7280;
  border: 0;
}

.secondary-button:hover {
  color: #ffffff;
  background: #4b5563;
}

.empty-state {
  margin-top: 28px;
  padding: 52px 24px;
  text-align: center;
  background: var(--dd-card);
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
}

.not-found {
  max-width: 780px;
  margin: 8vh auto;
}

.notebook-layout {
  min-height: calc(100vh - 91px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.cell-rail {
  position: sticky;
  top: 91px;
  align-self: start;
  height: calc(100vh - 91px);
  padding: 28px 18px 44px;
  overflow-y: auto;
  color: var(--dd-text);
  background: #ffffff;
  border-right: 1px solid var(--dd-border);
  box-shadow: 6px 0 20px rgba(17, 24, 39, 0.04);
}

.rail-top {
  padding: 0 10px 20px;
}

.rail-top > a {
  color: var(--dd-blue);
  font-size: 13px;
  font-weight: 700;
}

.rail-top .eyebrow {
  margin-top: 28px;
}

.rail-top h2 {
  color: var(--dd-dark);
  font-size: 17px;
  line-height: 1.35;
}

.rail-progress {
  padding: 13px 12px 10px;
  color: #4b5563;
  background:
    linear-gradient(
      90deg,
      rgba(212, 160, 23, 0.8),
      rgba(242, 159, 5, 0.8),
      rgba(255, 90, 0, 0.8)
    ) top / 100% 4px no-repeat,
    #f9fafb;
  border: 1px solid var(--dd-border);
  border-radius: 9px;
  font-size: 12px;
}

.cell-rail nav {
  display: grid;
  gap: 4px;
}

.rail-link {
  min-width: 0;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 8px;
  color: #4b5563;
  border-left: 3px solid transparent;
  border-radius: 8px;
  text-decoration: none;
}

.rail-marker {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
}

.rail-link span {
  color: #9ca3af;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rail-link .rail-check {
  display: none;
  color: #15803d;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.rail-link.is-complete .rail-sequence {
  display: none;
}

.rail-link.is-complete .rail-check {
  display: inline;
}

.rail-link strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.rail-link small {
  grid-column: 2;
  color: var(--dd-muted);
  font-size: 11px;
}

.rail-link:hover,
.rail-link.is-current {
  color: var(--dd-dark);
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.09),
    rgba(124, 58, 237, 0.11)
  );
  border-left-color: var(--dd-purple);
}

.notebook-main {
  min-width: 0;
  padding: clamp(28px, 5vw, 64px);
}

.lab-overview,
.notebook-cell,
.notebook-end {
  width: min(900px, 100%);
  margin: 0 auto 30px;
}

.lab-overview {
  scroll-margin-top: 118px;
  padding: clamp(34px, 5vw, 58px);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
}

.dd-notebook-hero h1 {
  font-size: clamp(34px, 5vw, 44px);
}

.overview-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #d1d5db;
  font-size: 12px;
}

.lab-overview .eyebrow,
.lab-overview .mini-label {
  color: #c4b5fd;
}

.lab-overview .lab-summary,
.lab-overview .field-note {
  color: #e5e7eb;
}

.overview-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-facts div,
.overview-grid > section,
.metadata-band,
.limitations {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.overview-facts dt {
  color: #cbd5e1;
}

.overview-facts dd {
  color: #ffffff;
}

.overview-grid {
  margin: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
}

.overview-grid > section,
.metadata-band,
.limitations {
  min-width: 0;
  padding: 19px;
  border-radius: 13px;
}

.overview-grid h2 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
}

.metadata-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.lab-overview .chip {
  color: #f9fafb;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.lab-overview .tag-line {
  color: #ddd6fe;
}

.limitations {
  margin-top: 20px;
}

.lab-overview .primary-button {
  margin-top: 26px;
}

.cell-stack {
  padding-top: 12px;
}

.dd-labs-page .notebook-cell.step {
  --cell-accent: var(--dd-blue);
  scroll-margin-top: 112px;
  padding: 0;
  overflow: hidden;
  border-top: 5px solid var(--cell-accent);
}

.cell-architecture,
.cell-agent,
.cell-multi_agent {
  --cell-accent: var(--dd-purple);
}

.cell-prompt {
  --cell-accent: #4f46e5;
}

.cell-security_stop {
  --cell-accent: #ea580c;
}

.cell-human_approval {
  --cell-accent: #d4a017;
}

.cell-code,
.cell-terminal {
  --cell-accent: var(--dd-dark);
}

.cell-deploy,
.cell-scale {
  --cell-accent: #4f46e5;
}

.notebook-cell.is-complete {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.cell-header,
.cell-payload,
.cell-footer {
  padding: 24px clamp(20px, 4vw, 36px);
}

.cell-header {
  background: #f9fafb;
  border-bottom: 1px solid var(--dd-border);
}

.cell-sequence {
  display: flex;
  gap: 6px;
  color: var(--dd-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cell-sequence span + span::before {
  content: "· ";
}

.cell-title-row {
  align-items: flex-start;
  margin-top: 13px;
}

.cell-type {
  margin: 0;
  color: var(--cell-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dd-labs-page .step .cell-header h2 {
  margin: 3px 0;
  color: var(--dd-dark);
  font-size: 24px;
  line-height: 1.2;
}

.cell-summary {
  color: var(--dd-muted);
  font-size: 16px;
}

.completion-button {
  flex: 0 0 auto;
  font-size: 12px;
}

.completion-check {
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #15803d;
  background: #dcfce7;
  border: 2px solid #15803d;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.is-complete .completion-button {
  color: #ffffff;
  background: #6b7280;
}

.is-complete .completion-button:hover {
  background: #4b5563;
}

.is-complete .completion-pending {
  display: none;
}

.is-complete .completion-check {
  display: grid;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.execution-banner,
.instruction-block,
.security-stop-mark,
.rollback-panel,
.boundary-panel {
  margin: 22px clamp(20px, 4vw, 36px) 0;
  padding: 15px 17px;
  border-radius: 11px;
}

.execution-banner {
  color: #694908;
  background: #fff7e6;
  border: 1px solid #f1cf83;
}

.instruction-block {
  background: #f9fafb;
  border-left: 4px solid var(--dd-blue);
}

.instruction-block p:last-child {
  margin-bottom: 0;
}

.prose {
  font-size: 16px;
}

.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.6em;
}

.dd-labs-page pre {
  max-width: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #e5e7eb;
  background: #0f172a;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dd-labs-page code {
  padding: 0.12em 0.3em;
  color: var(--dd-dark);
  background: #eef2ff;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.dd-labs-page pre code,
.dd-labs-page .code-box code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.component-grid,
.variable-grid,
.security-grid,
.detail-columns,
.decision-outcomes,
.trigger-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.component-card,
.variable-grid section,
.security-grid section,
.decision-outcomes section,
.trigger-list section {
  min-width: 0;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--dd-border);
  border-radius: 11px;
}

.component-card h3,
.variable-grid h3,
.trigger-list h3 {
  margin: 0 0 5px;
}

.relationship-list {
  margin: 22px 0;
}

.relationship-list > div {
  padding: 10px 0;
  display: grid;
  grid-template-columns:
    minmax(0, 0.8fr) 28px minmax(0, 0.8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--dd-border);
}

.relationship-list strong {
  overflow-wrap: anywhere;
}

.relationship-list p {
  margin: 0 0 0 12px;
  color: var(--dd-muted);
}

.source-panel {
  margin: 20px 0;
  padding: 17px;
  background: #f9fafb;
  border: 1px solid var(--dd-border);
  border-radius: 11px;
}

.field-note,
.local-status {
  color: var(--dd-muted);
  font-size: 13px;
}

.prompt-label {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.prompt-label span {
  color: var(--dd-muted);
  font-size: 12px;
}

.dd-labs-page .prompt-editor {
  width: 100%;
  min-height: 180px;
  height: auto;
  padding: 16px;
  color: var(--dd-text);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  resize: vertical;
}

.dd-labs-page .prompt-editor:focus {
  border-color: var(--dd-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.control-row {
  justify-content: flex-start;
  margin: 10px 0 22px;
}

.security-stop-mark {
  margin-left: 0;
  margin-right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.security-stop-mark > span {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #ea580c;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}

.security-stop-mark strong {
  display: block;
  font-size: 18px;
}

.security-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.security-stop-mark p {
  margin: 2px 0 0;
}

.cell-security_stop .security-grid section {
  background: #fffaf5;
  border-color: #fed7aa;
}

.rollback-panel {
  margin-left: 0;
  margin-right: 0;
  color: #694908;
  background: #fff7e6;
  border: 1px solid #f1cf83;
}

.approval-requirement {
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 8px;
}

.detail-list {
  grid-template-columns: 1fr;
}

.local-choice {
  margin-top: 22px;
  padding: 17px;
  background: #fffbeb;
  border: 1px solid #f3d27a;
  border-radius: 12px;
}

.local-choice legend {
  font-weight: 700;
}

.local-choice legend span {
  display: block;
  color: var(--dd-muted);
  font-size: 12px;
  font-weight: 400;
}

.choice-row {
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-choice button.is-selected {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.approval-card {
  padding: 19px;
  background: #fff7e6;
  border-left: 5px solid #d4a017;
  border-radius: 8px;
}

.approval-action {
  font-size: 18px;
  font-weight: 700;
}

.boundary-panel {
  margin-left: 0;
  margin-right: 0;
  background: #f9fafb;
  border: 1px solid var(--dd-border);
}

.cell-footer {
  background: #f9fafb;
  border-top: 1px solid var(--dd-border);
}

.cell-controls {
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--dd-border);
}

.cell-controls a {
  color: var(--dd-blue);
  font-weight: 700;
  text-decoration: none;
}

.cell-controls a:hover {
  text-decoration: underline;
}

.notebook-end {
  padding: 44px 24px;
  text-align: center;
}

.dd-labs-page .dd-footer-wave {
  overflow: hidden;
}

.dd-labs-page .dd-footer-wave img {
  min-width: 720px;
}

.dd-labs-page .dd-footer img {
  width: auto;
  height: auto;
}

.dd-labs-footer-nav {
  display: grid;
  gap: 10px;
}

.dd-labs-footer-nav a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.dd-labs-footer-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .notebook-layout {
    grid-template-columns: 1fr;
  }

  .cell-rail {
    position: relative;
    top: auto;
    height: auto;
    padding: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--dd-border);
  }

  .cell-rail nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .rail-link {
    min-width: 170px;
  }

  .overview-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dd-labs-page .dd-header {
    padding: 14px 18px;
  }

  .dd-labs-page .dd-logo {
    height: 54px;
  }

  .dd-labs-page .dd-nav {
    justify-content: center;
    gap: 10px 18px;
  }

  .directory-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 34px;
  }

  .dd-lab-directory-hero {
    padding: 44px 22px;
  }

  .lab-card-grid,
  .overview-grid,
  .metadata-band,
  .component-grid,
  .variable-grid,
  .security-grid,
  .detail-columns,
  .decision-outcomes,
  .trigger-list {
    grid-template-columns: 1fr;
  }

  .lab-card {
    min-height: 0;
  }

  .card-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notebook-main {
    padding: 18px 12px 42px;
  }

  .lab-overview {
    padding: 30px 20px;
    border-radius: 16px;
  }

  .cell-title-row {
    display: block;
  }

  .completion-button {
    margin-top: 14px;
  }

  .relationship-list > div {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  }

  .relationship-list p {
    grid-column: 1 / -1;
    margin: 0;
  }

  .dd-labs-page .dd-footer-wave img {
    min-width: 540px;
    transform: translateX(-18%);
  }
}

@media (max-width: 440px) {
  .dd-labs-page .dd-nav {
    font-size: 13px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .card-facts,
  .overview-facts {
    grid-template-columns: 1fr;
  }

  .choice-row button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dd-labs-page * {
    scroll-behavior: auto;
  }
}
/* Admin-only workflow framing around the otherwise exact public preview. */
.admin-preview-workflow { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto; padding: 1rem; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; box-shadow: 0 12px 35px rgba(15, 23, 42, .13); }
.admin-preview-workflow ol { display: flex; flex-wrap: wrap; gap: .45rem 1rem; padding: 0; list-style: none; font-size: .85rem; }
.admin-preview-workflow li.complete { color: #176a43; font-weight: 750; }
.admin-preview-workflow li.current { color: #1d4ed8; font-weight: 800; }
.admin-preview-workflow li.remaining { color: #65707e; }
.admin-preview-action { display: inline-flex; min-height: 3rem; align-items: center; padding: .7rem 1.1rem; border-radius: 10px; background: linear-gradient(135deg, #2563eb 0%, #111827 100%); color: #fff; font-weight: 800; text-decoration: none; }
.admin-preview-action:focus-visible { outline: 4px solid rgba(37, 99, 235, .35); outline-offset: 3px; }
