
:root {
  --rh-bg: #2C2B29;
  --rh-panel: #242321;
  --rh-raised: #333230;
  --rh-line: #454440;
  --rh-muted: #b8b7b3;
  --rh-text: #f6f5f2;
  --rh-red: #ED1B24;
  --rh-red-hover: #ff3b30;
  --rh-red-pill: #3e2628;
  --rh-dark-code: #1c1b19;
  --rh-green: #27c93f;
  --rh-code-bg: #181716;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--rh-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--rh-text);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--rh-bg);
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

/* 3-Column Documentation Architecture */
.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 240px;
  gap: 36px;
  padding-top: 32px;
  padding-bottom: 90px;
}

/* Column 1: Left Sticky Navigation */
.docs-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid var(--rh-line);
  scrollbar-width: thin;
  scrollbar-color: #55534d transparent;
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rh-muted);
  margin: 0 0 8px 10px;
}

.sidebar-navlist {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  color: #cfceca;
  font-size: 13.5px;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  background: transparent;
}

.sidebar-link:hover {
  background: var(--rh-raised);
  color: #fff;
}

.sidebar-link.active {
  background: var(--rh-red-pill);
  border-left-color: var(--rh-red);
  color: #fff;
  font-weight: 700;
}

.sidebar-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #201f1d;
  color: var(--rh-muted);
  border: 1px solid var(--rh-line);
}

/* Column 2: Center Stage Main Content */
.docs-main {
  min-width: 0;
  max-width: 900px;
}

.eyebrow-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rh-red);
  margin-bottom: 8px;
}

.doc-heading h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
  color: #fff;
}

.doc-subtitle {
  font-size: 15px;
  color: var(--rh-muted);
  margin: 0 0 28px 0;
  line-height: 1.6;
}

/* Prominent Action Bar */
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 28px;
}

.btn-primary {
  background: var(--rh-red);
  color: #fff;
  border: 1px solid var(--rh-red);
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 750;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--rh-red-hover);
  border-color: var(--rh-red-hover);
}

.btn-secondary {
  background: var(--rh-raised);
  color: #fff;
  border: 1px solid var(--rh-line);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #3c3a37;
  border-color: #585651;
}

/* Interactive OS Switcher Tabs */
.tabbed-box {
  background: var(--rh-panel);
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0 26px;
}

.tabbed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e1d1b;
  border-bottom: 1px solid var(--rh-line);
  padding: 0 14px;
}

.tabbed-nav {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--rh-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--rh-red);
}

.tab-pane {
  display: none;
  padding: 16px;
}

.tab-pane.active {
  display: block;
}

/* macOS Terminal Style Codeblocks */
.terminal-card {
  background: var(--rh-dark-code);
  border: 1px solid var(--rh-line);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 16px;
}

.terminal-card:last-child {
  margin-bottom: 0;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #171615;
  padding: 8px 14px;
  border-bottom: 1px solid #33322f;
}

.terminal-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: var(--rh-muted);
  font-weight: 600;
  margin-left: 10px;
}

.copy-pill {
  background: var(--rh-raised);
  border: 1px solid var(--rh-line);
  color: #dfded9;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.copy-pill:hover {
  background: #474541;
  color: #fff;
}

.copy-pill.copied {
  background: #203c30;
  border-color: #2e5944;
  color: #94e5b7;
}

.terminal-body {
  padding: 14px 18px;
  overflow-x: auto;
}

.terminal-pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  color: #f6f5f2;
  white-space: pre-wrap;
  word-break: break-all;
}


.dual-container {
  display: grid;
  gap: 14px;
  margin: 20px 0 28px;
}

.dual-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rh-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Column 3: Right Column Sticky TOC */
.docs-toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.toc-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rh-muted);
  margin-bottom: 12px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  border-left: 1px solid var(--rh-line);
  padding-left: 12px;
}

.toc-item {
  font-size: 12.5px;
  color: var(--rh-muted);
  transition: color 0.15s;
}

.toc-item:hover, .toc-item.active {
  color: #fff;
  font-weight: 700;
}

.toc-card {
  background: var(--rh-panel);
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  padding: 16px;
}

.toc-card h4 {
  margin: 0 0 6px 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.toc-card p {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--rh-muted);
  line-height: 1.45;
}

/* Callout Box */
.callout-box {
  background: #282724;
  border-left: 3px solid var(--rh-red);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 13.5px;
  color: #e2e1dc;
}

/* Data Table */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  margin: 20px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: #201f1d;
  padding: 12px 14px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--rh-muted);
  border-bottom: 1px solid var(--rh-line);
  text-align: left;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rh-line);
  color: #e6e5e1;
  font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Step list */
.step-container {
  margin-bottom: 30px;
}

.step-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #fff;
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: none;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #2f2e2b;
  border: 1px solid var(--rh-line);
  border-radius: 6px;
  min-width: 0;
}

.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333230;
  border: 1px solid #454440;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.step-detail {
  min-width: 0;
  overflow-wrap: anywhere;
}

.step-item-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
  margin: 1px 0 5px;
}

