/* User guide extras: search, mobile Contents panel, back-to-top, small-screen and RTL fixes.
   Loaded after the page's own <style>, so these rules win on equal specificity. */

html { scroll-behavior: smooth; }
/* Constant header height so the sticky bar below it never gaps or overlaps. */
.site-header, .site-header.is-scrolled { padding: 12px 0; }
.docs-body h3[id], .docs-body h4[id] { scroll-margin-top: 100px; }

/* ---------- search box ---------- */
.docs-search { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.docs-search-ico { position: absolute; inset-inline-start: 11px; display: flex; color: var(--slate-400); pointer-events: none; }
.docs-search-ico svg { width: 16px; height: 16px; }
.docs-search input {
  width: 100%; font: inherit; font-size: 14px; color: var(--slate-900);
  background: #fff; border: 1.5px solid var(--slate-200); border-radius: 10px;
  padding: 9px 34px 9px 34px; min-width: 0; -webkit-appearance: none; appearance: none;
}
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.docs-search-clear {
  position: absolute; inset-inline-end: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: var(--slate-100); color: var(--slate-600); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.docs-search-clear[hidden] { display: none; }

/* ---------- results ---------- */
.docs-results[hidden] { display: none; }
.docs-count, .docs-none { font-size: 12px; color: var(--slate-500); margin: 0 0 8px; padding: 0 4px; }
.docs-hit {
  display: block; padding: 10px 11px; border-radius: 9px; margin-bottom: 2px;
  border: 1px solid transparent; color: var(--slate-700); text-decoration: none;
}
.docs-hit:hover, .docs-hit:focus { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.2); outline: none; }
.docs-hit-sec { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400); margin-bottom: 2px; }
.docs-hit-title { display: block; font-size: 13.5px; font-weight: 700; color: var(--slate-900); line-height: 1.35; }
.docs-hit-snip { display: block; font-size: 12.5px; color: var(--slate-500); line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.docs-results mark { background: rgba(245,158,11,.28); color: inherit; border-radius: 3px; padding: 0 1px; }
.docs-toc.is-searching > ul { display: none; }
.docs-toc.is-searching > h4 { display: none; }

/* ---------- mobile bar (hidden on desktop) ---------- */
.docs-mbar { display: none; }
.docs-flash { animation: docsFlash 1.6s ease-out; }
@keyframes docsFlash { 0%, 30% { background: rgba(245,158,11,.22); box-shadow: 0 0 0 8px rgba(245,158,11,.22); } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }

/* ---------- back to top ---------- */
.docs-top {
  position: fixed; inset-inline-end: 16px; bottom: 18px; z-index: 80; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--navy-900, #0a1628); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(10,22,40,.3);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.docs-top svg { width: 20px; height: 20px; }
.docs-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- RTL / logical spacing ---------- */
.docs-toc .sub { padding-left: 0; padding-inline-start: 14px; }
.docs-section ul, .docs-section ol { padding-left: 0; padding-inline-start: 22px; }
.tip { border-left: 0; border-inline-start: 3px solid var(--amber-500); border-radius: var(--radius-sm); }
.docs-body code { overflow-wrap: anywhere; }
.docs-body img, .docs-body svg { max-width: 100%; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 960px) {
  .page-header { padding: 104px 0 28px; }
  .page-header h1 { font-size: 28px; line-height: 1.2; }
  .docs-layout { display: block; padding: 16px 0 72px; }
  .docs-section { margin-bottom: 44px; scroll-margin-top: calc(var(--docs-bar, 120px) + 12px); }
  .docs-body h3[id], .docs-body h4[id] { scroll-margin-top: calc(var(--docs-bar, 120px) + 12px); }
  .docs-section h2 { font-size: 22px; }
  .docs-section h3 { font-size: 16px; }

  .docs-mbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: var(--docs-hdr, 60px); z-index: 90;
    margin: 0 -16px; padding: 8px 16px; background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--slate-200);
  }
  .docs-mbar-toc {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; font: inherit; font-size: 13.5px; font-weight: 600;
    color: var(--slate-800); background: var(--slate-100); border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer;
  }
  .docs-mbar-toc svg { width: 17px; height: 17px; }
  .docs-mbar-search { flex: 1; min-width: 0; }
  .docs-mbar .docs-search { margin: 0; }
  .docs-mbar .docs-search input { font-size: 16px; padding-top: 10px; padding-bottom: 10px; } /* 16px stops iOS zoom on focus */

  .docs-toc {
    display: none; position: fixed; top: var(--docs-bar, 120px); inset-inline: 10px; z-index: 95;
    max-height: calc(100vh - var(--docs-bar, 120px) - 14px); max-height: calc(100dvh - var(--docs-bar, 120px) - 14px);
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    box-shadow: 0 18px 50px -10px rgba(10,22,40,.4); background: #fff;
  }
  .docs-toc.is-open, .docs-toc.is-searching { display: block; }
  .docs-toc > ul > li > a, .docs-toc .sub a { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
  .docs-toc .sub a { font-size: 13px; }
  .docs-hit { padding: 12px; }

  .lang-bar .container { gap: 6px; }
  .lang-bar-label { width: 100%; margin: 0 0 2px; }
  .perm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .docs-mbar-toc span { display: none; }
  .docs-mbar-toc { padding: 10px; }
  .screen-wrap { margin-inline: -4px; }
  .screen-body { padding: 12px; }
  .app-card { padding: 12px; gap: 10px; }
  .status-flow { gap: 6px; }
  .cta-band .cta-actions { flex-direction: column; align-items: stretch; }
}

/* Tables become stacked cards on phones, so nothing hides off-screen to the side. */
@media (max-width: 600px) {
  .table-scroll { overflow: visible; margin: 14px 0 20px; }
  .field-table { min-width: 0; display: block; }
  .field-table thead { display: none; }
  .field-table tbody { display: block; }
  .field-table tr { display: block; border: 1px solid var(--slate-200); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: #fff; }
  .field-table td { display: block; border: 0; padding: 4px 0; font-size: 14px; }
  .field-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--slate-400); margin-bottom: 1px;
  }
  .field-table td.fname { white-space: normal; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--slate-100); margin-bottom: 4px; }
  .field-table td.fname::before { display: none; }
  .field-table .badge-req, .field-table .badge-opt { display: inline-block; }
}
