/* Hallmark · macrostructure: Reference Sheet · tone: technical-precise · anchor hue: ink + gold
   Humantic AI · API (/api), Website V2, rebuilt Oct 19 2026, tightened Oct 20 (AK: "UIs are basic, too big, put things
   in a table, merge, keep it short"). Loaded after surfaces.css (shared with /mcp); everything here is scoped to body.ap.
   Idea: a developer reference sheet in three compact blocks: one plain-words endpoint table, "For Developers" (the
   copyable sample beside the four production rules) and a 3-column surface table. Locked palette; desktop density ~80%
   zoom (h2 36px at 1280+). */

.ap { --pad: 64px; --white: #fff; --rule: rgba(17,10,51,.1); --rule-ink: rgba(221,214,255,.16); color: var(--ink); font-family: Manrope, Arial, sans-serif; }
:where(.ap main) :is(ul, ol, dl, dd, figure) { margin: 0; padding: 0; list-style: none; }
:where(.ap main) :is(h1, h2, h3) { text-wrap: balance; }
.ap-shell { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.ap main a:focus-visible, .ap main button:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 10px; }

.ap-head { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.ap-head h2 { font: 700 clamp(28px, 2.2vw + 12px, 36px)/1.12 var(--disp); letter-spacing: -.02em; }
.ap-head p { margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--slate); }
.ap-head a, .ap-foot a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.ap-foot { margin-top: 20px; text-align: center; font-size: 14px; line-height: 1.6; color: var(--slate); }
.ap-sec { padding: var(--pad) 0; }
@media (min-width: 1024px) { .ap { --pad: 72px; } }
@media (max-width: 599px) { .ap { --pad: 56px; } }
.ap-sec--mist { background: var(--mist); }

/* ---------- Endpoints table ---------- */
.ap-ep { width: 100%; max-width: 960px; margin: 0 auto; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--lav); border-radius: 24px; overflow: hidden; font-size: 15px; line-height: 1.45; }
.ap-ep col.c1 { width: 28%; } .ap-ep col.c2 { width: 30%; } .ap-ep col.c3 { width: 42%; }
.ap-ep th, .ap-ep td { padding: 10px 20px; text-align: start; vertical-align: top; border-top: 1px solid var(--lav); }
.ap-ep thead th { padding-block: 12px; border-top: 0; font: 700 14px/1.4 Manrope, Arial, sans-serif; color: var(--ink); background: var(--mist); }
.ap-ep tbody th { padding-inline-start: 24px; }
.ap-ep tbody th a { display: inline-block; font: 700 17px/1.2 var(--disp); color: var(--ink); text-decoration: none; }
.ap-ep tbody th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ap-ep tbody th span { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--slate); }
.ap-ep td:nth-child(2) { color: var(--slate); }
.ap-ep td:last-child { padding-inline-end: 24px; color: var(--ink); }
.ap-ep tbody tr { transition: background-color .15s var(--ease); }
@media (hover: hover) and (pointer: fine) { .ap-ep tbody tr:hover { background: var(--mist); } }
.ap-paths { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.ap-paths code { padding: 2px 8px; border-radius: 8px; background: var(--lav); font: 500 12px/1.5 var(--mono); color: var(--ink); }
.ap-paths code b { font-weight: 700; }

/* ---------- For Developers: the request (ink) beside its response fields, then every production fact in one lined table ---------- */
.ap-dev { background: var(--white); }
.ap-dev__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 12px 32px; align-items: stretch; max-width: 1040px; margin: 0 auto 32px; }
.ap-dev__h { margin: 0; font: 700 20px/1.25 var(--disp); letter-spacing: -.01em; color: var(--ink); }
.ap-dev__h--l { grid-column: 1; grid-row: 1; } .ap-dev__h--r { grid-column: 2; grid-row: 1; }
.ap-code { grid-column: 1; grid-row: 2; display: flex; margin: 0; border-radius: 24px; background: var(--ink); color: var(--white); overflow: hidden; }
.ap-code__req { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; padding: 20px 24px; }
.ap-code__req pre { flex: 1; min-width: 0; }
.ap-code pre { margin: 0; padding-inline-end: 0; overflow-x: auto; font: 500 12.5px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-code .t-c { color: rgba(221, 214, 255, .7); }
.ap-code .t-m { color: var(--gold); font-weight: 700; }
.ap-code .t-u { color: var(--white); }
.ap-code .t-p { color: var(--lav); }
.ap-code .t-v { color: #FFE8A5; }
.ap-copy { position: absolute; top: 12px; inset-inline-end: 14px; min-width: 64px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font: 700 13px/1 Manrope, Arial, sans-serif; cursor: pointer; transition: background-color .15s var(--ease), transform .15s var(--ease); }
.ap-copy:hover { background: #FFE8A5; }
.ap-copy:active { transform: scale(.96); }
.ap-res { grid-column: 2; grid-row: 2; display: flex; min-width: 0; }
.ap-res .ap-tbl { height: 100%; }

/* ---------- Lined tables: one 1px #DDD6FF rule between rows, 24px corners, white surface ---------- */
.ap-tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--lav); border-radius: 24px; overflow: hidden; font-size: 15px; line-height: 1.5; color: var(--ink); }
.ap-tbl th, .ap-tbl td { padding: 14px 20px; text-align: start; vertical-align: baseline; border-top: 1px solid var(--lav); }
.ap-tbl thead th { padding-block: 12px; border-top: 0; background: var(--mist); font: 700 14px/1.4 Manrope, Arial, sans-serif; color: var(--ink); }
.ap-tbl td { color: var(--slate); }
.ap-tbl tbody th { font: 700 16px/1.3 var(--disp); color: var(--ink); }
.ap-tbl--res { font-size: 14px; }
.ap-tbl--res th, .ap-tbl--res td { padding: 12px 16px; }
.ap-tbl--res tbody th { width: 1%; white-space: nowrap; }
.ap-tbl--res tbody th code { display: inline-block; padding: 2px 8px; border-radius: 8px; background: var(--lav); font: 600 13px/1.5 var(--mono); color: var(--ink); }
.ap-tbl--facts { max-width: 1040px; margin-inline: auto; }
.ap-tbl--facts tbody th { width: 24%; padding-inline-start: 24px; }
.ap-tbl--facts td { padding-inline-end: 24px; }
.ap-chip { display: inline-block; margin-inline-end: 8px; padding: 2px 10px; border-radius: 8px; background: var(--lav); color: var(--ink); font: 700 12px/1.6 var(--mono); white-space: nowrap; }
.ap-tbl td a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; white-space: nowrap; }
.ap-tbl tbody tr { transition: background-color .15s var(--ease); }
@media (hover: hover) and (pointer: fine) { .ap-tbl--facts tbody tr:hover { background: var(--mist); } }