.step-item-copy {
  margin: 0;
  color: #d3d1cb;
  font-size: 14px;
  line-height: 1.5;
}

/* Grid for apps */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 32px;
}

.client-card {
  background: var(--rh-panel);
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s;
}

.client-card:hover {
  border-color: #63615a;
  background: #282725;
}

.client-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-card-protocol {
  font-size: 11px;
  font-weight: 750;
  color: var(--rh-red);
  background: #3e2628;
  border: 1px solid #682e33;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Notice */
.notice {
  padding: 14px 16px;
  margin: 16px 0;
  border: 1px solid #427659;
  border-radius: 6px;
  background: #253b2d;
  color: #c3ebd2;
  font-size: 14px;
}

.notice.error {
  border-color: #99545a;
  background: #492d30;
  color: #ffd0d2;
}

.mobile-view {
  display: none;
}

/* Responsive Breakpoints */
@media (max-width: 1150px) {
  .docs-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }
  .docs-sidebar {
    display: none;
  }
  .mobile-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
  }
  .clients-grid {
    grid-template-columns: 1fr;
  }
}

.actions-bar .lucide, .toc-card .lucide {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 1.8;
}

.actions-bar .btn-primary, .actions-bar .btn-secondary, .actions-bar .copy-pill, .toc-card .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Beginner Onboarding Guide Cards */
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 36px;
}
.guide-card {
  background: var(--rh-panel);
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.guide-card:hover {
  border-color: #63615a;
  background: #282725;
}
.guide-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.guide-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rh-red);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.guide-card-desc {
  font-size: 13.5px;
  color: var(--rh-muted);
  line-height: 1.5;
  margin: 0;
}
.guide-card-action {
  margin-top: auto;
  padding-top: 8px;
}
.guide-tip {
  background: #232220;
  border-left: 3px solid var(--rh-red);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #e2e1dc;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-tip strong {
  color: #fff;
}
@media (max-width: 768px) {
  .onboarding-steps {
    grid-template-columns: 1fr;
  }
}

/* UI Setting Flow Mockup Card */
.settings-mockup {
  background: #171615;
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  overflow: hidden;
  margin: 18px 0 24px;
}
.mockup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #121110;
  padding: 8px 14px;
  border-bottom: 1px solid #2d2c29;
}
.mockup-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mockup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mockup-field label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--rh-muted);
  letter-spacing: 0.05em;
}
.mockup-value {
  background: #1f1e1c;
  border: 1px solid #3c3a37;
  border-radius: 6px;
  padding: 9px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  color: #94e5b7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mockup-highlight {
  color: #fff;
  font-weight: 700;
}
.guide-card-action {
  display: none !important;
}

/* Step-by-Step Visual Screenshot Gallery */
.visual-steps-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 20px 0 32px;
}
.visual-step-card {
  background: var(--rh-panel);
  border: 1px solid var(--rh-line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}
.visual-step-card:hover {
  border-color: #68655d;
}
.visual-step-header {
  padding: 14px 18px;
  background: #1e1d1b;
  border-bottom: 1px solid var(--rh-line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.visual-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rh-red);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.visual-step-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.visual-step-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.visual-step-desc {
  font-size: 13.5px;
  color: #cfceca;
  line-height: 1.5;
  margin: 0;
}
.visual-step-img-wrap {
  background: #141312;
  border: 1px solid #33322f;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.visual-step-img {
  max-width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* Mobile Header Overhaul: Clean 2-Row Layout Matching Bot Hub */
@media (max-width: 768px) {
  html, body {
    overflow-x: clip;
  }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
    border-bottom: 1px solid var(--rh-line);
  }
  .site-header .shell.nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand actions"
      "links links" !important;
    align-items: center !important;
    min-height: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    gap: 10px !important;
  }
  .site-header .brand {
    grid-area: brand !important;
    min-width: 0 !important;
    flex: none !important;
  }
  .site-header .brand img {
    width: min(160px, 48vw) !important;
    height: auto !important;
    display: block !important;
  }
  .site-header .navright {
    grid-area: actions !important;
    min-width: 0 !important;
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .site-header .navright .pill {
    display: none !important;
  }
  .site-header .navright .btn {
    min-height: 36px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  .site-header .navlinks {
    grid-area: links !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 4px !important;
    padding: 0 !important;
    align-self: auto !important;
    overflow: visible !important;
  }
  .site-header .navlinks a {
    min-width: 0 !important;
    min-height: 36px !important;
    padding: 6px 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    color: var(--rh-muted) !important;
    border-radius: 5px !important;
    border: 1px solid transparent !important;
  }
  .site-header .navlinks a.current {
    color: #fff !important;
    background: #3e2628 !important;
    border-color: #6b3337 !important;
    font-weight: 800 !important;
  }
  .site-header .navlinks a:hover {
    background: #353431 !important;
    color: #fff !important;
  }
  .site-header .navlinks .lucide {
    display: none !important;
  }
}
@media (max-width: 359px) {
  .site-header .navlinks {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .site-header .brand img {
    width: 140px !important;
  }
  .site-header .navlinks a {
    font-size: 11px !important;
  }
}
