/* =============================================================================
   Cyfendo Developer Guide & CLI Reference Styling
   ============================================================================= */

:root {
  --docs-bg: var(--sand);
  --docs-surface: var(--paper);
  --docs-surface-hover: var(--paper-bright, #FFFFFF);
  --docs-border: var(--line);
  --docs-border-accent: var(--teal);
  --accent-cyan: var(--teal);
  --accent-emerald: #1a7a58;
  --accent-amber: #b27a00;
  --accent-rose: #d9381e;
  --accent-blue: #1e5a8a;
  --accent-purple: #5c3d82;
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--ink-soft);
  --font-mono: var(--app-font-mono);
}

/* Ensure sticky sidebar functions properly on documentation page */
html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  overflow-y: visible;
  background-color: var(--sand);
  color: var(--ink);
}

.docs-wrapper {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px 24px;
  box-sizing: border-box;
  overflow-x: clip;
}

.docs-hero {
  text-align: center;
  padding: 48px 20px 40px 20px;
  background: radial-gradient(circle at 65% 20%, hsl(46 91% 66% / .2), transparent 55%), var(--sand);
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
  border-radius: 16px;
  box-sizing: border-box;
  max-width: 100%;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9999px;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--app-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.docs-title {
  font-family: var(--app-font-serif);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
  line-height: 1.15;
}

.docs-title-gradient {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: initial !important;
  color: var(--teal) !important;
  font-style: italic;
}

.docs-subtitle {
  font-family: var(--app-font-sans);
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.65;
}

/* -----------------------------------------------------------------------------
   Two-Column Docs Layout (Sidebar Nav + Main Content)
   ----------------------------------------------------------------------------- */
.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.docs-sidebar {
  position: sticky;
  top: 90px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px;
  box-shadow: 0 6px 20px hsl(183 34% 13% / .04);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-heading {
  font-family: var(--app-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px 6px 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: hsl(183 45% 28% / .06);
  color: var(--teal);
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.sidebar-link.active {
  background: hsl(183 45% 28% / .1);
  color: var(--teal);
  font-weight: 600;
  border-left: 3px solid var(--teal);
}

/* Sidebar Nested Sub-navigation */
.sidebar-item-group {
  display: flex;
  flex-direction: column;
}

.sidebar-subnav {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 3px 0 6px 14px;
  padding-left: 12px;
  border-left: 1.5px solid var(--line);
  gap: 2px;
}

.sidebar-sublink {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  color: var(--ink-soft);
  font-size: 0.81rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-sublink::before {
  content: "";
  position: absolute;
  left: -13.5px;
  top: 50%;
  width: 8px;
  height: 1.5px;
  background: var(--line);
  transition: background 0.2s ease, width 0.2s ease;
}

.sidebar-sublink:hover {
  color: var(--teal);
  background: hsl(183 45% 28% / .04);
}

.sidebar-sublink:hover::before {
  background: var(--teal);
  width: 10px;
}

.sidebar-sublink:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.sidebar-sublink.active {
  color: var(--teal);
  font-weight: 600;
  background: hsl(183 45% 28% / .08);
}

.sidebar-sublink.active::before {
  background: var(--teal);
  width: 12px;
}

/* -----------------------------------------------------------------------------
   Main Docs Content Styling
   ----------------------------------------------------------------------------- */
.docs-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.docs-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 4px 16px hsl(183 34% 13% / .04);
  scroll-margin-top: 100px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.section-header-wrap {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-icon-badge {
  display: none !important;
}

.section-title {
  font-family: var(--app-font-serif);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px 0;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

/* Step list */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.step-card {
  display: flex;
  gap: 16px;
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: hsl(183 45% 28% / .08);
  border: 1px solid hsl(183 45% 28% / .2);
  color: var(--teal);
  font-weight: 600;
  font-family: var(--app-font-mono);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content {
  flex: 1;
}

.step-title {
  font-family: var(--app-font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px 0;
}

.step-body {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

/* Callouts / Alerts */
.docs-callout {
  padding: 16px 20px;
  border-radius: 10px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-info {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #E2F8FF;
}

.callout-info svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #DCFCE7;
}

.callout-tip svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
  margin-top: 2px;
}

/* -----------------------------------------------------------------------------
   Ubuntu Terminal Theme & Code Syntax Highlighting
   ----------------------------------------------------------------------------- */
.code-block-wrap {
  background: #2c3649;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  margin: 18px 0;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(18, 30, 48, 0.12);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #38455c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.terminal-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot.dot-red { background: #E95420; }
.terminal-dot.dot-yellow { background: #F57900; }
.terminal-dot.dot-green { background: #73D216; }

.code-lang-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #CBD5E1;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.btn-code-copy {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: #CBD5E1;
  font-family: var(--font-sans, 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-code-copy:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #FFFFFF;
}

.btn-code-copy:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Responsive Table Wrapper for Documentation Tables */
.table-responsive-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border-radius: 8px;
  scrollbar-width: thin;
}

.table-responsive-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-responsive-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Data tables: ruled tables on wide screens, cards on tablets and phones.
   A --stack table shows one card per row, with each field labelled from its data-label.
   Fields sit side by side when the card has room and in a single column on a phone. */
.docs-data-table-wrap {
  margin: 12px 0 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: left;
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.docs-data-table th {
  padding: 10px 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--sand);
  border-bottom: 2px solid var(--line);
}

.docs-data-table td {
  padding: 10px 14px;
  vertical-align: top;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.docs-data-table tr:last-child td {
  border-bottom: 0;
}

.docs-data-table td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* A short key column, such as P1 to P4: fits a phone as a table, so it never stacks */
.docs-data-table--keyed td:first-child {
  width: 1%;
  white-space: nowrap;
}

/* Flags and file names stay whole instead of breaking after a hyphen */
#dependency-audit p code,
#dependency-audit li code,
.docs-data-table code {
  white-space: nowrap;
}

/* Long API paths break after a slash (<wbr>), not in the middle of a word */
.docs-data-table code.api-path {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 960px) {
  .docs-data-table--stack,
  .docs-data-table--stack tbody {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .docs-data-table--stack {
    font-size: 0.88rem;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .docs-data-table--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .docs-data-table--stack tr {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 0;
    margin-bottom: 10px;
    background: var(--paper-bright, #FFFFFF);
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .docs-data-table--stack tr:last-child {
    margin-bottom: 0;
  }

  .docs-data-table--stack td,
  .docs-data-table--stack tr:last-child td {
    display: block;
    flex: 1 1 200px;
    min-width: 0;
    padding: 6px 12px;
    border-bottom: 0;
  }

  .docs-data-table--stack td:first-child,
  .docs-data-table--stack tr:last-child td:first-child {
    flex-basis: 100%;
  }

  .docs-data-table--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
}

.code-block-pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Ubuntu Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #F8FAFC;
  background: #2c3649;
}

.code-block-pre:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

/* Safeguard inline code tags from overflowing on small mobile screens */
code:not(pre code) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Ubuntu Syntax Highlighting Tokens */
.sh-comment {
  color: #94A3B8; /* High-contrast readable comment */
  font-style: italic;
  font-weight: 500;
}

.sh-prompt {
  color: #8AE234; /* Ubuntu green prompt */
  font-weight: 700;
  user-select: none;
  margin-right: 4px;
}

.sh-cmd {
  color: #8AE234; /* Ubuntu Bright Green */
  font-weight: 700;
}

.sh-subcmd {
  color: #FFFFFF; /* Crisp White */
  font-weight: 600;
}

.sh-flag {
  color: #8FB8E8; /* light blue, 5.9:1 on the code background */
  font-weight: 600;
}

.sh-str {
  color: #FCE94F; /* Ubuntu Warm Yellow */
  font-weight: 500;
}

.sh-path {
  color: #E2E8F0;
  font-weight: 500;
}

.sh-env {
  color: #D4A5D0; /* light lavender, 5.8:1 on the code background */
  font-weight: 700;
}

.sh-op {
  color: #FF79C6; /* Magenta Pipe / Operator */
  font-weight: 700;
}

/* YAML Syntax */
.yml-key {
  color: #8FB8E8;
  font-weight: 600;
}

.yml-val {
  color: #FCE94F;
}

.yml-str {
  color: #8AE234;
}

/* Cheat Sheet Table */
.cheat-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.cheat-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.cheat-table th {
  padding: 12px 16px;
  background: var(--sand);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--line);
}

.cheat-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

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

.code-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 3px 8px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   CI/CD Accessible Tab Switcher & Quality Gate Cards
   ----------------------------------------------------------------------------- */
.cicd-tabs-wrap {
  margin: 24px 0 28px 0;
  width: 100%;
}

.cicd-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--muted);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.cicd-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans, 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cicd-tab-btn:hover {
  color: var(--ink);
  background: var(--paper);
}

.cicd-tab-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.cicd-tab-btn.active {
  background: var(--paper-bright, #FFFFFF);
  border-color: var(--line);
  color: var(--teal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cicd-tab-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-sovereign {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(4, 120, 87, 0.3);
  color: #064E3B;
}

.badge-cloud {
  background: rgba(30, 64, 175, 0.1);
  border: 1px solid rgba(30, 64, 175, 0.25);
  color: #1D4ED8;
}

.cicd-tabpanel {
  display: block;
  outline: none;
}

.cicd-tabpanel[hidden] {
  display: none !important;
}

.cicd-panel-intro {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cicd-secrets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 14px 0 18px 0;
}

.cicd-secret-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cicd-secret-icon {
  color: var(--accent-amber);
  flex-shrink: 0;
  margin-top: 2px;
}

.cicd-secret-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.cicd-secret-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.cicd-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 22px 0 16px 0;
}

.cicd-feature-card {
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cicd-feature-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cicd-feature-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.badge-pr {
  background: rgba(109, 40, 217, 0.1);
  border: 1px solid rgba(109, 40, 217, 0.25);
  color: #6D28D9;
}

.badge-fast {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(180, 83, 9, 0.3);
  color: #78350F;
}

/* GitHub Pull Request Lifecycle & Simulation Cards */
.pr-lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0 24px 0;
}

.pr-lifecycle-card {
  background: var(--paper-bright, #FFFFFF);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pr-lifecycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}

.pr-lifecycle-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-lifecycle-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* GitHub PR Gate UI Simulation */
.gh-gate-mockup {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.gh-gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  font-size: 0.85rem;
  color: #c9d1d9;
}

.gh-gate-branch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(110, 118, 129, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  color: #58a6ff;
}

.gh-gate-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gh-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid #21262d;
}

.gh-check-item.passed {
  border-left: 4px solid #238636;
}

.gh-check-item.failed {
  border-left: 4px solid #da3633;
}

.gh-check-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 2px;
}

.gh-check-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #c9d1d9;
}

.gh-check-desc {
  font-size: 0.78rem;
  color: #8b949e;
  margin-top: 2px;
}

.gh-merge-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #161b22;
  border-top: 1px solid #30363d;
  flex-wrap: wrap;
  gap: 10px;
}

.gh-merge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-sans, 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  cursor: default;
}

.gh-merge-btn.allowed {
  background: #238636;
  color: #ffffff;
  border: 1px solid rgba(240, 246, 252, 0.1);
}

.gh-merge-btn.blocked {
  background: #21262d;
  color: #8B949E;
  border: 1px solid #30363d;
}

.gh-gate-status-text {
  font-size: 0.8rem;
  color: #8b949e;
}


/* -----------------------------------------------------------------------------
   Responsive Breakpoints
   ----------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .docs-sidebar {
    position: sticky;
    top: 72px;
    z-index: 50;
    background: hsl(39 31% 94% / 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    box-shadow: 0 4px 16px rgba(22, 39, 40, 0.08);
  }

  .sidebar-heading {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 2px 2px 8px 2px;
    scrollbar-width: thin;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .sidebar-nav::-webkit-scrollbar {
    height: 4px;
  }

  .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(22, 39, 40, 0.2);
    border-radius: 4px;
  }

  .sidebar-link {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 9999px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
  }

  .sidebar-link.active,
  .sidebar-link:hover {
    background: var(--teal);
    color: #FFFFFF;
    border-color: var(--teal);
  }

  .sidebar-item-group {
    display: contents;
  }

  .sidebar-subnav {
    margin: 0;
    padding: 0;
    border-left: none;
    display: contents;
  }

  .sidebar-sublink {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
  }

  .sidebar-sublink::before {
    display: none;
  }

  .sidebar-sublink.active {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    border-left: 1px solid var(--accent-cyan);
  }

  .docs-section,
  #git-scheduling,
  #byom-providers {
    scroll-margin-top: 140px;
  }

  .btn-code-copy {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
  }
}

/* Tablets: the sticky chip navigation is taller here, so a linked section's title must land below it */
@media (min-width: 641px) and (max-width: 960px) {
  .docs-section,
  #git-scheduling,
  #byom-providers {
    scroll-margin-top: 300px;
  }
}

/* Landscape phones: a sticky chip navigation would leave about 100px to read in */
@media (max-width: 960px) and (max-height: 500px) {
  .docs-sidebar {
    position: static;
  }

  .docs-section,
  #git-scheduling,
  #byom-providers {
    scroll-margin-top: 90px;
  }
}

@media (max-width: 640px) {
  .docs-wrapper {
    padding: 16px 12px 60px 12px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .docs-hero {
    padding: 32px 14px 28px;
    margin-bottom: 24px;
    border-radius: 12px;
  }

  .docs-title {
    font-size: 1.65rem;
    line-height: 1.25;
  }

  .docs-subtitle {
    font-size: 0.92rem;
  }

  .docs-section {
    padding: 20px 14px;
    border-radius: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .section-header-wrap {
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    min-width: 0;
    max-width: 100%;
  }

  .section-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .section-title {
    font-size: 1.25rem;
    word-break: break-word;
  }

  .step-list {
    margin: 16px 0;
    gap: 16px;
  }

  .step-card {
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .step-content {
    min-width: 0;
    max-width: 100%;
  }

  .step-body {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .docs-callout {
    padding: 14px;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .code-block-wrap {
    margin: 14px 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .code-block-pre {
    font-size: 0.78rem;
    padding: 12px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
  }

  .code-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    min-width: 0;
    max-width: 100%;
  }

  .cheat-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    margin: 12px 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .cheat-table th,
  .cheat-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .cicd-tablist {
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }

  .cicd-tab-btn {
    width: 100%;
    justify-content: space-between;
    padding: 10px 14px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .cicd-secrets-grid {
    grid-template-columns: 1fr;
  }

  .cicd-feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .docs-wrapper {
    padding: 12px 8px 48px 8px;
  }

  .docs-hero {
    padding: 24px 10px 20px;
  }

  .docs-title {
    font-size: 1.4rem;
  }

  .docs-section {
    padding: 16px 10px;
  }

  .code-block-pre {
    padding: 10px 8px;
    font-size: 0.74rem;
  }
}
