/* tikhaze.com/api-docs, on top of legal.css + docs.css (the /docs look). */

/* How it works: three numbered steps in one framed list. */
.doc ol.api-flow { list-style: none; margin: 24px 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.doc ol.api-flow > li { display: flex; gap: 16px; margin: 0; padding: 18px 20px; border-top: 1px solid var(--rule); }
.doc ol.api-flow > li:first-child { border-top: 0; }
.api-flow-n { flex: 0 0 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--raised); color: var(--label); font: 600 13px/26px var(--font-data); text-align: center; }
.api-flow strong { display: block; margin-bottom: 2px; font-size: 16px; color: var(--label); }
.doc .api-flow p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--label-2); }

/* Pricing */
.api-price { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin: 8px 0 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.api-price-main, .api-price-side { padding: 24px; }
.api-price-side { border-inline-start: 1px solid var(--line); background: #0f0f11; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.doc .api-price-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--label-3); }
.doc .api-price-figure { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; font-family: var(--font-data); font-size: 44px; font-weight: 700; line-height: 1; color: var(--label); font-variant-numeric: tabular-nums; }
.api-price-figure small { font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--label-3); }
.doc ul.api-perks { list-style: none; margin: 0; padding: 0; }
.doc .api-perks li { position: relative; margin: 0; padding: 7px 0 7px 26px; font-size: 15px; line-height: 1.5; color: var(--label-2); }
.api-perks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--tint); border-bottom: 2px solid var(--tint); transform: rotate(-45deg); }
.api-perks strong { color: var(--label); font-family: var(--font-data); }
.api-buy-btn { width: 100%; margin-top: 4px; }
.api-buy-btn:disabled { opacity: .45; cursor: not-allowed; }
.doc .api-rules-note { margin: 0 0 8px; font-size: 13px; }
.doc .api-msg { min-height: 1.4em; margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--label-2); }
.doc .api-msg:empty { min-height: 0; margin: 0; }
.doc .api-warn { padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.doc .api-warn[hidden] { display: none; }

/* Purchase consent (same look as app.css's, which this page does not load). */
.purchase-consent { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 4px 0 8px; font-size: 13px; line-height: 1.5; color: var(--label-2); cursor: pointer; }
.purchase-consent-box { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--tint); cursor: pointer; }
.purchase-consent a { color: var(--label); text-decoration: underline; text-underline-offset: 2px; }

/* The signed-in panel */
.api-panel { margin: 0 0 8px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.doc .api-panel h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; font-stretch: 112%; }
.api-panel [hidden] { display: none !important; }
.api-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.doc .api-panel-head p { margin: 0; }
.api-signin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.api-signin .btn { text-decoration: none; }
.api-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.api-stats > div { padding: 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); text-align: center; }
.api-stat { display: block; font-family: var(--font-data); font-size: 24px; font-weight: 700; color: var(--label); font-variant-numeric: tabular-nums; }
.api-stat-label { display: block; margin-top: 4px; font-size: 12px; color: var(--label-3); }
.doc ul.api-keys { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.doc .api-key { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 16px; border-top: 1px solid var(--rule); }
.doc .api-key:first-child { border-top: 0; }
.doc .api-key.is-empty { display: block; color: var(--label-3); font-size: 15px; }
.api-key > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.api-key-label { font-weight: 600; color: var(--label); overflow-wrap: anywhere; }
.api-key-meta { font-size: 13px; color: var(--label-3); }
.api-revoke { flex: 0 0 auto; min-height: 40px; font-size: 13px; }
.api-revoke.is-armed { border-color: var(--red); color: var(--red); }
.api-new-key { margin: 0 0 16px; padding: 16px; border: 1px solid rgba(157, 255, 58, .35); border-radius: 12px; background: #11170b; }
.doc .api-new-key p { margin: 0 0 10px; font-size: 15px; }
.api-code-line { display: flex; align-items: center; gap: 8px; }
.api-code-line code { flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: 14px; word-break: break-all; }
.api-create { display: flex; gap: 8px; }
.api-create input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--raised); color: var(--label); font: 500 15px/1 var(--font); }
.api-create input:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }

