/* ============================================================
   ContextQA MCP Docs — Shared Stylesheet
   Aesthetic: Editorial / technical — dark nav, warm light content
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Reset & Variables ---------- */
.catalog-index { padding-left: 20px; margin: 16px 0 28px; columns: 2; }
.catalog-index li { break-inside: avoid; overflow-wrap: anywhere; }
.catalog-entry { margin: 28px 0; scroll-margin-top: 20px; }
.catalog-entry h3 { overflow-wrap: anywhere; }
.catalog-entry details { margin-top: 12px; }
.catalog-entry summary { cursor: pointer; font-weight: 600; }
.catalog-guidance { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--font-mono); padding: 16px; margin-top: 12px; background: var(--cloud); border-radius: var(--r-sm); }
.parameter-description { font-size: 12px; margin-top: 6px; overflow-wrap: anywhere; }
.sidebar-overlay { border: 0; padding: 0; }
@media (max-width: 640px) { .catalog-index { columns: 1; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --ink:        #0c0e14;
  --ink-soft:   #1a1d27;
  --ink-muted:  #2d3148;
  --slate:      #6b7294;
  --slate-light:#9ba2c2;
  --cloud:      #f4f5f9;
  --snow:       #fafbfe;
  --white:      #ffffff;

  --accent:     rgb(27, 31, 235);
  --accent-dim: rgb(27, 31, 235);
  --accent-glow: rgba(27, 31, 235, .12);
  --accent-soft: #ededfe;
  --teal:       #18b8a8;
  --teal-soft:  #e6faf7;
  --amber:      #f0a030;
  --amber-soft: #fef6e6;
  --rose:       #e84670;
  --rose-soft:  #fdedf1;
  --green:      #22a858;
  --green-soft: #e8f8ef;

  /* Surfaces */
  --sidebar-bg:   #0f1119;
  --sidebar-text: #c0c4d8;
  --sidebar-hover:#1a1e2e;
  --sidebar-active:#252a3d;
  --content-bg:   var(--snow);
  --card-bg:      var(--white);
  --card-border:  #e4e6ee;

  /* Typography */
  --font-body:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --sidebar-w:  272px;
  --content-max: 1200px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(12,14,20,.05);
  --shadow-md:  0 4px 16px rgba(12,14,20,.07);
  --shadow-lg:  0 12px 40px rgba(12,14,20,.09);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--content-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dim); }

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg { width: 20px; height: 20px; }

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.3px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 11.5px;
  color: var(--slate);
  font-weight: 400;
  letter-spacing: .2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1.1px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all .15s;
  line-height: 1.3;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--white);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--white);
}

.sidebar-link .link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .55;
}

.sidebar-link.active .link-icon,
.sidebar-link:hover .link-icon {
  opacity: .9;
}

.sidebar-link .link-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255,255,255,.08);
  color: var(--slate-light);
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1.4;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12.5px;
  color: var(--slate);
  text-decoration: none;
  transition: color .15s;
}

.sidebar-footer-link:hover { color: var(--white); }

.sidebar-footer-link svg {
  width: 14px;
  height: 14px;
  opacity: .6;
}

/* ---------- Main Content ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 48px 80px;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--slate);
  margin-bottom: 32px;
}

.breadcrumbs a {
  color: var(--slate);
  font-weight: 500;
}

.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs .sep {
  color: var(--slate-light);
  font-size: 10px;
}

.breadcrumbs .current {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Typography ---------- */
.page-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 17px;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 640px;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
  margin: 48px 0 16px;
  padding-top: 8px;
}

h2:first-of-type { margin-top: 0; }

h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 12px;
}

p { margin-bottom: 16px; color: var(--ink-soft); }

