/* =========================================================================
   DEVELOPERS: the MCP page (and, next, the API page)

   Every colour is a token from tokens.css, so both themes follow. Shape from
   the design system: controls 4px, cards 6px, large panels 10px.
   ========================================================================= */

/* ---- Hero ---------------------------------------------------------------- */
.dv-hero {
  position: relative; overflow: hidden;
  padding: clamp(32px, 5vw, 48px) 0 clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--ink-700);
}
.dv-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(81, 112, 255, 0.18), transparent);
  pointer-events: none;
}
.dv-crumbs {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: clamp(32px, 5vw, 56px);
  font-size: 13px; line-height: 20px; color: var(--fg-faint);
}
.dv-crumbs a { color: var(--fg-subtle); text-decoration: none; }
.dv-crumbs a:hover { color: var(--fg); }
.dv-crumbs [aria-current] { color: var(--fg); }

.dv-hero__grid {
  position: relative; display: grid; gap: clamp(40px, 6vw, 72px);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center;
}
.dv-hero__text { display: flex; flex-direction: column; gap: 20px; }
.dv-hero__text .v-lead { max-width: 560px; }

/* The address: the one thing most people need, so it is the loudest thing on
   the page. A recessed well, the value in mono at reading size. */
.dv-addr { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 600px; }
.dv-addr__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fg); }
.dv-addr__well {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px;
  background: var(--ink-950); border: 1px solid var(--ink-500); border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}
.dv-addr__value {
  flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; outline: none;
  font-family: var(--font-mono); font-size: clamp(14px, 1.25vw, 16px); line-height: 28px; color: var(--fg-strong);
  text-overflow: ellipsis;
}
.dv-addr__well .v-btn { min-height: 44px; }
.dv-addr__hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-subtle); }

/* The example conversation. */
.dv-chat {
  margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.dv-chat__cap { font-size: 12px; line-height: 16px; color: var(--fg-faint); }
.dv-chat__msg p { margin: 0; font-size: 15px; line-height: 23px; }
.dv-chat__msg--you {
  align-self: flex-end; max-width: 85%; padding: 10px 14px;
  background: var(--brand-soft); border-radius: var(--radius-md); color: var(--fg);
}
.dv-chat__msg--ai { display: flex; flex-direction: column; gap: 12px; color: var(--fg-muted); }
.dv-chat__msg--ai strong { color: var(--fg); font-weight: 600; }
.dv-chat__call {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--ink-700); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 18px; color: var(--fg-subtle);
}
.dv-chat__call code { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand-300); }
.dv-chat__ok { color: var(--accent-green); }
.dv-chat__table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 20px; }
.dv-chat__table th { text-align: left; font-weight: 500; color: var(--fg-faint); padding: 0 0 6px; }
.dv-chat__table td { padding: 7px 0; border-top: 1px solid var(--ink-700); color: var(--fg-muted); }
.dv-chat__table td:first-child { color: var(--fg); }
.dv-chat__table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Sections ------------------------------------------------------------ */
.dv-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin-bottom: 40px; }
.dv-head--row { max-width: none; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.dv-head--row > div:first-child { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.dv-prose { margin: 0; max-width: 680px; font-size: 16px; line-height: 26px; }

/* ---- Tabs ---------------------------------------------------------------- */
.dv-tabs__list {
  display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--ink-700); margin-bottom: 28px;
  scrollbar-width: none;
}
.dv-tabs__list [role=tab] {
  flex: none; min-height: 44px; padding: 0 16px; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--fg-subtle); cursor: pointer;
}
.dv-tabs__list [role=tab]:hover { color: var(--fg); }
.dv-tabs__list [aria-selected=true] { color: var(--fg); border-bottom-color: var(--brand-500); }
.dv-tabs__list [role=tab]:focus-visible { outline: 2px solid var(--brand-300); outline-offset: -2px; }
.dv-tabs__panel { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.dv-tabs__panel[hidden] { display: none; }
.dv-tabs__panel > .dv-prose { grid-column: 1 / -1; }

/* A real sequence, so it is numbered. */
.dv-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 18px; }
.dv-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 14px; font-size: 16px; line-height: 26px; }
.dv-steps li::before {
  content: counter(s); display: grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid var(--ink-500); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--fg);
}
.dv-steps b { color: var(--fg); font-weight: 600; }
.dv-steps code, .dv-prose code {
  font-family: var(--font-mono); font-size: 0.88em; padding: 1px 6px;
  background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: var(--radius-xs); color: var(--fg);
}

