/* TextScaleHQ — docs.css
   Loaded only under /docs/. Extends base.css; defines no tokens of its own
   beyond --mono, which base.css references but never declared.

   2.6.7 — TSH_267_DOCS_ZOOM. The nav's 10px left padding (and -10px margin)
           so the current page's pill isn't cut flat at the left edge, and the
           screenshot Enlarge button and overlay (.tsh-zoom*, .tsh-lb*). Both
           were in the August theme's 2.2.0 and lost in the preview rebuild.

   2.5.5 — Tables on phones. Under 720px each row is a card (docs.js adds
           .tsh-tcard, the roles and each cell's data-label): the first cell
           on top, the rest at full width under it, the column's name above
           each value when there are three or more columns. Before, the
           first column's white-space: nowrap took most of a phone's width
           and left "What it means" a word a line.

   2.1.3 — .tsh-req-r, the amber "Recommended" badge. Params tables had only
           .tsh-req-y (red Required) and .tsh-req-n (grey Optional), so a
           field the product labels Recommended rendered identically to one
           it labels Optional. Two fields in Messaging Setup carry that badge
           — Twilio From Number and Vonage From Number / Sender ID — and
           collapsing them into Optional makes the docs disagree with the UI
           the reader is looking at. Colour is the .tsh-note-warn pair
           (#c2410c on orange-1 at low alpha), so the three badges read as
           one family. */

:root { --mono: 'JetBrains Mono', 'Menlo', 'Monaco', monospace; }

/* ---------- shell ---------- */
.tsh-docs { max-width: 1400px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.tsh-docs-grid { display: grid; gap: 0; align-items: start; }
@media (min-width: 960px)  { .tsh-docs-grid { grid-template-columns: 248px minmax(0,1fr); } }
@media (min-width: 1280px) { .tsh-docs-grid { grid-template-columns: 248px minmax(0,1fr) 208px; } }

/* ---------- left: section nav ---------- */
.tsh-docs-nav { display: none; }
@media (min-width: 960px) {
  .tsh-docs-nav {
    display: block; position: sticky; top: 24px;
    /* 2.6.7: the links' margin-left:-10px pill needs room; overflow-y:auto
       clips the horizontal axis too, so without this padding the current
       page's pill is cut flat. The negative margin keeps the column put. */
    padding: 32px 24px 32px 10px;
    margin-left: -10px;
    max-height: calc(100vh - 48px); overflow-y: auto;
    border-right: 1px solid var(--line);
  }
}
.tsh-docs-navgroup + .tsh-docs-navgroup { margin-top: 26px; }
.tsh-docs-navgroup h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-4); margin-bottom: 11px;
}
.tsh-docs-navgroup h4 a { color: inherit; }
.tsh-docs-navgroup h4 a:hover { color: var(--ink-2); }
.tsh-docs-navgroup a {
  display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  padding: 6px 10px; margin-left: -10px; border-radius: 7px; line-height: 1.35;
  transition: background 130ms, color 130ms;
}
.tsh-docs-navgroup a:hover { background: var(--bg-3); color: var(--ink); }
.tsh-docs-navgroup a.is-current {
  background: rgba(11,116,255,0.08); color: var(--brand-3); font-weight: 600;
}

/* ---------- mobile section picker ---------- */
.tsh-docs-mobnav { margin: 18px 0 6px; }
@media (min-width: 960px) { .tsh-docs-mobnav { display: none; } }
.tsh-docs-mobnav select {
  width: 100%; font: 500 14px/1 'Inter', sans-serif; color: var(--ink-2);
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--btn-radius);
  background: var(--bg-2);
}

/* ---------- centre ---------- */
.tsh-docs-main { padding: 26px 0 72px; min-width: 0; }
@media (min-width: 960px) { .tsh-docs-main { padding: 32px clamp(24px,4vw,56px) 88px; } }

.tsh-docs-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-4); margin-bottom: 14px;
}
.tsh-docs-crumb a:hover { color: var(--brand-2); }

.tsh-docs-h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 12px;
}
.tsh-docs-lede { font-size: 16.5px; color: var(--ink-3); line-height: 1.6; max-width: 62ch; margin-bottom: 14px; }
.tsh-docs-meta {
  font-size: 12.5px; color: var(--ink-4);
  padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line);
}

