/* SPDX-FileCopyrightText: 2026 Original Syndicate, LLC */
/* SPDX-License-Identifier: LicenseRef-OGS-Proprietary */
/* ==========================================================================
   OGS suite in-app Help, shared drawer, one look across every tool.
   Loaded once from CloudFront (like ogs-theme.css). Reads the per-app content
   in window.OGSHelp and injects a "?" launcher + a themed slide-over guide.
   All colors come from the shared theme tokens (--ogs-*), so it matches OGS
   Default and the Bloomberg Terminal theme automatically.
   ========================================================================== */
/* Footer-integrated help, a subtle link that sits in the suite footer. */
.ogs-help-link {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 16px;
  padding: 0; background: none; border: 0; cursor: pointer; line-height: 1;
  font-family: var(--ogs-font, system-ui, sans-serif); font-size: var(--ogs-fs-sm, 12px); font-weight: 500;
  color: var(--ogs-text-dim, #8592ad); transition: color .12s ease;
}
.ogs-help-link:hover { color: var(--ogs-text, #e8edf7); }
.ogs-help-link .ogs-help-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 999px; font-size: var(--ogs-fs-2xs, 10px); font-weight: 600;
  border: 1px solid currentColor;
}
:root[data-ogs-theme="terminal"] .ogs-help-link .ogs-help-q { border-radius: 0; }
/* Fallback launcher, only when a page has no footer; small + clears the footer strip. */
.ogs-help-fab {
  position: fixed; right: 16px; bottom: 46px; z-index: 100050;
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ogs-border, rgba(255,255,255,.16)); border-radius: 999px;
  background: color-mix(in srgb, var(--ogs-surface, #14171d) 88%, transparent);
  color: var(--ogs-text-dim, #8592ad); cursor: pointer; opacity: .82;
  transition: opacity .12s ease, color .12s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ogs-help-fab:hover { opacity: 1; color: var(--ogs-text, #e8edf7); }
.ogs-help-fab .ogs-help-qm { font-size: var(--ogs-fs-md, 13px); font-weight: 600; }
:root[data-ogs-theme="terminal"] .ogs-help-fab { border-radius: 0; }

/* backdrop + drawer */
.ogs-help-overlay {
  position: fixed; inset: 0; z-index: 100051;
  background: rgba(3,5,10,.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.ogs-help-overlay.open { opacity: 1; pointer-events: auto; }
.ogs-help-drawer {
  position: fixed; top: 0; right: 0; z-index: 100052;
  height: 100%; width: min(460px, 100vw);
  display: flex; flex-direction: column;
  background: var(--ogs-surface, #14171d); color: var(--ogs-text, #e8edf7);
  border-left: 1px solid var(--ogs-border, rgba(255,255,255,.10));
  font-family: var(--ogs-font, system-ui, sans-serif);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: -18px 0 50px rgba(0,0,0,.4);
}
.ogs-help-overlay.open + .ogs-help-drawer,
.ogs-help-drawer.open { transform: translateX(0); }

.ogs-help-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--ogs-hairline, rgba(255,255,255,.08));
}
.ogs-help-head .ogs-help-eyebrow {
  font-size: var(--ogs-fs-2xs, 10px); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ogs-text-dim, #8592ad); font-weight: 600;
}
.ogs-help-head .ogs-help-title { font-size: var(--ogs-fs-xl, 16px); font-weight: 600; color: var(--ogs-text, #e8edf7); line-height: 1.15; }
.ogs-help-close {
  margin-left: auto; flex: 0 0 auto; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ogs-border, rgba(255,255,255,.12)); border-radius: var(--ogs-radius-sm, 6px);
  background: transparent; color: var(--ogs-text-dim, #8592ad); cursor: pointer; font-size: var(--ogs-fs-xl, 16px); line-height: 1;
}
.ogs-help-close:hover { color: var(--ogs-text, #e8edf7); border-color: var(--ogs-text-dim, #8592ad); }

.ogs-help-body { flex: 1 1 auto; overflow-y: auto; padding: 18px; }
.ogs-help-tagline { font-size: var(--ogs-fs-lg, 14px); color: var(--ogs-text, #e8edf7); line-height: 1.5; margin: 0 0 4px; }

.ogs-help-section { margin-top: 22px; }
.ogs-help-section > h3 {
  font-size: var(--ogs-fs-xs, 11px); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ogs-accent, #5a82dc); font-weight: 600; margin: 0 0 10px;
}
/* numbered steps */
.ogs-help-steps { list-style: none; margin: 0; padding: 0; counter-reset: ogsstep; }
.ogs-help-steps > li { position: relative; padding: 0 0 14px 34px; }
.ogs-help-steps > li:before {
  counter-increment: ogsstep; content: counter(ogsstep);
  position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--ogs-accent, #336cd2); color: var(--ogs-accent-ink, #fff);
  font-size: var(--ogs-fs-sm, 12px); font-weight: 600;
}
:root[data-ogs-theme="terminal"] .ogs-help-steps > li:before { border-radius: 0; }
.ogs-help-steps .ogs-help-st { font-weight: 600; font-size: var(--ogs-fs-md, 13px); color: var(--ogs-text, #e8edf7); }
.ogs-help-steps .ogs-help-sb { font-size: var(--ogs-fs-md, 13px); color: var(--ogs-text-dim, #8592ad); line-height: 1.5; margin-top: 2px; }

/* term/definition + task list */
.ogs-help-defs { display: grid; gap: 12px; }
.ogs-help-defs .ogs-help-term { font-weight: 600; font-size: var(--ogs-fs-md, 13px); color: var(--ogs-text, #e8edf7); }
.ogs-help-defs .ogs-help-def { font-size: var(--ogs-fs-md, 13px); color: var(--ogs-text-dim, #8592ad); line-height: 1.5; margin-top: 1px; }

/* troubleshooting = disclosure list */
.ogs-help-qa { border-top: 1px solid var(--ogs-hairline, rgba(255,255,255,.08)); }
.ogs-help-qa details { border-bottom: 1px solid var(--ogs-hairline, rgba(255,255,255,.08)); }
.ogs-help-qa summary {
  cursor: pointer; padding: 11px 0; font-size: var(--ogs-fs-md, 13px); font-weight: 600;
  color: var(--ogs-text, #e8edf7); list-style: none; display: flex; align-items: center; gap: 8px;
}
.ogs-help-qa summary::-webkit-details-marker { display: none; }
.ogs-help-qa summary:before { content: "+"; color: var(--ogs-text-dim, #8592ad); font-weight: 600; width: 12px; }
.ogs-help-qa details[open] summary:before { content: "\2212"; }
.ogs-help-qa .ogs-help-a { font-size: var(--ogs-fs-md, 13px); color: var(--ogs-text-dim, #8592ad); line-height: 1.5; padding: 0 0 12px 20px; }

.ogs-help-support {
  margin-top: 22px; padding: 12px 14px; font-size: var(--ogs-fs-md, 13px); line-height: 1.5;
  color: var(--ogs-text-dim, #8592ad);
  background: var(--ogs-surface-2, #1b2029); border: 1px solid var(--ogs-border, rgba(255,255,255,.10));
  border-radius: var(--ogs-radius-sm, 6px);
}
:root[data-ogs-theme="terminal"] .ogs-help-support { border-radius: 0; }
.ogs-help-body code { font-family: var(--ogs-font-mono, monospace); font-size: var(--ogs-fs-sm, 12px);
  background: var(--ogs-surface-2, #1b2029); padding: 1px 5px; border-radius: 4px; }
.ogs-help-body a { color: var(--ogs-link, #5a82dc); }



/* Which build this browser is running. A footnote most of the time; the loudest
   thing in the drawer when the tab has fallen behind a deploy. */
.ogs-help-build {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ogs-border, rgba(255,255,255,.10));
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: var(--ogs-fs-sm, 12px); color: var(--ogs-text-dim, #8592ad);
}
.ogs-help-build-label { text-transform: uppercase; letter-spacing: .06em; font-size: var(--ogs-fs-xs, 11px); }
.ogs-help-build-id { font-family: var(--ogs-font-mono, monospace); font-size: var(--ogs-fs-xs, 11px); }
.ogs-help-build-stale { color: var(--ogs-warn, #d9a441); font-weight: 600; }
.ogs-help-build-reload { color: var(--ogs-link, #5a82dc); text-decoration: underline; cursor: pointer; }

/* ---- suite alerts -------------------------------------------------------
   A pip in the header and a panel under it. Quiet when there is nothing wrong:
   an indicator that shouts all day is one nobody reads on the day it matters. */
.ogs-alert-pip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  border: 1px solid var(--ogs-border, rgba(255, 255, 255, 0.16));
  background: color-mix(in srgb, var(--ogs-text, #fff) 6%, transparent);
  color: var(--ogs-text-dim, #8592ad);
  font: 600 var(--ogs-fs-xs,11px)/1 var(--ogs-font, 'Plus Jakarta Sans', system-ui, sans-serif);
  cursor: pointer;
}
.ogs-alert-pip:hover { color: var(--ogs-text, #e8edf7); }
.ogs-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ogs-pos, #3fb950);
  flex: 0 0 auto;
}
.ogs-alert-pip.warn {
  border-color: color-mix(in srgb, var(--ogs-warn, #f2b23a) 55%, transparent);
  background: color-mix(in srgb, var(--ogs-warn, #f2b23a) 14%, transparent);
  color: var(--ogs-text, #e8edf7);
}
.ogs-alert-pip.warn .ogs-alert-dot { background: var(--ogs-warn, #f2b23a); }
.ogs-alert-pip.crit {
  border-color: color-mix(in srgb, var(--ogs-neg, #ef4444) 55%, transparent);
  background: color-mix(in srgb, var(--ogs-neg, #ef4444) 16%, transparent);
  color: var(--ogs-text, #e8edf7);
}
.ogs-alert-pip.crit .ogs-alert-dot {
  background: var(--ogs-neg, #ef4444);
  animation: ogs-alert-pulse 2s ease-in-out infinite;
}
@keyframes ogs-alert-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .ogs-alert-pip.bad .ogs-alert-dot { animation: none; }
}
:root[data-ogs-theme='terminal'] .ogs-alert-pip { border-radius: 0; }

.ogs-alert-panel {
  position: fixed;
  /* The header is 10001 and its other dropdown, .ogs-usw-flyout, is 10060. This panel does
     the same job and belongs in the same band. At 60 it was painted over by whatever an app
     put below the header: in Live Control the workspace toolbar covered it completely, so
     the alert opened, was reported visible by the DOM, and could not be seen or clicked. */
  z-index: 10060;
  width: 340px;
  max-height: 60vh;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--ogs-border, rgba(255, 255, 255, 0.14));
  background: var(--ogs-surface, #12161d);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  font: 500 12px/1.45 var(--ogs-font, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ogs-text, #e8edf7);
}
:root[data-ogs-theme='terminal'] .ogs-alert-panel { border-radius: 0; }
.ogs-alert-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ogs-hairline, rgba(255, 255, 255, 0.08));
  font-size: var(--ogs-fs-xs, 11px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ogs-text-dim, #8592ad);
}
.ogs-alert-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ogs-hairline, rgba(255, 255, 255, 0.06));
}
.ogs-alert-item:last-child { border-bottom: 0; }
.ogs-alert-h { display: flex; align-items: center; gap: 7px; }
.ogs-alert-h .ogs-alert-dot { background: var(--ogs-neg, #ef4444); }
.ogs-alert-h b { font-size: var(--ogs-fs-sm, 12px); font-weight: 600; }
.ogs-alert-age {
  margin-left: auto;
  font-size: var(--ogs-fs-xs, 11px);
  color: var(--ogs-text-dim, #8592ad);
  white-space: nowrap;
}
.ogs-alert-item p {
  margin: 5px 0 0 15px;
  color: var(--ogs-text-dim, #8592ad);
  font-size: var(--ogs-fs-xs, 11px);
}
.ogs-alert-empty {
  padding: 14px;
  color: var(--ogs-text-dim, #8592ad);
}
.ogs-alert-empty span { display: block; margin-top: 5px; font-size: var(--ogs-fs-xs, 11px); opacity: 0.8; }

/* Severity in the list: critical is red because it means the facility is not doing its
   job right now. Warnings are amber and can wait. */
.ogs-alert-item.crit .ogs-alert-dot { background: var(--ogs-neg, #ef4444); }
.ogs-alert-item.warn .ogs-alert-dot { background: var(--ogs-warn, #f2b23a); }
.ogs-alert-item.crit b { color: var(--ogs-neg, #ef4444); }
.ogs-alert-item.muted { opacity: 0.5; }
/* Suppress row: a label and the durations, on one line under the alert. */
.ogs-alert-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0 0 15px;
}
.ogs-alert-go {
  padding: 2px 9px;
  font: 700 var(--ogs-fs-2xs,10px)/1.6 var(--ogs-font, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ogs-text, #e8edf7);
  text-decoration: none;
  background: color-mix(in srgb, var(--ogs-accent, #336cd2) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--ogs-accent, #336cd2) 55%, transparent);
  border-radius: 5px;
  margin-right: 4px;
}
.ogs-alert-go:hover {
  background: color-mix(in srgb, var(--ogs-accent, #336cd2) 34%, transparent);
}
.ogs-alert-suppress-label,
.ogs-alert-muted-note {
  font-size:var(--ogs-fs-2xs,10px);
  color: var(--ogs-text-dim, #8592ad);
}
.ogs-alert-mute {
  margin: 0;
  padding: 2px 8px;
  font: 600 var(--ogs-fs-2xs,10px)/1.6 var(--ogs-font, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ogs-text-dim, #8592ad);
  background: transparent;
  border: 1px solid var(--ogs-border, rgba(255, 255, 255, 0.16));
  border-radius: 5px;
  cursor: pointer;
}
.ogs-alert-mute:hover { color: var(--ogs-text, #e8edf7); }