p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--ink); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  /* At most three columns, so the wide content area keeps rows even (3 cards, or 3 + 3). */
  grid-template-columns: repeat(auto-fit, minmax(max(240px, calc((100% - 32px) / 3)), 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 24px;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

a.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow);
  transform: translateY(-2px);
  color: inherit;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.card-icon svg { width: 20px; height: 20px; }

.card-icon.purple  { background: var(--accent-soft); color: var(--accent); }
.card-icon.teal    { background: var(--teal-soft);   color: var(--teal); }
.card-icon.amber   { background: var(--amber-soft);  color: var(--amber); }
.card-icon.rose    { background: var(--rose-soft);    color: var(--rose); }
.card-icon.green   { background: var(--green-soft);   color: var(--green); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.55;
  flex: 1;
}

.card-meta {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-meta svg { width: 14px; height: 14px; }

/* ---------- Code Blocks ---------- */
.code-block {
  position: relative;
  background: var(--ink);
  border-radius: var(--r-md);
  margin: 16px 0 24px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.code-block-lang {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.code-block-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--slate-light);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all .15s;
}

.code-block-copy:hover {
  background: rgba(255,255,255,.14);
  color: var(--white);
}

.code-block-copy.copied {
  color: var(--teal);
  border-color: rgba(24,184,168,.3);
}

.code-block-copy svg { width: 13px; height: 13px; }

.code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d4d8f0;
  tab-size: 2;
}

.code-block pre code {
  font-family: inherit;
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--cloud);
  color: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--card-border);
}

.code-block pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Ensure text selection is visible in dark code blocks */
.code-block pre ::selection {
  background: rgba(139, 139, 247, .4);
  color: #fff;
}

.code-block pre ::-moz-selection {
  background: rgba(139, 139, 247, .4);
  color: #fff;
}

