@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* CGI Brand */
  --purple-900: #200A58;
  --purple-800: #2D1E5E;
  --purple-700: #3A2679;
  --purple-base: #5236AB;
  --purple-500: #755EBC;
  --purple-400: #9E83F5;
  --purple-300: #AFA3D8;
  --purple-200: #CBC3E6;
  --purple-100: #E6E3F3;
  --purple-50:  #F2F1F9;

  --red-base:   #E31937;
  --red-700:    #A21127;

  --magenta-base: #A82465;

  --gray-base:  #333333;
  --gray-700:   #242424;
  --gray-400:   #5C5C5C;
  --gray-200:   #A8A8A8;
  --gray-100:   #C0C0C0;
  --gray-50:    #EFEFEF;

  --white-700:  #EBEEF2;
  --white-600:  #F0F3F6;
  --white-500:  #F2F4F7;
  --white-400:  #F5F7F9;
  --white-base: #FFFFFF;

  --success:    #1AB977;
  --success-900:#0B4E32;
  --success-700:#128354;
  --success-200:#96DFC0;
  --success-50: #E8F8F1;
  --warning:    #F1A425;
  --warning-900:#654510;
  --warning-600:#DB9522;
  --warning-50: #FEF6E9;
  --error:      #B00020;
  --error-900:  #4A000D;
  --error-100:  #E7B0BA;
  --error-50:   #F7E6E9;

  --brand-primary: var(--purple-base);
  --brand-danger: var(--red-base);
  --surface: var(--white-base);
  --surface-muted: var(--white-400);
  --text-strong: var(--gray-base);
  --text-muted: var(--gray-400);
  --text-subtle: var(--gray-200);

  /* Gradient A — CGI brand */
  --gradient-a: linear-gradient(90deg, var(--purple-base), var(--magenta-base) 50%, var(--red-base));

  /* Layout */
  --sidebar-w:  260px;
  --topbar-h:   64px;
  --radius:     4px;
  --radius-lg:  8px;

  /* Typography */
  --font: "Source Sans Pro", Helvetica, "Helvetica Neue", Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white-400);
  color: var(--gray-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white-base);
  border-right: 1px solid var(--white-700);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--white-700);
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-gradient-bar {
  height: 3px;
  background: var(--gradient-a);
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 56px;
  height: 32px;
  background: var(--white-base);
  border: 1px solid var(--white-700);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 5px 6px;
  text-decoration: none;
}

.sidebar-logo-mark:hover {
  border-color: var(--red-base);
}

.sidebar-logo-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.sidebar-app-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--purple-800);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-app-sub {
  font-size: 11px;
  color: var(--gray-200);
  font-weight: 400;
}

.app-home-link {
  color: inherit;
  text-decoration: none;
}

.sidebar-nav { flex: 1; padding: 8px 0 24px; overflow-y: auto; }

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-200);
  padding: 16px 20px 6px;
}

.nav-group-label-with-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-base);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}

.nav-link:hover {
  background: var(--purple-50);
  color: var(--purple-base);
  border-left-color: var(--purple-200);
}

.nav-link.active {
  background: var(--purple-50);
  color: var(--purple-base);
  font-weight: 600;
  border-left-color: var(--purple-base);
}

.sidebar-logo-mark:focus-visible,
.nav-link:focus-visible,
.breadcrumb a:focus-visible,
.role-card:focus-visible,
.pnav-btn:focus-visible,
.page-toc a:focus-visible,
.app-link-callout a:focus-visible,
summary.faq-q:focus-visible {
  outline: 3px solid var(--purple-400);
  outline-offset: 3px;
}

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .6; }
.nav-link.active svg { opacity: 1; }

.nav-badge { display: none; }
.nav-badge-orange { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: var(--warning-50); color: var(--warning-900); white-space: nowrap; letter-spacing: 0.04em; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

.topbar-gradient { height: 2px; background: var(--gradient-a); }

.topbar {
  position: sticky; top: 2px;
  height: var(--topbar-h);
  background: var(--white-base);
  border-bottom: 1px solid var(--white-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-200);
}
.breadcrumb a { color: var(--gray-400); text-decoration: none; }
.breadcrumb a:hover { color: var(--purple-base); }
.breadcrumb span { color: var(--gray-base); font-weight: 600; }
.breadcrumb .sep { color: var(--gray-100); }

.version-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--purple-50);
  color: var(--purple-700);
  border: 1px solid var(--purple-200);
  font-family: var(--font);
}

.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-base);
  margin-bottom: 8px;
}

h1.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--purple-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.page-lead {
  font-size: 16px;
  color: var(--gray-400);
  line-height: 1.7;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--white-700);
}

