#alpha-help-link{
  position:fixed;
  right:18px;
  bottom:calc(18px + var(--alpha-boundary-height, 0px));
  z-index:2147483000;
}

.alpha-help-host{
  position:relative;
  display:inline-flex;
  align-items:center;
  isolation:isolate;
}

.alpha-help-host:hover,
.alpha-help-host:focus-within,
.alpha-help-host.open{
  z-index:2147483000;
}

.alpha-help-trigger{
  position:relative;
  appearance:none;
  border:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
}

.alpha-help-trigger::before{
  content:none;
}

.alpha-help-trigger::after{
  content:none;
}

.alpha-help-trigger:hover,
.alpha-help-trigger:focus-visible,
.alpha-help-host.open .alpha-help-trigger{
  transform:translateY(-1px);
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.14);
  outline:none;
}

.alpha-help-trigger:hover::before,
.alpha-help-trigger:focus-visible::before,
.alpha-help-host.open .alpha-help-trigger::before{
  content:none;
}

.help-dot.alpha-help-trigger{
  width:17px;
  height:17px;
  min-width:17px;
  min-height:17px;
  margin-left:5px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#2563eb;
  font-size:10px;
  font-weight:900;
  line-height:1;
  vertical-align:1px;
  background:rgba(239,246,255,.96);
  text-decoration:none;
  opacity:.78;
  box-shadow:none;
  transition:opacity .18s ease,transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.alpha-help-host:hover .help-dot.alpha-help-trigger,
.alpha-help-host.open .help-dot.alpha-help-trigger,
.help-dot.alpha-help-trigger:focus-visible{
  opacity:1;
  color:#1d4ed8;
  background:#eff6ff;
}

.alpha-help-floating-trigger{
  width:52px;
  min-width:52px;
  height:38px;
  padding:0;
  border:1px solid rgba(148,163,184,.28);
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:0;
  background:rgba(248,250,252,.96);
  color:#2563eb;
  opacity:.72;
  box-shadow:0 10px 24px rgba(15,23,42,.12);
  text-decoration:none;
  overflow:hidden;
  white-space:nowrap;
  transition:opacity .18s ease,transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.alpha-help-floating-trigger::before{
  content:"";
}

.alpha-help-floating-trigger:hover,
.alpha-help-floating-trigger:focus-visible,
.alpha-help-floating.open .alpha-help-floating-trigger{
  opacity:1;
}

.alpha-help-mark{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  color:#2563eb;
  background:transparent;
  font-size:14px;
  font-weight:950;
  line-height:1;
}

.alpha-help-label{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}

.alpha-help-surface{
  position:relative;
}

.mot-overlay.alpha-help-surface,
.result-overlay.alpha-help-surface,
.modal-overlay.alpha-help-surface,
.rc-modal-backdrop.alpha-help-surface,
[role="dialog"].alpha-help-surface,
[aria-modal="true"].alpha-help-surface{
  position:fixed;
}

.alpha-help-auto{
  display:inline-flex;
  margin-left:0;
  vertical-align:0;
  opacity:.42;
  transition:opacity .18s ease;
}

.alpha-help-auto:hover,
.alpha-help-auto:focus-within,
.alpha-help-auto.open,
.alpha-help-surface:hover > .alpha-help-auto{
  opacity:1;
}

.alpha-help-auto-trigger{
  width:16px;
  height:16px;
  min-width:16px;
  min-height:16px;
  border:1px solid rgba(37,99,235,.35);
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#2563eb;
  background:rgba(239,246,255,.96);
  font-size:9px;
  font-weight:950;
  line-height:1;
  box-shadow:none;
  transition:opacity .18s ease,transform .18s ease,border-color .18s ease,box-shadow .18s ease,color .18s ease;
}

.alpha-help-auto-trigger:hover,
.alpha-help-auto-trigger:focus-visible,
.alpha-help-auto.open .alpha-help-auto-trigger{
  color:#1d4ed8;
  background:#eff6ff;
}

.alpha-help-card{
  position:absolute;
  top:8px;
  right:8px;
}

.alpha-help-auto-surface{
  box-sizing:border-box;
}

html.alpha-trader .alpha-help-auto,
html.alpha-lite .alpha-help-auto{
  display:inline-flex;
}

.alpha-help-popover{
  position:absolute;
  right:0;
  bottom:calc(100% + 12px);
  width:min(340px, calc(100vw - 28px));
  max-height:calc(100vh - 28px);
  max-height:calc(100dvh - 28px);
  display:none;
  gap:8px;
  padding:14px;
  color:#0f172a;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.45);
  border-radius:10px;
  box-shadow:0 18px 42px rgba(15,23,42,.18), 0 0 0 1px rgba(255,255,255,.82) inset;
  opacity:0;
  pointer-events:none;
  transform:translateY(8px) scale(.98);
  transform-origin:bottom right;
  transition:opacity .18s ease, transform .18s ease;
  z-index:2147483001;
  box-sizing:border-box;
  max-width:min(340px, calc(100vw - 24px));
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  text-transform:none;
  letter-spacing:0;
  text-align:left;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

.alpha-help-positioned .alpha-help-popover,
.alpha-help-positioned.alpha-help-inline .alpha-help-popover{
  position:fixed;
  left:clamp(12px, var(--alpha-help-left, 14px), calc(100vw - 352px));
  top:clamp(12px, var(--alpha-help-top, 14px), calc(100dvh - 220px));
  right:auto;
  bottom:auto;
  transform:translateY(0) scale(1);
  transform-origin:top left;
}

.alpha-help-popover *{
  min-width:0;
  text-transform:none;
  letter-spacing:0;
}

.alpha-help-short,
.alpha-help-detail-text{
  overflow-wrap:anywhere;
}

.alpha-help-inline .alpha-help-popover{
  left:50%;
  right:auto;
  top:calc(100% + 11px);
  bottom:auto;
  transform:translate(-50%,-8px) scale(.98);
  transform-origin:top center;
}

.alpha-help-host:hover .alpha-help-popover,
.alpha-help-host:focus-within .alpha-help-popover,
.alpha-help-host.open .alpha-help-popover{
  display:grid;
  opacity:1;
  pointer-events:auto;
}

.alpha-help-inline:hover .alpha-help-popover,
.alpha-help-inline:focus-within .alpha-help-popover,
.alpha-help-inline.open .alpha-help-popover{
  transform:translate(-50%,0) scale(1);
}

.alpha-help-floating:hover .alpha-help-popover,
.alpha-help-floating:focus-within .alpha-help-popover,
.alpha-help-floating.open .alpha-help-popover{
  transform:translateY(0) scale(1);
}

.alpha-help-positioned.alpha-help-inline:hover .alpha-help-popover,
.alpha-help-positioned.alpha-help-inline:focus-within .alpha-help-popover,
.alpha-help-positioned.alpha-help-inline.open .alpha-help-popover,
.alpha-help-positioned:hover .alpha-help-popover,
.alpha-help-positioned:focus-within .alpha-help-popover,
.alpha-help-positioned.open .alpha-help-popover{
  transform:translateY(0) scale(1);
}

.alpha-help-popover-glow{
  display:none;
}

.alpha-help-kicker,
.alpha-help-short,
.alpha-help-actions,
.alpha-help-detail{
  position:relative;
  z-index:1;
}

.alpha-help-kicker{
  color:#2563eb;
  font-size:10px;
  font-weight:900;
  letter-spacing:1.3px;
  text-transform:uppercase;
}

.alpha-help-short,
.alpha-help-detail-text{
  display:block;
  color:#1e293b;
  font-size:12px;
  line-height:1.55;
  font-weight:650;
}

.alpha-help-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding-top:2px;
}

.alpha-help-more,
.alpha-help-manual{
  min-height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  padding:0 10px;
  font-size:11px;
  font-weight:850;
  text-decoration:none;
}

.alpha-help-more{
  color:#fff;
  background:#2563eb;
  border:1px solid #1d4ed8;
  cursor:pointer;
}

.alpha-help-manual{
  color:#1d4ed8;
  background:#fff;
  border:1px solid rgba(148,163,184,.45);
}

.alpha-help-more:hover,
.alpha-help-more:focus-visible,
.alpha-help-manual:hover,
.alpha-help-manual:focus-visible{
  filter:brightness(1.07);
  outline:2px solid rgba(96,165,250,.45);
  outline-offset:2px;
}

.alpha-help-detail{
  display:grid;
  gap:5px;
  margin-top:2px;
  padding-top:10px;
  border-top:1px solid rgba(148,163,184,.28);
}

.alpha-help-detail[hidden]{
  display:none;
}

@media(max-width:640px){
  #alpha-help-link{
    right:14px;
    bottom:calc(14px + var(--alpha-boundary-height, 0px));
  }
  .alpha-help-floating-trigger{
    width:36px;
    min-width:36px;
    height:36px;
    padding:0;
  }
  .alpha-help-popover,
  .alpha-help-inline .alpha-help-popover{
    position:fixed;
    left:12px;
    right:12px;
    bottom:calc(76px + var(--alpha-boundary-height, 0px));
    width:auto;
    transform:translateY(8px) scale(.98);
    transform-origin:bottom center;
  }
  .alpha-help-positioned .alpha-help-popover,
  .alpha-help-positioned.alpha-help-inline .alpha-help-popover{
    left:12px;
    right:12px;
    top:auto;
    bottom:calc(76px + var(--alpha-boundary-height, 0px));
    width:auto;
    transform:translateY(8px) scale(.98);
    transform-origin:bottom center;
  }
  .alpha-help-inline:hover .alpha-help-popover,
  .alpha-help-inline:focus-within .alpha-help-popover,
  .alpha-help-inline.open .alpha-help-popover{
    transform:translateY(0) scale(1);
  }
}

@media(prefers-reduced-motion:reduce){
  .alpha-help-trigger::before,
  .alpha-help-trigger:hover::before,
  .alpha-help-trigger:focus-visible::before,
  .alpha-help-host.open .alpha-help-trigger::before{
    animation:none;
  }
}

/* Shared UI grammar: text links stay textual; action links look intentional. */
a.ao-inline-link,
.data-control-note a,
.ai-data-use a,
.case-context a,
.trust-item a,
.terms-card a,
.disclosure-note a,
.link-row a{
  color:var(--ao-link-color, #bfdbfe);
  font-weight:800;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  border:0;
  background:transparent;
  box-shadow:none;
}

a.ao-inline-link:hover,
.data-control-note a:hover,
.ai-data-use a:hover,
.case-context a:hover,
.trust-item a:hover,
.terms-card a:hover,
.disclosure-note a:hover,
.link-row a:hover{
  color:var(--ao-link-hover, #fff);
}

a.ao-text-link,
a.nav-link.ao-text-link,
a.btn-secondary.ao-text-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--ao-text-link-color, var(--muted2, #a3afbf));
  text-decoration:none;
  box-shadow:none;
  font-weight:850;
}

a.ao-text-link::after,
a.btn-secondary.ao-text-link::after{
  content:"→";
  color:currentColor;
  opacity:.82;
}

a.ao-text-link:hover,
a.nav-link.ao-text-link:hover,
a.btn-secondary.ao-text-link:hover{
  color:var(--ao-text-link-hover, #fff);
  transform:none;
  box-shadow:none;
}

a.ao-action-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid rgba(59,130,246,.42);
  background:rgba(59,130,246,.10);
  border-radius:9px;
  color:var(--ao-action-color, #bfdbfe);
  text-decoration:none;
  font-weight:900;
}

a.ao-action-link:not([data-no-arrow="true"])::after{
  content:"→";
  opacity:.88;
}

a.ao-action-link:hover{
  border-color:var(--accent, #3b82f6);
  color:#fff;
}

:where(a,button)[data-alpha-action-arrow="true"]::after{
  content:"→";
  display:inline-block;
  margin-left:1px;
  color:currentColor;
  opacity:.88;
  font-weight:950;
  transform:translateY(-.5px);
}

:where(a,button)[data-alpha-action-arrow="true"]:hover::after,
:where(a,button)[data-alpha-action-arrow="true"]:focus-visible::after{
  opacity:1;
  transform:translate(1px,-.5px);
}

/* Shared UI grammar: passive information chips must not read as buttons. */
span.data-quality-chip,
span.data-warning-chip,
span.investor-mode-chip,
span.scope-chip,
span.status-pill,
span.score-pill,
span.cost-pill,
span.variant-pill,
span.rc-card-badge,
span.rc-mot-pill,
span.sev-pill,
span.mot-warn-pill,
span.rec-tag,
.rc-focus-chip{
  cursor:default!important;
  user-select:text;
  border-color:rgba(148,163,184,.16)!important;
  background:rgba(148,163,184,.045)!important;
  color:var(--muted2, #a3afbf)!important;
  box-shadow:none!important;
  text-decoration:none!important;
}

span.data-quality-chip,
span.data-warning-chip,
span.investor-mode-chip,
span.scope-chip,
span.status-pill,
span.score-pill,
span.cost-pill,
span.variant-pill,
span.rc-card-badge,
span.rc-mot-pill,
span.sev-pill,
span.mot-warn-pill,
span.rec-tag{
  border-radius:6px!important;
}

span.data-quality-chip.warn,
span.data-warning-chip:not(.info),
span.status-pill.warn,
span.rc-card-badge.warn,
span.rc-mot-pill,
span.mot-warn-pill,
span.sev-pill.sev-check,
span.rec-tag.rt-watch,
span.rec-tag.rt-crit{
  border-color:rgba(245,158,11,.24)!important;
  background:rgba(245,158,11,.045)!important;
  color:#d8bd72!important;
}

span.status-pill.ok,
span.cost-pill,
span.rc-card-badge.green,
span.rec-tag.rt-act{
  border-color:rgba(16,185,129,.20)!important;
  background:rgba(16,185,129,.045)!important;
  color:#8fcfb8!important;
}

span.status-pill.bad,
span.rec-tag.rt-stop{
  border-color:rgba(239,68,68,.22)!important;
  background:rgba(239,68,68,.045)!important;
  color:#e8a1a1!important;
}

span.data-warning-chip strong{
  color:inherit!important;
}

button.rc-report-btn,
button.rc-report-drill-btn{
  cursor:pointer;
}

/* Shared UI grammar: action groups wrap instead of squeezing links off-screen. */
.rc-acc-head{
  flex-wrap:wrap;
  align-items:flex-start!important;
}

.rc-acc-actions{
  min-width:0;
  max-width:100%;
  justify-content:flex-end;
}

.rc-acc-actions .ao-inline-link{
  min-height:28px;
  display:inline-flex;
  align-items:center;
  white-space:nowrap;
}

@media(max-width:900px){
  .rc-acc-actions{
    justify-content:flex-start;
  }
}

.ao-status-route-note{
  margin-top:12px;
  border-top:1px solid rgba(148,163,184,.14);
  padding-top:10px;
  color:var(--muted, #8492a6);
  font-size:11px;
  line-height:1.45;
}

/* Shared modal safety: large dialogs must keep their top, bottom, and close control reachable. */
.modal-overlay,
.rc-modal-backdrop,
.start-orchestrator,
.onboarding-overlay,
#oandaSettingsModal,
#onboardingOverlay{
  align-items:flex-start!important;
  justify-content:center!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding:clamp(12px,3vh,28px)!important;
}

.modal,
.rc-modal-inner,
.start-card,
.onboarding-panel,
.settings-modal-panel,
#oandaSettingsModal > div,
#onboardingOverlay > div{
  max-height:calc(100vh - clamp(24px,6vh,56px))!important;
  max-height:calc(100dvh - clamp(24px,6vh,56px))!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}

#oandaSettingsModal > .settings-modal-panel,
#onboardingOverlay > .onboarding-panel{
  margin:0 auto!important;
}

.modal-top,
.rc-modal-header{
  position:sticky;
  top:0;
  z-index:5;
  background:linear-gradient(180deg,rgba(13,18,32,.98),rgba(13,18,32,.94));
}

.rc-modal-header{
  margin-top:-28px;
  padding-top:28px;
}

.modal-close,
.rc-modal-close,
.settings-modal-close,
.onboarding-panel-close{
  position:sticky;
  top:10px;
  z-index:6;
}

#oandaSettingsModal > div > button:first-child,
.settings-modal-close{
  position:sticky!important;
  top:0!important;
  z-index:10!important;
  float:right!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:34px!important;
  height:34px!important;
  margin:-18px -18px 8px 12px!important;
  background:rgba(13,18,32,.96)!important;
  border:1px solid var(--border2, #253660)!important;
  border-radius:8px!important;
  color:var(--muted2, #a3afbf)!important;
}

#oandaSettingsModal > div > button:first-child:hover,
.settings-modal-close:hover{
  color:#fff!important;
  border-color:var(--accent, #3b82f6)!important;
}


/* Light shell contrast guard: keep the pale product direction, but never let legacy dark labels fade out. */
body.analysis-refresh a.ao-inline-link,
body.analysis-refresh .data-control-note a,
body.analysis-refresh .ai-data-use a,
body.mot-refresh .mot-tip a,
body.mot-refresh .safety-strip a{
  color:var(--cs-blue, #2563eb)!important;
}

body.analysis-refresh a.ao-inline-link:hover,
body.analysis-refresh .data-control-note a:hover,
body.analysis-refresh .ai-data-use a:hover,
body.mot-refresh .mot-tip a:hover,
body.mot-refresh .safety-strip a:hover{
  color:#1d4ed8!important;
}

body.analysis-refresh span.data-quality-chip,
body.analysis-refresh span.data-warning-chip,
body.analysis-refresh span.investor-mode-chip,
body.analysis-refresh span.scope-chip,
body.analysis-refresh span.status-pill,
body.analysis-refresh span.score-pill,
body.analysis-refresh span.cost-pill,
body.analysis-refresh span.variant-pill,
body.analysis-refresh span.rc-card-badge,
body.analysis-refresh span.rc-mot-pill,
body.analysis-refresh span.sev-pill,
body.analysis-refresh span.rec-tag,
body.analysis-refresh .rc-focus-chip{
  border-color:#c7d7ed!important;
  background:#f3f7fd!important;
  color:var(--cs-text, #172033)!important;
}

body.analysis-refresh span.data-quality-chip.warn,
body.analysis-refresh span.data-warning-chip:not(.info),
body.analysis-refresh span.status-pill.warn,
body.analysis-refresh span.rc-card-badge.warn,
body.analysis-refresh span.rc-mot-pill,
body.analysis-refresh span.sev-pill.sev-check,
body.analysis-refresh span.rec-tag.rt-watch,
body.analysis-refresh span.rec-tag.rt-crit,
body.mot-refresh span.mot-warn-pill.w-check,
body.mot-refresh span.mot-warn-pill.w-high{
  border-color:rgba(217,119,6,.30)!important;
  background:#fff7ed!important;
  color:#8a4b00!important;
}

body.analysis-refresh span.status-pill.ok,
body.analysis-refresh span.cost-pill,
body.analysis-refresh span.rc-card-badge.green,
body.analysis-refresh span.rec-tag.rt-act,
body.mot-refresh span.mot-warn-pill.w-ok{
  border-color:rgba(22,163,74,.26)!important;
  background:#ecfdf5!important;
  color:#047857!important;
}

body.analysis-refresh span.status-pill.bad,
body.analysis-refresh span.rec-tag.rt-stop,
body.mot-refresh span.mot-warn-pill.w-critical{
  border-color:rgba(220,38,38,.28)!important;
  background:#fee2e2!important;
  color:#991b1b!important;
}

body.analysis-refresh .modal-top,
body.analysis-refresh .rc-modal-header,
body.analysis-refresh #oandaSettingsModal .modal-top,
body.analysis-refresh #oandaSettingsModal .rc-modal-header{
  background:linear-gradient(180deg,#ffffff,#f8fbff)!important;
  border-color:var(--cs-border, #d8e1ef)!important;
}

body.analysis-refresh .modal-close,
body.analysis-refresh .rc-modal-close,
body.analysis-refresh .settings-modal-close,
body.analysis-refresh .onboarding-panel-close,
body.analysis-refresh #oandaSettingsModal > div > button:first-child{
  background:#ffffff!important;
  border-color:var(--cs-border, #d8e1ef)!important;
  color:var(--cs-muted-2, #4d5b73)!important;
}

body.analysis-refresh .modal-close:hover,
body.analysis-refresh .rc-modal-close:hover,
body.analysis-refresh .settings-modal-close:hover,
body.analysis-refresh .onboarding-panel-close:hover,
body.analysis-refresh #oandaSettingsModal > div > button:first-child:hover{
  border-color:rgba(37,99,235,.45)!important;
  color:var(--cs-blue, #2563eb)!important;
}

body.analysis-refresh .settings-modal-panel,
body.analysis-refresh #oandaSettingsModal > div{
  background:#ffffff!important;
  border-color:var(--cs-border, #d8e1ef)!important;
  color:var(--cs-text, #172033)!important;
}

body.analysis-refresh .settings-modal-panel :is(h1,h2,h3,h4,strong,span,div,li,label)[style*="color:#fff"],
body.analysis-refresh .settings-modal-panel :is(h1,h2,h3,h4,strong,span,div,li,label)[style*="color: #fff"],
body.analysis-refresh #oandaSettingsModal :is(h1,h2,h3,h4,strong,span,div,li,label)[style*="color:#fff"],
body.analysis-refresh #oandaSettingsModal :is(h1,h2,h3,h4,strong,span,div,li,label)[style*="color: #fff"]{
  color:var(--cs-text, #172033)!important;
}

body.analysis-refresh .settings-modal-panel [style*="background:rgba(15,23,42"],
body.analysis-refresh .settings-modal-panel [style*="background: rgba(15,23,42"],
body.analysis-refresh #oandaSettingsModal [style*="background:rgba(15,23,42"],
body.analysis-refresh #oandaSettingsModal [style*="background: rgba(15,23,42"]{
  background:#f4f8ff!important;
  border-color:#b9cffd!important;
  color:var(--cs-muted-2, #4d5b73)!important;
}


body.legacy-refresh .alpha-help-manual,
body.analysis-refresh .alpha-help-manual,
body.mot-refresh .alpha-help-manual{
  background:#111827!important;
  border-color:rgba(148,163,184,.30)!important;
  color:#dbeafe!important;
}

body.legacy-refresh .alpha-help-more,
body.analysis-refresh .alpha-help-more,
body.mot-refresh .alpha-help-more{
  background:#93c5fd!important;
  border-color:#bfdbfe!important;
  color:#0b1120!important;
}