/* ---------- API, MCP or the web app?: one compact row at the foot of For Developers ---------- */
.ap-surf { max-width: 1040px; margin: 28px auto 0; padding-top: 24px; border-top: 1px solid var(--rule); }
.ap-surf__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 12px; }
.ap-surf__h h3 { font: 700 22px/1.2 var(--disp); letter-spacing: -.02em; }
.ap-surf__h p { font-size: 14px; line-height: 1.5; color: var(--slate); }
.ap-surf__h a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.ap-tbl--surf { font-size: 15px; }
.ap-tbl--surf tbody th { width: 30%; padding-inline-start: 24px; }
.ap-tbl--surf tbody th b { font: 700 17px/1.2 var(--disp); letter-spacing: -.01em; }
.ap-tbl--surf tbody th a { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; color: var(--ink); text-decoration: none; white-space: normal; }
.ap-tbl--surf tbody th a:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.ap-tbl--surf tbody th .sf-chip { margin-inline-start: 8px; padding: 2px 10px; font-size: 12px; vertical-align: 2px; }
.ap-tbl--surf tbody tr.is-here { background: var(--mist); }
.ap-tbl--surf td { padding-inline-end: 24px; }

/* ---------- Shared blocks on this page: same density ---------- */
@media (min-width: 1024px) {
  .ap .hxb { padding: 72px 24px; }
  .ap .hxb.hxb .hxb-h2 { font-size: 36px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .ap-dev__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .ap-dev__h--l, .ap-code, .ap-dev__h--r, .ap-res { grid-column: 1; grid-row: auto; }
  .ap-dev__h--r { margin-top: 12px; }
  .ap-res .ap-tbl { height: auto; }
}
@media (max-width: 767px) {
  .ap-ep colgroup { display: none; }
  .ap-ep, .ap-ep tbody, .ap-ep tr, .ap-ep th, .ap-ep td { display: block; width: auto !important; }
  .ap-ep { border: 0; background: none; border-radius: 0; overflow: visible; }
  .ap-ep thead { display: none; }
  .ap-ep tbody { border-radius: 20px; background: var(--white); border: 1px solid var(--lav); overflow: hidden; }
  .ap-ep tbody tr { padding: 12px 16px; }
  .ap-ep tbody tr + tr { border-top: 1px solid var(--rule); }
  .ap-ep th, .ap-ep td, .ap-ep tbody th, .ap-ep td:last-child { padding: 0; border: 0; }
  .ap-ep tbody th { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
  .ap-ep tbody th span { margin: 0; }
  .ap-ep td { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink) !important; }
  .ap-ep td::before { content: attr(data-l) ": "; font-weight: 700; color: var(--slate); }

  .ap-tbl--surf tbody th, .ap-tbl--surf td { padding: 0; }
  .ap-tbl--surf tbody th a { min-height: 44px; }
  .ap-tbl--surf td[data-l]::before { content: attr(data-l) ": "; font-weight: 700; color: var(--ink); }
  .ap-tbl--surf td { margin-top: 2px; }

  /* Lined tables stack: the row label sits above its detail, the lines between rows stay */
  .ap-tbl, .ap-tbl tbody, .ap-tbl tr, .ap-tbl th, .ap-tbl td { display: block; width: 100% !important; }
  .ap-tbl thead { display: none; }
  .ap-tbl { border-radius: 20px; }
  .ap-tbl tbody tr { padding: 14px 16px; }
  .ap-tbl tbody tr + tr { border-top: 1px solid var(--lav); }
  .ap-tbl th, .ap-tbl td, .ap-tbl--res th, .ap-tbl--res td, .ap-tbl--facts tbody th, .ap-tbl--facts td { padding: 0; border: 0; }
  .ap-tbl tbody th { margin-bottom: 4px; }
  .ap-tbl--res tbody th { white-space: normal; }
  .ap-tbl--res tbody tr { padding: 10px 16px; }
  .ap-tbl--res td { font-size: 14px; }
  .ap-tbl td a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .ap-tbl--facts td { padding-inline-end: 0; }
}
@media (max-width: 599px) {
  .ap-shell { padding: 0 16px; }
  .ap-code__req { padding: 14px 16px; }
  .ap-code pre { padding-inline-end: 0; padding-top: 40px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap *, .ap *::before, .ap *::after { transition-duration: .01ms !important; }
}

/* Phones: inline links in FAQ answers get a 40px+ tap area without moving the text */
@media (max-width: 767px) { .ap .ap-ep tbody th a { padding: 10px 0; margin: -10px 0; } }

/* Phones: inline links and the Copy button get a 44px tap area without moving the text */
@media (max-width: 767px) {
  .ap .ap-head a, .ap .ap-foot a, .ap .ap-surf__h a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .ap .ap-copy { min-height: 44px; }
}

/* Desktop and tablet: the Copy button sits bottom right, where the last line is short, so it never covers a command */
@media (min-width: 600px) { .ap-copy { top: auto; bottom: 14px; } }
/* MOBILE-B (Oct 21): shorter /api on phones: 36px section air, tighter table rows, response fields two to a row */
@media (max-width: 767px) {
  .ap { --pad: 36px; }
  .ap-dev__h { font-size: 18px; }
  .ap-dev__h--r { margin-top: 4px; }
  .ap-ep tbody tr { padding: 10px 14px; }
  .ap-tbl tbody tr, .ap-tbl--res tbody tr { padding: 10px 14px; }
  .ap-tbl tbody th { margin-bottom: 2px; }
  .ap-tbl--res tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-tbl--res tbody tr + tr { border-top: 1px solid var(--lav); }
  .ap-tbl--res tbody tr:nth-child(2) { border-top: 0; }
  .ap-tbl--res tbody tr:nth-child(odd) { border-right: 1px solid var(--lav); }
  .ap-tbl--res td { font-size: 13px; line-height: 1.4; }
}
@media (max-width: 359px) {
  .ap-tbl--res tbody { grid-template-columns: minmax(0, 1fr); }
  .ap-tbl--res tbody tr:nth-child(odd) { border-right: 0; }
  .ap-tbl--res tbody tr:nth-child(2) { border-top: 1px solid var(--lav); }
}