.tsh-docs-body { max-width: 74ch; }
.tsh-docs-body h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin: 44px 0 14px; scroll-margin-top: 24px; }
.tsh-docs-body h3 { font-size: 1.08rem; font-weight: 700; margin: 30px 0 10px; scroll-margin-top: 24px; }
.tsh-docs-body p  { font-size: 15.5px; line-height: 1.72; color: var(--ink-2); margin-bottom: 16px; }
.tsh-docs-body a:not(.anch) { color: var(--brand-2); font-weight: 500; border-bottom: 1px solid rgba(11,116,255,0.3); }
.tsh-docs-body a:not(.anch):hover { border-bottom-color: var(--brand-2); }
.tsh-docs-body ul, .tsh-docs-body ol { margin: 0 0 18px; padding-left: 22px; }
.tsh-docs-body ul li { list-style: disc; }
.tsh-docs-body ol li { list-style: decimal; }
.tsh-docs-body li { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); margin-bottom: 7px; padding-left: 4px; }
.tsh-docs-body li > ul, .tsh-docs-body li > ol { margin: 7px 0 0; }
.tsh-docs-body strong { font-weight: 650; color: var(--ink); }
.tsh-docs-body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.tsh-docs-body img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------- 2.6.7: screenshots enlarge (TSH_267_DOCS_ZOOM) ---------- */
.tsh-zoom { position: relative; display: inline-block; max-width: 100%; vertical-align: top; line-height: 0; }
.tsh-zoom > img { cursor: zoom-in; transition: box-shadow 160ms ease, border-color 160ms ease; }
.tsh-zoom:hover > img { border-color: var(--line-2); box-shadow: 0 6px 22px -8px rgba(15, 23, 42, 0.22); }
.tsh-zoom-btn {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 9px;
  background: rgba(255, 255, 255, 0.94); color: #0f172a;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.25);
  cursor: zoom-in; line-height: 1;
  transition: background 130ms ease, transform 130ms ease;
}
.tsh-zoom-btn:hover { background: #fff; transform: scale(1.06); }
.tsh-zoom-btn:focus-visible { outline: 2px solid var(--brand-2, #0b74ff); outline-offset: 2px; }
.tsh-zoom-btn svg { width: 18px; height: 18px; }
.tsh-lb {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 56px clamp(12px, 3vw, 40px) clamp(12px, 3vw, 40px);
  background: rgba(15, 23, 42, 0.86);
  opacity: 0; visibility: hidden;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}
.tsh-lb.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.tsh-lb img {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: var(--radius); background: #fff;
  box-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.98); transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: zoom-out;
}
.tsh-lb.is-open img { transform: scale(1); }
.tsh-lb-close {
  position: absolute; top: 12px; right: 14px;
  width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
  color: #fff; cursor: pointer; line-height: 1; transition: background 140ms ease;
}
.tsh-lb-close:hover { background: rgba(255, 255, 255, 0.26); }
.tsh-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tsh-lb-close svg { width: 18px; height: 18px; }
html.tsh-lb-lock, html.tsh-lb-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .tsh-lb, .tsh-lb img, .tsh-zoom-btn, .tsh-zoom > img { transition: none; }
  .tsh-lb img { transform: none; }
}
.tsh-docs-body :not(pre) > code {
  font-family: var(--mono); font-size: 0.875em;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px;
  padding: 1.5px 5px; color: var(--brand-3);
}

.tsh-docs-body h2 .anch, .tsh-docs-body h3 .anch {
  opacity: 0; margin-left: 8px; color: var(--ink-4); font-weight: 500;
  border-bottom: 0; transition: opacity 130ms;
}
.tsh-docs-body h2:hover .anch, .tsh-docs-body h3:hover .anch,
.tsh-docs-body .anch:focus { opacity: 1; }

/* ---------- code ---------- */
.tsh-code {
  position: relative; margin: 0 0 20px; border-radius: var(--radius);
  overflow: hidden; background: #0f172a; border: 1px solid #1e293b;
}
.tsh-code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px 9px 14px; background: #111c31; border-bottom: 1px solid #1e293b;
}
.tsh-code-lang {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: #64748b;
}
.tsh-code-copy {
  font: 600 11px/1 'Inter', sans-serif; color: #94a3b8;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 5px 9px; cursor: pointer; transition: all 130ms;
}
.tsh-code-copy:hover { color: #fff; background: rgba(255,255,255,0.14); }
.tsh-code-copy.done  { color: #6ee7b7; border-color: rgba(16,185,129,0.4); }
.tsh-code pre  { margin: 0; padding: 14px; overflow-x: auto; }
.tsh-code code { font-family: var(--mono); font-size: 12.8px; line-height: 1.65; color: #e2e8f0; white-space: pre; }

/* A bare <pre> from the editor's Code block gets the same treatment. */
.tsh-docs-body > pre {
  margin: 0 0 20px; padding: 14px; overflow-x: auto;
  background: #0f172a; border: 1px solid #1e293b; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.8px; line-height: 1.65; color: #e2e8f0;
}
.tsh-docs-body > pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.tok-key { color: #8CC3FF; } .tok-str { color: #6ee7b7; } .tok-num { color: #fbbf24; }
.tok-cmt { color: #64748b; font-style: italic; } .tok-fn { color: #c4b5fd; }

/* ---------- callouts ---------- */
.tsh-note {
  display: flex; gap: 11px; padding: 14px 16px; border-radius: var(--radius);
  margin: 0 0 20px; border: 1px solid var(--line); background: var(--bg-2);
  border-left: 3px solid var(--ink-4);
}
.tsh-note svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.tsh-note p { font-size: 14.5px; line-height: 1.62; margin: 0; color: var(--ink-2); }
.tsh-note p + p { margin-top: 8px; }
.tsh-note-info { border-left-color: var(--brand-2); background: rgba(11,116,255,0.045); }
.tsh-note-info svg { color: var(--brand-2); }
.tsh-note-warn { border-left-color: var(--orange-1); background: rgba(251,146,60,0.06); }
.tsh-note-warn svg { color: #c2410c; }
.tsh-note-stop { border-left-color: #ef4444; background: rgba(239,68,68,0.05); }
.tsh-note-stop svg { color: #b91c1c; }

/* ---------- params table ---------- */
.tsh-params { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14px; }
.tsh-params th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-4);
  padding: 0 12px 9px 0; border-bottom: 1px solid var(--line);
}
.tsh-params td {
  padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line);
  vertical-align: top; color: var(--ink-2); line-height: 1.55;
}
.tsh-params td:first-child { white-space: nowrap; }
.tsh-params code { font-family: var(--mono); font-size: 12.5px; color: var(--brand-3); font-weight: 500; }
.tsh-req {
  display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px;
}
.tsh-req-y { color: #b91c1c; background: rgba(239,68,68,0.11); }
.tsh-req-r { color: #c2410c; background: rgba(251,146,60,0.14); }
.tsh-req-n { color: var(--ink-3); background: var(--bg-3); }

/* Editor tables get the params look without any class on them. */
.tsh-docs-body table:not(.tsh-params) { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14px; }
.tsh-docs-body table:not(.tsh-params) th,
.tsh-docs-body table:not(.tsh-params) td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); }
.tsh-docs-body table:not(.tsh-params) th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }

/* 2.5.5 — tables on phones: one card per row (see the header). */
@media (max-width: 719.98px) {
  .tsh-docs-body table td:first-child { white-space: normal; }
  .tsh-docs-body td code { overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .tsh-docs-body table.tsh-tcard,
  .tsh-docs-body table.tsh-tcard tbody,
  .tsh-docs-body table.tsh-tcard tr,
  .tsh-docs-body table.tsh-tcard td { display: block; width: auto; }
  .tsh-docs-body table.tsh-tcard thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .tsh-docs-body table.tsh-tcard { border-top: 1px solid var(--line); }
  .tsh-docs-body table.tsh-tcard tr { padding: 14px 0 15px; border-bottom: 1px solid var(--line); }
  .tsh-docs-body table.tsh-tcard td { padding: 0; border: 0; line-height: 1.6; }
  .tsh-docs-body table.tsh-tcard td:first-child { font-weight: 600; color: var(--ink); margin-bottom: 7px; }
  .tsh-docs-body table.tsh-tcard td + td { margin-top: 10px; }
  .tsh-docs-body table.tsh-tcard.is-two td + td { margin-top: 0; }
  .tsh-docs-body table.tsh-tcard td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4);
  }
  .tsh-docs-body table.tsh-tcard.is-two td::before { content: none; }
}

/* ---------- pager ---------- */
.tsh-docs-pager { display: grid; gap: 12px; margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
@media (min-width: 620px) { .tsh-docs-pager { grid-template-columns: 1fr 1fr; } }
.tsh-docs-pager a {
  display: block; padding: 15px 17px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff;
  transition: border-color 140ms, box-shadow 140ms, transform 140ms;
}
.tsh-docs-pager a:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tsh-docs-pager span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); margin-bottom: 5px; }
.tsh-docs-pager b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.tsh-docs-pager .nx { text-align: right; }

/* ---------- right: on-page ToC ---------- */
.tsh-docs-toc { display: none; }
@media (min-width: 1280px) {
  .tsh-docs-toc {
    display: block; position: sticky; top: 24px; padding: 38px 0 32px 8px;
    max-height: calc(100vh - 48px); overflow-y: auto;
  }
}
.tsh-docs-toc h4 { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-4); margin-bottom: 12px; }
.tsh-docs-toc a {
  display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-3);
  padding: 5px 0 5px 12px; border-left: 2px solid var(--line);
  transition: color 130ms, border-color 130ms;
}
.tsh-docs-toc a:hover { color: var(--ink); }
.tsh-docs-toc a.is-active { color: var(--brand-2); border-left-color: var(--brand-2); font-weight: 600; }
.tsh-docs-toc a.lvl3 { padding-left: 22px; font-size: 12px; }

