/* Software Catalog + MCP connector docs.
   Shared by /docs/software-catalog.html and /docs/mcp.html.
   Everything is scoped under .cat-doc so the other docs pages are untouched. */

.cat-doc {
  max-width: 980px;
}

.cat-doc .cat-intro {
  max-width: 70ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 1.5rem;
}

.cat-doc p,
.cat-doc li {
  max-width: 78ch;
}

.cat-doc h2 {
  scroll-margin-top: 80px;
}

/* ---------- Video walkthrough: player + chapter list ---------- */
.vw {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 1.1rem;
  margin: 1.25rem 0 2.5rem;
}

.vw-player {
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
  align-self: start;
}

.vw-player video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.vw-player video:focus-visible {
  outline: 2px solid var(--pink-3);
  outline-offset: -2px;
}

.vw-chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--ink-2);
  align-self: start;
  overflow: hidden;
}

.vw-chapters li {
  margin: 0;
  line-height: 1.35;
  max-width: none;
}

.vw-chapter {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem calc(0.9rem - 3px);
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.vw-chapters li:last-child .vw-chapter {
  border-bottom: 0;
}

.vw-chapter time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
  padding-top: 0.1rem;
}

.vw-chapter:hover {
  color: var(--text);
  background: rgba(237, 22, 108, 0.06);
}

.vw-chapter:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--pink-3);
  color: var(--text);
}

.vw-chapter[aria-current="true"] {
  color: var(--text);
  border-left-color: var(--pink);
  background: rgba(237, 22, 108, 0.08);
}

.vw-chapter[aria-current="true"] time {
  color: var(--pink-3);
}

.vw-caption {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-3);
}

.vw-caption a {
  color: var(--text-2);
}

@media (max-width: 1100px) {
  .vw {
    grid-template-columns: 1fr;
  }
  .vw-chapters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .vw-chapters li:last-child .vw-chapter {
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 600px) {
  .vw-chapters {
    grid-template-columns: 1fr;
  }
}

/* ---------- The MCP URL: the one thing people get wrong ---------- */
.mcp-url {
  margin: 1.25rem 0 2rem;
  padding: 1.25rem 1.5rem 1.2rem;
  background: var(--ink-3);
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--pink);
  border-radius: var(--radius-card);
}

.mcp-url .mcp-url-label {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: var(--text-3);
}

.cat-doc .mcp-url code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: normal;
}

.cat-doc .mcp-url code b {
  font-weight: 700;
  color: var(--hi);
}

.mcp-url p {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
  color: var(--text-2);
}

/* ---------- Screenshots ---------- */
.cat-doc figure.shot {
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--ink);
  max-width: 760px;
}

.cat-doc figure.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.cat-doc figure.shot figcaption {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 0.86rem;
  color: var(--text-3);
}

/* Steps reuse .wf-steps from docs-workflow.css; widen the screenshot column here. */
.cat-doc .wf-shot {
  max-width: 760px;
}

.cat-doc .wf-text {
  max-width: 72ch;
}

.cat-doc .wf-step ul,
.cat-doc .wf-step p + p {
  grid-column: 2;
  margin: 0;
  color: var(--text-2);
  font-size: 0.98rem;
}

.cat-doc .wf-step ul {
  padding-left: 1.2rem;
}

.cat-doc .wf-step ul li {
  margin-bottom: 0.35rem;
}

/* ---------- Permission scopes ---------- */
.scopes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.scope {
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--good);
  border-radius: var(--radius-card);
}

.scope.scope-write {
  border-top-color: var(--hi);
}

.cat-doc .scope code {
  font-size: 0.98rem;
}

.scope p {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: var(--text-2);
}

/* ---------- Tables (scores, prompts, tool reference) ---------- */
.cat-doc .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 1.75rem;
}

.cat-doc table {
  margin: 0;
  font-size: 0.94rem;
  border: 1px solid var(--rule-2);
}

.cat-doc th,
.cat-doc td {
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--text-2);
  line-height: 1.5;
}

.cat-doc th {
  background: var(--ink-3);
  color: var(--text);
  font-weight: 600;
}

.cat-doc tbody th[scope="row"] {
  background: transparent;
  font-weight: 500;
  white-space: nowrap;
}

.cat-doc tbody tr:last-child th,
.cat-doc tbody tr:last-child td {
  border-bottom: 0;
}

.cat-doc td code {
  white-space: nowrap;
}

.cat-doc .tier-free,
.cat-doc .tier-advanced,
.cat-doc .credits {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.cat-doc .tier-free {
  color: var(--good);
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.cat-doc .tier-advanced {
  color: var(--pink-3);
  border: 1px solid rgba(237, 22, 108, 0.5);
}

.cat-doc .credits {
  color: var(--hi);
  border: 1px solid rgba(253, 224, 71, 0.45);
}

.cat-doc .prompt {
  font-style: italic;
  color: var(--text);
}

/* ---------- Command block ---------- */
.cat-doc pre {
  max-width: 760px;
}

@media (max-width: 768px) {
  .cat-doc pre {
    max-width: none;
  }
  .cat-doc table {
    display: table;
    width: 100%;
    min-width: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vw-chapter {
    transition: none;
  }
}

/* Tool reference: keep the cost column on one line */
.cat-doc .tool-table th:last-child,
.cat-doc .tool-table td:last-child {
  white-space: nowrap;
  width: 1%;
}

.cat-doc .tool-table td:first-child {
  width: 1%;
}