h2.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--purple-800);
  margin: 40px 0 12px;
}

h3.sub-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-base);
  margin: 24px 0 8px;
}

p {
  font-size: 15px;
  color: var(--gray-400);
  margin-bottom: 14px;
  line-height: 1.7;
}

/* ── Screenshot marker ────────────────────────────────────────────────────── */
.shot-marker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--warning-50);
  border: 1.5px dashed var(--warning-600);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 20px 0;
}

.shot-icon {
  width: 34px; height: 34px;
  background: var(--warning-600);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shot-icon svg { width: 18px; height: 18px; fill: var(--warning-900); }
.shot-icon svg circle { stroke: var(--warning-900); }

.shot-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warning-900);
  margin-bottom: 3px;
}

.shot-desc {
  font-size: 13px;
  color: var(--warning-900);
  line-height: 1.5;
  margin: 0;
}

.shot-placeholder {
  width: 100%;
  min-height: 140px;
  background: repeating-linear-gradient(-45deg, var(--warning-50), var(--warning-50) 8px, var(--white-base) 8px, var(--white-base) 16px);
  border: 1.5px dashed var(--warning-600);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 24px;
}

.shot-placeholder-inner {
  background: var(--white-base);
  border: 1px solid var(--warning-600);
  border-radius: var(--radius);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning-900);
}

/* ── Note ─────────────────────────────────────────────────────────────────── */
.note {
  display: flex;
  gap: 10px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-left: 3px solid var(--purple-base);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--purple-800);
  line-height: 1.6;
}

.note-icon {
  align-items: center;
  background: var(--purple-base);
  border-radius: 50%;
  color: var(--white-base);
  display: inline-flex;
  flex: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-top: 2px;
  width: 18px;
}

.external-doc-link {
  color: var(--purple-base);
  font-weight: 600;
}

.col-provider-icon { width: 56px; }
.col-term { width: 180px; }
.col-area { width: 160px; }
.col-zone { width: 140px; }
.col-access { width: 180px; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 16px 0 28px;
  border: 1px solid var(--white-700);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.doc-table thead th {
  background: var(--purple-800);
  color: white;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 16px;
  text-align: left;
}

.doc-table tbody tr { border-top: 1px solid var(--white-700); }
.doc-table tbody tr:nth-child(even) { background: var(--white-400); }
.doc-table tbody tr:hover { background: var(--purple-50); }

.doc-table td {
  padding: 10px 16px;
  color: var(--gray-400);
  vertical-align: top;
  line-height: 1.5;
}

.doc-table td:first-child { font-weight: 600; color: var(--gray-base); }

.td-route {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--purple-500);
  white-space: nowrap;
}

.td-no { color: var(--gray-100); font-style: italic; }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps { margin: 16px 0 28px; }

.step { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }

.step-n {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--purple-base);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(82,54,171,.3);
}

.step-body { flex: 1; font-size: 14.5px; color: var(--gray-400); line-height: 1.6; }
.step-body strong { color: var(--gray-base); }

/* ── Bullets ──────────────────────────────────────────────────────────────── */
ul.doc-list { list-style: none; margin: 10px 0 20px; padding: 0; }
ul.doc-list li {
  display: flex; gap: 10px;
  font-size: 14.5px; color: var(--gray-400);
  padding: 4px 0; line-height: 1.6;
}
ul.doc-list li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple-base);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ── Pills ────────────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  vertical-align: middle;
}
.pill-purple  { background: var(--purple-100); color: var(--purple-700); }
.pill-green   { background: var(--success-50); color: var(--success-900); }
.pill-red     { background: var(--error-50); color: var(--error-900); }
.pill-gray    { background: var(--gray-50); color: var(--gray-400); }

/* ── Role cards (home) ────────────────────────────────────────────────────── */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 24px 0 36px;
}