/* ---- Code blocks --------------------------------------------------------- */
.dv-code { background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: var(--radius-md); overflow: hidden; }
.dv-code__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--ink-700);
  font-size: 13px; line-height: 18px; color: var(--fg-faint);
}
.dv-code__copy {
  min-height: 32px; padding: 0 12px; background: none; border: 1px solid var(--ink-600); border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--fg-muted); cursor: pointer;
}
.dv-code__copy:hover { color: var(--fg); background: var(--ink-800); }
.dv-code pre { margin: 0; padding: 18px 16px; overflow-x: auto; }
.dv-code code { font-family: var(--font-mono); font-size: 14px; line-height: 22px; color: var(--fg); }
.tk-key { color: var(--brand-300); }
.tk-str { color: var(--accent-green); }
.tk-dim { color: var(--fg-faint); user-select: none; }

/* ---- Things you can ask: a list, not a card grid ------------------------ */
.dv-asks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.dv-asks li { display: flex; flex-direction: column; gap: 10px; padding: 22px 0; border-top: 1px solid var(--ink-700); }
.dv-asks p { margin: 0; font-size: 18px; line-height: 27px; color: var(--fg); letter-spacing: -0.01em; }
.dv-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-tools code {
  font-family: var(--font-mono); font-size: 12px; line-height: 18px; padding: 2px 8px;
  border: 1px solid var(--ink-700); border-radius: var(--radius-xs); color: var(--fg-subtle);
}

/* ---- Tool catalogue ------------------------------------------------------ */
.dv-search {
  display: flex; align-items: center; gap: 10px; width: min(340px, 100%); min-height: 44px; padding: 0 14px;
  background: var(--ink-950); border: 1px solid var(--ink-500); border-radius: var(--radius-sm); color: var(--fg-faint);
}
.dv-search:focus-within { border-color: var(--brand-300); }
.dv-search input {
  flex: 1; width: auto; min-width: 0; height: 42px; margin: 0; padding: 0; border: 0; background: none; outline: none; box-shadow: none;
  font: inherit; font-size: 15px; text-align: left; color: var(--fg);
}
.dv-groups { border-bottom: 1px solid var(--ink-700); }
.dv-group { border-top: 1px solid var(--ink-700); }
.dv-group[hidden] { display: none; }
.dv-group summary {
  display: grid; grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.4fr) auto 20px; align-items: center; gap: 24px;
  padding: 20px 0; cursor: pointer; list-style: none;
}
.dv-group summary::-webkit-details-marker { display: none; }
.dv-group summary:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; }
.dv-group__title { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--fg); }
.dv-group__blurb { font-size: 15px; line-height: 22px; color: var(--fg-subtle); }
.dv-group__count { font-size: 13px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.dv-group__chev { color: var(--fg-faint); transition: transform 160ms var(--ease-std); }
.dv-group[open] .dv-group__chev { transform: rotate(180deg); }
.dv-group__tools {
  list-style: none; margin: 0; padding: 0 0 24px; display: grid; gap: 14px 40px;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}
.dv-group__tools li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dv-group__tools li[hidden] { display: none; }
.dv-group__tools code { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--fg); overflow-wrap: anywhere; }
.dv-group__tools span { font-size: 14px; line-height: 20px; color: var(--fg-subtle); }

/* ---- Safety -------------------------------------------------------------- */
.dv-facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.dv-facts div { padding: 22px 0; border-top: 1px solid var(--ink-700); }
.dv-facts dt { margin-bottom: 6px; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--fg); }
.dv-facts dd { margin: 0; font-size: 15px; line-height: 23px; color: var(--fg-subtle); }

