/* Help & docs (docs.html): what the docs page adds on top of the legal pages'
   document system (assets/legal.css). Loaded only by docs.html. Logical
   properties throughout: the page also renders right to left (Arabic). */
:root { --red: #ff6b61; --amber: #f5c76b; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* A translated visit hides the page body until docs.js swaps the text in
   (the inline <head> script lifts this after 3 s regardless). */
html[data-docs-pending] main { visibility: hidden; }

.eyebrow b { font-weight: inherit; }

/* Top bar: language picker + Back to Haze */
.docs-top-actions { display: flex; align-items: center; gap: 8px; }
.docs-lang { position: relative; display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--label-2); transition: border-color .15s; }
.docs-lang:hover, .docs-lang:focus-within { border-color: #4a4a52; color: var(--label); }
.docs-lang svg { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; pointer-events: none; }
.docs-lang select { appearance: none; -webkit-appearance: none; min-height: 42px; padding-block: 0; padding-inline: 36px 14px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: 600 14px/1 var(--font); cursor: pointer; }
.docs-lang select:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.docs-lang option { background: var(--raised); color: var(--label); }
[dir="rtl"] .back-link svg { transform: scaleX(-1); }
@media (max-width: 719.98px) {
  .topbar-in { flex-wrap: nowrap; }
  .brand { gap: 10px; min-width: 0; }
  .brand-logo svg { width: 64px; }
  .back-link { padding: 0 12px; }
  .back-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .docs-lang select { padding-inline: 34px 10px; font-size: 13px; }
}

/* Lists read the same both ways. */
.doc ul, .doc ol { padding-left: 0; padding-inline-start: 22px; }
.doc li { padding-left: 0; padding-inline-start: 4px; }
.toc-sub { margin: 2px 0 6px !important; padding-inline-start: 32px !important; }
.toc-sub a { padding: 4px 0; font-size: 13px; }
@media (max-width: 1023.98px) { .toc-sub a { min-height: 36px; } }

/* Numbered steps */
.doc ol.steps { list-style: none; margin: 0 0 22px; padding-inline-start: 0; counter-reset: step; }
.doc ol.steps > li { position: relative; margin: 0 0 14px; padding-inline-start: 44px; counter-increment: step; }
.doc ol.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 1px; width: 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; }
.doc h4 { margin: 26px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--label-3); }
.doc .small { font-size: 15px; line-height: 1.65; color: var(--label-3); }
.doc .option { margin: 22px 0 12px; font-size: 16px; font-weight: 600; color: var(--label); }
.doc .panel > .option:first-of-type { margin-top: 4px; }

/* Live engine status */
.engines { list-style: none; margin: 4px 0 18px !important; padding: 0 !important; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.engines[hidden] { display: none; }
.doc .engine { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; margin: 0; padding: 16px 20px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; }
.doc .engine:first-child { border-top: 0; }
.doc .engine.is-loading { display: block; color: var(--label-3); }
.engine-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; font-stretch: 112%; color: var(--label); }
.engine-what { grid-column: 1; margin: 0 !important; font-size: 14px !important; color: var(--label-3) !important; }
.engine-note { grid-column: 1 / -1; margin: 6px 0 0 !important; padding: 10px 12px; border-radius: 10px; background: var(--raised); font-size: 14px !important; color: var(--label-2) !important; }
.engine-status { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--label); white-space: nowrap; }
/* The shared status marks (app.css, Engine status). */
.hz-status-mark { flex: none; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.hz-status-mark[data-status="working"] { fill: var(--tint); }
.hz-status-mark[data-status="patched"] { stroke: #ff7a70; }
.hz-status-mark[data-status="fixing"] { stroke: #f5b84d; }
.hz-status-mark[data-status="fixing"] path { fill: #f5b84d; stroke: none; }
.engine[data-status="patched"] .engine-name, .engine[data-status="fixing"] .engine-name { color: var(--label-2); }
.engine.is-recommended { background: #141a0d; }
.engine-badge { padding: 3px 7px; border-radius: 5px; background: var(--tint); color: #0a0a0a; font-size: 11px; font-weight: 700; font-stretch: 100%; letter-spacing: .08em; text-transform: uppercase; }
.doc .engines-error { padding: 14px 16px; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 15px; }
.doc .engines-legend { font-size: 14px; line-height: 1.6; color: var(--label-3); }
@media (prefers-reduced-motion: no-preference) {
  .engine:not(.is-loading) { animation: docsIn .35s var(--ease-out) backwards; }
  .engine:nth-child(2) { animation-delay: .04s; }
  .engine:nth-child(3) { animation-delay: .08s; }
}
@keyframes docsIn { from { opacity: 0; transform: translateY(4px); } }

/* Tabs (progressive: without docs.js every panel shows, stacked). */
.tabs { margin: 28px 0 8px; }
.tablist { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.tablist[hidden] { display: none; }
.tablist [role="tab"] { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--label-3); font: 600 14px/1.2 var(--font); cursor: pointer; transition: color .15s, background-color .15s; }
.tablist [role="tab"]:hover { color: var(--label); }
.tablist [role="tab"][aria-selected="true"] { background: var(--label); color: var(--bg); }
.tablist [role="tab"]:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.tabs:not(.is-ready) > .panel + .panel { margin-top: 32px; }
.tabs.is-ready .panel-title { display: none; }
.panel[hidden] { display: none; }
.doc .panel > h3:first-child { margin-top: 0; }
.doc .issue .panel h4.panel-title { margin-top: 24px; }

/* Known issues: one block each, with its own link. */
.issue { padding: 30px 0 12px; border-top: 1px solid var(--rule); scroll-margin-top: 96px; }
.issue:first-of-type { margin-top: 28px; }
.issue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.doc .issue-head h3 { margin: 6px 0 0; font-size: 19px; font-weight: 700; font-stretch: 112%; }
.issue-copy { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: transparent; color: var(--label-3); font: 600 13px/1 var(--font); cursor: pointer; transition: color .15s, border-color .15s; }
.issue-copy:hover { color: var(--label); border-color: #4a4a52; }
.issue-copy svg { width: 16px; height: 16px; flex: 0 0 16px; }
.issue-copy.is-done { color: var(--tint); border-color: rgba(157, 255, 58, .4); }
.issue-copy[hidden] { display: none; }
@media (max-width: 559.98px) { .issue-copy .issue-copy-label { display: none; } .issue-copy { padding: 0; justify-content: center; } }
.issue:target .issue-head h3, .panel:target { scroll-margin-top: 96px; }
@media (prefers-reduced-motion: no-preference) {
  .issue:target .issue-head h3 { animation: docsTarget 1.6s var(--ease-out); }
}
@keyframes docsTarget { 0%, 40% { color: var(--tint); } }

.doc .contact-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media print {
  .docs-top-actions, .issue-copy, .tablist { display: none !important; }
  .panel[hidden] { display: block !important; }
  .tabs.is-ready .panel-title { display: block; }
  .engine.is-recommended { background: #fff !important; }
}