/* Code blocks with a copy button */
.api-code { position: relative; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 12px; background: #0d0d0f; }
.api-code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; }
.api-code pre code { padding: 0; border: 0; background: none; font-size: inherit; color: #e4e4e7; overflow-wrap: normal; white-space: pre; }
/* Syntax colours (assets/api-docs.js highlight()). Muted on purpose, so the
   page's chartreuse still reads as the accent; all ≥ 4.5:1 on #0d0d0f. */
.api-code code .tk-com { color: #7b7b86; font-style: italic; }
.api-code code .tk-str { color: #b8e986; }
.api-code code .tk-kw  { color: #8fb6ff; }
.api-code code .tk-lit { color: #f5b971; }
.api-code code .tk-fn  { color: #7fdccd; }
.api-code code .tk-key { color: #c9b5ff; }
.api-code code .tk-pun { color: #8e8e97; }
.api-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--raised); color: var(--label-3); font: 600 12px/1 var(--font); cursor: pointer; transition: color .15s, border-color .15s; }
.api-copy:hover { color: var(--label); border-color: #4a4a52; }
.api-copy svg { width: 14px; height: 14px; flex: 0 0 14px; }
.api-copy.is-done { color: var(--tint); border-color: rgba(157, 255, 58, .4); }
.api-code-copy { position: absolute; top: 8px; inset-inline-end: 8px; border-start-end-radius: 4px; }
@media (hover: hover) {
  .api-code-copy { opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
  .api-code:hover .api-code-copy, .api-code-copy:focus-visible, .api-code-copy.is-done { opacity: 1; }
}

/* Build it with AI: three logo tiles, the whole tile copies its prompt.
   Phones (below) turn them into one grouped list of rows. */
.api-ai { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 6px; }
.api-ai-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; min-height: 196px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--label); font: inherit; text-align: start; cursor: pointer; transition: border-color .18s, background-color .18s, transform .18s var(--ease-out, ease-out); }
.api-ai-tile:hover { border-color: #3a3a42; background: #16161a; }
.api-ai-tile:active { transform: scale(.985); }
.api-ai-tile:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 16px; }
.api-ai-tile.is-done { border-color: rgba(157, 255, 58, .4); }
.api-ai-logo { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: 0 0 52px; border: 1px solid var(--line-2); border-radius: 13px; background: var(--raised); }
.api-ai-logo img { display: block; width: 30px; height: 30px; }
.api-ai-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.api-ai-name { font-size: 18px; font-weight: 700; font-stretch: 112%; color: var(--label); }
.api-ai-where { font-size: 13px; line-height: 1.45; color: var(--label-3); }
.api-ai-where code { font-size: 12px; }
.api-ai-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: var(--label); color: #0a0a0a; font: 600 14px/1 var(--font); transition: background-color .18s, color .18s, border-color .18s; }
.api-ai-chip svg { width: 15px; height: 15px; flex: 0 0 15px; }
.api-ai-tile:hover .api-ai-chip { background: #fff; }
.api-ai-tile.is-done .api-ai-chip { background: #16200d; border-color: rgba(157, 255, 58, .35); color: var(--tint); }
.doc .api-ai-status { min-height: 1.5em; margin: 0 0 14px; font-size: 14px; color: var(--tint); }

/* Reference */
.api-endpoint { scroll-margin-top: 96px; }
.api-verb { display: inline-block; margin-inline-end: 8px; padding: 3px 8px; border-radius: 6px; background: var(--tint); color: #0a0a0a; font: 700 12px/1.3 var(--font-code); letter-spacing: .04em; vertical-align: 2px; }
.api-verb.is-get { background: var(--raised); color: var(--label); border: 1px solid var(--line-2); }
.api-table td { font-size: 14.5px; }
.api-table td:first-child { width: 30%; }
.api-download { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.api-download .btn { text-decoration: none; }

@media (max-width: 719.98px) {
  .api-price { grid-template-columns: minmax(0, 1fr); }
  .api-price-side { border-inline-start: 0; border-top: 1px solid var(--line); }
  .api-panel, .api-price-main, .api-price-side { padding: 20px 16px; }
  .api-create { flex-direction: column; }
  .api-key { flex-wrap: wrap; }
  .doc .api-price-figure { font-size: 38px; }
  .api-ai { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
  .api-ai-tile { flex-direction: row; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; }
  .api-ai-tile:first-child { border-top: 0; }
  .api-ai-tile.is-done { border-color: var(--rule); background: #12160d; }
  .api-ai-tile:focus-visible { outline-offset: -2px; border-radius: 0; }
  .api-ai-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: 10px; }
  .api-ai-logo img { width: 24px; height: 24px; }
  .api-ai-text { flex: 1 1 auto; }
  .api-ai-name { font-size: 16px; }
  .api-ai-chip { flex: 0 0 auto; margin: 0; padding: 0 14px; min-width: 92px; justify-content: center; }
  .api-ai-chip-long { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .api-copy, .api-code-copy, .api-ai-tile, .api-ai-chip { transition: none; }
  .api-ai-tile:active { transform: none; }
}