/* ---- Technical details and plan ----------------------------------------- */
.dv-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.dv-spec { margin: 20px 0 0; }
.dv-spec div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--ink-700); }
.dv-spec dt { font-size: 14px; line-height: 22px; color: var(--fg-faint); }
.dv-spec dd { margin: 0; font-size: 15px; line-height: 22px; color: var(--fg-muted); overflow-wrap: anywhere; }
.dv-spec code { font-family: var(--font-mono); font-size: 13.5px; color: var(--fg); }
.dv-plan {
  display: flex; flex-direction: column; gap: 14px; padding: 28px;
  background: var(--card); border: 1px solid var(--brand-600); border-radius: var(--radius-lg);
}
.dv-plan p { margin: 0; font-size: 15px; line-height: 23px; color: var(--fg-subtle); }
.dv-plan .v-ctas { align-items: center; gap: 20px; margin-top: 6px; }

/* ---- API overview -------------------------------------------------------- */
.dv-term { margin: 0; background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.dv-term pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.dv-term code { font-family: var(--font-mono); font-size: 13.5px; line-height: 21px; color: var(--fg); }
.dv-term__resp { padding: 10px 18px 0; border-top: 1px solid var(--ink-700); }
.dv-term__out { white-space: pre-wrap; overflow-wrap: anywhere; }
.dv-term__out code { color: var(--fg-muted); }
.tk-num { color: var(--accent-orange); }
.dv-status { display: inline-block; padding: 1px 8px; border-radius: var(--radius-xs); font-family: var(--font-mono); font-size: 12px; line-height: 18px; }
.dv-status--ok { color: var(--accent-green); border: 1px solid currentColor; }
.dv-hero__text .v-ctas { align-items: center; gap: 20px; }

.dv-steps--row { flex-direction: row; gap: 32px; }
.dv-steps--row li { flex: 1; }
.dv-facts code, .dv-plan code, .dr-head__meta code, .dr-fields dd code, .dr-errors code {
  font-family: var(--font-mono); font-size: 0.88em; padding: 1px 5px;
  background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: var(--radius-xs); color: var(--fg);
}

.dv-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.dv-index li { border-top: 1px solid var(--ink-700); }
.dv-index a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 18px 0; text-decoration: none;
}
.dv-index__name { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--fg); }
.dv-index__count { font-size: 13px; line-height: 24px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.dv-index__blurb { grid-column: 1 / -1; font-size: 15px; line-height: 22px; color: var(--fg-subtle); }
.dv-index a:hover .dv-index__name { color: var(--brand-300); }
.dv-index a:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; }
.dv-alt { display: flex; flex-direction: column; gap: 12px; padding: 28px 0; }
.dv-alt p { margin: 0; font-size: 15px; line-height: 23px; color: var(--fg-subtle); }

/* ---- API reference ------------------------------------------------------- */
.dr-wrap {
  max-width: 1480px; margin: 0 auto; padding: 0 88px 0 40px;
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 48px;
}
.dr-nav { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; padding: 32px 0; scrollbar-width: thin; }
.dr-nav__box > summary { display: none; }
.dr-nav ul { list-style: none; margin: 0; padding: 0; }
.dr-nav__home, .dr-nav li > a {
  display: block; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 20px; color: var(--fg-subtle); text-decoration: none;
}
.dr-nav__home { margin-bottom: 8px; color: var(--fg); font-weight: 500; }
.dr-nav li > a:hover, .dr-nav__home:hover { background: var(--ink-800); color: var(--fg); }
.dr-nav [aria-current=page] { color: var(--fg); font-weight: 600; }
.dr-nav__ops { margin: 2px 0 10px 10px !important; padding-left: 10px !important; border-left: 1px solid var(--ink-700); }
.dr-nav__ops a { display: flex !important; gap: 8px; align-items: baseline; font-size: 13px !important; }

/* Method badges: a word as well as a colour. */
.dr-m {
  flex: none; display: inline-block; min-width: 54px; text-align: center; padding: 0 4px;
  border-radius: var(--radius-xs); font-family: var(--font-mono); font-size: 10.5px; line-height: 18px; font-weight: 600;
}
.dr-m--get { color: var(--accent-green); background: color-mix(in srgb, var(--accent-green) 12%, transparent); }
.dr-m--post { color: var(--brand-300); background: color-mix(in srgb, var(--brand-500) 16%, transparent); }
.dr-m--put, .dr-m--patch { color: var(--accent-orange); background: color-mix(in srgb, var(--accent-orange) 12%, transparent); }
.dr-m--delete { color: var(--accent-red); background: color-mix(in srgb, var(--accent-red) 12%, transparent); }