/* Syntax colors (CSS-only via spans) */
.tok-key   { color: #8b8bf7; }
.tok-str   { color: #5ee6b8; }
.tok-com   { color: #4d5280; font-style: italic; }
.tok-num   { color: #f0a030; }
.tok-fn    { color: #66b3ff; }
.tok-tag   { color: #e84670; }
.tok-attr  { color: #c596f7; }
.tok-bool  { color: #f0a030; }

/* ---------- Prompt Library ---------- */
.library-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.library-heading h2 { margin: 0 0 6px; padding: 0; }

.library-heading-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.library-heading-link svg { width: 13px; height: 13px; }

.library-lede { font-size: 14px; color: var(--slate); max-width: 720px; margin-bottom: 12px; }

/* Search + category chips stay pinned while browsing. */
.library-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 0;
  background: var(--content-bg);
}

.library-toolbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px;
  background: linear-gradient(var(--content-bg), rgba(250, 251, 254, 0));
  pointer-events: none;
}

.library-search { position: relative; }

.library-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--slate);
  pointer-events: none;
}

.library-search input {
  width: 100%;
  min-width: 0;
  font: 400 15px/1.5 var(--font-body);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 10px 44px 10px 40px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}

.library-search input::placeholder { color: var(--slate); opacity: 1; }
.library-search input:hover { border-color: #cccee0; }
.library-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.search-key {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font: 500 11px/1 var(--font-mono);
  color: var(--slate);
  background: var(--cloud);
  border: 1px solid var(--card-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px;
  pointer-events: none;
}

.library-search input:not(:placeholder-shown) + .search-key { display: none; }

.category-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 12.5px/1.2 var(--font-body);
  color: var(--ink-muted);
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 6px 5px 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.chip:hover { border-color: var(--slate-light); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip.is-empty { opacity: .5; }

.chip-count {
  min-width: 20px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--slate);
  background: var(--cloud);
  border-radius: 999px;
  padding: 2px 6px;
}

.chip[aria-pressed="true"] .chip-count { color: var(--white); background: rgba(255, 255, 255, .16); }

.chip-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--slate-light); }
.chip-dot.purple { background: var(--accent); }
.chip-dot.teal   { background: var(--teal); }
.chip-dot.amber  { background: var(--amber); }
.chip-dot.rose   { background: var(--rose); }
.chip-dot.green  { background: var(--green); }

.library-status { display: flex; align-items: center; gap: 12px; min-height: 22px; margin: 2px 0 20px; font-size: 13px; color: var(--slate); }
.library-status p { margin: 0; color: inherit; }

.link-button {
  font: 600 13px/1.4 var(--font-body);
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover { color: var(--accent-dim); }

.empty-prompts { padding: 24px; background: var(--cloud); border-radius: var(--r-md); }

/* Sections and cards */
.prompt-section[id] { margin-bottom: 40px; scroll-margin-top: 150px; }

.prompt-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.prompt-section-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prompt-section-icon svg { width: 15px; height: 15px; }
.prompt-section-icon.purple { background: var(--accent-soft); color: var(--accent); }
.prompt-section-icon.teal   { background: var(--teal-soft);   color: #0e7a6e; }
.prompt-section-icon.amber  { background: var(--amber-soft);  color: #a86a10; }
.prompt-section-icon.rose   { background: var(--rose-soft);   color: #c0335a; }
.prompt-section-icon.green  { background: var(--green-soft);  color: #17803f; }

.prompt-section-title { margin: 0; padding: 0; font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.prompt-section-count { font-size: 12.5px; color: var(--slate); white-space: nowrap; }
.prompt-section-note { font-size: 13px; color: var(--slate); max-width: 760px; margin: -4px 0 14px; }

.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* A card is just a title and a one-line description. The title button opens the details
   dialog and stretches over the whole card, so the card is a single click target. */
.prompt-card {
  position: relative;
  min-width: 0;
  padding: 14px 16px 15px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}

.prompt-card:hover { border-color: #c9cbe0; box-shadow: var(--shadow-sm); }

.prompt-card-label { margin: 0; padding-right: 28px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }

.prompt-open {
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .15s;
}

.prompt-open::after { content: ""; position: absolute; inset: -1px; border-radius: var(--r-md); }
.prompt-open:focus-visible { outline: none; }
.prompt-open:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.prompt-card:hover .prompt-open { color: var(--accent-dim); }

.prompt-card-desc { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--slate); }

.prompt-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--cloud);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-text .placeholder { color: var(--accent); font-weight: 500; }

.prompt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cloud);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.prompt-copy-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.prompt-copy-btn.copied { background: var(--teal-soft); color: #08766c; border-color: var(--teal); }
.prompt-copy-btn svg { width: 12px; height: 12px; }

/* Quick copy sits in the card's corner. These rules must follow .prompt-copy-btn, which they override;
   on pointer devices the icon appears only when the card is hovered or focused. */
.prompt-copy-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  color: var(--slate);
  background: transparent;
  border-color: transparent;
}

.prompt-copy-icon:hover { border-color: transparent; }
.prompt-copy-icon svg { width: 15px; height: 15px; flex-shrink: 0; }
.prompt-copy-icon [data-copy-label] { display: none; }

@media (hover: hover) {
  .prompt-copy-icon { opacity: 0; }
  .prompt-card:hover .prompt-copy-icon,
  .prompt-card:focus-within .prompt-copy-icon,
  .prompt-copy-icon.copied { opacity: 1; }
}

/* Registered MCP templates */
.template-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  margin: 16px 0 24px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}

.template-card:hover { border-color: #c9cbe0; box-shadow: var(--shadow-sm); }
.template-card code { align-self: flex-start; font-size: 12px; }
.template-card span { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* Details dialog */
html:has(.prompt-dialog[open]) { overflow: hidden; }

.prompt-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card-bg);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.prompt-dialog[open] { display: flex; flex-direction: column; animation: dialogIn .18s ease-out; }
.prompt-dialog::backdrop { background: rgba(12, 14, 20, .5); }

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.prompt-dialog-inner { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.prompt-dialog-head { padding: 16px 24px 18px; border-bottom: 1px solid var(--card-border); }

.prompt-dialog-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.prompt-dialog-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--slate);
}

.prompt-dialog-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.prompt-dialog-position { font-size: 12px; color: var(--slate); margin-right: 6px; white-space: nowrap; }

.dialog-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

.dialog-icon-btn:hover:not(:disabled) { background: var(--cloud); border-color: var(--card-border); }
.dialog-icon-btn:disabled { opacity: .35; cursor: default; }
.dialog-icon-btn svg { width: 16px; height: 16px; }

.prompt-dialog-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.3px; line-height: 1.3; }
.prompt-dialog-title:focus { outline: none; }
.prompt-dialog-desc { margin: 4px 0 0; font-size: 14px; color: var(--slate); }

.prompt-dialog-body { display: flex; flex-direction: column; gap: 20px; min-height: 0; padding: 20px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }

.dialog-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

.dialog-block-head h4,
.dialog-fact h4 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--slate);
}

.dialog-block-note { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--slate-light); }
.prompt-dialog .prompt-text { font-size: 13px; padding: 14px 16px; }

.dialog-example {
  margin: 0;
  padding: 14px 16px;
  font: 13px/1.65 var(--font-mono);
  color: #d4d8f0;
  background: var(--ink);
  border-radius: var(--r-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dialog-example code { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.dialog-example ::selection { background: rgba(139, 139, 247, .4); color: #fff; }

.dialog-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dialog-fact { padding: 14px 16px; background: var(--snow); border: 1px solid var(--card-border); border-radius: var(--r-md); }
.dialog-fact p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }

@media (max-width: 900px) {
  /* The fixed menu button sits over the top of the page, so the toolbar scrolls normally here. */
  .library-toolbar { position: static; margin: 0; padding: 4px 0 12px; }
  .library-toolbar::after, .search-key { display: none; }
  .library-search input { font-size: 16px; padding-right: 14px; }
  .category-chips { flex-wrap: nowrap; overflow-x: auto; margin: 10px -24px 0; padding: 0 24px 4px; scrollbar-width: none; }
  .category-chips::-webkit-scrollbar { display: none; }
  .prompt-section[id] { scroll-margin-top: 72px; }
}

@media (max-width: 640px) {
  .prompt-grid, .template-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .prompt-section[id] { margin-bottom: 28px; }
  .prompt-dialog { width: 100%; max-height: 92%; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .prompt-dialog-head { padding: 12px 18px 16px; }
  .prompt-dialog-body { padding: 16px 18px 24px; }
  .prompt-dialog-title { font-size: 18px; }
}

@media (max-width: 480px) {
  .category-chips { margin: 10px -16px 0; padding: 0 16px 4px; }
}

@media (hover: none) {
  .prompt-card:hover { box-shadow: none; }
}

/* ---------- Flow / Steps (Bug Fix page) ---------- */
.flow {
  position: relative;
  padding-left: 40px;
  margin: 32px 0;
}

.flow::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--teal));
  border-radius: 2px;
}

.flow-step {
  position: relative;
  margin-bottom: 32px;
}

.flow-step:last-child { margin-bottom: 0; }

.flow-step-dot {
  position: absolute;
  left: -40px;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  z-index: 1;
}

.flow-step-dot.teal { border-color: var(--teal); color: var(--teal); }
.flow-step-dot.green { border-color: var(--green); color: var(--green); }
.flow-step-dot.amber { border-color: var(--amber); color: var(--amber); }
.flow-step-dot.rose { border-color: var(--rose); color: var(--rose); }

.flow-step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  padding-top: 6px;
}

.flow-step-body {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.flow-step-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.flow-step-body li {
  margin-bottom: 4px;
}

/* ---------- Info Boxes ---------- */
.info-box {
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
}

.info-box-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-box.tip {
  background: var(--teal-soft);
  border: 1px solid #baf0e8;
  color: #0e7a6e;
}

.info-box.warning {
  background: var(--amber-soft);
  border: 1px solid #fce0a0;
  color: #8a6114;
}

.info-box.danger {
  background: var(--rose-soft);
  border: 1px solid #f8c4d0;
  color: #b02e50;
}

.info-box.info {
  background: var(--accent-soft);
  border: 1px solid #d0d0fd;
  color: #3e3eb8;
}

.info-box strong { color: inherit; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead {
  background: var(--cloud);
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  padding: 12px 16px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--card-border);
}

td {
  padding: 12px 16px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

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

tbody tr:hover { background: rgba(27,31,235,.02); }

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  background: var(--card-bg);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  line-height: 1.4;
  gap: 16px;
  transition: background .15s;
}

.faq-question:hover { background: var(--cloud); }

.faq-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--slate);
  transition: transform .25s;
}

.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.faq-item.open .faq-answer { display: block; }

/* ---------- Tag / Badge ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  line-height: 1.4;
}

.tag.purple { background: var(--accent-soft); color: var(--accent); }
.tag.teal   { background: var(--teal-soft);   color: var(--teal); }
.tag.amber  { background: var(--amber-soft);  color: var(--amber); }
.tag.rose   { background: var(--rose-soft);    color: var(--rose); }
.tag.green  { background: var(--green-soft);   color: var(--green); }

/* ---------- Stat Row (landing page) ---------- */
.stat-row {
  display: flex;
  gap: 24px;
  margin: 24px 0 40px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--slate);
  font-weight: 500;
}

/* ---------- Conversation Example ---------- */
.conversation {
  margin: 20px 0 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.conv-msg {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.conv-msg + .conv-msg {
  border-top: 1px solid var(--card-border);
}

.conv-msg.user { background: var(--cloud); }
.conv-msg.ai   { background: var(--card-bg); }

.conv-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.conv-msg.user .conv-avatar {
  background: var(--accent-soft);
  color: var(--accent);
}

.conv-msg.ai .conv-avatar {
  background: var(--teal-soft);
  color: var(--teal);
}

.conv-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  flex: 1;
  min-width: 0;
}

.conv-body strong { font-weight: 600; color: var(--ink); }

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--card-border);
  margin: 40px 0;
}