/* ---------- index / group landing ---------- */
.tsh-dochome { padding: 48px 0 80px; }
.tsh-dochome-head { max-width: 60ch; margin-bottom: 40px; }
.tsh-dochome-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brand-3); background: rgba(11,116,255,0.07);
  border: 1px solid rgba(11,116,255,0.18); padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
.tsh-dochome-h1 { font-size: clamp(2.1rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 14px; }
.tsh-dochome-sub { font-size: 17px; color: var(--ink-3); line-height: 1.6; }

.tsh-doccols { display: grid; gap: 34px 28px; }
@media (min-width: 700px)  { .tsh-doccols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .tsh-doccols { grid-template-columns: repeat(3, 1fr); } }
.tsh-doccard {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; background: #fff;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.tsh-doccard:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.tsh-doccard h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.tsh-doccard h3 a:hover { color: var(--brand-2); }
.tsh-doccard p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; margin-bottom: 14px; }
.tsh-doccard ul { list-style: none; margin: 0; padding: 0; }
.tsh-doccard ul li { margin-bottom: 8px; }
.tsh-doccard ul a { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.tsh-doccard ul a:hover { color: var(--brand-2); }
.tsh-doccard-empty { font-size: 13px; color: var(--ink-4); font-style: italic; }

/* Flag an article that is planned but not written. Add <span class="tsh-soon">Soon</span>
   inside the link text, or leave the page as a draft — an unpublished page simply
   does not appear in the tree. */
.tsh-soon {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-4); background: var(--bg-3); padding: 2px 6px; border-radius: 5px;
  margin-left: 5px; vertical-align: 1px;
}

/* ---------- print ---------- */
@media print {
  .tsh-docs-nav, .tsh-docs-toc, .tsh-docs-pager, .tsh-docs-mobnav,
  .tsh-code-copy, .tsh-header, .tsh-footer, .tsh-zoom-btn, .tsh-lb { display: none !important; }
  .tsh-docs-grid { grid-template-columns: 1fr !important; }
  .tsh-docs-body { max-width: none; }
  .tsh-code { border: 1px solid #cbd5e1; }
  .tsh-code pre, .tsh-code code, .tsh-docs-body > pre { background: #f8fafc !important; color: #0f172a !important; }
}

/* ---- 2.4.0: search on /docs/ and in the sidebar ---- */
.tsh-dsbox { position: relative; max-width: 640px; margin: 26px 0 0; text-align: left; }
.tsh-dsbox-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: flex; }
.tsh-dsbox input { width: 100%; height: 56px; border: 1px solid var(--line-2); border-radius: 14px; padding: 0 76px 0 46px; font-family: inherit; font-size: 16px; font-weight: 500; color: var(--ink); background: #fff; box-shadow: 0 10px 30px -18px rgba(15,23,42,.35); outline: none; -webkit-appearance: none; }
.tsh-dsbox input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(11,116,255,.14); }
.tsh-dsbox input::-webkit-search-cancel-button { display: none; }
.tsh-dsbox > .tsh-kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin: 0; }
.tsh-dsbox-res { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(15,23,42,.28); max-height: min(460px, 60vh); z-index: 20; }
.tsh-dsbox-res[hidden] { display: none; }
.tsh-dsugs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; margin: 16px 0 34px; max-width: 680px; font-size: 13px; color: var(--ink-3); align-items: center; }
.tsh-dsugs button { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: #fff; color: var(--ink-2); font-family: inherit; font-size: 13px; cursor: pointer; }
.tsh-dsugs button:hover { border-color: var(--brand-1); color: var(--brand-3); }
.tsh-docs-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); color: var(--ink-3); font-family: inherit; font-size: 13.5px; cursor: pointer; }
.tsh-docs-search:hover { border-color: var(--line-2); color: var(--ink-2); }
.tsh-docs-search--mob { height: 44px; font-size: 14.5px; margin: 14px 0 0; }
@media (min-width: 960px) { .tsh-docs-search--mob { display: none; } }