.dr-main { min-width: 0; padding-bottom: 96px; }
.dr-head { padding: 32px 0 40px; border-bottom: 1px solid var(--ink-700); display: flex; flex-direction: column; gap: 14px; }
.dr-head .dv-crumbs { margin-bottom: 8px; }
.dr-head__meta { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-faint); }

.dr-op {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px;
  padding: 48px 0; border-bottom: 1px solid var(--ink-700); scroll-margin-top: 96px;
}
.dr-op__doc { min-width: 0; }
.dr-op__title { margin: 0 0 10px; font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -0.015em; }
.dr-op__title a { color: var(--fg); text-decoration: none; }
.dr-op__title a:hover { color: var(--brand-300); }
.dr-op__line { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.dr-op__line code { font-family: var(--font-mono); font-size: 14px; color: var(--fg); overflow-wrap: anywhere; }
.dr-op__desc { margin: 0 0 16px; font-size: 15px; line-height: 24px; }
.dr-sub { margin: 24px 0 4px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--fg-faint); }
.dr-fields { margin: 0; }
.dr-fields > div { padding: 10px 0; border-top: 1px solid var(--ink-700); }
.dr-fields dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dr-fields dt > code { font-family: var(--font-mono); font-size: 13.5px; color: var(--fg); }
.dr-type { font-size: 13px; color: var(--fg-faint); }
.dr-req { font-size: 12px; font-weight: 500; color: var(--accent-orange); }
.dr-fields dd { margin: 4px 0 0; font-size: 14px; line-height: 21px; color: var(--fg-subtle); }
.dr-more { margin-top: 20px; border-top: 1px solid var(--ink-700); }
.dr-more > summary { padding: 12px 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fg); }
.dr-more > summary span { color: var(--fg-faint); font-weight: 400; margin-left: 4px; }
.dr-errors { margin: 16px 0 0; font-size: 14px; line-height: 21px; color: var(--fg-subtle); }

.dr-op__code { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dr-op__code pre { max-height: 420px; }
.dr-op__code code { font-size: 13px; line-height: 20px; }
.dr-resp code { color: var(--fg-muted); }
.dr-langs { display: flex; gap: 2px; }
.dr-langs button {
  min-height: 30px; padding: 0 10px; background: none; border: 0; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--fg-faint); cursor: pointer;
}
.dr-langs button:hover { color: var(--fg); }
.dr-langs [aria-pressed=true] { background: var(--ink-800); color: var(--fg); }
.dv-code__bar .dv-status { margin-left: 6px; }

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 1180px) {
  .dr-op { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dr-op__code { position: static; }
}
@media (max-width: 960px) {
  .dv-hero__grid, .dv-tabs__panel, .dv-split { grid-template-columns: minmax(0, 1fr); }
  .dv-steps--row { flex-direction: column; gap: 18px; }
  .dr-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 20px; }
  .dr-nav { position: static; max-height: none; padding: 16px 0 0; }
  .dr-nav__box { border: 1px solid var(--ink-600); border-radius: var(--radius-md); padding: 0 12px; }
  .dr-nav__box > summary { display: block; padding: 12px 0; cursor: pointer; font-weight: 500; color: var(--fg); }
  .dr-nav__box[open] { padding-bottom: 12px; }
  .dv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dv-asks, .dv-facts, .dv-index { grid-template-columns: minmax(0, 1fr); }
  .dv-group summary { grid-template-columns: minmax(0, 1fr) auto 20px; gap: 12px; }
  .dv-group__blurb { grid-column: 1 / -1; grid-row: 2; }
  .dv-addr__well { flex-direction: column; align-items: stretch; padding: 12px; }
  .dv-addr__value { font-size: 14px; }
  .dv-spec div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dv-chat { padding: 16px; }
  .dv-group__tools code { font-size: 12px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .dv-group__chev { transition: none; }
}

/* Identifiers inside API text (main.templatetags.dev_tags.devtext). */
.dv-group__tools span code, .dr-op__desc code {
  font-family: var(--font-mono); font-size: 0.88em; padding: 0 4px;
  background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: var(--radius-xs); color: var(--fg);
}