.role-card {
  background: white;
  border: 1px solid var(--white-700);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.role-card:hover {
  border-color: var(--purple-base);
  box-shadow: 0 2px 12px rgba(82,54,171,.12);
  transform: translateY(-2px);
}

.role-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.role-card-title { font-size: 14px; font-weight: 700; color: var(--purple-800); }
.role-card-desc  { font-size: 13px; color: var(--gray-400); line-height: 1.5; flex: 1; }
.role-card-link  { font-size: 12px; font-weight: 600; color: var(--purple-base); }

.role-card-icon-purple { background: var(--purple-50); color: var(--purple-700); }
.role-card-icon-success { background: var(--success-50); color: var(--success-900); }
.role-card-icon-warning { background: var(--warning-50); color: var(--warning-900); }
.role-card-icon-error { background: var(--error-50); color: var(--error-900); }

.role-card-icon svg {
  height: 22px;
  width: 22px;
  stroke: currentColor;
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq { margin: 8px 0 28px; }

details.faq-item {
  border: 1px solid var(--white-700);
  border-radius: var(--radius);
  margin-bottom: 6px;
  overflow: hidden;
  background: white;
}

summary.faq-q {
  padding: 13px 18px;
  font-size: 14px; font-weight: 600;
  color: var(--gray-base);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

summary.faq-q::-webkit-details-marker { display: none; }
summary.faq-q::after { content: '+'; font-size: 18px; color: var(--purple-base); font-weight: 400; }
details[open] summary.faq-q { border-bottom: 1px solid var(--white-700); }
details[open] summary.faq-q::after { content: '\2212'; }

.faq-a {
  padding: 12px 18px 14px;
  font-size: 14px; color: var(--gray-400); line-height: 1.7;
}

/* ── Page nav ─────────────────────────────────────────────────────────────── */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--white-700);
}

.pnav-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--white-700);
  border-radius: var(--radius-lg);
  text-decoration: none;
  flex: 1;
  max-width: 48%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pnav-btn:hover {
  border-color: var(--purple-base);
  box-shadow: 0 2px 8px rgba(82,54,171,.1);
}

.pnav-btn.next { text-align: right; margin-left: auto; }
.pnav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-200); }
.pnav-title { font-size: 14px; font-weight: 600; color: var(--purple-base); }

/* ── Page table of contents ─────────────────────────────────────────── */
.page-toc {
  background: var(--white-400);
  border: 1px solid var(--white-700);
  border-left: 3px solid var(--purple-300);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 20px;
  margin-bottom: 28px;
  display: inline-block;
  min-width: 260px;
}

.page-toc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-200);
  margin-bottom: 8px;
}

.page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc ul li {
  padding: 3px 0;
}

.page-toc ul li a {
  font-size: 13.5px;
  color: var(--purple-base);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-toc ul li a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--purple-300);
  flex-shrink: 0;
}

.page-toc ul li a:hover {
  color: var(--purple-800);
  text-decoration: underline;
}

/* ── Callouts ──────────────────────────────────────────────────────────── */
.callout-tip, .callout-formal {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}

.callout-tip-header, .callout-formal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.callout-tip p, .callout-formal p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.callout-tip p:last-child, .callout-formal p:last-child { margin-bottom: 0; }

.callout-tip {
  background: var(--success-50);
  border: 1px solid var(--success-200);
  border-left: 3px solid var(--success);
}
.callout-tip-header { color: var(--success-900); }
.callout-tip-header svg { stroke: var(--success); }
.callout-tip p { color: var(--success-900); }

.callout-formal {
  background: var(--error-50);
  border: 1px solid var(--error-100);
  border-left: 3px solid var(--error);
}
.callout-formal-header { color: var(--error-900); }
.callout-formal-header svg { stroke: var(--error); }
.callout-formal p { color: var(--error-900); }

.providers-table td { vertical-align: middle; }
.providers-table td:first-child { padding: 8px 12px; }
.provider-logo-image { display: block; width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.provider-coming-soon { opacity: 0.5; }
.provider-subtext { color: var(--gray-200); font-size: 12px; }
.is-muted { color: var(--gray-200); }
.provider-logo-bg-openai { fill: var(--success-700); }
.provider-logo-bg-github { fill: var(--gray-700); }
.provider-logo-bg-librechat { fill: var(--purple-base); }
.provider-logo-bg-muted { fill: var(--gray-100); }
.provider-logo-fg-muted { fill: var(--gray-400); }

/* ── App link callout ─────────────────────────────────────────────────────── */
.app-link-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--purple-800);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 32px;
  color: white;
  font-size: 15px;
  font-weight: 600;
}

.app-link-callout svg { flex-shrink: 0; stroke: white; }

.app-link-callout a {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-link-callout a:hover { opacity: .85; }

/* ── Screenshots ──────────────────────────────────────────────────────────── */
.screenshot {
  margin: 20px 0 28px;
  border: 1px solid var(--white-700);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
}

.screenshot img {
  width: 100%;
  display: block;
}

.screenshot figcaption {
  font-size: 12px;
  color: var(--gray-200);
  padding: 8px 14px;
  background: var(--white-400);
  border-top: 1px solid var(--white-700);
  font-style: italic;
}

code.inline {
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: var(--purple-50);
  color: var(--purple-700);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 28px 20px 60px; }
  .topbar { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