/* ---------- Hamburger (mobile) ---------- */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--ink);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.hamburger svg { width: 20px; height: 20px; color: var(--white); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,14,20,.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 72px 24px 60px;
  }

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

  .stat-row {
    gap: 16px;
  }

  .page-title {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 64px 16px 48px;
  }
}

/* ---------- Entrance Animation ---------- */
.content {
  animation: fadeIn .4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Scrollbar ---------- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* ---------- Selection ---------- */
::selection { background: var(--accent-glow); color: var(--ink); }

/* ---------- Quick Reference Grid ---------- */
.ref-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 16px 0 24px;
  font-size: 13.5px;
}

.ref-grid .ref-verb {
  padding: 10px 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  background: var(--cloud);
  border-bottom: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}

.ref-grid .ref-example {
  padding: 10px 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--card-border);
}

.ref-grid .ref-verb:last-of-type,
.ref-grid .ref-example:last-of-type {
  border-bottom: none;
}

/* ---------- Documentation navigation and discovery ---------- */
[hidden] { display: none !important; }
code { overflow-wrap: anywhere; }
.code-block pre code { overflow-wrap: normal; }
.sidebar-brand-sub, .sidebar-section-title, .sidebar-footer-link { color: var(--slate-light); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h2[id], h3[id], section[id] { scroll-margin-top: 24px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 300; transform: translateY(-200%); background: var(--white); padding: 12px 16px; border-radius: var(--r-sm); }
.skip-link:focus { transform: none; }
.docs-button { font: 600 13px/1.4 var(--font-body); color: var(--ink); background: var(--white); border: 1px solid var(--card-border); border-radius: var(--r-sm); padding: 10px 14px; cursor: pointer; }
.docs-button:hover { background: var(--cloud); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.quick-setup { margin: 20px 0 32px; }
.client-picker { display: flex; flex-wrap: wrap; gap: 16px 20px; margin-bottom: 16px; }
.client-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.client-group:first-child { flex: 2 1 288px; }
.client-group:last-child { flex: 3 1 436px; }
.client-group-label { font-size: 11px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--slate); }
.client-group-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.client-choice { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 12px 14px 13px; border: 1px solid var(--card-border); border-radius: var(--r-md); background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.client-choice:hover { border-color: var(--slate-light); box-shadow: var(--shadow-sm); }
.client-choice[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-glow); }
.client-icon { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 10px; border: 1px solid var(--card-border); border-radius: var(--r-sm); background: var(--white); color: var(--ink); transition: inherit; }
.client-icon svg { width: 20px; height: 20px; }
.client-choice[aria-selected="true"] .client-icon { border-color: rgba(27, 31, 235, .3); }
.client-text { display: flex; flex-direction: column; min-width: 0; }
.client-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.client-choice[aria-selected="true"] .client-name { color: var(--accent-dim); }
.client-caption { font-size: 12px; line-height: 1.4; color: var(--slate); margin-top: 2px; }
/* Inactive panels stay in the layout, invisible, so the tallest one sets the height and switching never shifts the page. */
.client-panels, .setup-bodies { display: grid; grid-template-columns: minmax(0, 1fr); }
.client-panels > .client-panel, .setup-bodies > .setup-body { grid-area: 1 / 1; min-width: 0; }
.client-panels > .client-panel[hidden] { display: flex !important; visibility: hidden; }
.setup-bodies > .setup-body[hidden] { display: block !important; visibility: hidden; }
.setup-bodies, .client-panel > .setup-body { flex: 1 0 auto; }
.client-panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow-sm); overflow: hidden; }
.setup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 24px; border-bottom: 1px solid var(--card-border); }
.setup-head h4 { font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.setup-head .setup-meta { font-size: 12.5px; color: var(--slate); margin: 2px 0 0; }
.config-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; background: var(--cloud); border: 1px solid var(--card-border); border-radius: var(--r-sm); }
.config-tabs button { font: 500 12.5px/1.4 var(--font-body); color: var(--slate); border: 0; border-radius: 6px; padding: 6px 12px; background: transparent; cursor: pointer; transition: background-color .15s, color .15s; }
.config-tabs button:hover { color: var(--ink); }
.config-tabs [aria-selected="true"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(12,14,20,.08), 0 0 0 1px var(--card-border); }
.setup-body { padding: 24px; }
.setup-steps { list-style: none; counter-reset: setup-step; margin: 0; padding: 0; }
.setup-steps > li { position: relative; counter-increment: setup-step; padding: 0 0 22px 40px; min-width: 0; }
.setup-steps > li:last-child { padding-bottom: 0; }
.setup-steps > li::before { content: counter(setup-step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dim); font-size: 12px; font-weight: 700; }
.setup-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 12.5px; top: 32px; bottom: 6px; width: 1px; background: var(--card-border); }
.step-title { display: block; font-size: 14px; font-weight: 600; line-height: 26px; color: var(--ink); }
.setup-steps p { font-size: 14px; line-height: 1.6; color: var(--ink-muted); margin: 2px 0 0; }
.setup-code { margin: 12px 0 0; min-width: 0; }
.setup-code .code-block-header { padding: 8px 10px 8px 16px; }
.setup-code pre { padding: 14px 16px; }
.code-block-path { font-family: var(--font-mono); font-weight: 500; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.setup-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; padding: 14px 24px; border-top: 1px solid var(--card-border); background: var(--snow); }
.setup-notes { display: flex; gap: 10px; flex: 1 1 320px; min-width: 0; font-size: 12.5px; }
.setup-notes > svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: var(--slate); }
.setup-notes p { font-size: 12.5px; line-height: 1.6; color: var(--slate); margin: 0; }
.setup-notes p + p { margin-top: 4px; }
.setup-guide { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.setup-guide svg { width: 13px; height: 13px; }
.other-clients { margin-top: 12px; border: 1px solid var(--card-border); border-radius: var(--r-md); background: var(--white); font-size: 13.5px; }
.other-clients summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--ink-muted); list-style: none; }
.other-clients summary::-webkit-details-marker { display: none; }
.other-clients summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.other-clients[open] summary::before { transform: rotate(45deg); }
.other-clients-body { padding: 0 16px 16px; }
.other-clients-body p { font-size: 13.5px; color: var(--ink-muted); }
.copy-feedback { position: fixed; bottom: 16px; right: 16px; left: 16px; z-index: 250; width: fit-content; max-width: calc(100% - 32px); margin: 0 auto; font-size: 13px; background: var(--ink); color: var(--white); border-radius: var(--r-sm); }
.copy-feedback:not(:empty) { padding: 12px 16px; }
.ref-grid { grid-template-columns: minmax(72px, 120px) minmax(0, 1fr); }
.ref-example { overflow-wrap: anywhere; }
.stat-row { flex-wrap: wrap; }

@media (max-width: 900px) {
  .sidebar { visibility: hidden; }
  .sidebar.open { visibility: visible; }
}

@media (max-width: 480px) {
  .setup-head { padding: 16px 18px; }
  .setup-body { padding: 20px 18px; }
  .setup-foot { padding: 12px 18px; }
  .setup-steps > li { padding-left: 36px; }
  .client-choice { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .client-icon { flex: 0 0 32px; margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
}
